diff --git a/resources/migrations/sql/create_tables_001.sql b/resources/migrations/sql/create_tables_001.sql index 0be5d6c..ef951c3 100644 --- a/resources/migrations/sql/create_tables_001.sql +++ b/resources/migrations/sql/create_tables_001.sql @@ -106,6 +106,24 @@ CREATE TABLE IF NOT EXISTS cashed_cheques CONSTRAINT double_spending UNIQUE (drawer_user_id, cheque_number) -- no double spending ); +CREATE TABLE IF NOT EXISTS cached_wire_transfers +( + id INTEGER PRIMARY KEY AUTOINCREMENT, + drawer_account_id INTEGER NOT NULL, + drawer_account_version INTEGER NOT NULL, + wire_transfer_request_number INTEGER NOT NULL, + amount INTEGER NOT NULL, + underlying_security INTEGER NOT NULL, + payee_account_id INTEGER NOT NULL, + payee_account_version INTEGER NOT NULL, + creation_time DATETIME DEFAULT CURRENT_TIMESTAMP, + + FOREIGN KEY (underlying_security) REFERENCES securities (id), + FOREIGN KEY (drawer_account_id) REFERENCES accounts (id), + FOREIGN KEY (payee_account_id) REFERENCES accounts (id), + CONSTRAINT double_spending UNIQUE (drawer_account_id, wire_transfer_request_number) -- no double spending +); + CREATE TABLE IF NOT EXISTS event_processing_statuses ( value TEXT PRIMARY KEY @@ -119,11 +137,11 @@ VALUES ('processing'), CREATE TABLE IF NOT EXISTS event_processing_log ( - id TEXT PRIMARY KEY, - event JSON, - status TEXT NOT NULL, - received_time DATETIME NOT NULL, + id TEXT PRIMARY KEY, + event JSON, + status TEXT NOT NULL, + received_time DATETIME NOT NULL, completed_time DATETIME, - error_message TEXT NOT NULL DEFAULT '', + error_message TEXT NOT NULL DEFAULT '', FOREIGN KEY (status) REFERENCES event_processing_statuses (value) ) \ No newline at end of file diff --git a/resources/templates/partials/actions/create_security.html b/resources/templates/partials/actions/create_security.html index 07b549b..86a3b32 100644 --- a/resources/templates/partials/actions/create_security.html +++ b/resources/templates/partials/actions/create_security.html @@ -30,6 +30,6 @@ - + {%include "partials/actions/submit_button.html"%} diff --git a/resources/templates/partials/actions/emit_securities.html b/resources/templates/partials/actions/emit_securities.html index 10daa07..a0777d7 100644 --- a/resources/templates/partials/actions/emit_securities.html +++ b/resources/templates/partials/actions/emit_securities.html @@ -1,3 +1,11 @@ + + + +