@ripwords/myinvois-client 0.2.3 → 0.2.5

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.
Files changed (79) hide show
  1. package/dist/api/documentManagement.d.ts +2 -2
  2. package/dist/api/documentSubmission.d.ts +2 -2
  3. package/dist/api/documentSubmission.js +2 -2
  4. package/dist/api/documentTypeManagement.d.ts +4 -4
  5. package/dist/api/notificationManagement.d.ts +3 -3
  6. package/dist/api/platformLogin.d.ts +2 -2
  7. package/dist/api/taxpayerValidation.d.ts +4 -4
  8. package/dist/api/taxpayerValidation.js +1 -1
  9. package/dist/{document-BSuYbfXR.js → document-BvyYSCPx.js} +85 -1
  10. package/dist/{document-vDphtJTv.cjs → document-djvnrrZo.cjs} +121 -1
  11. package/dist/document-djvnrrZo.cjs.map +1 -0
  12. package/dist/{documentSubmission-BdJxIB_I.js → documentSubmission-695VhFA8.js} +1 -1
  13. package/dist/{documentSubmission-D5TC0MPC.cjs → documentSubmission-CK1zOsSV.cjs} +2 -2
  14. package/dist/{documentSubmission-D5TC0MPC.cjs.map → documentSubmission-CK1zOsSV.cjs.map} +1 -1
  15. package/dist/documentTypeManagement-DXRLfTsW.cjs.map +1 -1
  16. package/dist/{documents-zzL50wnG.d.ts → documents-Br8I8SvT.d.ts} +37 -2
  17. package/dist/{documents-DCOYxz61.d.cts → documents-BuH9ULyn.d.cts} +38 -3
  18. package/dist/index.cjs +3 -3
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.ts +8 -8
  21. package/dist/index.js +3 -3
  22. package/dist/index10.cjs +16 -187
  23. package/dist/index10.cjs.map +1 -1
  24. package/dist/index12.cjs +25 -16
  25. package/dist/index12.cjs.map +1 -1
  26. package/dist/index13.cjs +24 -0
  27. package/dist/{index19.cjs.map → index13.cjs.map} +1 -1
  28. package/dist/index15.cjs +0 -29
  29. package/dist/index16.cjs +0 -25
  30. package/dist/index17.cjs +5 -0
  31. package/dist/index18.cjs +5 -33
  32. package/dist/index19.cjs +4 -23
  33. package/dist/index2.cjs +61 -4
  34. package/dist/{index8.cjs.map → index2.cjs.map} +1 -1
  35. package/dist/index20.cjs +3 -0
  36. package/dist/index21.cjs +3 -0
  37. package/dist/index22.cjs +5 -0
  38. package/dist/index25.cjs +7 -1
  39. package/dist/index27.cjs +1 -1
  40. package/dist/index28.cjs +53 -0
  41. package/dist/index28.cjs.map +1 -1
  42. package/dist/index3.cjs +531 -5
  43. package/dist/index3.cjs.map +1 -0
  44. package/dist/index4.cjs +195 -4
  45. package/dist/index4.cjs.map +1 -0
  46. package/dist/index5.cjs +0 -3
  47. package/dist/index6.cjs +24 -2
  48. package/dist/index6.cjs.map +1 -0
  49. package/dist/index63.cts.map +1 -1
  50. package/dist/index64.cts.map +1 -1
  51. package/dist/index66.cts.map +1 -1
  52. package/dist/index67.cts.map +1 -1
  53. package/dist/index7.cjs +0 -5
  54. package/dist/index70.cts.map +1 -1
  55. package/dist/index73.cts.map +1 -1
  56. package/dist/index8.cjs +0 -62
  57. package/dist/index9.cjs +23 -526
  58. package/dist/index9.cjs.map +1 -1
  59. package/dist/notificationManagement-C_qrFwWL.cjs.map +1 -1
  60. package/dist/{taxpayer-CxAVm7lJ.d.ts → taxpayer-5MlboTnW.d.ts} +1 -1
  61. package/dist/{taxpayer-aaXyVf7B.d.cts → taxpayer-DVjaFzJw.d.cts} +2 -2
  62. package/dist/{taxpayerValidation-DdeXCvPT.cjs → taxpayerValidation-CSuifcY1.cjs} +2 -15
  63. package/dist/taxpayerValidation-CSuifcY1.cjs.map +1 -0
  64. package/dist/{taxpayerValidation-DI4B6kWx.js → taxpayerValidation-DiLGJg1l.js} +1 -14
  65. package/dist/types/documents.d.ts +1 -1
  66. package/dist/types/index.d.ts +2 -2
  67. package/dist/types/taxpayer.d.ts +2 -2
  68. package/dist/utils/document.d.ts +54 -3
  69. package/dist/utils/document.js +2 -2
  70. package/dist/utils/signature-diagnostics.d.ts +2 -2
  71. package/dist/utils/signature-diagnostics.js +1 -1
  72. package/dist/utils/validation.d.ts +65 -3
  73. package/dist/utils/validation.js +53 -1
  74. package/package.json +1 -1
  75. package/dist/document-vDphtJTv.cjs.map +0 -1
  76. package/dist/index15.cjs.map +0 -1
  77. package/dist/index16.cjs.map +0 -1
  78. package/dist/index18.cjs.map +0 -1
  79. package/dist/taxpayerValidation-DdeXCvPT.cjs.map +0 -1
package/dist/index12.cjs CHANGED
@@ -1,25 +1,34 @@
1
1
 
