Supplier Management Workflow¶
This document outlines the complete workflow for managing suppliers in the PRS system, from syncing to suspension.
Workflow Diagram¶
flowchart TD
Start([Sync Supplier]) -->S2[Active]
S2 -->|Suspend| S3[Suspended]
S3 -->|Reactivate| S2
Status Definitions¶
| Status | Description |
|---|---|
| ACTIVE | Initial default status after syncing, supplier is active and can be used in canvassing |
| SUSPENDED | Supplier is suspended and cannot be used in any transactions but can be reactivated |
Detailed Workflow Steps¶
1. Supplier Sync¶
Actor: Purchasing Admin and IT Admin
Actions:
- Sync Supplier - pull from Cityland Legacy System
- Edit information as needed (contact details, etc.)
Status Transitions:
- ACTIVE (default after syncing)
Business Rules:
- All required fields must be filled
- Contact number accept alphanumeric characters
2. Supplier Update¶
Actor: Purchasing Admin and IT Admin
Actions:
- Update supplier information
- Change supplier status
Status Transitions:
- No status change (if only information is updated)
Business Rules:
- Supplier information can be updated at any time
- Change in information should reflect in all open documents
- Canvass: CS Draft and For Approval
- Purchase Order: For PO Review and For Approval
- Payment Request: PR Draft and For Approval
- Non-RS Payment Request: Non RS Draft and For Approval
- Closed documents shall not be affected
- RS: RS Closed, Cancelled
- CS: CS Approved, Cancelled
- PO: For Sending, For Delivery, Closed, Cancelled
- PR: PR Closed
- Non-RS: Non RS Closed
3. Supplier Suspension¶
Actor: Purchasing Admin and IT Admin
Actions:
- Suspend a supplier
Status Transitions:
- ACTIVE → SUSPENDED
Business Rules:
- Suspended suppliers cannot be used in new transactions
- Existing transactions with suspended suppliers are affected:
- Purchase orders with status FOR_PO_REVIEW and FOR_PO_APPROVAL are automatically cancelled
- Canvass selections are invalidated - should recanvass again
- Suspending is not allowed when supplier is used in the following documents with status:
- Open PO - For Sending and For Delivery
- Open PR - For PR Approval
- Status change will not affect Closed RS
4. Supplier Reactivation¶
Actor: Purchasing Admin and IT Admin
Actions:
- Reactivate a suspended or inactive supplier
Status Transitions:
- SUSPENDED → ACTIVE
Business Rules:
- Previously cancelled transactions are not automatically restored
Example Scenarios¶
Scenario 1: Standard Supplier Creation¶
- Purchasing Staff syncs supplier
- Supplier is activated by default
- Supplier can now be used in canvassing
Scenario 2: Supplier Suspension¶
- Admin suspends a supplier due to poor performance
- System cancels all pending purchase orders for the supplier
- System notifies relevant users about the suspension
- Supplier cannot be selected in new canvassing
Scenario 3: Supplier Reactivation¶
- Admin reactivates a previously suspended supplier
- Supplier becomes available for selection in canvassing
- Previously cancelled transactions remain cancelled
Implementation Details¶
Key Files¶
- Controller:
src/app/handlers/controllers/supplierController.js - Service:
src/app/services/supplierService.js - Repository:
src/infra/repositories/supplierRepository.js - Entity:
src/domain/entities/supplierEntity.js - Constants:
src/domain/constants/supplierConstants.js
Status Transition Implementation¶
Common Issues and Solutions¶
Issue 1: Cannot Suspend Supplier¶
Cause: Supplier has active transactions that cannot be cancelled.
Solution: - Complete or manually cancel all active transactions - Provide a detailed suspension reason
Issue 2: Supplier Reactivation Issues¶
Cause: System constraints preventing reactivation.
Solution: - Check for any blocking conditions - Ensure all required fields are still valid - Update any outdated information before reactivation