Customer Address Management
Customer Address Management reviews requests to update customer address GPS coordinates. It is an approval queue, separate from editing draft customer addresses in Customer Management and separate from directly setting a default address on an existing SAP customer.
App Entry Points
| App | Target |
|---|---|
| Mobile | CustomerManagementAddressList -> CustomerManagementAddressDetail |
| POS Terminal | customerAddressManagement -> CustomerAddressManagementDetailForm |
Approval Workflow
Data And API Rules
| Operation | Service |
|---|---|
| List requests | getCustomerDraftAddressLatLngList -> GET /customer-draft/address-lat-lng?branchId=... |
| Detail | getCustomerDraftAddressLatLngById |
| Approve | approveCustomerAddressGpsUpdateRequest(id) |
| Reject | rejectCustomerAddressGpsUpdateRequest(id) |
| Create request from customer detail | requestCustomerAddressGpsUpdate(payload) |
| Direct SAP customer GPS update | updateCustomerAddressGps(customerCode, addressId, payload) |
| Default address | setCustomerDefaultAddress(customerCode, addressId) |
Validation Guidance
| Rule | Behavior |
|---|---|
| Empty coordinate | Empty, missing, null, string null, or unusable zero-like coordinates must not be treated as valid. |
| Review context | Reviewer should see requester, request time, old address, requested lat/lng, and notes where available. |
| Approval impact | Approved coordinates affect delivery fee, route assignment, map distance, and sales order address checks. |
| Separate flows | GPS approval does not replace Customer Management draft address CRUD. |
Permissions And Guards
| Topic | Behavior |
|---|---|
| Terminal menu key | customerAddressManagement |
| deptCode menu set | -2, 1, 2, 3, 4, 7, 29, 21, 8, 9, 13, 14, 16, 27, 30 |
| Approval flag | Should follow the same customer approval authority as customer management (approveCustomer). |
| Branch scope | Request list is selected-branch scoped. |
Mobile vs POS Terminal
| Topic | Mobile | POS Terminal |
|---|---|---|
| List | Dedicated address request list | Split-pane list normalized by customerAddressManagement |
| Detail | Full-screen request detail | CustomerAddressManagementDetailForm |
| Coordinates | Mobile may use map/device location flows | Terminal review/approval panel |
| After action | Refresh queue and return/list update | Refresh list pane/detail |
Developer Handoff Map
| Area | Code |
|---|---|
| Mobile list/detail | apps/mobile/src/screens/customerManagementStack/customerManagementAddressListScreen, customerManagementAddressDetailScreen |
| Terminal detail | apps/pos-terminal/src/screens/HomeScreen/CustomerAddressManagementDetailForm.tsx |
| Customer service | apps/*/src/services/customers.ts |
| Terminal split data | apps/pos-terminal/src/services/splitMenuData.ts -> normalizeCustomerAddressManagementList |
| Sales dependency | Sales order address/route/coordinate validation |