@provis/provis-common-be-module 2.6.65 → 2.6.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ICCB-INV-IMPACT-ANALYSIS.md +177 -0
- package/package.json +1 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Impact Analysis: Adding `ICCB-INV` Insurance Type (Institute Cargo Clause B)
|
|
2
|
+
|
|
3
|
+
> Analisis dampak penambahan tipe asuransi baru `ICCB-INV` (Institute Cargo Clause B) ke seluruh ekosistem Provi/Polismall.
|
|
4
|
+
>
|
|
5
|
+
> Tanggal analisis: 2026-07-17
|
|
6
|
+
|
|
7
|
+
## Ringkasan Eksekutif
|
|
8
|
+
|
|
9
|
+
Saat ini sistem hanya mendukung 4 tipe clause: `ICCA-INV`, `ICCC-INV`, `ICCA-FLB`, `ICCC-FLB` (Clause A dan C). Penambahan `ICCB-INV` berdampak ke banyak project karena **logika clause diduplikasi secara lokal** di tiap konsumen (bukan memakai satu sumber tunggal).
|
|
10
|
+
|
|
11
|
+
Temuan penting:
|
|
12
|
+
|
|
13
|
+
- `ICCB-INV` **sudah ada** di shared library `provis-common-be-module` (TYPE map), tetapi **belum ada** di sebagian besar konsumen yang punya konstanta/switch lokal sendiri.
|
|
14
|
+
- **Tidak ada satu pun validasi DTO (`IsEnum`/`IsIn`)** di semua backend. Artinya `ICCB-INV` akan lolos diam-diam tanpa error, dan bug hanya muncul sebagai **data kosong/salah** di output (sertifikat, PDF, premi), bukan sebagai error yang mudah terdeteksi.
|
|
15
|
+
- Terdapat **dua vocabulary clause yang berbeda** di codebase: format `ICCA-INV` (exim/dashboard/common-module) vs format `ICC A` (provis-invoice, provis-meratus-api). Tidak ada single source of truth.
|
|
16
|
+
|
|
17
|
+
Dua hal yang harus dikonfirmasi sebelum implementasi:
|
|
18
|
+
|
|
19
|
+
1. **Nilai rate ICCB** — dipakai di perhitungan premi (`pdf.ts`, `provis-invoice`, `provis-meratus-api`). Tidak bisa ditebak.
|
|
20
|
+
2. **Apakah butuh varian `ICCB-FLB`** juga, atau cukup `ICCB-INV`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Project yang WAJIB Diubah (ada logika clause)
|
|
25
|
+
|
|
26
|
+
### 1. provis-common-be-module (shared, source of truth)
|
|
27
|
+
|
|
28
|
+
| File | Lokasi | Keterangan |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| `src/constants/product/cargo/cargo.ts` | TYPE map | `ICCB-INV` **sudah ada**. Namun **belum ada `ICCB-FLB`** → gap kalau butuh varian First Loss Basis. |
|
|
31
|
+
| `src/helpers/getCargoType.ts:3` | `getCargoType()` | Data-driven (lookup by code di TYPE map), otomatis resolve. Tidak perlu ubah kode. |
|
|
32
|
+
|
|
33
|
+
### 2. polismall-exim-api
|
|
34
|
+
|
|
35
|
+
| File | Lokasi | Keterangan |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| `src/common/constants/cargo.ts` | `CARGO_TYPE_ICC_*` | Hanya A & C, wajib tambah konstanta ICCB. |
|
|
38
|
+
| `src/common/constants/pdf.ts:7` | `RATE_RULES` | **KRITIS** — wajib tambah rate `ICCB` untuk perhitungan premi. `getRate()` ambil prefix `code.split('-')[0]`; tanpa entry `ICCB` akan return `null`. |
|
|
39
|
+
| `src/service/booking.service.ts:1305` | `convertInsuranceTypeDesc` | Tambah case ICCB. |
|
|
40
|
+
| `src/service/declarationBundle.service.ts:387` | `convertInsuranceTypeDesc` | Tambah case ICCB. |
|
|
41
|
+
| `src/service/internal.declaration.service.ts:1516` | `convertInsuranceType` | Matching by text "Institute Cargo Clause (A/C)". |
|
|
42
|
+
| `src/service/internal.declaration.service.ts:1527` | `convertInsuranceTypeNamingConv` | Tambah case ICCB. |
|
|
43
|
+
| `src/service/internal.declaration.service.ts:1541` | `convertInsuranceTypeDesc` | ⚠️ **Tanpa `default`** → return `undefined` untuk tipe tak dikenal. |
|
|
44
|
+
| `src/service/internal.declaration.service.ts:2587` | `convertIdCoverage` | Tambah case ICCB. |
|
|
45
|
+
| `src/service/internal.declaration.service.ts:2602` | `convertInsuranceTypeNamingConvReverse` | Tambah case ICCB. |
|
|
46
|
+
| `src/service/retry.service.ts:112` | `convertInsuranceTypeNamingConv` | Duplikat, default return `''`. |
|
|
47
|
+
|
|
48
|
+
### 3. provis-invoice (KRITIS — rate hardcode)
|
|
49
|
+
|
|
50
|
+
| File | Lokasi | Keterangan |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| `src/service/cargoMeratus.service.ts:298` | `checkInsuranceType()` | Tanpa case ICC B akan masuk `default` → **throw error** di `:384`/`:447`. |
|
|
53
|
+
| `src/service/cargoMeratus.service.ts:302,309,325,341` | description strings | Butuh string clause B sendiri. |
|
|
54
|
+
| `src/service/cargoMeratus.service.ts:504` | render conditions | Mengalir dari string di atas. |
|
|
55
|
+
| `src/common/constants/cargoMeratus.ts:34-37` | konstanta `ICC A`/`ICC C`/`FLB A`/`FLB C` | Tambah `ICC B`. ⚠️ Pakai vocabulary beda (`ICC A`, bukan `ICCA-INV`). |
|
|
56
|
+
|
|
57
|
+
### 4. provis-meratus-api (core mapping)
|
|
58
|
+
|
|
59
|
+
| File | Lokasi | Keterangan |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `src/common/constants/config.ts:35-38` | konstanta clause | Tambah `ICC B`/`FLB B`. |
|
|
62
|
+
| `src/service/meratus.service.ts:681-692` | `getInsuranceTypeDesc()` | Tambah case Clause B. |
|
|
63
|
+
| `src/service/meratus.service.ts:702-711` | `getInsuranceGoodType()` | Butuh keputusan good type untuk Clause B. |
|
|
64
|
+
| `src/service/meratus.service.ts:721-732` | `getInsuranceTypeCode()` | Tambah case `ICCB-INV`/`ICCB-FLB`. |
|
|
65
|
+
|
|
66
|
+
### 5. polismall-dashboard-api
|
|
67
|
+
|
|
68
|
+
> Catatan: saat ini bahkan **hanya ICCA** yang ter-wire (belum ada ICCC).
|
|
69
|
+
|
|
70
|
+
| File | Lokasi | Keterangan |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `src/common/constants/excelRead.ts:13-14` | `TYPE_ICCA_INV`, `TYPE_ICCA_FLB` | Tambah entry ICCB. |
|
|
73
|
+
| `src/controller/excelRead.controller.ts:165-172` | dropdown `insuranceTypes` | Dibangun via `getCargoType()`. |
|
|
74
|
+
| `src/service/excelRead.service.ts:228,305,324,346-352` | sumInsured / `detectInsuranceType()` | Logika keyed pada `TYPE_ICCA_INV.code`. |
|
|
75
|
+
|
|
76
|
+
### 6. provis-back-office
|
|
77
|
+
|
|
78
|
+
| File | Lokasi | Keterangan |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| `src/service/excel.service.ts:221-227` | switch clause | ⚠️ line 227 kemungkinan bug: `ICCC-INV` di posisi label `ICCA-FLB`. |
|
|
81
|
+
| `src/common/constants/excelUpload.ts:74` | header "RISK COVER" | Enumerasi kode yang diperbolehkan. |
|
|
82
|
+
| `src/common/constants/excelUploadBundleCargo.ts:84` | header "RISK COVER" | Enumerasi kode yang diperbolehkan. |
|
|
83
|
+
|
|
84
|
+
### 7. bolier-plate-go-rest
|
|
85
|
+
|
|
86
|
+
| File | Lokasi | Keterangan |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| `app/constants/ppnp_constants.go:5-8` | konstanta clause Go + contoh rate | Tambah konstanta ICCB. |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Frontend / Microsite (dropdown & label)
|
|
93
|
+
|
|
94
|
+
### 8. temas-microsite
|
|
95
|
+
|
|
96
|
+
| File | Lokasi | Keterangan |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `views/index.ejs:259-262` | dropdown user | Satu-satunya tempat user memilih clause. Tambah `<option value="ICCB-INV">`. |
|
|
99
|
+
| `src/service/micrositeService.ts:782-788` | switch mapping | Tambah case ICCB-INV. |
|
|
100
|
+
| `public/js/function-detail.js:294-315` | rate switch + cap sum insured | Tambah case ICCB-INV. |
|
|
101
|
+
| `public/js/function-index.js:374-395` | rate switch (mirror) | Tambah case ICCB-INV. |
|
|
102
|
+
| `public/js/function-index.js:284-285` | option-hide logic | Review apakah ICCB perlu di-hide kondisional. |
|
|
103
|
+
| `public/js/common/upload.js:18-198` | bulk-upload code mapping | ⚠️ Juga referensi `ICCA-SEC`, `ICCC-NEW`, `ICCC-SEC` → universe clause ternyata lebih luas. |
|
|
104
|
+
| `locales/id.json:25,28`, `locales/en.json:26,29` | teks i18n | Update copy untuk menyebut Clause B. |
|
|
105
|
+
|
|
106
|
+
### 9. polismall-exim-microsite
|
|
107
|
+
|
|
108
|
+
| File | Lokasi | Keterangan |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| `src/constants/index.js:22` | `INSURANCE_TYPES` array | `["ICCA-INV","ICCC-INV","ICCA-FLB","ICCC-FLB"]` → tambah `ICCB-INV`. |
|
|
111
|
+
| `src/components/Detail/Detail.js:144` | label hardcode | Teks statis "Institute Cargo Clause (A)...", perlu varian B / dinamis. |
|
|
112
|
+
| `src/pages/Booking/BookingNext.js:266` | default fallback | Review default value. |
|
|
113
|
+
|
|
114
|
+
### 10. polismall-dashboard-web
|
|
115
|
+
|
|
116
|
+
| File | Lokasi | Keterangan |
|
|
117
|
+
|---|---|---|
|
|
118
|
+
| `src/constants/index.js:38-47` | `INSURANCE_TYPE_YUDHA_OPTIONS` | Hanya ICCA-INV & ICCA-FLB. Tambah opsi ICCB. |
|
|
119
|
+
| `src/pages/Tanto/UploadTransaction/index.js:91` | `orderedCodes` | `["ICCA-INV","ICCC-INV","ICCA-FLB","ICCC-FLB"]` → tambah ICCB. |
|
|
120
|
+
|
|
121
|
+
### 11. provis-internal-web
|
|
122
|
+
|
|
123
|
+
| File | Lokasi | Keterangan |
|
|
124
|
+
|---|---|---|
|
|
125
|
+
| `src/components/FileUpload/FileUpload.js:610-621` | dropdown MenuItem | Tambah item ICCB. |
|
|
126
|
+
| `src/pages/Upload/Gemilang/Component/CreateData.js:205-215` | dropdown MenuItem | Tambah item ICCB. |
|
|
127
|
+
| `src/pages/Upload/Gemilang/Component/DataTableExcel.js:514-524` | dropdown MenuItem | Tambah item ICCB. |
|
|
128
|
+
| `src/components/Forms/UpdateForm.js:349-366` | switch label | Dead code (commented out). Tidak perlu aksi kecuali diaktifkan. |
|
|
129
|
+
|
|
130
|
+
### 12. provis-internal-web-v2
|
|
131
|
+
|
|
132
|
+
| File | Lokasi | Keterangan |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| `src/lib/constants.js:71-76` | `CARGO_TYPE` | Copy dari shared module. Tambah `TYPE_ICCB_INV`. |
|
|
135
|
+
| `src/lib/constants.js:81-85` | `cargoTypeLabel()` | Iterasi `CARGO_TYPE`, auto-resolve entry baru. |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Project TANPA Impact (pass-through / DB-driven)
|
|
140
|
+
|
|
141
|
+
| Project | Alasan |
|
|
142
|
+
|---|---|
|
|
143
|
+
| **marine-cargo** | DB-driven via tabel `rate_group`. Cukup tambah record DB, **tidak ada perubahan kode**. |
|
|
144
|
+
| **marine-cargo..** | Sama seperti marine-cargo (DB-driven). |
|
|
145
|
+
| **provis-generate-pdf** | Hanya render string `insuranceType`/`insuranceTypeDesc` yang diterima. Switch keyed pada `productType`/`productCode`, bukan clause. |
|
|
146
|
+
| **provis-generate-excel** | Tidak ada referensi clause sama sekali. |
|
|
147
|
+
| **provis-claim-api** | `insuranceType`/`insuranceTypeName` hanya pass-through string. |
|
|
148
|
+
| **provis-payment** | Tidak ada referensi clause. |
|
|
149
|
+
| **polismall-cargo-container-api** | `insuranceType` pass-through, tidak pernah diinspeksi. |
|
|
150
|
+
| **polismall-cargo-claim-microsite** | Tidak ada referensi clause. |
|
|
151
|
+
| **polismall-otto-api** | Keyed pada `productCode`, bukan clause. |
|
|
152
|
+
| **polismall-kca-api** | `insuranceType` plain string, no clause logic. |
|
|
153
|
+
| **polismall-invoice-microsite** | Tidak ada logika clause (match hanya false positive). |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Matriks Prioritas
|
|
158
|
+
|
|
159
|
+
| Prioritas | Project | Alasan |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| **KRITIS** | provis-invoice | `default` case → throw error, premi gagal |
|
|
162
|
+
| **KRITIS** | polismall-exim-api | rate `RATE_RULES` + 6 fungsi konversi |
|
|
163
|
+
| **KRITIS** | provis-meratus-api | 3 switch core mapping |
|
|
164
|
+
| **TINGGI** | dashboard-api, back-office | rate/excel logic |
|
|
165
|
+
| **SEDANG** | temas-microsite, exim-microsite, dashboard-web, internal-web, internal-web-v2 | dropdown + label |
|
|
166
|
+
| **RENDAH** | provis-common-be-module | `ICCB-INV` sudah ada, cek perlu `ICCB-FLB` |
|
|
167
|
+
| **NONE** | marine-cargo (DB), generators, pass-through services | tinggal data DB |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Catatan Risiko
|
|
172
|
+
|
|
173
|
+
1. **Silent failure**: Tanpa validasi DTO, input `ICCB-INV` tidak ditolak. Field turunan (deskripsi, premi) akan `undefined`/`null`/kosong tanpa error.
|
|
174
|
+
2. **Duplikasi logika**: `convertInsuranceTypeDesc` ada di 3 service dengan behavior default berbeda (return value asli / `''` / `undefined`). Harus disinkronkan.
|
|
175
|
+
3. **Dua vocabulary**: `ICCA-INV` vs `ICC A`. Update di satu format tidak otomatis memperbaiki format lain.
|
|
176
|
+
4. **Universe clause lebih luas dari perkiraan**: `temas-microsite/upload.js` menyebut `ICCA-SEC`, `ICCC-NEW`, `ICCC-SEC`. Konfirmasi daftar clause otoritatif lengkap sebelum implementasi.
|
|
177
|
+
5. **Rate ICCB belum diketahui**: harus dikonfirmasi dari tim bisnis/aktuaria.
|