Appearance
Deposit Product Versioning
Immutable product versions with flag snapshots for audit, compliance, and safe product evolution.
Overview
Deposit product versioning allows administrators to create immutable snapshots of product configuration (flags) at a point in time. This ensures:
- Audit trail — Every flag change is captured as a new version
- Account stability — Existing accounts can be pinned to the version they were created under
- Safe rollout — New flag values can be tested as DRAFT before activation
- Regulatory compliance — Historical product terms are preserved forever
Version Lifecycle
DRAFT → APPROVED → ACTIVE → RETIRED
↑
(new version activated)| Status | Description |
|---|---|
| DRAFT | Newly created version, not yet approved |
| APPROVED | Reviewed and approved, ready for activation |
| ACTIVE | Currently live version for this product |
| RETIRED | Previously active version, superseded by newer one |
| REJECTED | Version was rejected during review |
How It Works
Creating a Version
When you create a new version, the system:
- Calls
resolve_deposit_product_flags(product_id)to get current effective flags - Stores the complete flag JSON as an immutable snapshot in
flag_snapshot - Records effective date, expiry date, and change summary
- Sets status to
DRAFT
Activating a Version
When you activate a version:
- The currently
ACTIVEversion (if any) is set toRETIRED - The selected version is set to
ACTIVE - The product's
product_versionfield is updated
Account Binding
Each deposit account has an optional product_version_id column:
- NULL — Account uses live/current product flags (default)
- Set — Account is pinned to a specific version's flag snapshot
The function resolve_deposit_account_flags(account_id) handles this:
sql
-- If account has a pinned version, use its snapshot
IF v_version_id IS NOT NULL THEN
RETURN flag_snapshot FROM deposit_product_version WHERE version_id = v_version_id;
END IF;
-- Otherwise, resolve live flags
RETURN resolve_deposit_product_flags(v_product_id);Flag Groups Managed by Versioning
All flag groups are captured in the version snapshot:
| Group | Example Flags |
|---|---|
| LIMITS | DAILY_DEPOSIT_LIMIT, MAX_WITHDRAWAL_PER_TXN, MONTHLY_TXN_COUNT_LIMIT |
| OVERDRAFT | OVERDRAFT_ALLOWED, MAX_OVERDRAFT_LIMIT, ALLOW_NEGATIVE_BALANCE |
| ACCESS | ATM_ACCESS, MOBILE_BANKING, CHECKBOOK_AVAILABLE |
| KYC | REQUIRES_KYC, BIOMETRIC_REQUIRED, KYC_LEVEL |
| INTEREST | INTEREST_BEARING, COMPOUNDING_ENABLED, DAYS_IN_YEAR |
| TRANSACTION_POLICY | ALLOW_BACK_DATED_TRANSACTIONS, MAX_BACKDATE_DAYS |
| AML_MONITORING | AML_DAILY_DEPOSIT_THRESHOLD, AML_ENABLE_NOTIFICATIONS |
| MATURITY | AUTO_RENEWAL_MAX_COUNT |
API Endpoints
| Method | Path | Permission | Description |
|---|---|---|---|
POST | /deposit-accounts/product-versions | MANAGE_DEPOSIT_PRODUCT | Create new version |
PUT | /deposit-accounts/product-versions/activate | MANAGE_DEPOSIT_PRODUCT | Activate a version |
GET | /deposit-accounts/product-versions?deposit_product_id=X | VIEW_DEPOSIT_PRODUCT | List all versions |
Frontend
The DepositProductVersionHistory component provides:
- Version history table with status chips
- Create version dialog (version number, label, effective date, change summary)
- One-click activation with automatic retirement of previous version
- Flag snapshot viewer to inspect exact flag values at any point in time
Best Practices
- Always create a version before changing flags — This preserves the previous state
- Use meaningful version numbers — e.g.
1.0,1.1,2.0(semver style) - Write change summaries — Document what changed and why
- Pin long-term accounts — For FDs and regulatory products, pin accounts to their creation version
- Review before activating — Use the DRAFT → APPROVED workflow for oversight
