Files
Krow-workspace/firebase/internal-launchpad/assets/diagrams/architectures/3-invoice-workflow-simple.mermaid
bwnyasse 20c29dc695 update
2025-11-14 12:59:00 -05:00

40 lines
2.1 KiB
Plaintext
Raw Blame History

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.
graph LR
START[💼 Shift<br/>Completed<br/>& Rated]
START --> CALC[📊 INTERNAL<br/><br/>Calculate Invoice<br/>• Hours worked<br/>• Rates × Hours<br/>• Overtime calc<br/>• Platform fees<br/>• Tax amounts]
CALC --> GENERATE[📄 INTERNAL<br/><br/>Generate Invoice<br/>• Create PDF<br/>• Invoice number<br/>• Line items<br/>• Due date]
GENERATE --> SAVE[💾 INTERNAL<br/><br/>Save to Database<br/>• Store invoice<br/>• Status: pending<br/>• Track history]
SAVE --> SEND[📧 API INTEGRATION<br/><br/>SendGrid<br/>• Send email<br/>• Track delivery<br/>• Reliable inbox]
SEND --> CLIENT[📱 Client<br/>Reviews<br/>Invoice]
CLIENT --> DECISION{Approve or<br/>Dispute?}
DECISION -->|⚠️ Dispute| DISPUTE[🔧 INTERNAL<br/><br/>Handle Dispute<br/>• Admin reviews<br/>• Adjustments<br/>• Re-calculate]
DISPUTE --> SAVE
DECISION -->|✅ Approve| PAY[💳 API INTEGRATION<br/><br/>Stripe<br/>• Credit card<br/>• ACH transfer<br/>• Payment tracking]
PAY --> CONFIRM[💾 INTERNAL<br/><br/>Update Status<br/>• Mark as paid<br/>• Record payment<br/>• Update reports]
CONFIRM --> PAYOUT[💰 API INTEGRATION<br/><br/>Stripe Connect<br/>• Pay staff<br/>• Direct deposit<br/>• Automated]
PAYOUT --> RECORD[📊 INTERNAL<br/><br/>Track Payments<br/>• Staff earnings<br/>• Payment history<br/>• Reports]
RECORD --> DONE[✅ Complete]
style START fill:#E1F5FF
style CALC fill:#FFF9E6,stroke:#F9A825,stroke-width:3px
style GENERATE fill:#FFF9E6,stroke:#F9A825,stroke-width:3px
style SAVE fill:#FFF9E6,stroke:#F9A825,stroke-width:3px
style DISPUTE fill:#FFF9E6,stroke:#F9A825,stroke-width:3px
style CONFIRM fill:#FFF9E6,stroke:#F9A825,stroke-width:3px
style RECORD fill:#FFF9E6,stroke:#F9A825,stroke-width:3px
style SEND fill:#E3F2FD,stroke:#1976D2,stroke-width:3px
style PAY fill:#E3F2FD,stroke:#1976D2,stroke-width:3px
style PAYOUT fill:#E3F2FD,stroke:#1976D2,stroke-width:3px
style DONE fill:#90EE90