summaryrefslogtreecommitdiff
path: root/golang/pkg/model/contract.go
diff options
context:
space:
mode:
authorJulien Dessaux2025-02-13 21:35:32 +0100
committerJulien Dessaux2025-02-13 21:35:32 +0100
commit3dad3f60f280289dee1b34ae04744f244d070bf7 (patch)
tree2e3d5ba10b1ac104708f557a520146f47fd6bf1f /golang/pkg/model/contract.go
parent[golang] update for registration API breaking changes (diff)
downloadspacetraders-3dad3f60f280289dee1b34ae04744f244d070bf7.tar.gz
spacetraders-3dad3f60f280289dee1b34ae04744f244d070bf7.tar.bz2
spacetraders-3dad3f60f280289dee1b34ae04744f244d070bf7.zip
[golang] Bootstrap contracting and refactor the agent code
Diffstat (limited to '')
-rw-r--r--golang/pkg/model/contract.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/golang/pkg/model/contract.go b/golang/pkg/model/contract.go
new file mode 100644
index 0000000..24ed403
--- /dev/null
+++ b/golang/pkg/model/contract.go
@@ -0,0 +1,32 @@
+package model
+
+import "time"
+
+type Contract struct {
+ Accepted bool `json:"accepted"`
+ DeadlineToAccept time.Time `json:"deadlineToAccept"`
+ Expiration time.Time `json:"expiration"`
+ FactionSymbol string `json:"factionSymbol"`
+ Fullfilled bool `json:"fulfilled"`
+ Id string `json:"id"`
+ Terms *Terms `json:"terms"`
+ Type string `json:"type"`
+}
+
+type Deliver struct {
+ DestinationSymbol string `json:"destinationSymbol"`
+ TradeSymbol string `json:"tradeSymbol"`
+ UnitsFulfilled int `json:"unitsFulfilled"`
+ UnitsRequired int `json:"unitsRequired"`
+}
+
+type Payment struct {
+ OnAccepted int `json:"onAccepted"`
+ OnFulfilled int `json:"onFulfilled"`
+}
+
+type Terms struct {
+ Deadline time.Time `json:"deadline"`
+ Payment *Payment `json:"payment"`
+ Deliver []Deliver `json:"deliver"`
+}