implemented a Maker-Checker workflow for Products, with approval-based updates and product locking to prevent concurrent edits
This commit is contained in:
@@ -6,17 +6,26 @@
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
-->
|
||||
|
||||
<div class="layout-row align-end gap-1percent layout-lt-md-column container m-b-20">
|
||||
<button mat-raised-button color="success" (click)="approveChecker()">
|
||||
<fa-icon icon="check" class="m-r-10"></fa-icon>{{ 'labels.buttons.Approve' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="warn" (click)="deleteChecker()">
|
||||
<fa-icon icon="trash" class="m-r-10"></fa-icon>{{ 'labels.buttons.Delete' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="reject" (click)="rejectChecker()">
|
||||
<fa-icon icon="times" class="m-r-10"></fa-icon>{{ 'labels.buttons.Reject' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
@if (isProductEditEntry) {
|
||||
<div class="container m-b-20">
|
||||
<div class="mat-elevation-z1" style="padding: 12px 16px; border-left: 4px solid #f59e0b; background: #fffbeb">
|
||||
This is a product edit awaiting approval. Approve or reject it from
|
||||
<strong>Approvals > Pending Product Edits</strong> instead — actioning it here would not release its lock.
|
||||
</div>
|
||||
</div>
|
||||
} @else {
|
||||
<div class="layout-row align-end gap-1percent layout-lt-md-column container m-b-20">
|
||||
<button mat-raised-button color="success" (click)="approveChecker()">
|
||||
<fa-icon icon="check" class="m-r-10"></fa-icon>{{ 'labels.buttons.Approve' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="warn" (click)="deleteChecker()">
|
||||
<fa-icon icon="trash" class="m-r-10"></fa-icon>{{ 'labels.buttons.Delete' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="reject" (click)="rejectChecker()">
|
||||
<fa-icon icon="times" class="m-r-10"></fa-icon>{{ 'labels.buttons.Reject' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="container">
|
||||
<mat-card>
|
||||
|
||||
@@ -50,6 +50,24 @@ export class ViewCheckerInboxComponent {
|
||||
/** Checks if there is any object or not in jsondata */
|
||||
displayJSONData = false;
|
||||
|
||||
/**
|
||||
* These entities' pending edits are gated by our own m_savings_product_temp lock, not the native
|
||||
* command-source pipeline. Approving/rejecting them here would replay the original command handler
|
||||
* directly via /makercheckers/{id}?command=approve and never clear our temp table's lock. Action them
|
||||
* from Approvals -> Pending Product Edits instead.
|
||||
*/
|
||||
private readonly productEditEntities = [
|
||||
'SAVINGSPRODUCT',
|
||||
'CURRENTPRODUCT',
|
||||
'SHAREPRODUCT',
|
||||
'FIXEDDEPOSITPRODUCT',
|
||||
'RECURRINGDEPOSITPRODUCT'
|
||||
];
|
||||
|
||||
get isProductEditEntry(): boolean {
|
||||
return this.productEditEntities.includes(this.checkerInboxDetail?.entityName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the maker checker id data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
|
||||
Reference in New Issue
Block a user