refactor(db): group database domain modules
This commit is contained in:
1 parent
e43a89096d
commit
6da0a58769
160 files changed
+2124
-1999
No files matched your search
@@ -32,7 +32,7 @@ export function registerBudgetHandlers({
|
||||
const parsed = budgetPolicyInputSchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
const id = db.budget.saveBudgetPolicy(parsed);
|
||||
const id = db.core.budget.saveBudgetPolicy(parsed);
|
||||
// D-06: Auto-resolve incidents if limit was increased above current spend
|
||||
if (budgetService) {
|
||||
try {
|
||||
@@ -50,7 +50,7 @@ export function registerBudgetHandlers({
|
||||
const parsed = deleteBudgetPolicySchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
db.budget.deleteBudgetPolicy(parsed.companyId, parsed.policyId);
|
||||
db.core.budget.deleteBudgetPolicy(parsed.companyId, parsed.policyId);
|
||||
publishDomainChanged();
|
||||
return ok(true);
|
||||
});
|
||||
@@ -60,7 +60,7 @@ export function registerBudgetHandlers({
|
||||
const parsed = listBudgetPoliciesSchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
return ok(db.budget.listBudgetPolicies(parsed.companyId));
|
||||
return ok(db.core.budget.listBudgetPolicies(parsed.companyId));
|
||||
});
|
||||
|
||||
// ---- List budget incidents ----
|
||||
@@ -68,7 +68,7 @@ export function registerBudgetHandlers({
|
||||
const parsed = listBudgetIncidentsSchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
return ok(db.budget.listBudgetIncidents(parsed.companyId, parsed.status));
|
||||
return ok(db.core.budget.listBudgetIncidents(parsed.companyId, parsed.status));
|
||||
});
|
||||
|
||||
// ---- Resolve a budget incident manually ----
|
||||
@@ -76,7 +76,7 @@ export function registerBudgetHandlers({
|
||||
const parsed = resolveBudgetIncidentSchema.parse(payload);
|
||||
const companyError = ensureCompanyExists(parsed.companyId);
|
||||
if (companyError) return companyError;
|
||||
db.budget.resolveBudgetIncident(parsed.incidentId, parsed.companyId);
|
||||
db.core.budget.resolveBudgetIncident(parsed.incidentId, parsed.companyId);
|
||||
publishDomainChanged();
|
||||
return ok(true);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user