Skip to content

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.

[!IMPORTANT] Please review the mapping between Government Terms and Business Terms proposed below. Once approved, these changes can be systematically executed across the libs/wms directory.

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.

The following codebase changes will be applied step-by-step:

Rename the directories and base filenames in libs/wms/src/wms/doctypes/:

[MODIFY] urc_registration -> outlet_registration

Section titled “[MODIFY] urc_registration -> outlet_registration”

[MODIFY] urc_dependency_change -> outlet_dependency_change

Section titled “[MODIFY] urc_dependency_change -> outlet_dependency_change”

[MODIFY] urc_termination -> outlet_termination

Section titled “[MODIFY] urc_termination -> outlet_termination”

[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] mstc_summary -> monthly_stock_summary

Section titled “[MODIFY] mstc_summary -> monthly_stock_summary”

[MODIFY] prgo_item_detail -> replenishment_item_detail

Section titled “[MODIFY] prgo_item_detail -> replenishment_item_detail”

Refactor all Python classes, fields, and queries inside libs/wms/src/wms/ according to the mapping map.

Specific Field Changes:

  • In Item, PriceRevisionRequest, PRCChart: Rename legacy_erp_price -> business_price, proposed_legacy_erp_price -> proposed_business_price, etc.
  • In OutletRegistration (formerly URCRegistration): Rename unit_name -> organization_name, formation -> division, co_name -> manager_name, co_rank -> manager_designation, co_contact -> manager_contact.
  • In Outlet (formerly URC): Rename officer_in_charge -> store_manager.
  • In OutletLoan (formerly URCLoan): Rename ifa_cleared -> finance_cleared, cda_cleared -> accounts_cleared.
  • In DirectOrderI and DirectOrderII (formerly AFDOrder*): Rename member -> customer, urc -> outlet, depot -> distribution_center, legacy_erp_price -> business_price.
  • In DemandUpload, BalanceUpload, Warehouse, Permit, StockVariance, DeliveryConfirmation, ReplenishmentItemDetail (formerly PRGOItemDetail): Rename depot -> distribution_center.
  • In StockEntry, DeliveryNote: Rename urc -> outlet.
  • In MonthlyStockSummary (formerly MSTCSummary): Rename depot -> distribution_center and inter-depot logic to inter-distribution-center.

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”
  • Run pytest and ruff check on the libs/wms directory.
  • Verify 100% of integration tests pass using the newly renamed objects.
  • Ensure all mocked dependencies correctly simulate the new schemas.
  • 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.