@finsys/core 3.5.0 → 4.0.0
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/dist/data/form-field-base-specs.json +134 -20
- package/dist/index.cjs +204 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -13
- package/dist/index.d.ts +57 -13
- package/dist/index.js +201 -75
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7898,7 +7898,13 @@ var form_field_base_specs_default = {
|
|
|
7898
7898
|
"openingBalanceT1",
|
|
7899
7899
|
"bankBalanceT1"
|
|
7900
7900
|
],
|
|
7901
|
-
category: "13"
|
|
7901
|
+
category: "13",
|
|
7902
|
+
document_type: "bankStatements",
|
|
7903
|
+
document_group: "bank_statements",
|
|
7904
|
+
document_group_label: "Bank Statements",
|
|
7905
|
+
wire_format: "path_array",
|
|
7906
|
+
document_slot: 1,
|
|
7907
|
+
time_period_unit: "month"
|
|
7902
7908
|
},
|
|
7903
7909
|
{
|
|
7904
7910
|
name: "bank_statement_t2",
|
|
@@ -7914,7 +7920,13 @@ var form_field_base_specs_default = {
|
|
|
7914
7920
|
"openingBalanceT2",
|
|
7915
7921
|
"bankBalanceT2"
|
|
7916
7922
|
],
|
|
7917
|
-
category: "13"
|
|
7923
|
+
category: "13",
|
|
7924
|
+
document_type: "bankStatements",
|
|
7925
|
+
document_group: "bank_statements",
|
|
7926
|
+
document_group_label: "Bank Statements",
|
|
7927
|
+
wire_format: "path_array",
|
|
7928
|
+
document_slot: 2,
|
|
7929
|
+
time_period_unit: "month"
|
|
7918
7930
|
},
|
|
7919
7931
|
{
|
|
7920
7932
|
name: "bank_statement_t3",
|
|
@@ -7930,7 +7942,13 @@ var form_field_base_specs_default = {
|
|
|
7930
7942
|
"openingBalanceT3",
|
|
7931
7943
|
"bankBalanceT3"
|
|
7932
7944
|
],
|
|
7933
|
-
category: "13"
|
|
7945
|
+
category: "13",
|
|
7946
|
+
document_type: "bankStatements",
|
|
7947
|
+
document_group: "bank_statements",
|
|
7948
|
+
document_group_label: "Bank Statements",
|
|
7949
|
+
wire_format: "path_array",
|
|
7950
|
+
document_slot: 3,
|
|
7951
|
+
time_period_unit: "month"
|
|
7934
7952
|
},
|
|
7935
7953
|
{
|
|
7936
7954
|
name: "bank_statement_t4",
|
|
@@ -7946,7 +7964,13 @@ var form_field_base_specs_default = {
|
|
|
7946
7964
|
"openingBalanceT4",
|
|
7947
7965
|
"bankBalanceT4"
|
|
7948
7966
|
],
|
|
7949
|
-
category: "13"
|
|
7967
|
+
category: "13",
|
|
7968
|
+
document_type: "bankStatements",
|
|
7969
|
+
document_group: "bank_statements",
|
|
7970
|
+
document_group_label: "Bank Statements",
|
|
7971
|
+
wire_format: "path_array",
|
|
7972
|
+
document_slot: 4,
|
|
7973
|
+
time_period_unit: "month"
|
|
7950
7974
|
},
|
|
7951
7975
|
{
|
|
7952
7976
|
name: "bank_statement_t5",
|
|
@@ -7962,7 +7986,13 @@ var form_field_base_specs_default = {
|
|
|
7962
7986
|
"openingBalanceT5",
|
|
7963
7987
|
"bankBalanceT5"
|
|
7964
7988
|
],
|
|
7965
|
-
category: "13"
|
|
7989
|
+
category: "13",
|
|
7990
|
+
document_type: "bankStatements",
|
|
7991
|
+
document_group: "bank_statements",
|
|
7992
|
+
document_group_label: "Bank Statements",
|
|
7993
|
+
wire_format: "path_array",
|
|
7994
|
+
document_slot: 5,
|
|
7995
|
+
time_period_unit: "month"
|
|
7966
7996
|
},
|
|
7967
7997
|
{
|
|
7968
7998
|
name: "bank_statement_t6",
|
|
@@ -7978,7 +8008,13 @@ var form_field_base_specs_default = {
|
|
|
7978
8008
|
"openingBalanceT6",
|
|
7979
8009
|
"bankBalanceT6"
|
|
7980
8010
|
],
|
|
7981
|
-
category: "13"
|
|
8011
|
+
category: "13",
|
|
8012
|
+
document_type: "bankStatements",
|
|
8013
|
+
document_group: "bank_statements",
|
|
8014
|
+
document_group_label: "Bank Statements",
|
|
8015
|
+
wire_format: "path_array",
|
|
8016
|
+
document_slot: 6,
|
|
8017
|
+
time_period_unit: "month"
|
|
7982
8018
|
},
|
|
7983
8019
|
{
|
|
7984
8020
|
name: "financials",
|
|
@@ -7999,7 +8035,13 @@ var form_field_base_specs_default = {
|
|
|
7999
8035
|
"netOperatingCashFlow",
|
|
8000
8036
|
"ebitda"
|
|
8001
8037
|
],
|
|
8002
|
-
category: "13"
|
|
8038
|
+
category: "13",
|
|
8039
|
+
document_type: "financialStatements",
|
|
8040
|
+
document_group: "financials",
|
|
8041
|
+
document_group_label: "Audited Financial Statements",
|
|
8042
|
+
wire_format: "path_array",
|
|
8043
|
+
document_slot: 1,
|
|
8044
|
+
time_period_unit: "year"
|
|
8003
8045
|
},
|
|
8004
8046
|
{
|
|
8005
8047
|
name: "financials_fincap_t1",
|
|
@@ -8243,7 +8285,13 @@ var form_field_base_specs_default = {
|
|
|
8243
8285
|
"depreciationOfInvestmentSecuritiesT2",
|
|
8244
8286
|
"endOfYearCashT2"
|
|
8245
8287
|
],
|
|
8246
|
-
category: "13"
|
|
8288
|
+
category: "13",
|
|
8289
|
+
document_type: "financialStatements",
|
|
8290
|
+
document_group: "financials",
|
|
8291
|
+
document_group_label: "Audited Financial Statements",
|
|
8292
|
+
wire_format: "path_array",
|
|
8293
|
+
document_slot: 1,
|
|
8294
|
+
time_period_unit: "year"
|
|
8247
8295
|
},
|
|
8248
8296
|
{
|
|
8249
8297
|
name: "financials_fincap_t2",
|
|
@@ -8369,7 +8417,13 @@ var form_field_base_specs_default = {
|
|
|
8369
8417
|
"depreciationOfInvestmentSecuritiesT3",
|
|
8370
8418
|
"endOfYearCashT3"
|
|
8371
8419
|
],
|
|
8372
|
-
category: "13"
|
|
8420
|
+
category: "13",
|
|
8421
|
+
document_type: "financialStatements",
|
|
8422
|
+
document_group: "financials",
|
|
8423
|
+
document_group_label: "Audited Financial Statements",
|
|
8424
|
+
wire_format: "path_array",
|
|
8425
|
+
document_slot: 2,
|
|
8426
|
+
time_period_unit: "year"
|
|
8373
8427
|
},
|
|
8374
8428
|
{
|
|
8375
8429
|
name: "form9",
|
|
@@ -8380,7 +8434,11 @@ var form_field_base_specs_default = {
|
|
|
8380
8434
|
"companyName",
|
|
8381
8435
|
"companyRegNo"
|
|
8382
8436
|
],
|
|
8383
|
-
category: "13"
|
|
8437
|
+
category: "13",
|
|
8438
|
+
document_type: "form9",
|
|
8439
|
+
document_group: "form9",
|
|
8440
|
+
document_group_label: "Form 9 / Section 17 / Form D",
|
|
8441
|
+
wire_format: "url_string"
|
|
8384
8442
|
},
|
|
8385
8443
|
{
|
|
8386
8444
|
name: "ssm",
|
|
@@ -8404,7 +8462,11 @@ var form_field_base_specs_default = {
|
|
|
8404
8462
|
"businessOrigin",
|
|
8405
8463
|
"registeredAddress"
|
|
8406
8464
|
],
|
|
8407
|
-
category: "13"
|
|
8465
|
+
category: "13",
|
|
8466
|
+
document_type: "ssm",
|
|
8467
|
+
document_group: "ssm_documents",
|
|
8468
|
+
document_group_label: "SSM Company Information",
|
|
8469
|
+
wire_format: "url_string"
|
|
8408
8470
|
},
|
|
8409
8471
|
{
|
|
8410
8472
|
name: "ic",
|
|
@@ -8421,7 +8483,11 @@ var form_field_base_specs_default = {
|
|
|
8421
8483
|
"icNationality",
|
|
8422
8484
|
"icRace"
|
|
8423
8485
|
],
|
|
8424
|
-
category: "13"
|
|
8486
|
+
category: "13",
|
|
8487
|
+
document_type: "ic",
|
|
8488
|
+
document_group: "ic_documents",
|
|
8489
|
+
document_group_label: "Identification Card",
|
|
8490
|
+
wire_format: "url_string"
|
|
8425
8491
|
},
|
|
8426
8492
|
{
|
|
8427
8493
|
name: "epf_statement_t1",
|
|
@@ -8438,7 +8504,13 @@ var form_field_base_specs_default = {
|
|
|
8438
8504
|
"epfTotalContributionT1",
|
|
8439
8505
|
"epfTotalCurrentContributionT1"
|
|
8440
8506
|
],
|
|
8441
|
-
category: "13"
|
|
8507
|
+
category: "13",
|
|
8508
|
+
document_type: "epfStatements",
|
|
8509
|
+
document_group: "epf_statements",
|
|
8510
|
+
document_group_label: "EPF Statements",
|
|
8511
|
+
wire_format: "path_array",
|
|
8512
|
+
document_slot: 1,
|
|
8513
|
+
time_period_unit: "year"
|
|
8442
8514
|
},
|
|
8443
8515
|
{
|
|
8444
8516
|
name: "epf_statement_t2",
|
|
@@ -8455,7 +8527,13 @@ var form_field_base_specs_default = {
|
|
|
8455
8527
|
"epfTotalContributionT2",
|
|
8456
8528
|
"epfTotalCurrentContributionT2"
|
|
8457
8529
|
],
|
|
8458
|
-
category: "13"
|
|
8530
|
+
category: "13",
|
|
8531
|
+
document_type: "epfStatements",
|
|
8532
|
+
document_group: "epf_statements",
|
|
8533
|
+
document_group_label: "EPF Statements",
|
|
8534
|
+
wire_format: "path_array",
|
|
8535
|
+
document_slot: 2,
|
|
8536
|
+
time_period_unit: "year"
|
|
8459
8537
|
},
|
|
8460
8538
|
{
|
|
8461
8539
|
name: "payslip_statement_t1",
|
|
@@ -8478,7 +8556,13 @@ var form_field_base_specs_default = {
|
|
|
8478
8556
|
"payslipEmployeeTaxT1",
|
|
8479
8557
|
"payslipOtherDeductionT1"
|
|
8480
8558
|
],
|
|
8481
|
-
category: "13"
|
|
8559
|
+
category: "13",
|
|
8560
|
+
document_type: "payslips",
|
|
8561
|
+
document_group: "payslip_statements",
|
|
8562
|
+
document_group_label: "Payslip Statements",
|
|
8563
|
+
wire_format: "path_array",
|
|
8564
|
+
document_slot: 1,
|
|
8565
|
+
time_period_unit: "month"
|
|
8482
8566
|
},
|
|
8483
8567
|
{
|
|
8484
8568
|
name: "payslip_statement_t2",
|
|
@@ -8501,7 +8585,13 @@ var form_field_base_specs_default = {
|
|
|
8501
8585
|
"payslipEmployeeTaxT2",
|
|
8502
8586
|
"payslipOtherDeductionT2"
|
|
8503
8587
|
],
|
|
8504
|
-
category: "13"
|
|
8588
|
+
category: "13",
|
|
8589
|
+
document_type: "payslips",
|
|
8590
|
+
document_group: "payslip_statements",
|
|
8591
|
+
document_group_label: "Payslip Statements",
|
|
8592
|
+
wire_format: "path_array",
|
|
8593
|
+
document_slot: 2,
|
|
8594
|
+
time_period_unit: "month"
|
|
8505
8595
|
},
|
|
8506
8596
|
{
|
|
8507
8597
|
name: "payslip_statement_t3",
|
|
@@ -8524,7 +8614,13 @@ var form_field_base_specs_default = {
|
|
|
8524
8614
|
"payslipEmployeeTaxT3",
|
|
8525
8615
|
"payslipOtherDeductionT3"
|
|
8526
8616
|
],
|
|
8527
|
-
category: "13"
|
|
8617
|
+
category: "13",
|
|
8618
|
+
document_type: "payslips",
|
|
8619
|
+
document_group: "payslip_statements",
|
|
8620
|
+
document_group_label: "Payslip Statements",
|
|
8621
|
+
wire_format: "path_array",
|
|
8622
|
+
document_slot: 3,
|
|
8623
|
+
time_period_unit: "month"
|
|
8528
8624
|
},
|
|
8529
8625
|
{
|
|
8530
8626
|
name: "payslip_statement_t4",
|
|
@@ -8547,7 +8643,13 @@ var form_field_base_specs_default = {
|
|
|
8547
8643
|
"payslipEmployeeTaxT4",
|
|
8548
8644
|
"payslipOtherDeductionT4"
|
|
8549
8645
|
],
|
|
8550
|
-
category: "13"
|
|
8646
|
+
category: "13",
|
|
8647
|
+
document_type: "payslips",
|
|
8648
|
+
document_group: "payslip_statements",
|
|
8649
|
+
document_group_label: "Payslip Statements",
|
|
8650
|
+
wire_format: "path_array",
|
|
8651
|
+
document_slot: 4,
|
|
8652
|
+
time_period_unit: "month"
|
|
8551
8653
|
},
|
|
8552
8654
|
{
|
|
8553
8655
|
name: "payslip_statement_t5",
|
|
@@ -8570,7 +8672,13 @@ var form_field_base_specs_default = {
|
|
|
8570
8672
|
"payslipEmployeeTaxT5",
|
|
8571
8673
|
"payslipOtherDeductionT5"
|
|
8572
8674
|
],
|
|
8573
|
-
category: "13"
|
|
8675
|
+
category: "13",
|
|
8676
|
+
document_type: "payslips",
|
|
8677
|
+
document_group: "payslip_statements",
|
|
8678
|
+
document_group_label: "Payslip Statements",
|
|
8679
|
+
wire_format: "path_array",
|
|
8680
|
+
document_slot: 5,
|
|
8681
|
+
time_period_unit: "month"
|
|
8574
8682
|
},
|
|
8575
8683
|
{
|
|
8576
8684
|
name: "payslip_statement_t6",
|
|
@@ -8593,7 +8701,13 @@ var form_field_base_specs_default = {
|
|
|
8593
8701
|
"payslipEmployeeTaxT6",
|
|
8594
8702
|
"payslipOtherDeductionT6"
|
|
8595
8703
|
],
|
|
8596
|
-
category: "13"
|
|
8704
|
+
category: "13",
|
|
8705
|
+
document_type: "payslips",
|
|
8706
|
+
document_group: "payslip_statements",
|
|
8707
|
+
document_group_label: "Payslip Statements",
|
|
8708
|
+
wire_format: "path_array",
|
|
8709
|
+
document_slot: 6,
|
|
8710
|
+
time_period_unit: "month"
|
|
8597
8711
|
}
|
|
8598
8712
|
]
|
|
8599
8713
|
};
|
|
@@ -9087,6 +9201,55 @@ var FileFieldTableType = /* @__PURE__ */ ((FileFieldTableType2) => {
|
|
|
9087
9201
|
return FileFieldTableType2;
|
|
9088
9202
|
})(FileFieldTableType || {});
|
|
9089
9203
|
|
|
9204
|
+
// src/document-types.ts
|
|
9205
|
+
var cached = null;
|
|
9206
|
+
function buildDocumentTypeGroups() {
|
|
9207
|
+
const fileFields = getBaseFieldSpecs().filter(
|
|
9208
|
+
(f) => f.type === "file" && !!f.name
|
|
9209
|
+
);
|
|
9210
|
+
const order = [];
|
|
9211
|
+
const byDocumentType = /* @__PURE__ */ new Map();
|
|
9212
|
+
for (const f of fileFields) {
|
|
9213
|
+
const documentType = f.document_type ?? f.name;
|
|
9214
|
+
const documentGroup = f.document_group ?? documentType;
|
|
9215
|
+
const label = f.document_group_label ?? f.displayName ?? documentType;
|
|
9216
|
+
if (!byDocumentType.has(documentType)) {
|
|
9217
|
+
order.push(documentType);
|
|
9218
|
+
byDocumentType.set(documentType, {
|
|
9219
|
+
documentGroup,
|
|
9220
|
+
label,
|
|
9221
|
+
wireFormat: f.wire_format,
|
|
9222
|
+
fields: []
|
|
9223
|
+
});
|
|
9224
|
+
}
|
|
9225
|
+
byDocumentType.get(documentType).fields.push(f);
|
|
9226
|
+
}
|
|
9227
|
+
return order.map((documentType) => {
|
|
9228
|
+
const entry = byDocumentType.get(documentType);
|
|
9229
|
+
return {
|
|
9230
|
+
documentType,
|
|
9231
|
+
documentGroup: entry.documentGroup,
|
|
9232
|
+
label: entry.label,
|
|
9233
|
+
wireFormat: entry.wireFormat,
|
|
9234
|
+
fields: entry.fields
|
|
9235
|
+
};
|
|
9236
|
+
});
|
|
9237
|
+
}
|
|
9238
|
+
function getDocumentTypeGroups() {
|
|
9239
|
+
if (!cached) cached = buildDocumentTypeGroups();
|
|
9240
|
+
return cached;
|
|
9241
|
+
}
|
|
9242
|
+
function isDocumentType(id) {
|
|
9243
|
+
return getDocumentTypeGroups().some((g) => g.documentType === id);
|
|
9244
|
+
}
|
|
9245
|
+
function assertDocumentType(id) {
|
|
9246
|
+
if (!isDocumentType(id)) {
|
|
9247
|
+
const known = getDocumentTypeGroups().map((g) => g.documentType);
|
|
9248
|
+
throw new Error(`Unknown document type: "${id}". Available: ${known.join(", ")}`);
|
|
9249
|
+
}
|
|
9250
|
+
return id;
|
|
9251
|
+
}
|
|
9252
|
+
|
|
9090
9253
|
// src/data/form-field-display-names.json
|
|
9091
9254
|
var form_field_display_names_default = {
|
|
9092
9255
|
accountHolderName: "Account Holder Name",
|
|
@@ -9295,42 +9458,26 @@ function groupColumnsByTimePeriod(columnNames) {
|
|
|
9295
9458
|
}
|
|
9296
9459
|
return groups;
|
|
9297
9460
|
}
|
|
9298
|
-
var FIELD_GROUP_PREFIXES = [
|
|
9299
|
-
["bank_statement", "bank_statements"],
|
|
9300
|
-
["financials", "financials"],
|
|
9301
|
-
["epf_statement", "epf_statements"],
|
|
9302
|
-
["payslip_statement", "payslip_statements"],
|
|
9303
|
-
["ssm", "ssm_documents"],
|
|
9304
|
-
["form9", "form9"],
|
|
9305
|
-
["ic", "ic_documents"]
|
|
9306
|
-
];
|
|
9307
9461
|
function groupFieldsByPattern(fields) {
|
|
9308
9462
|
const groups = {};
|
|
9309
9463
|
for (const field of fields) {
|
|
9310
9464
|
if (!field.name) continue;
|
|
9311
|
-
|
|
9312
|
-
for (const [prefix, group] of FIELD_GROUP_PREFIXES) {
|
|
9313
|
-
if (field.name.startsWith(prefix)) {
|
|
9314
|
-
groupName = group;
|
|
9315
|
-
break;
|
|
9316
|
-
}
|
|
9317
|
-
}
|
|
9465
|
+
const groupName = field.document_group ?? field.name;
|
|
9318
9466
|
if (!groups[groupName]) groups[groupName] = [];
|
|
9319
9467
|
groups[groupName].push(field);
|
|
9320
9468
|
}
|
|
9321
9469
|
return groups;
|
|
9322
9470
|
}
|
|
9323
|
-
var
|
|
9324
|
-
bank_statements: "Bank Statements",
|
|
9325
|
-
financials: "Audited Financial Statements",
|
|
9326
|
-
epf_statements: "EPF Statements",
|
|
9327
|
-
payslip_statements: "Payslip Statements",
|
|
9328
|
-
form9: "Form 9 / Section 17 / Form D",
|
|
9329
|
-
ssm_documents: "SSM Company Information",
|
|
9330
|
-
ic_documents: "Identification Card"
|
|
9331
|
-
};
|
|
9471
|
+
var cachedGroupDisplayNames = null;
|
|
9332
9472
|
function getGroupDisplayNames() {
|
|
9333
|
-
|
|
9473
|
+
if (!cachedGroupDisplayNames) {
|
|
9474
|
+
const names = {};
|
|
9475
|
+
for (const group of getDocumentTypeGroups()) {
|
|
9476
|
+
names[group.documentGroup] = group.label;
|
|
9477
|
+
}
|
|
9478
|
+
cachedGroupDisplayNames = names;
|
|
9479
|
+
}
|
|
9480
|
+
return cachedGroupDisplayNames;
|
|
9334
9481
|
}
|
|
9335
9482
|
function isNumericField(fieldName) {
|
|
9336
9483
|
const patterns = [
|
|
@@ -9375,7 +9522,7 @@ function buildTableForGroup(groupName, fields, ihsData, fieldProvenance) {
|
|
|
9375
9522
|
const periods = extractTimePeriods(allColumns);
|
|
9376
9523
|
const isTimeSeries = periods.length > 0;
|
|
9377
9524
|
const tableType = isTimeSeries ? "timeSeries" /* TIME_SERIES */ : "keyValue" /* KEY_VALUE */;
|
|
9378
|
-
const groupDisplayName =
|
|
9525
|
+
const groupDisplayName = getGroupDisplayNames()[groupName] || fields[0]?.displayName || getDisplayName(groupName);
|
|
9379
9526
|
if (isTimeSeries) {
|
|
9380
9527
|
const columnGroups = groupColumnsByTimePeriod(allColumns);
|
|
9381
9528
|
const items = [];
|
|
@@ -9696,16 +9843,6 @@ var ExtractionJobStatus = /* @__PURE__ */ ((ExtractionJobStatus2) => {
|
|
|
9696
9843
|
ExtractionJobStatus2["Failed"] = "failed";
|
|
9697
9844
|
return ExtractionJobStatus2;
|
|
9698
9845
|
})(ExtractionJobStatus || {});
|
|
9699
|
-
var ExtractionFileType = /* @__PURE__ */ ((ExtractionFileType2) => {
|
|
9700
|
-
ExtractionFileType2["FinancialStatement"] = "financialStatements";
|
|
9701
|
-
ExtractionFileType2["BankStatement"] = "bankStatements";
|
|
9702
|
-
ExtractionFileType2["Epf"] = "epfStatements";
|
|
9703
|
-
ExtractionFileType2["Payslip"] = "payslips";
|
|
9704
|
-
ExtractionFileType2["Ssm"] = "ssm";
|
|
9705
|
-
ExtractionFileType2["Form9"] = "form9";
|
|
9706
|
-
ExtractionFileType2["Ic"] = "ic";
|
|
9707
|
-
return ExtractionFileType2;
|
|
9708
|
-
})(ExtractionFileType || {});
|
|
9709
9846
|
|
|
9710
9847
|
// src/ihs-status.ts
|
|
9711
9848
|
var IhsStatus = /* @__PURE__ */ ((IhsStatus2) => {
|
|
@@ -9765,19 +9902,6 @@ var DocExtractionStatus = /* @__PURE__ */ ((DocExtractionStatus2) => {
|
|
|
9765
9902
|
DocExtractionStatus2["Unknown"] = "unknown";
|
|
9766
9903
|
return DocExtractionStatus2;
|
|
9767
9904
|
})(DocExtractionStatus || {});
|
|
9768
|
-
var FILE_TYPE_TO_GROUP = {
|
|
9769
|
-
["bankStatements" /* BankStatement */]: "bank_statements",
|
|
9770
|
-
["financialStatements" /* FinancialStatement */]: "financials",
|
|
9771
|
-
["epfStatements" /* Epf */]: "epf_statements",
|
|
9772
|
-
["payslips" /* Payslip */]: "payslip_statements",
|
|
9773
|
-
["ssm" /* Ssm */]: "ssm_documents",
|
|
9774
|
-
["form9" /* Form9 */]: "form9",
|
|
9775
|
-
["ic" /* Ic */]: "ic_documents"
|
|
9776
|
-
};
|
|
9777
|
-
var _specs = getBaseFieldSpecs();
|
|
9778
|
-
var _fileFields = _specs.filter((f) => f.type === "file" && f.ihs_column_names?.length);
|
|
9779
|
-
var _grouped = groupFieldsByPattern(_fileFields);
|
|
9780
|
-
var _groupDisplayNames = getGroupDisplayNames();
|
|
9781
9905
|
function isPopulated(value) {
|
|
9782
9906
|
if (value === null || value === void 0 || value === "") return false;
|
|
9783
9907
|
if (value === "Not Specified") return false;
|
|
@@ -9841,10 +9965,10 @@ function resolveDocStatus(columns, ihsRecord, uploaded, jobRecord, hasJobRecords
|
|
|
9841
9965
|
function resolveExtractionStatus(ihsRecord, jobRecords) {
|
|
9842
9966
|
const documents = [];
|
|
9843
9967
|
const hasJobRecords = jobRecords !== void 0;
|
|
9844
|
-
for (const
|
|
9845
|
-
const
|
|
9846
|
-
const fields =
|
|
9847
|
-
const displayName =
|
|
9968
|
+
for (const group of getDocumentTypeGroups()) {
|
|
9969
|
+
const fileType = group.documentType;
|
|
9970
|
+
const fields = group.fields;
|
|
9971
|
+
const displayName = group.label;
|
|
9848
9972
|
const uploadedCount = countUploadedFiles(ihsRecord, fileType);
|
|
9849
9973
|
const isUploaded = uploadedCount > 0 || fields.some((f) => f.name && isPopulated(ihsRecord[f.name]));
|
|
9850
9974
|
const matchingJobs = jobRecords?.filter((j) => j.fileType === fileType) ?? [];
|
|
@@ -10493,7 +10617,6 @@ export {
|
|
|
10493
10617
|
BasicFormField,
|
|
10494
10618
|
DEFAULT_VALIDATOR_DEFINITIONS,
|
|
10495
10619
|
DocExtractionStatus,
|
|
10496
|
-
ExtractionFileType,
|
|
10497
10620
|
ExtractionJobStatus,
|
|
10498
10621
|
FIELD_TYPE_DEFINITIONS,
|
|
10499
10622
|
FieldType,
|
|
@@ -10513,6 +10636,7 @@ export {
|
|
|
10513
10636
|
applyAggregation,
|
|
10514
10637
|
applyDynamicTitles,
|
|
10515
10638
|
assertAdapterCategory,
|
|
10639
|
+
assertDocumentType,
|
|
10516
10640
|
buildDocumentRows,
|
|
10517
10641
|
buildFileFieldTables,
|
|
10518
10642
|
categoryFieldsOf,
|
|
@@ -10533,6 +10657,7 @@ export {
|
|
|
10533
10657
|
getDisplayName,
|
|
10534
10658
|
getDisplayNames,
|
|
10535
10659
|
getDocDisplayNames,
|
|
10660
|
+
getDocumentTypeGroups,
|
|
10536
10661
|
getExtractableDocTypes,
|
|
10537
10662
|
getGroupDisplayNames,
|
|
10538
10663
|
getPastMonthLabel,
|
|
@@ -10545,6 +10670,7 @@ export {
|
|
|
10545
10670
|
groupFieldsByCategory,
|
|
10546
10671
|
groupFieldsByPattern,
|
|
10547
10672
|
isAdapterCategory,
|
|
10673
|
+
isDocumentType,
|
|
10548
10674
|
isFailureIhsStatus,
|
|
10549
10675
|
isTerminalIhsStatus,
|
|
10550
10676
|
isValidIhsStatus,
|