How santoshrobot7/so-approvals-public works
SO Approvals digitizes CG Motors’ sales-order-for-billing workflow: sales staff prepare forms and supporting files, submit them for rule-selected or manually picked approvals, and after final approval record SAP order details and download a combined PDF for attachment in SAP. The browser app calls the Worker API; shared logic defines form validation, totals, roles, and chains, while D1 persists workflow state and documents. The README documents user/rule administration, brand-scoped access, signatures, and PDF assembly. Unsampled routes and storage internals are represented only at documented subsystem level.
Main entry points: worker.js API routing · app.js Forms and admin UI · shared.js Form and chain rules · pdf.js PDF builder
Components 15
Browser experience
- Forms and admin UI
public/app.js - PDF builder
public/pdf.js
Approval workflow
- Form and chain rules
public/shared.js - Form lifecycle
src/worker.js - Approval decisions
src/worker.js - Users and rules
src/worker.js - Supporting documents
src/worker.js - SAP handoff
src/worker.js
API and identity
- API routing
src/worker.js - Sessions and access
src/worker.js
Workflow records
- D1 records
- Workflow schema
migrations
Other components
- Sales staff
- Approvers and admins
- SAP order process
Connections 25
- Sales staff → Forms and admin UI: fills forms
README.md - Approvers and admins → Forms and admin UI: reviews forms
README.md - Forms and admin UI → API routing: calls API
public/app.js - Forms and admin UI → Form and chain rules: uses rules
public/app.js - Forms and admin UI → PDF builder: builds download
public/app.js - PDF builder → Form and chain rules: uses form definitions
public/pdf.js - API routing → Sessions and access: checks sessions
src/worker.js - API routing → Form lifecycle: routes form actions
src/worker.js - API routing → Approval decisions: routes decisions
src/worker.js - API routing → Users and rules: routes admin actions
src/worker.js - API routing → Supporting documents: routes file actions
src/worker.js - API routing → SAP handoff: routes SAP actions
src/worker.js - Form lifecycle → Form and chain rules: validates and selects chain
src/worker.js - Approval decisions → Form and chain rules: checks role access
src/worker.js - Form lifecycle → D1 records: reads and writes
- Approval decisions → D1 records: records decisions
- Sessions and access → D1 records: reads sessions and users
src/worker.js - Users and rules → D1 records: manages users and rules
- Supporting documents → D1 records: stores file pieces
- SAP handoff → D1 records: records order handoff
- Workflow schema → D1 records: defines schema
README.md - Forms and admin UI → Supporting documents: uploads and fetches files
- Forms and admin UI → SAP handoff: records SO details
- PDF builder → Supporting documents: loads attached files
- Sales staff → SAP order process: attaches final PDF
README.md