@ripwords/myinvois-client 0.3.0 → 0.3.1
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/api/documentManagement.d.ts +2 -2
- package/dist/api/documentSubmission.d.ts +2 -2
- package/dist/api/documentSubmission.js +2 -2
- package/dist/api/documentTypeManagement.d.ts +2 -2
- package/dist/api/notificationManagement.d.ts +2 -2
- package/dist/api/platformLogin.d.ts +2 -2
- package/dist/api/taxpayerValidation.d.ts +2 -2
- package/dist/{document-DLFdGSK1.js → document-D4O7JY0G.js} +9 -3
- package/dist/{document-CCza2JPL.cjs → document-DoQEvmcK.cjs} +10 -4
- package/dist/document-DoQEvmcK.cjs.map +1 -0
- package/dist/{documentSubmission-M4UlirJ7.cjs → documentSubmission-DUsjqWhR.cjs} +2 -2
- package/dist/{documentSubmission-M4UlirJ7.cjs.map → documentSubmission-DUsjqWhR.cjs.map} +1 -1
- package/dist/{documentSubmission-ZAgXsd3X.js → documentSubmission-uJ7yPWub.js} +1 -1
- package/dist/{documents-DCZ3Ffya.d.cts → documents-BECak3KN.d.cts} +7 -1
- package/dist/{documents-DzZA3NHj.d.ts → documents-Dp19RgNX.d.ts} +6 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index18.cjs +2 -2
- package/dist/index33.cjs +4 -17
- package/dist/index34.cjs +9 -34
- package/dist/index34.cjs.map +1 -1
- package/dist/index35.cjs +4 -18
- package/dist/index36.cjs +21 -28
- package/dist/index37.cjs +2 -19
- package/dist/index38.cjs +2 -13
- package/dist/index39.cjs +324 -8
- package/dist/index39.cjs.map +1 -1
- package/dist/index40.cjs +187 -11
- package/dist/index40.cjs.map +1 -1
- package/dist/index41.cjs +11 -6
- package/dist/index41.cjs.map +1 -1
- package/dist/index42.cjs +31 -101
- package/dist/index42.cjs.map +1 -1
- package/dist/index43.cjs +12 -106
- package/dist/index43.cjs.map +1 -1
- package/dist/index44.cjs +22 -119
- package/dist/index44.cjs.map +1 -1
- package/dist/index45.cjs +13 -106
- package/dist/index45.cjs.map +1 -1
- package/dist/index46.cjs +7 -98
- package/dist/index46.cjs.map +1 -1
- package/dist/index47.cjs +7 -118
- package/dist/index47.cjs.map +1 -1
- package/dist/index48.cjs +10 -127
- package/dist/index48.cjs.map +1 -1
- package/dist/index49.cjs +6 -117
- package/dist/index49.cjs.map +1 -1
- package/dist/index50.cjs +101 -14
- package/dist/index50.cjs.map +1 -1
- package/dist/index51.cjs +106 -95
- package/dist/index51.cjs.map +1 -1
- package/dist/index52.cjs +119 -142
- package/dist/index52.cjs.map +1 -1
- package/dist/index53.cjs +106 -114
- package/dist/index53.cjs.map +1 -1
- package/dist/index54.cjs +98 -144
- package/dist/index54.cjs.map +1 -1
- package/dist/index55.cjs +118 -113
- package/dist/index55.cjs.map +1 -1
- package/dist/index56.cjs +127 -17
- package/dist/index56.cjs.map +1 -1
- package/dist/index57.cjs +117 -112
- package/dist/index57.cjs.map +1 -1
- package/dist/index58.cjs +14 -47
- package/dist/index58.cjs.map +1 -1
- package/dist/index59.cjs +95 -14
- package/dist/index59.cjs.map +1 -1
- package/dist/index60.cjs +142 -28
- package/dist/index60.cjs.map +1 -1
- package/dist/index61.cjs +114 -22
- package/dist/index61.cjs.map +1 -1
- package/dist/index62.cjs +144 -9
- package/dist/index62.cjs.map +1 -1
- package/dist/index63.cjs +113 -8
- package/dist/index63.cjs.map +1 -1
- package/dist/index64.cjs +17 -17
- package/dist/index64.cjs.map +1 -1
- package/dist/index65.cjs +112 -412
- package/dist/index65.cjs.map +1 -1
- package/dist/index66.cjs +47 -8
- package/dist/index66.cjs.map +1 -1
- package/dist/index67.cjs +14 -9
- package/dist/index67.cjs.map +1 -1
- package/dist/index68.cjs +34 -4
- package/dist/index68.cjs.map +1 -0
- package/dist/index69.cjs +25 -9
- package/dist/index69.cjs.map +1 -1
- package/dist/index70.cjs +15 -4
- package/dist/index70.cjs.map +1 -0
- package/dist/index71.cjs +14 -21
- package/dist/index71.cjs.map +1 -0
- package/dist/index71.cts.map +1 -1
- package/dist/index72.cjs +23 -2
- package/dist/index72.cjs.map +1 -0
- package/dist/index73.cjs +418 -2
- package/dist/index73.cjs.map +1 -0
- package/dist/index74.cjs +9 -324
- package/dist/index74.cjs.map +1 -1
- package/dist/index75.cjs +10 -187
- package/dist/index75.cjs.map +1 -1
- package/dist/{taxpayer-DmHW0m7o.d.ts → taxpayer-BdvCGHHC.d.ts} +1 -1
- package/dist/{taxpayer-Pm90MrPj.d.cts → taxpayer-CaDfslWB.d.cts} +2 -2
- package/dist/types/documents.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/taxpayer.d.ts +2 -2
- package/dist/utils/document.d.ts +4 -3
- package/dist/utils/document.js +1 -1
- package/dist/utils/signature-diagnostics.d.ts +2 -2
- package/dist/utils/signature-diagnostics.js +1 -1
- package/dist/utils/validation.d.ts +2 -2
- package/package.json +1 -1
- package/dist/document-CCza2JPL.cjs.map +0 -1
- package/dist/index33.cjs.map +0 -1
- package/dist/index35.cjs.map +0 -1
- package/dist/index36.cjs.map +0 -1
- package/dist/index37.cjs.map +0 -1
- package/dist/index38.cjs.map +0 -1
package/dist/index40.cjs
CHANGED
|
@@ -1,17 +1,193 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/utils/validation.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Validates TIN format based on registration type
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const validateTIN = (tin, registrationType) => {
|
|
7
|
+
const errors = [];
|
|
8
|
+
if (!tin) {
|
|
9
|
+
errors.push({
|
|
10
|
+
field: "tin",
|
|
11
|
+
code: "TIN_REQUIRED",
|
|
12
|
+
message: "TIN is required",
|
|
13
|
+
severity: "error"
|
|
14
|
+
});
|
|
15
|
+
return errors;
|
|
16
|
+
}
|
|
17
|
+
if (registrationType === "BRN" && !tin.startsWith("C")) errors.push({
|
|
18
|
+
field: "tin",
|
|
19
|
+
code: "TIN_FORMAT_INVALID",
|
|
20
|
+
message: "Company TIN should start with \"C\" for BRN registration",
|
|
21
|
+
severity: "warning"
|
|
22
|
+
});
|
|
23
|
+
if (registrationType === "NRIC" && !tin.startsWith("IG")) errors.push({
|
|
24
|
+
field: "tin",
|
|
25
|
+
code: "TIN_FORMAT_INVALID",
|
|
26
|
+
message: "Individual TIN should start with \"IG\" for NRIC registration",
|
|
27
|
+
severity: "warning"
|
|
28
|
+
});
|
|
29
|
+
if (tin.length > 14) errors.push({
|
|
30
|
+
field: "tin",
|
|
31
|
+
code: "TIN_LENGTH_INVALID",
|
|
32
|
+
message: "TIN cannot exceed 14 characters",
|
|
33
|
+
severity: "error"
|
|
34
|
+
});
|
|
35
|
+
return errors;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Validates contact number format (E.164 standard)
|
|
39
|
+
*/
|
|
40
|
+
const validateContactNumber = (contactNumber) => {
|
|
41
|
+
const errors = [];
|
|
42
|
+
if (!contactNumber || contactNumber === "NA") return errors;
|
|
43
|
+
const e164Regex = /^\+[1-9]\d{1,14}$/;
|
|
44
|
+
if (!e164Regex.test(contactNumber)) errors.push({
|
|
45
|
+
field: "contactNumber",
|
|
46
|
+
code: "CONTACT_FORMAT_INVALID",
|
|
47
|
+
message: "Contact number must be in E.164 format (e.g., +60123456789)",
|
|
48
|
+
severity: "error"
|
|
49
|
+
});
|
|
50
|
+
if (contactNumber.length < 8) errors.push({
|
|
51
|
+
field: "contactNumber",
|
|
52
|
+
code: "CONTACT_LENGTH_INVALID",
|
|
53
|
+
message: "Contact number must be at least 8 characters",
|
|
54
|
+
severity: "error"
|
|
55
|
+
});
|
|
56
|
+
return errors;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Validates monetary amounts
|
|
60
|
+
*/
|
|
61
|
+
const validateMonetaryAmount = (amount, fieldName, maxDigits = 18, maxDecimals = 2) => {
|
|
62
|
+
const errors = [];
|
|
63
|
+
if (amount < 0) errors.push({
|
|
64
|
+
field: fieldName,
|
|
65
|
+
code: "AMOUNT_NEGATIVE",
|
|
66
|
+
message: `${fieldName} cannot be negative`,
|
|
67
|
+
severity: "error"
|
|
68
|
+
});
|
|
69
|
+
const amountStr = amount.toString();
|
|
70
|
+
const [integerPart, decimalPart] = amountStr.split(".");
|
|
71
|
+
if (integerPart && integerPart.length > maxDigits - maxDecimals) errors.push({
|
|
72
|
+
field: fieldName,
|
|
73
|
+
code: "AMOUNT_DIGITS_EXCEEDED",
|
|
74
|
+
message: `${fieldName} exceeds maximum ${maxDigits} digits`,
|
|
75
|
+
severity: "error"
|
|
76
|
+
});
|
|
77
|
+
if (decimalPart && decimalPart.length > maxDecimals) errors.push({
|
|
78
|
+
field: fieldName,
|
|
79
|
+
code: "AMOUNT_DECIMALS_EXCEEDED",
|
|
80
|
+
message: `${fieldName} exceeds maximum ${maxDecimals} decimal places`,
|
|
81
|
+
severity: "error"
|
|
82
|
+
});
|
|
83
|
+
return errors;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Validates line item tax calculation consistency for both fixed rate and percentage taxation
|
|
87
|
+
*/
|
|
88
|
+
const validateLineItemTax = (item, index) => {
|
|
89
|
+
const errors = [];
|
|
90
|
+
const tolerance = .01;
|
|
91
|
+
const hasFixedRate = item.taxPerUnitAmount !== void 0 && item.baseUnitMeasure !== void 0;
|
|
92
|
+
const hasPercentageRate = item.taxRate !== void 0;
|
|
93
|
+
if (!hasFixedRate && !hasPercentageRate) {
|
|
94
|
+
errors.push({
|
|
95
|
+
field: `lineItem[${index}]`,
|
|
96
|
+
code: "TAX_METHOD_MISSING",
|
|
97
|
+
message: `Line item ${index + 1} must specify either taxRate (for percentage) or taxPerUnitAmount + baseUnitMeasure (for fixed rate)`,
|
|
98
|
+
severity: "error"
|
|
99
|
+
});
|
|
100
|
+
return errors;
|
|
101
|
+
}
|
|
102
|
+
if (hasFixedRate && hasPercentageRate) errors.push({
|
|
103
|
+
field: `lineItem[${index}]`,
|
|
104
|
+
code: "TAX_METHOD_CONFLICT",
|
|
105
|
+
message: `Line item ${index + 1} cannot have both percentage and fixed rate tax methods`,
|
|
106
|
+
severity: "error"
|
|
107
|
+
});
|
|
108
|
+
if (hasFixedRate) {
|
|
109
|
+
if (item.baseUnitMeasureCode === void 0) errors.push({
|
|
110
|
+
field: `lineItem[${index}].baseUnitMeasureCode`,
|
|
111
|
+
code: "UNIT_CODE_MISSING",
|
|
112
|
+
message: `Line item ${index + 1} with fixed rate tax must specify baseUnitMeasureCode`,
|
|
113
|
+
severity: "error"
|
|
114
|
+
});
|
|
115
|
+
const expectedTaxAmount = item.taxPerUnitAmount * item.baseUnitMeasure;
|
|
116
|
+
if (Math.abs(item.taxAmount - expectedTaxAmount) > tolerance) errors.push({
|
|
117
|
+
field: `lineItem[${index}].taxAmount`,
|
|
118
|
+
code: "FIXED_TAX_CALCULATION_MISMATCH",
|
|
119
|
+
message: `Line item ${index + 1} tax amount (${item.taxAmount}) doesn't match fixed rate calculation (${item.taxPerUnitAmount} × ${item.baseUnitMeasure} = ${expectedTaxAmount})`,
|
|
120
|
+
severity: "error"
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (hasPercentageRate && !hasFixedRate) {
|
|
124
|
+
const expectedTaxAmount = item.totalTaxableAmountPerLine * item.taxRate / 100;
|
|
125
|
+
if (Math.abs(item.taxAmount - expectedTaxAmount) > tolerance) errors.push({
|
|
126
|
+
field: `lineItem[${index}].taxAmount`,
|
|
127
|
+
code: "PERCENTAGE_TAX_CALCULATION_MISMATCH",
|
|
128
|
+
message: `Line item ${index + 1} tax amount (${item.taxAmount}) doesn't match percentage calculation (${item.totalTaxableAmountPerLine} × ${item.taxRate}% = ${expectedTaxAmount})`,
|
|
129
|
+
severity: "error"
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return errors;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Validates tax calculation consistency
|
|
136
|
+
*/
|
|
137
|
+
const validateTaxCalculations = (invoice) => {
|
|
138
|
+
const errors = [];
|
|
139
|
+
invoice.invoiceLineItems.forEach((item, index) => {
|
|
140
|
+
errors.push(...validateLineItemTax(item, index));
|
|
141
|
+
});
|
|
142
|
+
const expectedTaxExclusive = invoice.invoiceLineItems.reduce((sum, item) => sum + item.totalTaxableAmountPerLine, 0);
|
|
143
|
+
const expectedTaxAmount = invoice.invoiceLineItems.reduce((sum, item) => sum + item.taxAmount, 0);
|
|
144
|
+
const tolerance = .01;
|
|
145
|
+
if (Math.abs(invoice.legalMonetaryTotal.taxExclusiveAmount - expectedTaxExclusive) > tolerance) errors.push({
|
|
146
|
+
field: "legalMonetaryTotal.taxExclusiveAmount",
|
|
147
|
+
code: "TAX_EXCLUSIVE_MISMATCH",
|
|
148
|
+
message: `Tax exclusive amount (${invoice.legalMonetaryTotal.taxExclusiveAmount}) doesn't match sum of line items (${expectedTaxExclusive})`,
|
|
149
|
+
severity: "error"
|
|
150
|
+
});
|
|
151
|
+
if (Math.abs(invoice.taxTotal.taxAmount - expectedTaxAmount) > tolerance) errors.push({
|
|
152
|
+
field: "taxTotal.taxAmount",
|
|
153
|
+
code: "TAX_AMOUNT_MISMATCH",
|
|
154
|
+
message: `Tax amount (${invoice.taxTotal.taxAmount}) doesn't match sum of line item taxes (${expectedTaxAmount})`,
|
|
155
|
+
severity: "error"
|
|
156
|
+
});
|
|
157
|
+
return errors;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Main validation function for complete invoice
|
|
161
|
+
*/
|
|
162
|
+
const validateInvoice = (invoice) => {
|
|
163
|
+
const allErrors = [];
|
|
164
|
+
allErrors.push(...validateTIN(invoice.supplier.tin, invoice.supplier.registrationType));
|
|
165
|
+
allErrors.push(...validateTIN(invoice.buyer.tin, invoice.buyer.registrationType));
|
|
166
|
+
allErrors.push(...validateContactNumber(invoice.supplier.contactNumber));
|
|
167
|
+
allErrors.push(...validateContactNumber(invoice.buyer.contactNumber));
|
|
168
|
+
allErrors.push(...validateMonetaryAmount(invoice.legalMonetaryTotal.taxExclusiveAmount, "taxExclusiveAmount"));
|
|
169
|
+
allErrors.push(...validateMonetaryAmount(invoice.legalMonetaryTotal.payableAmount, "payableAmount"));
|
|
170
|
+
allErrors.push(...validateMonetaryAmount(invoice.taxTotal.taxAmount, "taxAmount"));
|
|
171
|
+
invoice.invoiceLineItems.forEach((item, index) => {
|
|
172
|
+
allErrors.push(...validateMonetaryAmount(item.unitPrice, `lineItem[${index}].unitPrice`));
|
|
173
|
+
allErrors.push(...validateMonetaryAmount(item.taxAmount, `lineItem[${index}].taxAmount`));
|
|
174
|
+
allErrors.push(...validateMonetaryAmount(item.totalTaxableAmountPerLine, `lineItem[${index}].totalTaxableAmountPerLine`));
|
|
175
|
+
});
|
|
176
|
+
allErrors.push(...validateTaxCalculations(invoice));
|
|
177
|
+
const errors = allErrors.filter((e) => e.severity === "error");
|
|
178
|
+
const warnings = allErrors.filter((e) => e.severity === "warning");
|
|
179
|
+
return {
|
|
180
|
+
isValid: errors.length === 0,
|
|
181
|
+
errors,
|
|
182
|
+
warnings
|
|
183
|
+
};
|
|
184
|
+
};
|
|
14
185
|
|
|
15
186
|
//#endregion
|
|
16
|
-
exports.
|
|
187
|
+
exports.validateContactNumber = validateContactNumber;
|
|
188
|
+
exports.validateInvoice = validateInvoice;
|
|
189
|
+
exports.validateLineItemTax = validateLineItemTax;
|
|
190
|
+
exports.validateMonetaryAmount = validateMonetaryAmount;
|
|
191
|
+
exports.validateTIN = validateTIN;
|
|
192
|
+
exports.validateTaxCalculations = validateTaxCalculations;
|
|
17
193
|
//# sourceMappingURL=index40.cjs.map
|
package/dist/index40.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index40.cjs","names":[],"sources":["../src/types/unit/8X.d.ts"],"sourcesContent":["/**\n * Unit type codes starting with '8'.\n */\nexport type UnitTypeCode_8X = '80' | '81' | '85' | '87' | '89'\n\n/**\n * Enum representing unit type codes starting with '8'.\n */\nexport enum UnitTypeCodeEnum_8X {\n PoundPerSquareInchAbsolute = '80',\n Henry = '81',\n FootPoundForce = '85',\n PoundPerCubicFoot = '87',\n Poise = '89',\n}\n"],"mappings":";;;;;AAQA,IAAY,sEAAL;AACL;AACA;AACA;AACA;AACA;;AACD"}
|
|
1
|
+
{"version":3,"file":"index40.cjs","names":["tin: string","registrationType?: string","errors: ValidationError[]","contactNumber: string","amount: number","fieldName: string","item: InvoiceLineItem","index: number","invoice: InvoiceV1_1","allErrors: ValidationError[]"],"sources":["../src/utils/validation.ts"],"sourcesContent":["import type { InvoiceV1_1, InvoiceLineItem } from '../types'\n\n/**\n * MyInvois Invoice Validation Utilities\n *\n * Provides comprehensive validation for invoice data before document generation\n * and submission to ensure compliance with MyInvois business rules and format requirements.\n */\n\nexport interface ValidationResult {\n isValid: boolean\n errors: ValidationError[]\n warnings: ValidationWarning[]\n}\n\nexport interface ValidationError {\n field: string\n code: string\n message: string\n severity: 'error' | 'warning'\n}\n\nexport interface ValidationWarning extends ValidationError {\n severity: 'warning'\n}\n\n/**\n * Validates TIN format based on registration type\n */\nexport const validateTIN = (\n tin: string,\n registrationType?: string,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n if (!tin) {\n errors.push({\n field: 'tin',\n code: 'TIN_REQUIRED',\n message: 'TIN is required',\n severity: 'error',\n })\n return errors\n }\n\n // TIN format validation based on type\n if (registrationType === 'BRN' && !tin.startsWith('C')) {\n errors.push({\n field: 'tin',\n code: 'TIN_FORMAT_INVALID',\n message: 'Company TIN should start with \"C\" for BRN registration',\n severity: 'warning',\n })\n }\n\n if (registrationType === 'NRIC' && !tin.startsWith('IG')) {\n errors.push({\n field: 'tin',\n code: 'TIN_FORMAT_INVALID',\n message: 'Individual TIN should start with \"IG\" for NRIC registration',\n severity: 'warning',\n })\n }\n\n // Length validation\n if (tin.length > 14) {\n errors.push({\n field: 'tin',\n code: 'TIN_LENGTH_INVALID',\n message: 'TIN cannot exceed 14 characters',\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Validates contact number format (E.164 standard)\n */\nexport const validateContactNumber = (\n contactNumber: string,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n if (!contactNumber || contactNumber === 'NA') {\n return errors // Allow NA for consolidated e-invoices\n }\n\n // E.164 format validation\n const e164Regex = /^\\+[1-9]\\d{1,14}$/\n if (!e164Regex.test(contactNumber)) {\n errors.push({\n field: 'contactNumber',\n code: 'CONTACT_FORMAT_INVALID',\n message: 'Contact number must be in E.164 format (e.g., +60123456789)',\n severity: 'error',\n })\n }\n\n if (contactNumber.length < 8) {\n errors.push({\n field: 'contactNumber',\n code: 'CONTACT_LENGTH_INVALID',\n message: 'Contact number must be at least 8 characters',\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Validates monetary amounts\n */\nexport const validateMonetaryAmount = (\n amount: number,\n fieldName: string,\n maxDigits = 18,\n maxDecimals = 2,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n if (amount < 0) {\n errors.push({\n field: fieldName,\n code: 'AMOUNT_NEGATIVE',\n message: `${fieldName} cannot be negative`,\n severity: 'error',\n })\n }\n\n // Check total digits\n const amountStr = amount.toString()\n const [integerPart, decimalPart] = amountStr.split('.')\n\n if (integerPart && integerPart.length > maxDigits - maxDecimals) {\n errors.push({\n field: fieldName,\n code: 'AMOUNT_DIGITS_EXCEEDED',\n message: `${fieldName} exceeds maximum ${maxDigits} digits`,\n severity: 'error',\n })\n }\n\n if (decimalPart && decimalPart.length > maxDecimals) {\n errors.push({\n field: fieldName,\n code: 'AMOUNT_DECIMALS_EXCEEDED',\n message: `${fieldName} exceeds maximum ${maxDecimals} decimal places`,\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Validates line item tax calculation consistency for both fixed rate and percentage taxation\n */\nexport const validateLineItemTax = (\n item: InvoiceLineItem,\n index: number,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n const tolerance = 0.01\n\n // Check if tax calculation method is specified\n const hasFixedRate =\n item.taxPerUnitAmount !== undefined && item.baseUnitMeasure !== undefined\n const hasPercentageRate = item.taxRate !== undefined\n\n if (!hasFixedRate && !hasPercentageRate) {\n errors.push({\n field: `lineItem[${index}]`,\n code: 'TAX_METHOD_MISSING',\n message: `Line item ${index + 1} must specify either taxRate (for percentage) or taxPerUnitAmount + baseUnitMeasure (for fixed rate)`,\n severity: 'error',\n })\n return errors\n }\n\n if (hasFixedRate && hasPercentageRate) {\n errors.push({\n field: `lineItem[${index}]`,\n code: 'TAX_METHOD_CONFLICT',\n message: `Line item ${index + 1} cannot have both percentage and fixed rate tax methods`,\n severity: 'error',\n })\n }\n\n // Validate fixed rate tax calculation\n if (hasFixedRate) {\n if (item.baseUnitMeasureCode === undefined) {\n errors.push({\n field: `lineItem[${index}].baseUnitMeasureCode`,\n code: 'UNIT_CODE_MISSING',\n message: `Line item ${index + 1} with fixed rate tax must specify baseUnitMeasureCode`,\n severity: 'error',\n })\n }\n\n const expectedTaxAmount = item.taxPerUnitAmount! * item.baseUnitMeasure!\n if (Math.abs(item.taxAmount - expectedTaxAmount) > tolerance) {\n errors.push({\n field: `lineItem[${index}].taxAmount`,\n code: 'FIXED_TAX_CALCULATION_MISMATCH',\n message: `Line item ${index + 1} tax amount (${item.taxAmount}) doesn't match fixed rate calculation (${item.taxPerUnitAmount} × ${item.baseUnitMeasure} = ${expectedTaxAmount})`,\n severity: 'error',\n })\n }\n }\n\n // Validate percentage tax calculation\n if (hasPercentageRate && !hasFixedRate) {\n const expectedTaxAmount =\n (item.totalTaxableAmountPerLine * item.taxRate!) / 100\n if (Math.abs(item.taxAmount - expectedTaxAmount) > tolerance) {\n errors.push({\n field: `lineItem[${index}].taxAmount`,\n code: 'PERCENTAGE_TAX_CALCULATION_MISMATCH',\n message: `Line item ${index + 1} tax amount (${item.taxAmount}) doesn't match percentage calculation (${item.totalTaxableAmountPerLine} × ${item.taxRate}% = ${expectedTaxAmount})`,\n severity: 'error',\n })\n }\n }\n\n return errors\n}\n\n/**\n * Validates tax calculation consistency\n */\nexport const validateTaxCalculations = (\n invoice: InvoiceV1_1,\n): ValidationError[] => {\n const errors: ValidationError[] = []\n\n // Validate individual line item tax calculations\n invoice.invoiceLineItems.forEach((item, index) => {\n errors.push(...validateLineItemTax(item, index))\n })\n\n // Calculate expected totals from line items\n const expectedTaxExclusive = invoice.invoiceLineItems.reduce(\n (sum, item) => sum + item.totalTaxableAmountPerLine,\n 0,\n )\n const expectedTaxAmount = invoice.invoiceLineItems.reduce(\n (sum, item) => sum + item.taxAmount,\n 0,\n )\n\n // Allow small rounding differences (0.01)\n const tolerance = 0.01\n\n if (\n Math.abs(\n invoice.legalMonetaryTotal.taxExclusiveAmount - expectedTaxExclusive,\n ) > tolerance\n ) {\n errors.push({\n field: 'legalMonetaryTotal.taxExclusiveAmount',\n code: 'TAX_EXCLUSIVE_MISMATCH',\n message: `Tax exclusive amount (${invoice.legalMonetaryTotal.taxExclusiveAmount}) doesn't match sum of line items (${expectedTaxExclusive})`,\n severity: 'error',\n })\n }\n\n if (Math.abs(invoice.taxTotal.taxAmount - expectedTaxAmount) > tolerance) {\n errors.push({\n field: 'taxTotal.taxAmount',\n code: 'TAX_AMOUNT_MISMATCH',\n message: `Tax amount (${invoice.taxTotal.taxAmount}) doesn't match sum of line item taxes (${expectedTaxAmount})`,\n severity: 'error',\n })\n }\n\n return errors\n}\n\n/**\n * Main validation function for complete invoice\n */\nexport const validateInvoice = (invoice: InvoiceV1_1): ValidationResult => {\n const allErrors: ValidationError[] = []\n\n // Core field validations\n allErrors.push(\n ...validateTIN(invoice.supplier.tin, invoice.supplier.registrationType),\n )\n allErrors.push(\n ...validateTIN(invoice.buyer.tin, invoice.buyer.registrationType),\n )\n\n allErrors.push(...validateContactNumber(invoice.supplier.contactNumber))\n allErrors.push(...validateContactNumber(invoice.buyer.contactNumber))\n\n // Monetary validations\n allErrors.push(\n ...validateMonetaryAmount(\n invoice.legalMonetaryTotal.taxExclusiveAmount,\n 'taxExclusiveAmount',\n ),\n )\n allErrors.push(\n ...validateMonetaryAmount(\n invoice.legalMonetaryTotal.payableAmount,\n 'payableAmount',\n ),\n )\n allErrors.push(\n ...validateMonetaryAmount(invoice.taxTotal.taxAmount, 'taxAmount'),\n )\n\n // Line item validations\n invoice.invoiceLineItems.forEach((item, index) => {\n allErrors.push(\n ...validateMonetaryAmount(item.unitPrice, `lineItem[${index}].unitPrice`),\n )\n allErrors.push(\n ...validateMonetaryAmount(item.taxAmount, `lineItem[${index}].taxAmount`),\n )\n allErrors.push(\n ...validateMonetaryAmount(\n item.totalTaxableAmountPerLine,\n `lineItem[${index}].totalTaxableAmountPerLine`,\n ),\n )\n })\n\n // Business rule validations\n allErrors.push(...validateTaxCalculations(invoice))\n\n // Separate errors and warnings\n const errors = allErrors.filter(e => e.severity === 'error')\n const warnings = allErrors.filter(\n e => e.severity === 'warning',\n ) as ValidationWarning[]\n\n return {\n isValid: errors.length === 0,\n errors,\n warnings,\n }\n}\n"],"mappings":";;;;;AA6BA,MAAa,cAAc,CACzBA,KACAC,qBACsB;CACtB,MAAMC,SAA4B,CAAE;AAEpC,MAAK,KAAK;AACR,SAAO,KAAK;GACV,OAAO;GACP,MAAM;GACN,SAAS;GACT,UAAU;EACX,EAAC;AACF,SAAO;CACR;AAGD,KAAI,qBAAqB,UAAU,IAAI,WAAW,IAAI,CACpD,QAAO,KAAK;EACV,OAAO;EACP,MAAM;EACN,SAAS;EACT,UAAU;CACX,EAAC;AAGJ,KAAI,qBAAqB,WAAW,IAAI,WAAW,KAAK,CACtD,QAAO,KAAK;EACV,OAAO;EACP,MAAM;EACN,SAAS;EACT,UAAU;CACX,EAAC;AAIJ,KAAI,IAAI,SAAS,GACf,QAAO,KAAK;EACV,OAAO;EACP,MAAM;EACN,SAAS;EACT,UAAU;CACX,E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AAS,UAAU,OAAO,OAAK,EAAE,aAAa,QAAQ;CAC5D,MAAM,WAAW,UAAU,OACzB,OAAK,EAAE,aAAa,UACrB;AAED,QAAO;EACL,SAAS,OAAO,WAAW;EAC3B;EACA;CACD;AACF"}
|
package/dist/index41.cjs
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/types/unit/
|
|
2
|
+
//#region src/types/unit/1X.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Enum representing unit type codes starting with '
|
|
4
|
+
* Enum representing unit type codes starting with '1'.
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
let UnitTypeCodeEnum_1X = /* @__PURE__ */ function(UnitTypeCodeEnum_1X$1) {
|
|
7
|
+
UnitTypeCodeEnum_1X$1["Group"] = "10";
|
|
8
|
+
UnitTypeCodeEnum_1X$1["Outfit"] = "11";
|
|
9
|
+
UnitTypeCodeEnum_1X$1["Ration"] = "13";
|
|
10
|
+
UnitTypeCodeEnum_1X$1["Shot"] = "14";
|
|
11
|
+
UnitTypeCodeEnum_1X$1["StickMilitary"] = "15";
|
|
12
|
+
UnitTypeCodeEnum_1X$1["FixedRate"] = "1I";
|
|
13
|
+
return UnitTypeCodeEnum_1X$1;
|
|
9
14
|
}({});
|
|
10
15
|
|
|
11
16
|
//#endregion
|
|
12
|
-
exports.
|
|
17
|
+
exports.UnitTypeCodeEnum_1X = UnitTypeCodeEnum_1X;
|
|
13
18
|
//# sourceMappingURL=index41.cjs.map
|
package/dist/index41.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index41.cjs","names":[],"sources":["../src/types/unit/
|
|
1
|
+
{"version":3,"file":"index41.cjs","names":[],"sources":["../src/types/unit/1X.d.ts"],"sourcesContent":["/**\n * Unit type codes starting with '1'.\n */\nexport type UnitTypeCode_1X = '10' | '11' | '13' | '14' | '15' | '1I'\n\n/**\n * Enum representing unit type codes starting with '1'.\n */\nexport enum UnitTypeCodeEnum_1X {\n Group = '10',\n Outfit = '11',\n Ration = '13',\n Shot = '14',\n StickMilitary = '15',\n FixedRate = '1I',\n}\n"],"mappings":";;;;;AAQA,IAAY,sEAAL;AACL;AACA;AACA;AACA;AACA;AACA;;AACD"}
|
package/dist/index42.cjs
CHANGED
|
@@ -1,108 +1,38 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/types/unit/
|
|
2
|
+
//#region src/types/unit/2X.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Enum representing unit type codes starting with '
|
|
4
|
+
* Enum representing unit type codes starting with '2'.
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
UnitTypeCodeEnum_AX$1["CubicCentimetrePerMole"] = "A36";
|
|
35
|
-
UnitTypeCodeEnum_AX$1["CubicDecimetrePerMole"] = "A37";
|
|
36
|
-
UnitTypeCodeEnum_AX$1["CubicMetrePerCoulomb"] = "A38";
|
|
37
|
-
UnitTypeCodeEnum_AX$1["CubicMetrePerKilogram"] = "A39";
|
|
38
|
-
UnitTypeCodeEnum_AX$1["AmperePerSquareCentimetre"] = "A4";
|
|
39
|
-
UnitTypeCodeEnum_AX$1["CubicMetrePerMole"] = "A40";
|
|
40
|
-
UnitTypeCodeEnum_AX$1["AmperePerSquareMetre"] = "A41";
|
|
41
|
-
UnitTypeCodeEnum_AX$1["CuriePerKilogram"] = "A42";
|
|
42
|
-
UnitTypeCodeEnum_AX$1["DeadweightTonnage"] = "A43";
|
|
43
|
-
UnitTypeCodeEnum_AX$1["Decalitre"] = "A44";
|
|
44
|
-
UnitTypeCodeEnum_AX$1["Decametre"] = "A45";
|
|
45
|
-
UnitTypeCodeEnum_AX$1["Decitex"] = "A47";
|
|
46
|
-
UnitTypeCodeEnum_AX$1["DegreeRankine"] = "A48";
|
|
47
|
-
UnitTypeCodeEnum_AX$1["Denier"] = "A49";
|
|
48
|
-
UnitTypeCodeEnum_AX$1["AmpereSquareMetre"] = "A5";
|
|
49
|
-
UnitTypeCodeEnum_AX$1["Electronvolt"] = "A53";
|
|
50
|
-
UnitTypeCodeEnum_AX$1["ElectronvoltPerMetre"] = "A54";
|
|
51
|
-
UnitTypeCodeEnum_AX$1["ElectronvoltSquareMetre"] = "A55";
|
|
52
|
-
UnitTypeCodeEnum_AX$1["ElectronvoltSquareMetrePerKilogram"] = "A56";
|
|
53
|
-
UnitTypeCodeEnum_AX$1["_8PartCloudCover"] = "A59";
|
|
54
|
-
UnitTypeCodeEnum_AX$1["AmperePerSquareMetreKelvinSquared"] = "A6";
|
|
55
|
-
UnitTypeCodeEnum_AX$1["Exajoule"] = "A68";
|
|
56
|
-
UnitTypeCodeEnum_AX$1["FaradPerMetre"] = "A69";
|
|
57
|
-
UnitTypeCodeEnum_AX$1["AmperePerSquareMillimetre"] = "A7";
|
|
58
|
-
UnitTypeCodeEnum_AX$1["Femtojoule"] = "A70";
|
|
59
|
-
UnitTypeCodeEnum_AX$1["Femtometre"] = "A71";
|
|
60
|
-
UnitTypeCodeEnum_AX$1["FootPerSecondSquared"] = "A73";
|
|
61
|
-
UnitTypeCodeEnum_AX$1["FootPoundForcePerSecond"] = "A74";
|
|
62
|
-
UnitTypeCodeEnum_AX$1["FreightTon"] = "A75";
|
|
63
|
-
UnitTypeCodeEnum_AX$1["Gal"] = "A76";
|
|
64
|
-
UnitTypeCodeEnum_AX$1["AmpereSecond"] = "A8";
|
|
65
|
-
UnitTypeCodeEnum_AX$1["GigacoulombPerCubicMetre"] = "A84";
|
|
66
|
-
UnitTypeCodeEnum_AX$1["Gigaelectronvolt"] = "A85";
|
|
67
|
-
UnitTypeCodeEnum_AX$1["Gigahertz"] = "A86";
|
|
68
|
-
UnitTypeCodeEnum_AX$1["Gigaohm"] = "A87";
|
|
69
|
-
UnitTypeCodeEnum_AX$1["GigaohmMetre"] = "A88";
|
|
70
|
-
UnitTypeCodeEnum_AX$1["Gigapascal"] = "A89";
|
|
71
|
-
UnitTypeCodeEnum_AX$1["Rate"] = "A9";
|
|
72
|
-
UnitTypeCodeEnum_AX$1["Gigawatt"] = "A90";
|
|
73
|
-
UnitTypeCodeEnum_AX$1["Gon"] = "A91";
|
|
74
|
-
UnitTypeCodeEnum_AX$1["GramPerCubicMetre"] = "A93";
|
|
75
|
-
UnitTypeCodeEnum_AX$1["GramPerMole"] = "A94";
|
|
76
|
-
UnitTypeCodeEnum_AX$1["Gray"] = "A95";
|
|
77
|
-
UnitTypeCodeEnum_AX$1["GrayPerSecond"] = "A96";
|
|
78
|
-
UnitTypeCodeEnum_AX$1["Hectopascal"] = "A97";
|
|
79
|
-
UnitTypeCodeEnum_AX$1["HenryPerMetre"] = "A98";
|
|
80
|
-
UnitTypeCodeEnum_AX$1["Bit"] = "A99";
|
|
81
|
-
UnitTypeCodeEnum_AX$1["Ball"] = "AA";
|
|
82
|
-
UnitTypeCodeEnum_AX$1["BulkPack"] = "AB";
|
|
83
|
-
UnitTypeCodeEnum_AX$1["Acre"] = "ACR";
|
|
84
|
-
UnitTypeCodeEnum_AX$1["Activity"] = "ACT";
|
|
85
|
-
UnitTypeCodeEnum_AX$1["Byte"] = "AD";
|
|
86
|
-
UnitTypeCodeEnum_AX$1["AmperePerMetre"] = "AE";
|
|
87
|
-
UnitTypeCodeEnum_AX$1["AdditionalMinute"] = "AH";
|
|
88
|
-
UnitTypeCodeEnum_AX$1["AverageMinutePerCall"] = "AI";
|
|
89
|
-
UnitTypeCodeEnum_AX$1["Fathom"] = "AK";
|
|
90
|
-
UnitTypeCodeEnum_AX$1["AccessLine"] = "AL";
|
|
91
|
-
UnitTypeCodeEnum_AX$1["AmpereHour"] = "AMH";
|
|
92
|
-
UnitTypeCodeEnum_AX$1["Ampere"] = "AMP";
|
|
93
|
-
UnitTypeCodeEnum_AX$1["Year"] = "ANN";
|
|
94
|
-
UnitTypeCodeEnum_AX$1["TroyOunceOrApothecaryOunce"] = "APZ";
|
|
95
|
-
UnitTypeCodeEnum_AX$1["AntiHemophilicFactorAHFUnit"] = "AQ";
|
|
96
|
-
UnitTypeCodeEnum_AX$1["Assortment"] = "AS";
|
|
97
|
-
UnitTypeCodeEnum_AX$1["AlcoholicStrengthByMass"] = "ASM";
|
|
98
|
-
UnitTypeCodeEnum_AX$1["AlcoholicStrengthByVolume"] = "ASU";
|
|
99
|
-
UnitTypeCodeEnum_AX$1["StandardAtmosphere"] = "ATM";
|
|
100
|
-
UnitTypeCodeEnum_AX$1["AmericanWireGauge"] = "AWG";
|
|
101
|
-
UnitTypeCodeEnum_AX$1["Assembly"] = "AY";
|
|
102
|
-
UnitTypeCodeEnum_AX$1["BritishThermalUnitInternationalTablePerPound"] = "AZ";
|
|
103
|
-
return UnitTypeCodeEnum_AX$1;
|
|
6
|
+
let UnitTypeCodeEnum_2X = /* @__PURE__ */ function(UnitTypeCodeEnum_2X$1) {
|
|
7
|
+
UnitTypeCodeEnum_2X$1["TwentyFootContainer"] = "20";
|
|
8
|
+
UnitTypeCodeEnum_2X$1["FortyFootContainer"] = "21";
|
|
9
|
+
UnitTypeCodeEnum_2X$1["DecilitrePerGram"] = "22";
|
|
10
|
+
UnitTypeCodeEnum_2X$1["GramPerCubicCentimetre"] = "23";
|
|
11
|
+
UnitTypeCodeEnum_2X$1["TheoreticalPound"] = "24";
|
|
12
|
+
UnitTypeCodeEnum_2X$1["GramPerSquareCentimetre"] = "25";
|
|
13
|
+
UnitTypeCodeEnum_2X$1["TheoreticalTon"] = "27";
|
|
14
|
+
UnitTypeCodeEnum_2X$1["KilogramPerSquareMetre"] = "28";
|
|
15
|
+
UnitTypeCodeEnum_2X$1["RadianPerSecond"] = "2A";
|
|
16
|
+
UnitTypeCodeEnum_2X$1["RadianPerSecondSquared"] = "2B";
|
|
17
|
+
UnitTypeCodeEnum_2X$1["Roentgen"] = "2C";
|
|
18
|
+
UnitTypeCodeEnum_2X$1["VoltAC"] = "2G";
|
|
19
|
+
UnitTypeCodeEnum_2X$1["VoltDC"] = "2H";
|
|
20
|
+
UnitTypeCodeEnum_2X$1["BritishThermalUnitInternationalTablePerHour"] = "2I";
|
|
21
|
+
UnitTypeCodeEnum_2X$1["CubicCentimetrePerSecond"] = "2J";
|
|
22
|
+
UnitTypeCodeEnum_2X$1["CubicFootPerHour"] = "2K";
|
|
23
|
+
UnitTypeCodeEnum_2X$1["CubicFootPerMinute"] = "2L";
|
|
24
|
+
UnitTypeCodeEnum_2X$1["CentimetrePerSecond"] = "2M";
|
|
25
|
+
UnitTypeCodeEnum_2X$1["Decibel"] = "2N";
|
|
26
|
+
UnitTypeCodeEnum_2X$1["Kilobyte"] = "2P";
|
|
27
|
+
UnitTypeCodeEnum_2X$1["Kilobecquerel"] = "2Q";
|
|
28
|
+
UnitTypeCodeEnum_2X$1["Kilocurie"] = "2R";
|
|
29
|
+
UnitTypeCodeEnum_2X$1["Megagram"] = "2U";
|
|
30
|
+
UnitTypeCodeEnum_2X$1["MetrePerMinute"] = "2X";
|
|
31
|
+
UnitTypeCodeEnum_2X$1["Milliroentgen"] = "2Y";
|
|
32
|
+
UnitTypeCodeEnum_2X$1["Millivolt"] = "2Z";
|
|
33
|
+
return UnitTypeCodeEnum_2X$1;
|
|
104
34
|
}({});
|
|
105
35
|
|
|
106
36
|
//#endregion
|
|
107
|
-
exports.
|
|
37
|
+
exports.UnitTypeCodeEnum_2X = UnitTypeCodeEnum_2X;
|
|
108
38
|
//# sourceMappingURL=index42.cjs.map
|
package/dist/index42.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index42.cjs","names":[],"sources":["../src/types/unit/
|
|
1
|
+
{"version":3,"file":"index42.cjs","names":[],"sources":["../src/types/unit/2X.d.ts"],"sourcesContent":["/**\n * Unit type codes starting with '2'.\n */\nexport type UnitTypeCode_2X =\n | '20'\n | '21'\n | '22'\n | '23'\n | '24'\n | '25'\n | '27'\n | '28'\n | '2A'\n | '2B'\n | '2C'\n | '2G'\n | '2H'\n | '2I'\n | '2J'\n | '2K'\n | '2L'\n | '2M'\n | '2N'\n | '2P'\n | '2Q'\n | '2R'\n | '2U'\n | '2X'\n | '2Y'\n | '2Z'\n\n/**\n * Enum representing unit type codes starting with '2'.\n */\nexport enum UnitTypeCodeEnum_2X {\n TwentyFootContainer = '20',\n FortyFootContainer = '21',\n DecilitrePerGram = '22',\n GramPerCubicCentimetre = '23',\n TheoreticalPound = '24',\n GramPerSquareCentimetre = '25',\n TheoreticalTon = '27',\n KilogramPerSquareMetre = '28',\n RadianPerSecond = '2A',\n RadianPerSecondSquared = '2B',\n Roentgen = '2C',\n VoltAC = '2G',\n VoltDC = '2H',\n BritishThermalUnitInternationalTablePerHour = '2I',\n CubicCentimetrePerSecond = '2J',\n CubicFootPerHour = '2K',\n CubicFootPerMinute = '2L',\n CentimetrePerSecond = '2M',\n Decibel = '2N',\n Kilobyte = '2P',\n Kilobecquerel = '2Q',\n Kilocurie = '2R',\n Megagram = '2U',\n MetrePerMinute = '2X',\n Milliroentgen = '2Y',\n Millivolt = '2Z',\n}\n"],"mappings":";;;;;AAkCA,IAAY,sEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
|
package/dist/index43.cjs
CHANGED
|
@@ -1,113 +1,19 @@
|
|
|
1
1
|
|
|
2
|
-
//#region src/types/unit/
|
|
2
|
+
//#region src/types/unit/3X.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Enum representing unit type codes starting with '
|
|
4
|
+
* Enum representing unit type codes starting with '3'.
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
UnitTypeCodeEnum_BX$1["Credit"] = "B17";
|
|
16
|
-
UnitTypeCodeEnum_BX$1["JouleSecond"] = "B18";
|
|
17
|
-
UnitTypeCodeEnum_BX$1["Digit"] = "B19";
|
|
18
|
-
UnitTypeCodeEnum_BX$1["JouleSquareMetrePerKilogram"] = "B20";
|
|
19
|
-
UnitTypeCodeEnum_BX$1["KelvinPerWatt"] = "B21";
|
|
20
|
-
UnitTypeCodeEnum_BX$1["Kiloampere"] = "B22";
|
|
21
|
-
UnitTypeCodeEnum_BX$1["KiloamperePerSquareMetre"] = "B23";
|
|
22
|
-
UnitTypeCodeEnum_BX$1["KiloamperePerMetre"] = "B24";
|
|
23
|
-
UnitTypeCodeEnum_BX$1["KilobecquerelPerKilogram"] = "B25";
|
|
24
|
-
UnitTypeCodeEnum_BX$1["Kilocoulomb"] = "B26";
|
|
25
|
-
UnitTypeCodeEnum_BX$1["KilocoulombPerCubicMetre"] = "B27";
|
|
26
|
-
UnitTypeCodeEnum_BX$1["KilocoulombPerSquareMetre"] = "B28";
|
|
27
|
-
UnitTypeCodeEnum_BX$1["Kiloelectronvolt"] = "B29";
|
|
28
|
-
UnitTypeCodeEnum_BX$1["BattingPound"] = "B3";
|
|
29
|
-
UnitTypeCodeEnum_BX$1["Gibibit"] = "B30";
|
|
30
|
-
UnitTypeCodeEnum_BX$1["KilogramMetrePerSecond"] = "B31";
|
|
31
|
-
UnitTypeCodeEnum_BX$1["KilogramMetreSquared"] = "B32";
|
|
32
|
-
UnitTypeCodeEnum_BX$1["KilogramMetreSquaredPerSecond"] = "B33";
|
|
33
|
-
UnitTypeCodeEnum_BX$1["KilogramPerCubicDecimetre"] = "B34";
|
|
34
|
-
UnitTypeCodeEnum_BX$1["KilogramPerLitre"] = "B35";
|
|
35
|
-
UnitTypeCodeEnum_BX$1["BarrelImperial"] = "B4";
|
|
36
|
-
UnitTypeCodeEnum_BX$1["KilojoulePerKelvin"] = "B41";
|
|
37
|
-
UnitTypeCodeEnum_BX$1["KilojoulePerKilogram"] = "B42";
|
|
38
|
-
UnitTypeCodeEnum_BX$1["KilojoulePerKilogramKelvin"] = "B43";
|
|
39
|
-
UnitTypeCodeEnum_BX$1["KilojoulePerMole"] = "B44";
|
|
40
|
-
UnitTypeCodeEnum_BX$1["Kilomole"] = "B45";
|
|
41
|
-
UnitTypeCodeEnum_BX$1["KilomolePerCubicMetre"] = "B46";
|
|
42
|
-
UnitTypeCodeEnum_BX$1["Kilonewton"] = "B47";
|
|
43
|
-
UnitTypeCodeEnum_BX$1["KilonewtonMetre"] = "B48";
|
|
44
|
-
UnitTypeCodeEnum_BX$1["Kiloohm"] = "B49";
|
|
45
|
-
UnitTypeCodeEnum_BX$1["KiloohmMetre"] = "B50";
|
|
46
|
-
UnitTypeCodeEnum_BX$1["Kilosecond"] = "B52";
|
|
47
|
-
UnitTypeCodeEnum_BX$1["Kilosiemens"] = "B53";
|
|
48
|
-
UnitTypeCodeEnum_BX$1["KilosiemensPerMetre"] = "B54";
|
|
49
|
-
UnitTypeCodeEnum_BX$1["KilovoltPerMetre"] = "B55";
|
|
50
|
-
UnitTypeCodeEnum_BX$1["KiloweberPerMetre"] = "B56";
|
|
51
|
-
UnitTypeCodeEnum_BX$1["LightYear"] = "B57";
|
|
52
|
-
UnitTypeCodeEnum_BX$1["LitrePerMole"] = "B58";
|
|
53
|
-
UnitTypeCodeEnum_BX$1["LumenHour"] = "B59";
|
|
54
|
-
UnitTypeCodeEnum_BX$1["LumenPerSquareMetre"] = "B60";
|
|
55
|
-
UnitTypeCodeEnum_BX$1["LumenPerWatt"] = "B61";
|
|
56
|
-
UnitTypeCodeEnum_BX$1["LumenSecond"] = "B62";
|
|
57
|
-
UnitTypeCodeEnum_BX$1["LuxHour"] = "B63";
|
|
58
|
-
UnitTypeCodeEnum_BX$1["LuxSecond"] = "B64";
|
|
59
|
-
UnitTypeCodeEnum_BX$1["MegaamperePerSquareMetre"] = "B66";
|
|
60
|
-
UnitTypeCodeEnum_BX$1["MegabecquerelPerKilogram"] = "B67";
|
|
61
|
-
UnitTypeCodeEnum_BX$1["Gigabit"] = "B68";
|
|
62
|
-
UnitTypeCodeEnum_BX$1["MegacoulombPerCubicMetre"] = "B69";
|
|
63
|
-
UnitTypeCodeEnum_BX$1["Cycle"] = "B7";
|
|
64
|
-
UnitTypeCodeEnum_BX$1["MegacoulombPerSquareMetre"] = "B70";
|
|
65
|
-
UnitTypeCodeEnum_BX$1["Megaelectronvolt"] = "B71";
|
|
66
|
-
UnitTypeCodeEnum_BX$1["MegagramPerCubicMetre"] = "B72";
|
|
67
|
-
UnitTypeCodeEnum_BX$1["Meganewton"] = "B73";
|
|
68
|
-
UnitTypeCodeEnum_BX$1["MeganewtonMetre"] = "B74";
|
|
69
|
-
UnitTypeCodeEnum_BX$1["Megaohm"] = "B75";
|
|
70
|
-
UnitTypeCodeEnum_BX$1["MegaohmMetre"] = "B76";
|
|
71
|
-
UnitTypeCodeEnum_BX$1["MegasiemensPerMetre"] = "B77";
|
|
72
|
-
UnitTypeCodeEnum_BX$1["Megavolt"] = "B78";
|
|
73
|
-
UnitTypeCodeEnum_BX$1["MegavoltPerMetre"] = "B79";
|
|
74
|
-
UnitTypeCodeEnum_BX$1["JoulePerCubicMetre"] = "B8";
|
|
75
|
-
UnitTypeCodeEnum_BX$1["GigabitPerSecond"] = "B80";
|
|
76
|
-
UnitTypeCodeEnum_BX$1["ReciprocalMetreSquaredReciprocalSecond"] = "B81";
|
|
77
|
-
UnitTypeCodeEnum_BX$1["InchPerLinearFoot"] = "B82";
|
|
78
|
-
UnitTypeCodeEnum_BX$1["MetreToTheFourthPower"] = "B83";
|
|
79
|
-
UnitTypeCodeEnum_BX$1["Microampere"] = "B84";
|
|
80
|
-
UnitTypeCodeEnum_BX$1["Microbar"] = "B85";
|
|
81
|
-
UnitTypeCodeEnum_BX$1["Microcoulomb"] = "B86";
|
|
82
|
-
UnitTypeCodeEnum_BX$1["MicrocoulombPerCubicMetre"] = "B87";
|
|
83
|
-
UnitTypeCodeEnum_BX$1["MicrocoulombPerSquareMetre"] = "B88";
|
|
84
|
-
UnitTypeCodeEnum_BX$1["MicrofaradPerMetre"] = "B89";
|
|
85
|
-
UnitTypeCodeEnum_BX$1["Microhenry"] = "B90";
|
|
86
|
-
UnitTypeCodeEnum_BX$1["MicrohenryPerMetre"] = "B91";
|
|
87
|
-
UnitTypeCodeEnum_BX$1["Micronewton"] = "B92";
|
|
88
|
-
UnitTypeCodeEnum_BX$1["MicronewtonMetre"] = "B93";
|
|
89
|
-
UnitTypeCodeEnum_BX$1["Microohm"] = "B94";
|
|
90
|
-
UnitTypeCodeEnum_BX$1["MicroohmMetre"] = "B95";
|
|
91
|
-
UnitTypeCodeEnum_BX$1["Micropascal"] = "B96";
|
|
92
|
-
UnitTypeCodeEnum_BX$1["Microradian"] = "B97";
|
|
93
|
-
UnitTypeCodeEnum_BX$1["Microsecond"] = "B98";
|
|
94
|
-
UnitTypeCodeEnum_BX$1["Microsiemens"] = "B99";
|
|
95
|
-
UnitTypeCodeEnum_BX$1["Bar"] = "BAR";
|
|
96
|
-
UnitTypeCodeEnum_BX$1["BaseBox"] = "BB";
|
|
97
|
-
UnitTypeCodeEnum_BX$1["BoardFoot"] = "BFT";
|
|
98
|
-
UnitTypeCodeEnum_BX$1["BrakeHorsePower"] = "BHP";
|
|
99
|
-
UnitTypeCodeEnum_BX$1["BillionEUR"] = "BIL";
|
|
100
|
-
UnitTypeCodeEnum_BX$1["DryBarrelUS"] = "BLD";
|
|
101
|
-
UnitTypeCodeEnum_BX$1["BarrelUS"] = "BLL";
|
|
102
|
-
UnitTypeCodeEnum_BX$1["HundredBoardFoot"] = "BP";
|
|
103
|
-
UnitTypeCodeEnum_BX$1["BeatsPerMinute"] = "BPM";
|
|
104
|
-
UnitTypeCodeEnum_BX$1["Becquerel"] = "BQL";
|
|
105
|
-
UnitTypeCodeEnum_BX$1["BritishThermalUnit"] = "BTU";
|
|
106
|
-
UnitTypeCodeEnum_BX$1["BushelUS"] = "BUA";
|
|
107
|
-
UnitTypeCodeEnum_BX$1["BushelUK"] = "BUI";
|
|
108
|
-
return UnitTypeCodeEnum_BX$1;
|
|
6
|
+
let UnitTypeCodeEnum_3X = /* @__PURE__ */ function(UnitTypeCodeEnum_3X$1) {
|
|
7
|
+
UnitTypeCodeEnum_3X$1["KilopascalSquareMetrePerGram"] = "33";
|
|
8
|
+
UnitTypeCodeEnum_3X$1["KilopascalPerMillimetre"] = "34";
|
|
9
|
+
UnitTypeCodeEnum_3X$1["MillilitrePerSquareCentimetreSecond"] = "35";
|
|
10
|
+
UnitTypeCodeEnum_3X$1["OuncePerSquareFoot"] = "37";
|
|
11
|
+
UnitTypeCodeEnum_3X$1["OuncePerSquareFootPer0_01inch"] = "38";
|
|
12
|
+
UnitTypeCodeEnum_3X$1["Megajoule"] = "3B";
|
|
13
|
+
UnitTypeCodeEnum_3X$1["Manmonth"] = "3C";
|
|
14
|
+
return UnitTypeCodeEnum_3X$1;
|
|
109
15
|
}({});
|
|
110
16
|
|
|
111
17
|
//#endregion
|
|
112
|
-
exports.
|
|
18
|
+
exports.UnitTypeCodeEnum_3X = UnitTypeCodeEnum_3X;
|
|
113
19
|
//# sourceMappingURL=index43.cjs.map
|
package/dist/index43.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index43.cjs","names":[],"sources":["../src/types/unit/
|
|
1
|
+
{"version":3,"file":"index43.cjs","names":[],"sources":["../src/types/unit/3X.d.ts"],"sourcesContent":["/**\n * Unit type codes starting with '3'.\n */\nexport type UnitTypeCode_3X = '33' | '34' | '35' | '37' | '38' | '3B' | '3C'\n\n/**\n * Enum representing unit type codes starting with '3'.\n */\nexport enum UnitTypeCodeEnum_3X {\n KilopascalSquareMetrePerGram = '33',\n KilopascalPerMillimetre = '34',\n MillilitrePerSquareCentimetreSecond = '35',\n OuncePerSquareFoot = '37',\n OuncePerSquareFootPer0_01inch = '38',\n Megajoule = '3B',\n Manmonth = '3C',\n}\n"],"mappings":";;;;;AAQA,IAAY,sEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
|