mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
feat: implement wagon transfer management modals and page
- Add TransferFulfillModal for fulfilling wagon transfer requests. - Create TransferRequestFormModal for filing new wagon transfer requests. - Introduce TransferCloseShortModal for closing requests that cannot be fully fulfilled. - Develop WagonTransfersPage to manage and display wagon transfer requests. - Implement utility functions for handling wagon transfer request data and UI components. - Enhance UI with Mantine components for better user experience.
This commit is contained in:
@@ -233,6 +233,12 @@ export const FLEET_RAIL_PERMISSIONS: FreightPermissionSeed[] = [
|
||||
perm('e1b00001-0001-4000-8000-000000000005', 'edr_freight_app:wagons:transfer_request', 'Request wagon transfer'),
|
||||
perm('e1b00001-0001-4000-8000-000000000006', 'edr_freight_app:wagons:transfer_fulfill', 'Fulfil wagon transfer (OCC)'),
|
||||
perm('e1b00001-0001-4000-8000-000000000007', 'edr_freight_app:wagons:transfer_history_all', "View all staff's transfer history"),
|
||||
// The transfer desk is its own screen, so it carries its own per-action keys —
|
||||
// seeing the queue, withdrawing a request and short-closing one are separate
|
||||
// grants from filing or fulfilling.
|
||||
perm('e1b00001-0001-4000-8000-000000000008', 'edr_freight_app:wagons:transfer_view', 'View wagon transfer requests'),
|
||||
perm('e1b00001-0001-4000-8000-000000000009', 'edr_freight_app:wagons:transfer_cancel', 'Withdraw a wagon transfer request'),
|
||||
perm('e1b00001-0001-4000-8000-00000000000a', 'edr_freight_app:wagons:transfer_close_short', 'Close a transfer request short of the requested count'),
|
||||
perm('e1c00001-0001-4000-8000-000000000001', 'edr_freight_app:trains:view', 'View trains'),
|
||||
perm('e1c00001-0001-4000-8000-000000000002', 'edr_freight_app:trains:create', 'Create train'),
|
||||
perm('e1c00001-0001-4000-8000-000000000003', 'edr_freight_app:trains:update', 'Update train'),
|
||||
@@ -524,6 +530,12 @@ export const FREIGHT_PERMS = {
|
||||
// executes the move). Distinct keys so OCC can hold fulfil without request.
|
||||
transferRequest: 'edr_freight_app:wagons:transfer_request',
|
||||
transferFulfill: 'edr_freight_app:wagons:transfer_fulfill',
|
||||
/** Open the transfer-requests desk (list + detail). */
|
||||
transferView: 'edr_freight_app:wagons:transfer_view',
|
||||
/** Withdraw a request that has not moved any wagon yet. */
|
||||
transferCancel: 'edr_freight_app:wagons:transfer_cancel',
|
||||
/** End a request short — anyone who can fulfil may also do this. */
|
||||
transferCloseShort: 'edr_freight_app:wagons:transfer_close_short',
|
||||
// Admin: read every staffer's transfer history. Without it, a user only sees
|
||||
// their own (the /history endpoint uses the caller id, backend-enforced).
|
||||
transferHistoryAll: 'edr_freight_app:wagons:transfer_history_all',
|
||||
@@ -905,6 +917,12 @@ export const POSITION_PERMISSION_PRESETS = {
|
||||
...ROLE_PERMISSION_PRESETS.director,
|
||||
...ROLE_PERMISSION_PRESETS.operationsOfficer,
|
||||
FREIGHT_PERMS.allocation.manage,
|
||||
// Customer desk: onboarding intake lands on the chief — open the customer
|
||||
// list and approve/suspend a submitted profile. Deliberately NOT granted:
|
||||
// create, update and password reset, which stay with the customer admins.
|
||||
FREIGHT_PERMS.customers.view,
|
||||
FREIGHT_PERMS.customers.verify,
|
||||
FREIGHT_PERMS.customers.deactivate,
|
||||
]),
|
||||
director: dedupe([...ROLE_PERMISSION_PRESETS.director]),
|
||||
ceo: dedupe([...ROLE_PERMISSION_PRESETS.ceo]),
|
||||
|
||||
Reference in New Issue
Block a user