Terminology Migration: Gov to Business Data Model mapping
This document outlines the required changes to adapt the WMS application from the legacy CSD/Government terminology to standardized business/B2B terminology.
As per instructions, this focuses purely on codebase refactoring (DocTypes, Controllers, file names, fields) rather than database migrations, since the app is not yet released.
User Review Required
Section titled “User Review Required”[!IMPORTANT] Please review the mapping between Government Terms and Business Terms proposed below. Once approved, these changes can be systematically executed across the
libs/wmsdirectory.
Terminology Mapping Table
Section titled “Terminology Mapping Table”| Government Term | Proposed Business Term | Affected Areas |
|---|---|---|
| URC (Unit Run Canteen) | Outlet | DocTypes (urc_*), fields, controller logic. |
| Depot | Distribution Center (DC) | DocTypes (depot), fields across supply chain modules. |
| CS Directorate / CSD | Head Office (HO) | Approval flow state machines, cs_approval fields. |
| BoA (Board of Administration) | Management Board | DocTypes (boa_approval), fields (boa_decision). |
| PNC (Price Negotiation Committee) | Pricing Committee | DocTypes (pnc_chart), fields (pnc_date). |
| PRC (Price Revision Committee) | Price Review Committee | DocTypes (prc_chart), fields (prc_date). |
| AGM (Assistant General Manager) | Operations Manager | Approval fields (agm_approval). |
| IFA / CDA | Finance / Accounts | Loan clearance fields (ifa_cleared, cda_cleared). |
| Legacy ERP Price | Business Price | Item fields, Price Revision fields. |
| Member | Customer | DocTypes (member), fields (member_id). |
| Unit Name / Formation | Organization / Division | Outlet registration demographic fields. |
| CO / Officer in Charge | Store Manager | Outlet management contact fields. |
| AFD (Against Firm Demand) | Direct Order | DocTypes (afd_order_i, afd_order_ii), controller logic. |
| MSTC (Monthly Stock Taking Committee) | Monthly Stock Summary | DocTypes (mstc_summary), controller logic. |
| PRGO (Provisioning Review Generating Order) | Replenishment Order | DocTypes (prgo, prgo_item_detail), controller logic. |
Proposed Changes
Section titled “Proposed Changes”The following codebase changes will be applied step-by-step:
1. DocType & Directory Renaming
Section titled “1. DocType & Directory Renaming”Rename the directories and base filenames in libs/wms/src/wms/doctypes/:
[MODIFY] urc -> outlet
Section titled “[MODIFY] urc -> outlet”[MODIFY] urc_registration -> outlet_registration
Section titled “[MODIFY] urc_registration -> outlet_registration”[MODIFY] urc_loan -> outlet_loan
Section titled “[MODIFY] urc_loan -> outlet_loan”[MODIFY] urc_dependency_change -> outlet_dependency_change
Section titled “[MODIFY] urc_dependency_change -> outlet_dependency_change”[MODIFY] urc_merger -> outlet_merger
Section titled “[MODIFY] urc_merger -> outlet_merger”[MODIFY] urc_termination -> outlet_termination
Section titled “[MODIFY] urc_termination -> outlet_termination”[MODIFY] depot -> distribution_center
Section titled “[MODIFY] depot -> distribution_center”[MODIFY] boa_approval -> management_approval
Section titled “[MODIFY] boa_approval -> management_approval”[MODIFY] pnc_chart -> pricing_committee_chart
Section titled “[MODIFY] pnc_chart -> pricing_committee_chart”[MODIFY] prc_chart -> price_review_chart
Section titled “[MODIFY] prc_chart -> price_review_chart”[MODIFY] member -> customer
Section titled “[MODIFY] member -> customer”[MODIFY] afd_order_i -> direct_order_i
Section titled “[MODIFY] afd_order_i -> direct_order_i”[MODIFY] afd_order_ii -> direct_order_ii
Section titled “[MODIFY] afd_order_ii -> direct_order_ii”[MODIFY] mstc_summary -> monthly_stock_summary
Section titled “[MODIFY] mstc_summary -> monthly_stock_summary”[MODIFY] prgo -> replenishment_order
Section titled “[MODIFY] prgo -> replenishment_order”[MODIFY] prgo_item_detail -> replenishment_item_detail
Section titled “[MODIFY] prgo_item_detail -> replenishment_item_detail”2. File Contents & Field Renaming
Section titled “2. File Contents & Field Renaming”Refactor all Python classes, fields, and queries inside libs/wms/src/wms/ according to the mapping map.
Specific Field Changes:
- In
Item,PriceRevisionRequest,PRCChart: Renamelegacy_erp_price->business_price,proposed_legacy_erp_price->proposed_business_price, etc. - In
OutletRegistration(formerlyURCRegistration): Renameunit_name->organization_name,formation->division,co_name->manager_name,co_rank->manager_designation,co_contact->manager_contact. - In
Outlet(formerlyURC): Renameofficer_in_charge->store_manager. - In
OutletLoan(formerlyURCLoan): Renameifa_cleared->finance_cleared,cda_cleared->accounts_cleared. - In
DirectOrderIandDirectOrderII(formerlyAFDOrder*): Renamemember->customer,urc->outlet,depot->distribution_center,legacy_erp_price->business_price. - In
DemandUpload,BalanceUpload,Warehouse,Permit,StockVariance,DeliveryConfirmation,ReplenishmentItemDetail(formerlyPRGOItemDetail): Renamedepot->distribution_center. - In
StockEntry,DeliveryNote: Renameurc->outlet. - In
MonthlyStockSummary(formerlyMSTCSummary): Renamedepot->distribution_centerand inter-depot logic to inter-distribution-center.
3. Workflow State Machine Updates
Section titled “3. Workflow State Machine Updates”Update workflow strings in Meta.workflow properties and corresponding service checks:
- “Submit to CS” -> “Submit to HO”
- “BoA Pending” -> “Management Pending”
- “CS Approved” -> “HO Approved”
- “AGM Review” -> “Ops Manager Review”
- “IFA Review” -> “Finance Review”
- “CDA Review” -> “Accounts Review”
Verification Plan
Section titled “Verification Plan”Automated Tests
Section titled “Automated Tests”- Run
pytestandruff checkon thelibs/wmsdirectory. - Verify 100% of integration tests pass using the newly renamed objects.
- Ensure all mocked dependencies correctly simulate the new schemas.
Manual Verification
Section titled “Manual Verification”- Review the diff visually to ensure no occurrences of “urc”, “depot”, “boa”, “pnc”, “cda”, “ifa”, “afd”, “mstc” or “prgo” remain in any Python files containing the WMS logic.