diff --git a/db/dev_data/betfidel_data.sql b/db/dev_data/betfidel_data.sql index 29bc5e3..376a0fe 100644 --- a/db/dev_data/betfidel_data.sql +++ b/db/dev_data/betfidel_data.sql @@ -91,9 +91,7 @@ VALUES ( TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP - ) ON CONFLICT (user_id, type) DO -UPDATE -SET updated_at = EXCLUDED.updated_at + ) RETURNING id INTO STRICT _company_wallet_id; INSERT INTO companies ( name, @@ -144,9 +142,7 @@ VALUES ( TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP - ) ON CONFLICT (user_id, type) DO -UPDATE -SET updated_at = EXCLUDED.updated_at + ) RETURNING id INTO STRICT _branch_wallet_id; INSERT INTO branches ( name, diff --git a/db/migrations/000001_fortune.up.sql b/db/migrations/000001_fortune.up.sql index 4b636ec..5214d69 100644 --- a/db/migrations/000001_fortune.up.sql +++ b/db/migrations/000001_fortune.up.sql @@ -73,7 +73,6 @@ CREATE TABLE IF NOT EXISTS wallets ( is_active BOOLEAN NOT NULL DEFAULT true, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UNIQUE(user_id, type), CONSTRAINT balance_positve CHECK (balance >= 0) ); CREATE TABLE refresh_tokens ( diff --git a/internal/web_server/routes.go b/internal/web_server/routes.go index 92dad34..7fc7049 100644 --- a/internal/web_server/routes.go +++ b/internal/web_server/routes.go @@ -319,7 +319,7 @@ func (a *App) initAppRoutes() { groupV1.Get("/branchCashier", a.authMiddleware, a.CompanyOnly, h.GetBranchForCashier) // Branch Operation - groupV1.Get("/supportedOperation", a.authMiddleware, a.SuperAdminOnly, h.GetAllSupportedOperations) + groupV1.Get("/supportedOperation", a.authMiddleware, h.GetAllSupportedOperations) groupV1.Post("/supportedOperation", a.authMiddleware, a.SuperAdminOnly, h.CreateSupportedOperation) groupV1.Post("/operation", a.authMiddleware, a.CompanyOnly, h.CreateBranchOperation) groupV1.Get("/branch/:id/operation", a.authMiddleware, a.CompanyOnly, h.GetBranchOperations)