5 Pages and Navigation
shad0w edited this page 2026-06-24 02:21:29 +00:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Pages and Navigation

The left sidebar adapts to the signed-in user's role and is organised into Purchasing, Reports, and Administration sections (with an Inventory group when the inventory flag is on). Routes below map to files under app/(portal)/.

Sidebar (role-aware)

Dashboard                        ← all users

─── Purchasing ──────────────────────────
New PO            /po/new         ← TECH, MANNING, MANAGER, SUPERUSER
My Orders         /my-orders      ← TECH, MANNING, MANAGER, SUPERUSER
Approvals         /approvals      ← MANAGER, SUPERUSER
Import PO         /po/import      ← MANAGER, SUPERUSER, ADMIN
Payments          /payments       ← ACCOUNTS (+ MANAGER, SUPERUSER)
History / Export  /history        ← MANAGER, SUPERUSER, AUDITOR, ADMIN
                                    (+ TECHNICAL, MANNING when SUBMITTER_VIEW_ALL flag on)
Vendors           /inventory/vendors  ← MANAGER, ACCOUNTS, ADMIN
Items             /inventory/items    ← all (read-only catalogue)
Cart              /inventory/cart     ← TECH, MANNING, MANAGER, SUPERUSER

─── Administration ──────────────────────
Users             /admin/users        ← ADMIN
Companies         /admin/companies     ← ADMIN
Accounting Codes  /admin/accounts      ← MANAGER, ADMIN
Cost Centres      /admin/vessels       ← MANAGER, ADMIN
Sites             /admin/sites         ← MANAGER, ADMIN
Products          /admin/products      ← MANAGER, ADMIN
Vendors           /admin/vendors       ← MANAGER, ACCOUNTS, ADMIN
SuperUser Requests /admin/superuser-requests ← ADMIN

Authenticated routes

Route Page Notes
/login Login Email + password; SSO button; "PPMS" branding
/dashboard Dashboard Role-specific stat cards + charts
/my-orders My Purchase Orders Submitter's open & past POs (Closed list scoped by role)
/po/new New PO Multi-section form (header, line items, T&C, documents)
/po/[id] PO Detail Read view; contextual action buttons by status/role; export. Own PO always; any PO for view_all_pos holders (and submitters when the SUBMITTER_VIEW_ALL flag is on)
/po/[id]/edit Edit PO DRAFT or EDITS_REQUESTED, owner/SUPERUSER; "Update & Resubmit"
/po/[id]/receipt Confirm Receipt PAID_DELIVERED; upload receipt; full or partial
/po/import Import PO Upload Pelagia-format Excel → CLOSED
/approvals Approval Queue MGR_REVIEW POs; search + filters
/approvals/[id] Approval Detail Approve / Approve+Note / Reject / Request Edits / Request Vendor ID; inline line-item edit
/payments Payment Queue MGR_APPROVED & SENT_FOR_PAYMENT cards; send/mark paid; partial
/payments/history Payment History Completed payments (ACCOUNTS, MANAGER)
/history History & Export All POs; filter by date/cost centre/multiple statuses; CSV/PDF. export_reports holders, plus submitters when the SUBMITTER_VIEW_ALL flag is on
/reports/cost-centres Reports → Cost Centres Approved spend compared across cost centres (vessels); drill to a cost-centre report. view_analytics
/reports/accounting-codes Reports → Accounting Codes Approved spend by the accounting-code tree (drill headings → sub → leaf); leaf opens its report. view_analytics
/inventory/items Items (read-only) Catalogue; expand for per-vendor prices; Cheapest/★Closest tags
/inventory/items/[id] Item Detail Price comparison, site-distance sort, stock by site
/inventory/vendors Vendors List with verified/active badges
/inventory/vendors/[id] Vendor Detail Info, items supplied, recent POs
/inventory/cart Cart localStorage cart → Create PO
/profile Profile Every role; set password (SSO users); signature (approvers); request SuperUser
/admin/users User Management ADMIN — CRUD + roles
/admin/companies Companies ADMIN — multi-company invoicing
/admin/accounts Accounting Codes 3-level hierarchy
/admin/vessels Cost Centre Management Vessels surfaced as "Cost Centre"
/admin/sites Sites Ports/depots/offices; inventory
/admin/sites/[id] Site Detail Stock chart, consumption log, assigned vessels
/admin/products Item Catalogue Editable; add/toggle/delete
/admin/products/[id] Item Detail Vendor prices, stock
/admin/vendors Vendor Registry Add/edit; GSTIN lookup
/admin/vendors/[id] Vendor Detail GSTIN/address/contacts; items; recent POs
/admin/superuser-requests SuperUser Requests ADMIN — approve/deny

PO detail action buttons

Which buttons appear is computed from PO status × role (via getAvailableActions in the state machine):

Condition Button
DRAFT or EDITS_REQUESTED + own submitter Edit
DRAFT + owner / MANAGER / SUPERUSER Discard
VENDOR_ID_PENDING + can provide vendor Inline vendor selection
PAID_DELIVERED / PARTIALLY_* + own submitter or SUPERUSER/MANAGER Confirm Receipt (full/partial)
MGR_APPROVED+ Export PDF / XLSX

Mobile

  • Manager and Accounts get a mobile layout: approval/payment cards and a bottom navigation bar (Home / section / Profile).
  • Other roles see a "Desktop Required" overlay on small viewports (375×812), with a Sign-out button.

The design-system tokens (colours, typography, component conventions) are in Docs/01-design-document.md §7.