2
- //#region src/types/e-invoice.d.ts
2
+ //#region src/types/state-codes.d.ts
3
3
  /**
4
- * Enum representing the allowed codes for e-Invoice types with descriptive names.
5
- * Provides a more readable way to reference e-Invoice types compared to using raw codes.
4
+ * Enum representing the allowed state codes with descriptive names.
5
+ * Provides a more readable way to reference states.
6
6
  *
7
7
  * @example
8
- * const invoiceCode = EInvoiceTypeCodeEnum.Invoice;
9
- * console.log(invoiceCode); // Output: "01"
8
+ * const code = StateCodeEnum.Selangor;
9
+ * console.log(code); // Output: "10"
10
10
  */
11
- let EInvoiceTypeCodeEnum = /* @__PURE__ */ function(EInvoiceTypeCodeEnum$1) {
12
- EInvoiceTypeCodeEnum$1["Invoice"] = "01";
13
- EInvoiceTypeCodeEnum$1["CreditNote"] = "02";
14
- EInvoiceTypeCodeEnum$1["DebitNote"] = "03";
15
- EInvoiceTypeCodeEnum$1["RefundNote"] = "04";
16
- EInvoiceTypeCodeEnum$1["SelfBilledInvoice"] = "11";
17
- EInvoiceTypeCodeEnum$1["SelfBilledCreditNote"] = "12";
18
- EInvoiceTypeCodeEnum$1["SelfBilledDebitNote"] = "13";
19
- EInvoiceTypeCodeEnum$1["SelfBilledRefundNote"] = "14";
20
- return EInvoiceTypeCodeEnum$1;
11
+ let StateCodeEnum = /* @__PURE__ */ function(StateCodeEnum$1) {
12
+ StateCodeEnum$1["Johor"] = "01";
13
+ StateCodeEnum$1["Kedah"] = "02";
14
+ StateCodeEnum$1["Kelantan"] = "03";
15
+ StateCodeEnum$1["Melaka"] = "04";
16
+ StateCodeEnum$1["NegeriSembilan"] = "05";
17
+ StateCodeEnum$1["Pahang"] = "06";
18
+ StateCodeEnum$1["PulauPinang"] = "07";
19
+ StateCodeEnum$1["Perak"] = "08";
20
+ StateCodeEnum$1["Perlis"] = "09";
21
+ StateCodeEnum$1["Selangor"] = "10";
22
+ StateCodeEnum$1["Terengganu"] = "11";
23
+ StateCodeEnum$1["Sabah"] = "12";
24
+ StateCodeEnum$1["Sarawak"] = "13";
25
+ StateCodeEnum$1["WPKualaLumpur"] = "14";
26
+ StateCodeEnum$1["WPLabuan"] = "15";
27
+ StateCodeEnum$1["WPPutrajaya"] = "16";
28
+ StateCodeEnum$1["NotApplicable"] = "17";
29
+ return StateCodeEnum$1;
21
30
  }({});
22
31
 
23
32
  //#endregion
24
- exports.EInvoiceTypeCodeEnum = EInvoiceTypeCodeEnum;
33
+ exports.StateCodeEnum = StateCodeEnum;
25
34
  //# sourceMappingURL=index12.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index12.cjs","names":[],"sources":["../src/types/e-invoice.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for e-Invoice types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/e-invoice-types/\n */\nexport type EInvoiceTypeCode =\n | '01' // Invoice\n | '02' // Credit Note\n | '03' // Debit Note\n | '04' // Refund Note\n | '11' // Self-billed Invoice\n | '12' // Self-billed Credit Note\n | '13' // Self-billed Debit Note\n | '14' // Self-billed Refund Note\n\n/**\n * Interface representing an e-Invoice type entry.\n * Contains the code and its corresponding description.\n */\nexport interface EInvoiceType {\n code: EInvoiceTypeCode\n description: string\n}\n\n/**\n * Enum representing the allowed codes for e-Invoice types with descriptive names.\n * Provides a more readable way to reference e-Invoice types compared to using raw codes.\n *\n * @example\n * const invoiceCode = EInvoiceTypeCodeEnum.Invoice;\n * console.log(invoiceCode); // Output: \"01\"\n */\nexport enum EInvoiceTypeCodeEnum {\n Invoice = '01',\n CreditNote = '02',\n DebitNote = '03',\n RefundNote = '04',\n SelfBilledInvoice = '11',\n SelfBilledCreditNote = '12',\n SelfBilledDebitNote = '13',\n SelfBilledRefundNote = '14',\n}\n"],"mappings":";;;;;;;;;;AA+BA,IAAY,wEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
1
+ {"version":3,"file":"index12.cjs","names":[],"sources":["../src/types/state-codes.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for Malaysian states and federal territories.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/state-codes/\n */\nexport type StateCode =\n | '01' // Johor\n | '02' // Kedah\n | '03' // Kelantan\n | '04' // Melaka\n | '05' // Negeri Sembilan\n | '06' // Pahang\n | '07' // Pulau Pinang\n | '08' // Perak\n | '09' // Perlis\n | '10' // Selangor\n | '11' // Terengganu\n | '12' // Sabah\n | '13' // Sarawak\n | '14' // Wilayah Persekutuan Kuala Lumpur\n | '15' // Wilayah Persekutuan Labuan\n | '16' // Wilayah Persekutuan Putrajaya\n | '17' // Not Applicable\n\n/**\n * Enum representing the allowed state codes with descriptive names.\n * Provides a more readable way to reference states.\n *\n * @example\n * const code = StateCodeEnum.Selangor;\n * console.log(code); // Output: \"10\"\n */\nexport enum StateCodeEnum {\n Johor = '01',\n Kedah = '02',\n Kelantan = '03',\n Melaka = '04',\n NegeriSembilan = '05',\n Pahang = '06',\n PulauPinang = '07',\n Perak = '08',\n Perlis = '09',\n Selangor = '10',\n Terengganu = '11',\n Sabah = '12',\n Sarawak = '13',\n WPKualaLumpur = '14',\n WPLabuan = '15',\n WPPutrajaya = '16',\n NotApplicable = '17',\n}\n\n/**\n * Interface representing a state code entry.\n * Contains the code and its corresponding name.\n */\nexport interface State {\n code: StateCode\n name: string\n}\n"],"mappings":";;;;;;;;;;AA+BA,IAAY,0DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
package/dist/index13.cjs CHANGED
@@ -0,0 +1,24 @@
1
+
2
+ //#region src/types/tax-types.d.ts
3
+ /**
4
+ * Enum representing the allowed tax type codes with descriptive names.
5
+ * Provides a more readable way to reference tax types.
6
+ *
7
+ * @example
8
+ * const code = TaxTypeCodeEnum.SalesTax;
9
+ * console.log(code); // Output: "01"
10
+ */
11
+ let TaxTypeCodeEnum = /* @__PURE__ */ function(TaxTypeCodeEnum$1) {
12
+ TaxTypeCodeEnum$1["SalesTax"] = "01";
13
+ TaxTypeCodeEnum$1["ServiceTax"] = "02";
14
+ TaxTypeCodeEnum$1["TourismTax"] = "03";
15
+ TaxTypeCodeEnum$1["HighValueGoodsTax"] = "04";
16
+ TaxTypeCodeEnum$1["SalesTaxLowValueGoods"] = "05";
17
+ TaxTypeCodeEnum$1["NotApplicable"] = "06";
18
+ TaxTypeCodeEnum$1["TaxExemption"] = "E";
19
+ return TaxTypeCodeEnum$1;
20
+ }({});
21
+
22
+ //#endregion
23
+ exports.TaxTypeCodeEnum = TaxTypeCodeEnum;
24
+ //# sourceMappingURL=index13.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index19.cjs","names":[],"sources":["../src/types/tax-types.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for tax types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/tax-types/\n */\nexport type TaxTypeCode =\n | '01' // Sales Tax\n | '02' // Service Tax\n | '03' // Tourism Tax\n | '04' // High-Value Goods Tax\n | '05' // Sales Tax on Low Value Goods\n | '06' // Not Applicable\n | 'E' // Tax exemption (where applicable)\n\n/**\n * Enum representing the allowed tax type codes with descriptive names.\n * Provides a more readable way to reference tax types.\n *\n * @example\n * const code = TaxTypeCodeEnum.SalesTax;\n * console.log(code); // Output: \"01\"\n */\nexport enum TaxTypeCodeEnum {\n SalesTax = '01',\n ServiceTax = '02',\n TourismTax = '03',\n HighValueGoodsTax = '04',\n SalesTaxLowValueGoods = '05',\n NotApplicable = '06',\n TaxExemption = 'E',\n}\n\n/**\n * Interface representing a tax type entry.\n * Contains the code and its corresponding description.\n */\nexport interface TaxType {\n code: TaxTypeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
1
+ {"version":3,"file":"index13.cjs","names":[],"sources":["../src/types/tax-types.d.ts"],"sourcesContent":["/**\n * Represents the allowed codes for tax types.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/tax-types/\n */\nexport type TaxTypeCode =\n | '01' // Sales Tax\n | '02' // Service Tax\n | '03' // Tourism Tax\n | '04' // High-Value Goods Tax\n | '05' // Sales Tax on Low Value Goods\n | '06' // Not Applicable\n | 'E' // Tax exemption (where applicable)\n\n/**\n * Enum representing the allowed tax type codes with descriptive names.\n * Provides a more readable way to reference tax types.\n *\n * @example\n * const code = TaxTypeCodeEnum.SalesTax;\n * console.log(code); // Output: \"01\"\n */\nexport enum TaxTypeCodeEnum {\n SalesTax = '01',\n ServiceTax = '02',\n TourismTax = '03',\n HighValueGoodsTax = '04',\n SalesTaxLowValueGoods = '05',\n NotApplicable = '06',\n TaxExemption = 'E',\n}\n\n/**\n * Interface representing a tax type entry.\n * Contains the code and its corresponding description.\n */\nexport interface TaxType {\n code: TaxTypeCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AAqBA,IAAY,8DAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
package/dist/index15.cjs CHANGED
@@ -1,29 +0,0 @@
1
-
2
- //#region src/types/notifications.d.ts
3
- let NotificationTypeEnum = /* @__PURE__ */ function(NotificationTypeEnum$1) {
4
- NotificationTypeEnum$1[NotificationTypeEnum$1["Profile data validation"] = 3] = "Profile data validation";
5
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document received"] = 6] = "Document received";
6
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document validated"] = 7] = "Document validated";
7
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document cancelled"] = 8] = "Document cancelled";
8
- NotificationTypeEnum$1[NotificationTypeEnum$1["User profile changed"] = 10] = "User profile changed";
9
- NotificationTypeEnum$1[NotificationTypeEnum$1["Taxpayer profile changed"] = 11] = "Taxpayer profile changed";
10
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document rejection initiated"] = 15] = "Document rejection initiated";
11
- NotificationTypeEnum$1[NotificationTypeEnum$1["ERP data validation"] = 26] = "ERP data validation";
12
- NotificationTypeEnum$1[NotificationTypeEnum$1["Documents processing summary"] = 33] = "Documents processing summary";
13
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document Template Published"] = 34] = "Document Template Published";
14
- NotificationTypeEnum$1[NotificationTypeEnum$1["Document Template Deletion"] = 35] = "Document Template Deletion";
15
- return NotificationTypeEnum$1;
16
- }({});
17
- let NotificationStatusEnum = /* @__PURE__ */ function(NotificationStatusEnum$1) {
18
- NotificationStatusEnum$1[NotificationStatusEnum$1["New"] = 1] = "New";
19
- NotificationStatusEnum$1[NotificationStatusEnum$1["Pending"] = 2] = "Pending";
20
- NotificationStatusEnum$1[NotificationStatusEnum$1["Batched"] = 3] = "Batched";
21
- NotificationStatusEnum$1[NotificationStatusEnum$1["Delivered"] = 4] = "Delivered";
22
- NotificationStatusEnum$1[NotificationStatusEnum$1["Error"] = 5] = "Error";
23
- return NotificationStatusEnum$1;
24
- }({});
25
-
26
- //#endregion
27
- exports.NotificationStatusEnum = NotificationStatusEnum;
28
- exports.NotificationTypeEnum = NotificationTypeEnum;
29
- //# sourceMappingURL=index15.cjs.map
package/dist/index16.cjs CHANGED
@@ -1,25 +0,0 @@
1
-
2
- //#region src/types/payment-modes.d.ts
3
- /**
4
- * Enum representing the allowed payment mode codes with descriptive names.
5
- * Provides a more readable way to reference payment modes.
6
- *
7
- * @example
8
- * const mode = PaymentModeCodeEnum.Cash;
9
- * console.log(mode); // Output: "01"
10
- */
11
- let PaymentModeCodeEnum = /* @__PURE__ */ function(PaymentModeCodeEnum$1) {
12
- PaymentModeCodeEnum$1["Cash"] = "01";
13
- PaymentModeCodeEnum$1["Cheque"] = "02";
14
- PaymentModeCodeEnum$1["BankTransfer"] = "03";
15
- PaymentModeCodeEnum$1["CreditCard"] = "04";
16
- PaymentModeCodeEnum$1["DebitCard"] = "05";
17
- PaymentModeCodeEnum$1["EWalletDigitalWallet"] = "06";
18
- PaymentModeCodeEnum$1["DigitalBank"] = "07";
19
- PaymentModeCodeEnum$1["Others"] = "08";
20
- return PaymentModeCodeEnum$1;
21
- }({});
22
-
23
- //#endregion
24
- exports.PaymentModeCodeEnum = PaymentModeCodeEnum;
25
- //# sourceMappingURL=index16.cjs.map
package/dist/index17.cjs CHANGED
@@ -0,0 +1,5 @@
1
+ const require_documentManagement = require('./documentManagement-DQ7JEcBq.cjs');
2
+
3
+ exports.getDocument = require_documentManagement.getDocument;
4
+ exports.getDocumentDetails = require_documentManagement.getDocumentDetails;
5
+ exports.searchDocuments = require_documentManagement.searchDocuments;
package/dist/index18.cjs CHANGED
@@ -1,34 +1,6 @@
1
+ require('./document-djvnrrZo.cjs');
2
+ const require_documentSubmission = require('./documentSubmission-CK1zOsSV.cjs');
1
3
 
2
- //#region src/types/state-codes.d.ts
3
- /**
4
- * Enum representing the allowed state codes with descriptive names.
5
- * Provides a more readable way to reference states.
6
- *
7
- * @example
8
- * const code = StateCodeEnum.Selangor;
9
- * console.log(code); // Output: "10"
10
- */
11
- let StateCodeEnum = /* @__PURE__ */ function(StateCodeEnum$1) {
12
- StateCodeEnum$1["Johor"] = "01";
13
- StateCodeEnum$1["Kedah"] = "02";
14
- StateCodeEnum$1["Kelantan"] = "03";
15
- StateCodeEnum$1["Melaka"] = "04";
16
- StateCodeEnum$1["NegeriSembilan"] = "05";
17
- StateCodeEnum$1["Pahang"] = "06";
18
- StateCodeEnum$1["PulauPinang"] = "07";
19
- StateCodeEnum$1["Perak"] = "08";
20
- StateCodeEnum$1["Perlis"] = "09";
21
- StateCodeEnum$1["Selangor"] = "10";
22
- StateCodeEnum$1["Terengganu"] = "11";
23
- StateCodeEnum$1["Sabah"] = "12";
24
- StateCodeEnum$1["Sarawak"] = "13";
25
- StateCodeEnum$1["WPKualaLumpur"] = "14";
26
- StateCodeEnum$1["WPLabuan"] = "15";
27
- StateCodeEnum$1["WPPutrajaya"] = "16";
28
- StateCodeEnum$1["NotApplicable"] = "17";
29
- return StateCodeEnum$1;
30
- }({});
31
-
32
- //#endregion
33
- exports.StateCodeEnum = StateCodeEnum;
34
- //# sourceMappingURL=index18.cjs.map
4
+ exports.getSubmissionStatus = require_documentSubmission.getSubmissionStatus;
5
+ exports.performDocumentAction = require_documentSubmission.performDocumentAction;
6
+ exports.submitDocument = require_documentSubmission.submitDocument;
package/dist/index19.cjs CHANGED
@@ -1,24 +1,5 @@
1
+ const require_documentTypeManagement = require('./documentTypeManagement-DXRLfTsW.cjs');
1
2
 
2
- //#region src/types/tax-types.d.ts
3
- /**
4
- * Enum representing the allowed tax type codes with descriptive names.
5
- * Provides a more readable way to reference tax types.
6
- *
7
- * @example
8
- * const code = TaxTypeCodeEnum.SalesTax;
9
- * console.log(code); // Output: "01"
10
- */
11
- let TaxTypeCodeEnum = /* @__PURE__ */ function(TaxTypeCodeEnum$1) {
12
- TaxTypeCodeEnum$1["SalesTax"] = "01";
13
- TaxTypeCodeEnum$1["ServiceTax"] = "02";
14
- TaxTypeCodeEnum$1["TourismTax"] = "03";
15
- TaxTypeCodeEnum$1["HighValueGoodsTax"] = "04";
16
- TaxTypeCodeEnum$1["SalesTaxLowValueGoods"] = "05";
17
- TaxTypeCodeEnum$1["NotApplicable"] = "06";
18
- TaxTypeCodeEnum$1["TaxExemption"] = "E";
19
- return TaxTypeCodeEnum$1;
20
- }({});
21
-
22
- //#endregion
23
- exports.TaxTypeCodeEnum = TaxTypeCodeEnum;
24
- //# sourceMappingURL=index19.cjs.map
3
+ exports.getDocumentType = require_documentTypeManagement.getDocumentType;
4
+ exports.getDocumentTypeVersion = require_documentTypeManagement.getDocumentTypeVersion;
5
+ exports.getDocumentTypes = require_documentTypeManagement.getDocumentTypes;
package/dist/index2.cjs CHANGED
@@ -1,5 +1,62 @@
1
- const require_documentManagement = require('./documentManagement-DQ7JEcBq.cjs');
2
1
 
3
- exports.getDocument = require_documentManagement.getDocument;
4
- exports.getDocumentDetails = require_documentManagement.getDocumentDetails;
5
- exports.searchDocuments = require_documentManagement.searchDocuments;
2
+ //#region src/types/classification-codes.d.ts
3
+ /**
4
+ * Enum representing the allowed classification codes with descriptive names.
5
+ * Provides a more readable way to reference classification codes.
6
+ *
7
+ * @example
8
+ * const code = ClassificationCodeEnum.ComputerSmartphoneOrTablet;
9
+ * console.log(code); // Output: "003"
10
+ */
11
+ let ClassificationCodeEnum = /* @__PURE__ */ function(ClassificationCodeEnum$1) {
12
+ ClassificationCodeEnum$1["BreastfeedingEquipment"] = "001";
13
+ ClassificationCodeEnum$1["ChildCareCentresAndKindergartensFees"] = "002";
14
+ ClassificationCodeEnum$1["ComputerSmartphoneOrTablet"] = "003";
15
+ ClassificationCodeEnum$1["ConsolidatedEInvoice"] = "004";
16
+ ClassificationCodeEnum$1["ConstructionMaterials"] = "005";
17
+ ClassificationCodeEnum$1["Disbursement"] = "006";
18
+ ClassificationCodeEnum$1["Donation"] = "007";
19
+ ClassificationCodeEnum$1["ECommerceEInvoiceToBuyer"] = "008";
20
+ ClassificationCodeEnum$1["ECommerceSelfBilledToSellerLogistics"] = "009";
21
+ ClassificationCodeEnum$1["EducationFees"] = "010";
22
+ ClassificationCodeEnum$1["GoodsOnConsignmentConsignor"] = "011";
23
+ ClassificationCodeEnum$1["GoodsOnConsignmentConsignee"] = "012";
24
+ ClassificationCodeEnum$1["GymMembership"] = "013";
25
+ ClassificationCodeEnum$1["InsuranceEducationMedicalBenefits"] = "014";
26
+ ClassificationCodeEnum$1["InsuranceTakafulLife"] = "015";
27
+ ClassificationCodeEnum$1["InterestFinancingExpenses"] = "016";
28
+ ClassificationCodeEnum$1["InternetSubscription"] = "017";
29
+ ClassificationCodeEnum$1["LandAndBuilding"] = "018";
30
+ ClassificationCodeEnum$1["MedicalExamLearningDisabilities"] = "019";
31
+ ClassificationCodeEnum$1["MedicalExamVaccination"] = "020";
32
+ ClassificationCodeEnum$1["MedicalExpensesSeriousDiseases"] = "021";
33
+ ClassificationCodeEnum$1["Others"] = "022";
34
+ ClassificationCodeEnum$1["PetroleumOperations"] = "023";
35
+ ClassificationCodeEnum$1["PrivateRetirementSchemeDeferredAnnuity"] = "024";
36
+ ClassificationCodeEnum$1["MotorVehicle"] = "025";
37
+ ClassificationCodeEnum$1["SubscriptionBooksJournalsEtc"] = "026";
38
+ ClassificationCodeEnum$1["Reimbursement"] = "027";
39
+ ClassificationCodeEnum$1["RentalOfMotorVehicle"] = "028";
40
+ ClassificationCodeEnum$1["EVChargingFacilities"] = "029";
41
+ ClassificationCodeEnum$1["RepairAndMaintenance"] = "030";
42
+ ClassificationCodeEnum$1["ResearchAndDevelopment"] = "031";
43
+ ClassificationCodeEnum$1["ForeignIncome"] = "032";
44
+ ClassificationCodeEnum$1["SelfBilledBettingGaming"] = "033";
45
+ ClassificationCodeEnum$1["SelfBilledImportationGoods"] = "034";
46
+ ClassificationCodeEnum$1["SelfBilledImportationServices"] = "035";
47
+ ClassificationCodeEnum$1["SelfBilledOthers"] = "036";
48
+ ClassificationCodeEnum$1["SelfBilledMonetaryPaymentToAgents"] = "037";
49
+ ClassificationCodeEnum$1["SportsEquipmentRentalFeesEtc"] = "038";
50
+ ClassificationCodeEnum$1["SupportingEquipmentDisabledPerson"] = "039";
51
+ ClassificationCodeEnum$1["VoluntaryContributionProvidentFund"] = "040";
52
+ ClassificationCodeEnum$1["DentalExamTreatment"] = "041";
53
+ ClassificationCodeEnum$1["FertilityTreatment"] = "042";
54
+ ClassificationCodeEnum$1["TreatmentHomeCareNursingEtc"] = "043";
55
+ ClassificationCodeEnum$1["VouchersGiftCardsLoyaltyPoints"] = "044";
56
+ ClassificationCodeEnum$1["SelfBilledNonMonetaryPaymentToAgents"] = "045";
57
+ return ClassificationCodeEnum$1;
58
+ }({});
59
+
60
+ //#endregion
61
+ exports.ClassificationCodeEnum = ClassificationCodeEnum;
62
+ //# sourceMappingURL=index2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index8.cjs","names":[],"sources":["../src/types/classification-codes.d.ts"],"sourcesContent":["/**\n * Represents the allowed classification codes for e-Invoice items.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/classification-codes/\n */\nexport type ClassificationCode =\n | '001' // Breastfeeding equipment\n | '002' // Child care centres and kindergartens fees\n | '003' // Computer, smartphone or tablet\n | '004' // Consolidated e-Invoice\n | '005' // Construction materials (as specified under Fourth Schedule of the Lembaga Pembangunan Industri Pembinaan Malaysia Act 1994)\n | '006' // Disbursement\n | '007' // Donation\n | '008' // e-Commerce - e-Invoice to buyer / purchaser\n | '009' // e-Commerce - Self-billed e-Invoice to seller, logistics, etc.\n | '010' // Education fees\n | '011' // Goods on consignment (Consignor)\n | '012' // Goods on consignment (Consignee)\n | '013' // Gym membership\n | '014' // Insurance - Education and medical benefits\n | '015' // Insurance - Takaful or life insurance\n | '016' // Interest and financing expenses\n | '017' // Internet subscription\n | '018' // Land and building\n | '019' // Medical examination for learning disabilities and early intervention or rehabilitation treatments of learning disabilities\n | '020' // Medical examination or vaccination expenses\n | '021' // Medical expenses for serious diseases\n | '022' // Others\n | '023' // Petroleum operations (as defined in Petroleum (Income Tax) Act 1967)\n | '024' // Private retirement scheme or deferred annuity scheme\n | '025' // Motor vehicle\n | '026' // Subscription of books / journals / magazines / newspapers / other similar publications\n | '027' // Reimbursement\n | '028' // Rental of motor vehicle\n | '029' // EV charging facilities (Installation, rental, sale / purchase or subscription fees)\n | '030' // Repair and maintenance\n | '031' // Research and development\n | '032' // Foreign income\n | '033' // Self-billed - Betting and gaming\n | '034' // Self-billed - Importation of goods\n | '035' // Self-billed - Importation of services\n | '036' // Self-billed - Others\n | '037' // Self-billed - Monetary payment to agents, dealers or distributors\n | '038' // Sports equipment, rental / entry fees for sports facilities, registration in sports competition or sports training fees imposed by associations / sports clubs / companies registered with the Sports Commissioner or Companies Commission of Malaysia and carrying out sports activities as listed under the Sports Development Act 1997\n | '039' // Supporting equipment for disabled person\n | '040' // Voluntary contribution to approved provident fund\n | '041' // Dental examination or treatment\n | '042' // Fertility treatment\n | '043' // Treatment and home care nursing, daycare centres and residential care centers\n | '044' // Vouchers, gift cards, loyalty points, etc\n | '045' // Self-billed - Non-monetary payment to agents, dealers or distributors\n\n/**\n * Enum representing the allowed classification codes with descriptive names.\n * Provides a more readable way to reference classification codes.\n *\n * @example\n * const code = ClassificationCodeEnum.ComputerSmartphoneOrTablet;\n * console.log(code); // Output: \"003\"\n */\nexport enum ClassificationCodeEnum {\n BreastfeedingEquipment = '001',\n ChildCareCentresAndKindergartensFees = '002',\n ComputerSmartphoneOrTablet = '003',\n ConsolidatedEInvoice = '004',\n ConstructionMaterials = '005',\n Disbursement = '006',\n Donation = '007',\n ECommerceEInvoiceToBuyer = '008',\n ECommerceSelfBilledToSellerLogistics = '009',\n EducationFees = '010',\n GoodsOnConsignmentConsignor = '011',\n GoodsOnConsignmentConsignee = '012',\n GymMembership = '013',\n InsuranceEducationMedicalBenefits = '014',\n InsuranceTakafulLife = '015',\n InterestFinancingExpenses = '016',\n InternetSubscription = '017',\n LandAndBuilding = '018',\n MedicalExamLearningDisabilities = '019',\n MedicalExamVaccination = '020',\n MedicalExpensesSeriousDiseases = '021',\n Others = '022',\n PetroleumOperations = '023',\n PrivateRetirementSchemeDeferredAnnuity = '024',\n MotorVehicle = '025',\n SubscriptionBooksJournalsEtc = '026',\n Reimbursement = '027',\n RentalOfMotorVehicle = '028',\n EVChargingFacilities = '029',\n RepairAndMaintenance = '030',\n ResearchAndDevelopment = '031',\n ForeignIncome = '032',\n SelfBilledBettingGaming = '033',\n SelfBilledImportationGoods = '034',\n SelfBilledImportationServices = '035',\n SelfBilledOthers = '036',\n SelfBilledMonetaryPaymentToAgents = '037',\n SportsEquipmentRentalFeesEtc = '038',\n SupportingEquipmentDisabledPerson = '039',\n VoluntaryContributionProvidentFund = '040',\n DentalExamTreatment = '041',\n FertilityTreatment = '042',\n TreatmentHomeCareNursingEtc = '043',\n VouchersGiftCardsLoyaltyPoints = '044',\n SelfBilledNonMonetaryPaymentToAgents = '045',\n}\n\n/**\n * Interface representing a classification code entry.\n * Contains the code and its corresponding description.\n */\nexport interface Classification {\n code: ClassificationCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AA2DA,IAAY,4EAAL;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
1
+ {"version":3,"file":"index2.cjs","names":[],"sources":["../src/types/classification-codes.d.ts"],"sourcesContent":["/**\n * Represents the allowed classification codes for e-Invoice items.\n * Based on the documentation: https://sdk.myinvois.hasil.gov.my/codes/classification-codes/\n */\nexport type ClassificationCode =\n | '001' // Breastfeeding equipment\n | '002' // Child care centres and kindergartens fees\n | '003' // Computer, smartphone or tablet\n | '004' // Consolidated e-Invoice\n | '005' // Construction materials (as specified under Fourth Schedule of the Lembaga Pembangunan Industri Pembinaan Malaysia Act 1994)\n | '006' // Disbursement\n | '007' // Donation\n | '008' // e-Commerce - e-Invoice to buyer / purchaser\n | '009' // e-Commerce - Self-billed e-Invoice to seller, logistics, etc.\n | '010' // Education fees\n | '011' // Goods on consignment (Consignor)\n | '012' // Goods on consignment (Consignee)\n | '013' // Gym membership\n | '014' // Insurance - Education and medical benefits\n | '015' // Insurance - Takaful or life insurance\n | '016' // Interest and financing expenses\n | '017' // Internet subscription\n | '018' // Land and building\n | '019' // Medical examination for learning disabilities and early intervention or rehabilitation treatments of learning disabilities\n | '020' // Medical examination or vaccination expenses\n | '021' // Medical expenses for serious diseases\n | '022' // Others\n | '023' // Petroleum operations (as defined in Petroleum (Income Tax) Act 1967)\n | '024' // Private retirement scheme or deferred annuity scheme\n | '025' // Motor vehicle\n | '026' // Subscription of books / journals / magazines / newspapers / other similar publications\n | '027' // Reimbursement\n | '028' // Rental of motor vehicle\n | '029' // EV charging facilities (Installation, rental, sale / purchase or subscription fees)\n | '030' // Repair and maintenance\n | '031' // Research and development\n | '032' // Foreign income\n | '033' // Self-billed - Betting and gaming\n | '034' // Self-billed - Importation of goods\n | '035' // Self-billed - Importation of services\n | '036' // Self-billed - Others\n | '037' // Self-billed - Monetary payment to agents, dealers or distributors\n | '038' // Sports equipment, rental / entry fees for sports facilities, registration in sports competition or sports training fees imposed by associations / sports clubs / companies registered with the Sports Commissioner or Companies Commission of Malaysia and carrying out sports activities as listed under the Sports Development Act 1997\n | '039' // Supporting equipment for disabled person\n | '040' // Voluntary contribution to approved provident fund\n | '041' // Dental examination or treatment\n | '042' // Fertility treatment\n | '043' // Treatment and home care nursing, daycare centres and residential care centers\n | '044' // Vouchers, gift cards, loyalty points, etc\n | '045' // Self-billed - Non-monetary payment to agents, dealers or distributors\n\n/**\n * Enum representing the allowed classification codes with descriptive names.\n * Provides a more readable way to reference classification codes.\n *\n * @example\n * const code = ClassificationCodeEnum.ComputerSmartphoneOrTablet;\n * console.log(code); // Output: \"003\"\n */\nexport enum ClassificationCodeEnum {\n BreastfeedingEquipment = '001',\n ChildCareCentresAndKindergartensFees = '002',\n ComputerSmartphoneOrTablet = '003',\n ConsolidatedEInvoice = '004',\n ConstructionMaterials = '005',\n Disbursement = '006',\n Donation = '007',\n ECommerceEInvoiceToBuyer = '008',\n ECommerceSelfBilledToSellerLogistics = '009',\n EducationFees = '010',\n GoodsOnConsignmentConsignor = '011',\n GoodsOnConsignmentConsignee = '012',\n GymMembership = '013',\n InsuranceEducationMedicalBenefits = '014',\n InsuranceTakafulLife = '015',\n InterestFinancingExpenses = '016',\n InternetSubscription = '017',\n LandAndBuilding = '018',\n MedicalExamLearningDisabilities = '019',\n MedicalExamVaccination = '020',\n MedicalExpensesSeriousDiseases = '021',\n Others = '022',\n PetroleumOperations = '023',\n PrivateRetirementSchemeDeferredAnnuity = '024',\n MotorVehicle = '025',\n SubscriptionBooksJournalsEtc = '026',\n Reimbursement = '027',\n RentalOfMotorVehicle = '028',\n EVChargingFacilities = '029',\n RepairAndMaintenance = '030',\n ResearchAndDevelopment = '031',\n ForeignIncome = '032',\n SelfBilledBettingGaming = '033',\n SelfBilledImportationGoods = '034',\n SelfBilledImportationServices = '035',\n SelfBilledOthers = '036',\n SelfBilledMonetaryPaymentToAgents = '037',\n SportsEquipmentRentalFeesEtc = '038',\n SupportingEquipmentDisabledPerson = '039',\n VoluntaryContributionProvidentFund = '040',\n DentalExamTreatment = '041',\n FertilityTreatment = '042',\n TreatmentHomeCareNursingEtc = '043',\n VouchersGiftCardsLoyaltyPoints = '044',\n SelfBilledNonMonetaryPaymentToAgents = '045',\n}\n\n/**\n * Interface representing a classification code entry.\n * Contains the code and its corresponding description.\n */\nexport interface Classification {\n code: ClassificationCode\n description: string\n}\n"],"mappings":";;;;;;;;;;AA2DA,IAAY,4EAAL;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACD"}
package/dist/index20.cjs CHANGED
@@ -0,0 +1,3 @@
1
+ const require_notificationManagement = require('./notificationManagement-C_qrFwWL.cjs');
2
+
3
+ exports.getNotifications = require_notificationManagement.getNotifications;
package/dist/index21.cjs CHANGED
@@ -0,0 +1,3 @@
1
+ const require_platformLogin = require('./platformLogin-CPiPiVUh.cjs');
2
+
3
+ exports.platformLogin = require_platformLogin.platformLogin;
package/dist/index22.cjs CHANGED
@@ -0,0 +1,5 @@
1
+ const require_taxpayerValidation = require('./taxpayerValidation-CSuifcY1.cjs');
2
+
3
+ exports.taxpayerQRCode = require_taxpayerValidation.taxpayerQRCode;
4
+ exports.tinSearch = require_taxpayerValidation.tinSearch;
5
+ exports.verifyTin = require_taxpayerValidation.verifyTin;
package/dist/index25.cjs CHANGED
@@ -1,13 +1,19 @@
1
- const require_document = require('./document-vDphtJTv.cjs');
1
+ const require_document = require('./document-djvnrrZo.cjs');
2
2
 
3
3
  exports.calculateCertificateDigest = require_document.calculateCertificateDigest;
4
4
  exports.calculateDocumentDigest = require_document.calculateDocumentDigest;
5
+ exports.calculateExpectedTaxAmount = require_document.calculateExpectedTaxAmount;
6
+ exports.calculateInvoiceTotals = require_document.calculateInvoiceTotals;
5
7
  exports.calculateSignedPropertiesDigest = require_document.calculateSignedPropertiesDigest;
6
8
  exports.canonicalizeJSON = require_document.canonicalizeJSON;
9
+ exports.createFixedRateTaxLineItem = require_document.createFixedRateTaxLineItem;
10
+ exports.createPercentageTaxLineItem = require_document.createPercentageTaxLineItem;
7
11
  exports.createSignedInfoAndSign = require_document.createSignedInfoAndSign;
8
12
  exports.createSignedProperties = require_document.createSignedProperties;
9
13
  exports.extractCertificateInfo = require_document.extractCertificateInfo;
10
14
  exports.generateCleanInvoiceObject = require_document.generateCleanInvoiceObject;
11
15
  exports.generateCleanUBLDocument = require_document.generateCleanUBLDocument;
12
16
  exports.generateCompleteDocument = require_document.generateCompleteDocument;
17
+ exports.isFixedRateTax = require_document.isFixedRateTax;
18
+ exports.isPercentageTax = require_document.isPercentageTax;
13
19
  exports.sortObjectKeys = require_document.sortObjectKeys;
package/dist/index27.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_document = require('./document-vDphtJTv.cjs');
2
+ const require_document = require('./document-djvnrrZo.cjs');
3
3
  const crypto = require_chunk.__toESM(require("crypto"));
4
4
 
5
5
  //#region src/utils/signature-diagnostics.ts
package/dist/index28.cjs CHANGED
@@ -83,10 +83,62 @@ const validateMonetaryAmount = (amount, fieldName, maxDigits = 18, maxDecimals =
83
83
  return errors;
84
84
  };
85
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
+ /**
86
135
  * Validates tax calculation consistency
87
136
  */
88
137
  const validateTaxCalculations = (invoice) => {
89
138
  const errors = [];
139
+ invoice.invoiceLineItems.forEach((item, index) => {
140
+ errors.push(...validateLineItemTax(item, index));
141
+ });
90
142
  const expectedTaxExclusive = invoice.invoiceLineItems.reduce((sum, item) => sum + item.totalTaxableAmountPerLine, 0);
91
143
  const expectedTaxAmount = invoice.invoiceLineItems.reduce((sum, item) => sum + item.taxAmount, 0);
92
144
  const tolerance = .01;
@@ -134,6 +186,7 @@ const validateInvoice = (invoice) => {
134
186
  //#endregion
135
187
  exports.validateContactNumber = validateContactNumber;
136
188
  exports.validateInvoice = validateInvoice;
189
+ exports.validateLineItemTax = validateLineItemTax;
137
190
  exports.validateMonetaryAmount = validateMonetaryAmount;
138
191
  exports.validateTIN = validateTIN;
139
192
  exports.validateTaxCalculations = validateTaxCalculations;
@@ -1 +1 @@
1
- {"version":3,"file":"index28.cjs","names":["tin: string","registrationType?: string","errors: ValidationError[]","contactNumber: string","amount: number","fieldName: string","invoice: InvoiceV1_1","allErrors: ValidationError[]"],"sources":["../src/utils/validation.ts"],"sourcesContent":["import type { InvoiceV1_1 } from '../types/documents/index.js'\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 tax calculation consistency\n */\nexport const validateTaxCalculations = (\n invoice: InvoiceV1_1,\n): ValidationError[] => {\n const errors: ValidationError[] = []\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,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AU,KACR,GAAG,uBAAuB,KAAK,YAAY,WAAW,MAAM,aAAa,CAC1E;AACD,YAAU,KACR,GAAG,uBACD,KAAK,4BACJ,WAAW,MAAM,6BACnB,CACF;CACF,EAAC;AAGF,WAAU,KAAK,GAAG,wBAAwB,QAAQ,CAAC;CAGnD,MAAM,SAAS,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"}
1
+ {"version":3,"file":"index28.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,OAA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