Data Layer low complexity backend
0
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Data access layer for the auto_approval_rules table, handling persistence of rule configurations per organization. Provides queries for fetching enabled rules filtered by organization and optional expense type, supporting the rule engine's evaluation logic.

Feature: Auto-Approval Rules

auto-approval-rule-store

Responsibilities

  • Persist and retrieve auto-approval rules from the auto_approval_rules table
  • Query enabled rules by organization ID and optional expense type filter
  • Enforce data integrity constraints (non-negative thresholds, valid expense type references)

Interfaces

insert(rule: AutoApprovalRule): AutoApprovalRule
update(ruleId: string, data: Partial<AutoApprovalRule>): AutoApprovalRule
delete(ruleId: string): void
findByOrganization(orgId: string): AutoApprovalRule[]
findEnabledByOrganization(orgId: string): AutoApprovalRule[]
findByIdAndOrganization(ruleId: string, orgId: string): AutoApprovalRule | null

Relationships

Dependents (1)

Components that depend on this component