From d3c17fe482d29e79fbf7c9da64676f9ebd91a441 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Fri, 22 Sep 2017 07:24:42 -0700 Subject: [PATCH] Add confirmation struct --- config/postgres.sql | 5 +++++ confirmation.go | 13 +++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 confirmation.go diff --git a/config/postgres.sql b/config/postgres.sql index b668232..1f7c681 100644 --- a/config/postgres.sql +++ b/config/postgres.sql @@ -13,3 +13,8 @@ CREATE UNIQUE INDEX product_trade_id_index ON trades ( trade_id); CREATE INDEX timestamp_index ON trades (timestamp); + +CREATE TABLE confirmations ( + id SERIAL PRIMARY KEY, + product CHAR(7) NOT NULL, + last_trade_id INTEGER NOT NULL DEFAULT 0); diff --git a/confirmation.go b/confirmation.go new file mode 100644 index 0000000..fce9d47 --- /dev/null +++ b/confirmation.go @@ -0,0 +1,13 @@ +package tacitus + +type Confirmation struct { + Id int `json:"id"` + Product string `json:"product"` + LastTradeId int `json:"last_trade_id"` +} + +type ConfirmationService interface { + Confirmation(product string) (*Confirmation, error) + CreateConfirmation(c *Confirmation) error + UpdateConfirmation(c *Confirmation) error +}