docs: add happy flow diagram and API reference to readme
This commit is contained in:
133
readme.md
133
readme.md
@@ -234,6 +234,139 @@ All requests follow a consistent pattern:
|
|||||||
→ statusBupot = "CANCELLED-Done"
|
→ statusBupot = "CANCELLED-Done"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Happy Flow Diagram
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
flowchart TD
|
||||||
|
Start([Start]) --> Auth[Get Authentication Token]
|
||||||
|
Auth -->|POST /auth/gettoken| TokenAPI[Token API]
|
||||||
|
TokenAPI -->|Returns: access_token, idpel| TokenOK{Token Received?}
|
||||||
|
|
||||||
|
TokenOK -->|Yes| Create[Create Tax Slip]
|
||||||
|
TokenOK -->|No| Error1[Check Credentials]
|
||||||
|
Error1 --> Auth
|
||||||
|
|
||||||
|
Create --> CreateAPI{Choose Tax Slip Type}
|
||||||
|
CreateAPI -->|PPh 21| P21[POST /ifs/api/wit/bulanan/new]
|
||||||
|
CreateAPI -->|PPh A0| PA0[POST /ifs/api/wit/bulanan/new]
|
||||||
|
CreateAPI -->|PPh A1| PA1[POST /ifs/api/wit/tahunan/new]
|
||||||
|
|
||||||
|
P21 -->|Request: monthlyIncome, dataBp21| CreateSuccess{Success?}
|
||||||
|
PA0 -->|Request: monthlyIncome, dataBpA0| CreateSuccess
|
||||||
|
PA1 -->|Request: yearlyIncome, dataBpA1| CreateSuccess
|
||||||
|
|
||||||
|
CreateSuccess -->|Yes: status=1| Return1[Returns: nomorBupot, idBupot]
|
||||||
|
CreateSuccess -->|No: status=0| Error2[Handle Error]
|
||||||
|
Error2 --> Create
|
||||||
|
|
||||||
|
Return1 --> Status[Check Tax Slip Status]
|
||||||
|
|
||||||
|
Status --> StatusAPI{Choose Tax Slip Type}
|
||||||
|
StatusAPI -->|PPh 21| S21[POST /ifs/api/wit/status]
|
||||||
|
StatusAPI -->|PPh A0| SA0[POST /ifs/api/wit/status]
|
||||||
|
StatusAPI -->|PPh A1| SA1[POST /ifs/api/wit/status]
|
||||||
|
|
||||||
|
S21 -->|Request: taxSlipVerification| StatusOK{Status Received?}
|
||||||
|
SA0 -->|Request: taxSlipVerification| StatusOK
|
||||||
|
SA1 -->|Request: taxSlipVerification| StatusOK
|
||||||
|
|
||||||
|
StatusOK -->|statusBupot=NORMAL-DONE| Decision{What's Next?}
|
||||||
|
StatusOK -->|statusBupot=AMENDED| Decision
|
||||||
|
StatusOK -->|statusBupot=CANCELLED-Done| End1([End])
|
||||||
|
StatusOK -->|Error| Error3[Handle Error]
|
||||||
|
Error3 --> Status
|
||||||
|
|
||||||
|
Decision -->|Download PDF| PDF[Download PDF]
|
||||||
|
Decision -->|Modify Slip| Edit[Edit Tax Slip]
|
||||||
|
Decision -->|Cancel Slip| Cancel[Cancel Tax Slip]
|
||||||
|
Decision -->|Done| End2([End])
|
||||||
|
|
||||||
|
PDF --> PDFAPI{Choose Tax Slip Type}
|
||||||
|
PDFAPI -->|PPh 21| PF21[POST /ifs/api/wit/pdf]
|
||||||
|
PDFAPI -->|PPh A0| PFA0[POST /ifs/api/wit/pdf]
|
||||||
|
PDFAPI -->|PPh A1| PFA1[POST /ifs/api/wit/pdf]
|
||||||
|
|
||||||
|
PF21 -->|Returns: Base64 PDF| PDFOK{Downloaded?}
|
||||||
|
PFA0 -->|Returns: Base64 PDF| PDFOK
|
||||||
|
PFA1 -->|Returns: Base64 PDF| PDFOK
|
||||||
|
|
||||||
|
PDFOK -->|Yes| End3([End])
|
||||||
|
PDFOK -->|No| Error4[Handle Error]
|
||||||
|
Error4 --> PDF
|
||||||
|
|
||||||
|
Edit --> EditAPI{Choose Tax Slip Type}
|
||||||
|
EditAPI -->|PPh 21| E21[POST /ifs/api/wit/bulanan/edit]
|
||||||
|
EditAPI -->|PPh A0| EA0[POST /ifs/api/wit/bulanan/edit]
|
||||||
|
EditAPI -->|PPh A1| EA1[POST /ifs/api/wit/tahunan/edit]
|
||||||
|
|
||||||
|
E21 -->|Request: monthlyIncome, nomorBupot, idBupot| EditSuccess{Success?}
|
||||||
|
EA0 -->|Request: monthlyIncome, nomorBupot, idBupot| EditSuccess
|
||||||
|
EA1 -->|Request: yearlyIncome, nomorBupot, idBupot| EditSuccess
|
||||||
|
|
||||||
|
EditSuccess -->|Yes: status=1| Return2[Returns: new nomorBupot, new idBupot]
|
||||||
|
EditSuccess -->|No: status=0| Error5[Handle Error]
|
||||||
|
Error5 --> Edit
|
||||||
|
|
||||||
|
Return2 --> Status2[Check Status Again]
|
||||||
|
Status2 --> Status
|
||||||
|
|
||||||
|
Cancel --> CancelAPI{Choose Tax Slip Type}
|
||||||
|
CancelAPI -->|PPh 21| C21[POST /ifs/api/wit/cancel]
|
||||||
|
CancelAPI -->|PPh A0| CA0[POST /ifs/api/wit/cancel]
|
||||||
|
CancelAPI -->|PPh A1| CA1[POST /ifs/api/wit/cancel]
|
||||||
|
|
||||||
|
C21 -->|Request: taxSlipCancel| CancelSuccess{Success?}
|
||||||
|
CA0 -->|Request: taxSlipCancel| CancelSuccess
|
||||||
|
CA1 -->|Request: taxSlipCancel| CancelSuccess
|
||||||
|
|
||||||
|
CancelSuccess -->|Yes: status=1| Return3[Returns: status=1]
|
||||||
|
CancelSuccess -->|No: status=0| Error6[Handle Error]
|
||||||
|
Error6 --> Cancel
|
||||||
|
|
||||||
|
Return3 --> Status3[Verify Cancellation]
|
||||||
|
Status3 --> Status
|
||||||
|
|
||||||
|
style Start fill:#e1f5fe
|
||||||
|
style Auth fill:#e1f5fe
|
||||||
|
style Create fill:#fff3e0
|
||||||
|
style Status fill:#e8f5e9
|
||||||
|
style PDF fill:#f3e5f5
|
||||||
|
style Edit fill:#fff8e1
|
||||||
|
style Cancel fill:#ffebee
|
||||||
|
style End1 fill:#c8e6c9
|
||||||
|
style End2 fill:#c8e6c9
|
||||||
|
style End3 fill:#c8e6c9
|
||||||
|
style Error1 fill:#ffcdd2
|
||||||
|
style Error2 fill:#ffcdd2
|
||||||
|
style Error3 fill:#ffcdd2
|
||||||
|
style Error4 fill:#ffcdd2
|
||||||
|
style Error5 fill:#ffcdd2
|
||||||
|
style Error6 fill:#ffcdd2
|
||||||
|
```
|
||||||
|
|
||||||
|
### Quick Reference: Happy Flow Steps
|
||||||
|
|
||||||
|
| Step | Action | Endpoint | Returns |
|
||||||
|
|------|--------|----------|---------|
|
||||||
|
| 1 | Get Token | `POST /auth/gettoken` | `access_token`, `idpel` |
|
||||||
|
| 2 | Create Slip | `POST /ifs/api/wit/bulanan/new` or `/tahunan/new` | `nomorBupot`, `idBupot` |
|
||||||
|
| 3 | Check Status | `POST /ifs/api/wit/status` | `statusBupot` |
|
||||||
|
| 4a | Download PDF | `POST /ifs/api/wit/pdf` | Base64 PDF |
|
||||||
|
| 4b | Edit Slip | `POST /ifs/api/wit/bulanan/edit` or `/tahunan/edit` | New `nomorBupot` |
|
||||||
|
| 4c | Cancel Slip | `POST /ifs/api/wit/cancel` | Success confirmation |
|
||||||
|
|
||||||
|
### Status Flow
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
stateDiagram-v2
|
||||||
|
[*] --> NORMAL_DONE: Pengesahan (New)
|
||||||
|
NORMAL_DONE --> AMENDED: Penggantian (Edit)
|
||||||
|
AMENDED --> AMENDED: Penggantian Lagi
|
||||||
|
NORMAL_DONE --> CANCELLED_DONE: Pembatalan (Cancel)
|
||||||
|
AMENDED --> CANCELLED_DONE: Pembatalan (Cancel)
|
||||||
|
CANCELLED_DONE --> [*]
|
||||||
|
```
|
||||||
|
|
||||||
## Important Notes
|
## Important Notes
|
||||||
|
|
||||||
1. **Language**: All API documentation and field names are in Indonesian (Bahasa Indonesia)
|
1. **Language**: All API documentation and field names are in Indonesian (Bahasa Indonesia)
|
||||||
|
|||||||
Reference in New Issue
Block a user