Project

General

Profile

Actions

ClientProject #2804

open

Backend: Module-Wise Approval Process

Added by Najmul Hasan 8 months ago. Updated 8 months ago.

Status:
Complete
Priority:
High
Assignee:
Category:
backend
Target version:
-
Start date:
08/04/2025
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

The backend infrastructure for the module-wise approval process, enabling CRUD operations for module-to-approver user mappings.

API Endpoints:

  • GET /v1/approval-management/module-based-approval: Fetches all module-to-approver mappings.
  • POST /v1/approval-management/module-based-approval: Creates new mappings with validation for moduleTitle, approverUserId, and serial.
  • PATCH /v1/approval-management/module-based-approval: Updates existing mappings, handling partial updates and deletions.
  • DELETE /v1/approval-management/module-based-approval/:moduleTitle: Deletes all mappings for a given moduleTitle.

Controller and Services:

Implemented deleteModuleToApproverUsers in controllers/moduleApproverController.ts, using services from services/deleteModuleToApproverUsers.service.ts.
Added checkModuleRecordsExist and deleteModuleRecords services to validate and delete records in a transaction.
Reused updateModuleToApproverUsers and its services (services/updateModuleToApproverUsers.service.ts) for consistency.
Used Zod for request validation (moduleToApproverUsersValidation.ts) to enforce moduleTitle constraints (non-empty, max 91 characters).

Tested API endpoints with Postman:

  • GET: Verified retrieval of mappings.
  • POST: Created new mappings and checked for duplicates.
  • PATCH: Updated mappings and validated record consistency.
  • DELETE: Deleted mappings for a moduleTitle and confirmed 404 for non-existent modules.

Future Improvements:

  • Implement audit logging for create, update, and delete operations.
Actions #1

Updated by Najmul Hasan 8 months ago

  • Status changed from In Progress to Complete
Actions

Also available in: Atom PDF