implemented a Maker-Checker workflow for Products, with approval-based updates and product locking to prevent concurrent edits
This commit is contained in:
+21
-2
@@ -103,6 +103,25 @@ export class CheckerInboxComponent implements OnInit {
|
||||
'entity'
|
||||
];
|
||||
|
||||
/**
|
||||
* Entities whose pending edits are gated by our own m_savings_product_temp lock rather than the
|
||||
* native command-source pipeline. They're excluded from Checker Inbox entirely - approving/rejecting
|
||||
* them here would call the native /makercheckers/{id}?command=approve endpoint, which replays the
|
||||
* original command handler directly and never touches our temp table, leaving its lock stuck forever.
|
||||
* Action them from Approvals -> Pending Product Edits instead, where that's handled correctly.
|
||||
*/
|
||||
private readonly productEditEntities = [
|
||||
'SAVINGSPRODUCT',
|
||||
'CURRENTPRODUCT',
|
||||
'SHAREPRODUCT',
|
||||
'FIXEDDEPOSITPRODUCT',
|
||||
'RECURRINGDEPOSITPRODUCT'
|
||||
];
|
||||
|
||||
private excludeProductEdits(items: any[]): any[] {
|
||||
return (items || []).filter((item: any) => !this.productEditEntities.includes(item?.entityName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the maker checker data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
@@ -116,7 +135,7 @@ export class CheckerInboxComponent implements OnInit {
|
||||
constructor() {
|
||||
this.route.data.subscribe((data: { makerCheckerResource: any; makerCheckerTemplate: any }) => {
|
||||
const raw = data.makerCheckerResource;
|
||||
this.searchData = Array.isArray(raw) ? raw : (raw?.pageItems ?? []);
|
||||
this.searchData = this.excludeProductEdits(Array.isArray(raw) ? raw : (raw?.pageItems ?? []));
|
||||
this.checkerData = this.searchData.length > 0;
|
||||
this.makerCheckerTemplate = data.makerCheckerTemplate ?? {};
|
||||
this.dataSource = new MatTableDataSource(this.searchData);
|
||||
@@ -156,7 +175,7 @@ export class CheckerInboxComponent implements OnInit {
|
||||
makerDateTimeto: this.dateUtils.formatDate(this.makerCheckerSearchForm.value.makerDateTimeto, dateFormat)
|
||||
};
|
||||
this.tasksService.getMakerCheckerData(makerCheckerSearchParams).subscribe((response: any) => {
|
||||
this.searchData = response;
|
||||
this.searchData = this.excludeProductEdits(response);
|
||||
if (this.searchData.length === 0) {
|
||||
this.noSearchedData = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user