From 71906abbd1753c9628d5cbe00d5e5c9665447e03 Mon Sep 17 00:00:00 2001 From: Zaven Arra Date: Fri, 29 Oct 2021 10:10:24 -0700 Subject: [PATCH] fix: open up CORS for dev --- .../sqls/20211018163418-createEarning-up.sql | 12 ++++++------ deployment/overlays/development/kustomization.yaml | 1 + deployment/overlays/development/mapping.yaml | 11 +++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 deployment/overlays/development/mapping.yaml diff --git a/database/migrations/sqls/20211018163418-createEarning-up.sql b/database/migrations/sqls/20211018163418-createEarning-up.sql index c4b3bf9..52d1785 100644 --- a/database/migrations/sqls/20211018163418-createEarning-up.sql +++ b/database/migrations/sqls/20211018163418-createEarning-up.sql @@ -5,10 +5,10 @@ CREATE TYPE currency_enum AS ENUM ('USD'); CREATE TABLE earnings ( - id uuid NOT NULL PRIMARY KEY, - worker_id uuid NOT NULL REFERENCES stakeholder.stakeholder(id), - contract_id uuid NOT NULL REFERENCES contract.contract(id), - funder_id uuid NOT NULL REFERENCES stakeholder.stakeholder(id), + id uuid NOT NULL DEFAULT uuid_generate_v4() PRIMARY KEY, + worker_id uuid NOT NULL, + contract_id uuid NOT NULL, + funder_id uuid NOT NULL, amount numeric NOT NULL, currency currency_enum NOT NULL, calculated_at timestamptz NOT NULL, @@ -18,10 +18,10 @@ CREATE TABLE earnings payment_confirmation_id varchar, payment_system varchar, payment_confirmed_by uuid, - payment_confirmation_method confirmation_method_enum NOT NULL, + payment_confirmation_method confirmation_method_enum, paid_at timestamptz, payment_confirmed_at timestamptz, status earning_status_enum NOT NULL, - active boolean NOT NULL, + active boolean DEFAULT true NOT NULL, batch_id uuid REFERENCES batch(id) ); diff --git a/deployment/overlays/development/kustomization.yaml b/deployment/overlays/development/kustomization.yaml index 0ca88b7..51b2782 100644 --- a/deployment/overlays/development/kustomization.yaml +++ b/deployment/overlays/development/kustomization.yaml @@ -2,3 +2,4 @@ bases: - ../../base patchesStrategicMerge: - database-connection-sealed-secret.yaml + - mapping.yaml diff --git a/deployment/overlays/development/mapping.yaml b/deployment/overlays/development/mapping.yaml new file mode 100644 index 0000000..2fc23dc --- /dev/null +++ b/deployment/overlays/development/mapping.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: getambassador.io/v2 +kind: Mapping +metadata: + name: treetracker-earnings-api + namespace: earnings +spec: + cors: + cors: + origins: + - '*'