From 312ef2eb5792cd145d6829e2abc017dd304c5819 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 19 Feb 2025 00:19:58 +0100 Subject: [golang] implement trading and contracting --- golang/pkg/model/contract.go | 2 +- golang/pkg/model/market.go | 10 ++++++++++ golang/pkg/model/trade_good.go | 11 +++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 golang/pkg/model/market.go create mode 100644 golang/pkg/model/trade_good.go (limited to 'golang/pkg/model') diff --git a/golang/pkg/model/contract.go b/golang/pkg/model/contract.go index 24ed403..9d9c7bd 100644 --- a/golang/pkg/model/contract.go +++ b/golang/pkg/model/contract.go @@ -7,7 +7,7 @@ type Contract struct { DeadlineToAccept time.Time `json:"deadlineToAccept"` Expiration time.Time `json:"expiration"` FactionSymbol string `json:"factionSymbol"` - Fullfilled bool `json:"fulfilled"` + Fulfilled bool `json:"fulfilled"` Id string `json:"id"` Terms *Terms `json:"terms"` Type string `json:"type"` diff --git a/golang/pkg/model/market.go b/golang/pkg/model/market.go new file mode 100644 index 0000000..6c11386 --- /dev/null +++ b/golang/pkg/model/market.go @@ -0,0 +1,10 @@ +package model + +type Market struct { + Exchange []Common `json:"exchange"` + Exports []Common `json:"exports"` + Imports []Common `json:"imports"` + Symbol string `json:"symbol"` + TradeGoods []TradeGood `json:"tradeGoods"` + Transactions []Transaction `json:"transactions"` +} diff --git a/golang/pkg/model/trade_good.go b/golang/pkg/model/trade_good.go new file mode 100644 index 0000000..602f667 --- /dev/null +++ b/golang/pkg/model/trade_good.go @@ -0,0 +1,11 @@ +package model + +type TradeGood struct { + Activity string `json:"activity"` + PurchasePrice int `json:"purchasePrice"` + SellPrice int `json:"sellPrice"` + Supply string `json:"supply"` + Symbol string `json:"symbol"` + TradeVolume int `json:"tradeVolume"` + Type string `json:"type"` +} -- cgit v1.2.3