Merge branch 'main' into stats

This commit is contained in:
Samuel Tariku 2025-10-15 21:19:43 +03:00
commit 528a948f20
3 changed files with 3 additions and 8 deletions

View File

@ -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,

View File

@ -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 (

View File

@ -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)