taxdrop-core 1.0.4 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxdrop-core",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -40,4 +40,4 @@
40
40
  "eslint-config-prettier": "^10.1.8",
41
41
  "eslint-plugin-prettier": "^5.5.5"
42
42
  }
43
- }
43
+ }
@@ -17,9 +17,9 @@ export const LEGAL_DOCUMENT_TYPES = Object.freeze({
17
17
  RECEIPT: 'receipt',
18
18
  TAX_INVOICE: 'tax_invoice',
19
19
  CREDIT_INVOICE: 'credit_invoice',
20
- PAYMENT_REQUEST: 'payment_request',
21
20
  TAX_INVOICE_RECEIPT: 'tax_invoice_receipt',
22
21
  })
22
+
23
23
  /**
24
24
  * Document type enum values.
25
25
  * These are the internal document type identifiers used throughout the system.
@@ -34,6 +34,7 @@ export const OPERATIONAL_DOCUMENT_TYPES = Object.freeze({
34
34
  INVOICE: 'invoice',
35
35
  DELIVERY_NOTE: 'delivery_note',
36
36
  PURCHASE_ORDER: 'purchase_order',
37
+ PAYMENT_REQUEST: 'payment_request',
37
38
  PROFORMA_INVOICE: 'proforma_invoice',
38
39
  })
39
40
 
@@ -16,7 +16,6 @@ describe('document-types', () => {
16
16
  RECEIPT: 'receipt',
17
17
  TAX_INVOICE: 'tax_invoice',
18
18
  CREDIT_INVOICE: 'credit_invoice',
19
- PAYMENT_REQUEST: 'payment_request',
20
19
  TAX_INVOICE_RECEIPT: 'tax_invoice_receipt',
21
20
  })
22
21
  })
@@ -47,6 +46,7 @@ describe('document-types', () => {
47
46
  INVOICE: 'invoice',
48
47
  DELIVERY_NOTE: 'delivery_note',
49
48
  PURCHASE_ORDER: 'purchase_order',
49
+ PAYMENT_REQUEST: 'payment_request',
50
50
  PROFORMA_INVOICE: 'proforma_invoice',
51
51
  })
52
52
  })
@@ -76,9 +76,7 @@ describe('document-types', () => {
76
76
  expect(DOCUMENT_TYPES.CREDIT_INVOICE).toBe(
77
77
  LEGAL_DOCUMENT_TYPES.CREDIT_INVOICE,
78
78
  )
79
- expect(DOCUMENT_TYPES.PAYMENT_REQUEST).toBe(
80
- LEGAL_DOCUMENT_TYPES.PAYMENT_REQUEST,
81
- )
79
+
82
80
  expect(DOCUMENT_TYPES.TAX_INVOICE_RECEIPT).toBe(
83
81
  LEGAL_DOCUMENT_TYPES.TAX_INVOICE_RECEIPT,
84
82
  )
@@ -97,6 +95,9 @@ describe('document-types', () => {
97
95
  expect(DOCUMENT_TYPES.PROFORMA_INVOICE).toBe(
98
96
  OPERATIONAL_DOCUMENT_TYPES.PROFORMA_INVOICE,
99
97
  )
98
+ expect(DOCUMENT_TYPES.PAYMENT_REQUEST).toBe(
99
+ OPERATIONAL_DOCUMENT_TYPES.PAYMENT_REQUEST,
100
+ )
100
101
  })
101
102
 
102
103
  it('should contain all document types from both legal and operational', () => {
@@ -110,11 +111,13 @@ describe('document-types', () => {
110
111
 
111
112
  allLegalKeys.forEach((key) => {
112
113
  expect(DOCUMENT_TYPES).toHaveProperty(key)
114
+ // @ts-ignore
113
115
  expect(DOCUMENT_TYPES[key]).toBe(LEGAL_DOCUMENT_TYPES[key])
114
116
  })
115
117
 
116
118
  allOperationalKeys.forEach((key) => {
117
119
  expect(DOCUMENT_TYPES).toHaveProperty(key)
120
+ // @ts-ignore
118
121
  expect(DOCUMENT_TYPES[key]).toBe(OPERATIONAL_DOCUMENT_TYPES[key])
119
122
  })
120
123
  })
@@ -0,0 +1 @@
1
+ {"version":"4.0.17","results":[[":document-types.test.js",{"duration":5.019667000000027,"failed":false}]]}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Entity type enum values.
3
+ * These are the internal entity type identifiers used throughout the system.
4
+ */
5
+ export type ENTITY_CATEGORY_MAP = object
6
+ /**
7
+ * Entity category map.
8
+ * Maps entity categories to their corresponding entity type and VAT status.
9
+ *
10
+ * @readonly
11
+ */
12
+ /**
13
+ * Entity type enum values.
14
+ * These are the internal entity type identifiers used throughout the system.
15
+ *
16
+ * @readonly
17
+ * @enum {object}
18
+ */
19
+ /**
20
+ * Entity category map constants.
21
+ * Maps entity categories to their corresponding entity type and VAT status.
22
+ *
23
+ * @module entity-category-map-types.constants
24
+ */
25
+ export const ENTITY_CATEGORY_MAP: Readonly<{
26
+ INDIVIDUAL: {
27
+ entityType: string
28
+ vatStatus: string
29
+ }
30
+ SOLE_EXEMPT: {
31
+ entityType: string
32
+ vatStatus: string
33
+ }
34
+ SOLE_REGISTERED: {
35
+ entityType: string
36
+ vatStatus: string
37
+ }
38
+ COMPANY: {
39
+ entityType: string
40
+ vatStatus: string
41
+ }
42
+ NON_PROFIT_EXEMPT: {
43
+ entityType: string
44
+ vatStatus: string
45
+ }
46
+ NON_PROFIT_REG: {
47
+ entityType: string
48
+ vatStatus: string
49
+ }
50
+ FOREIGN: {
51
+ entityType: string
52
+ vatStatus: string
53
+ }
54
+ GOVERNMENT: {
55
+ entityType: string
56
+ vatStatus: string
57
+ }
58
+ }>
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Entity type enum values.
3
+ * These are the internal entity type identifiers used throughout the system.
4
+ */
5
+ export type ENTITY_TYPES = string
6
+ /**
7
+ * Entity type constants.
8
+ * Defines all valid entity types in the system.
9
+ *
10
+ * @module entity-types.constants
11
+ */
12
+ /**
13
+ * Entity type enum values.
14
+ * These are the internal entity type identifiers used throughout the system.
15
+ *
16
+ * @readonly
17
+ * @enum {string}
18
+ */
19
+ export const ENTITY_TYPES: Readonly<{
20
+ OTHER: 'other'
21
+ COMPANY: 'company'
22
+ INDIVIDUAL: 'individual'
23
+ NON_PROFIT: 'non_profit'
24
+ GOVERNMENT: 'government'
25
+ PARTNERSHIP: 'partnership'
26
+ SOLE_PROPRIETOR: 'sole_proprietor'
27
+ FOREIGN_ENTITY: 'foreign_entity'
28
+ }>
@@ -0,0 +1,4 @@
1
+ import { ENTITY_TYPES } from './entity-types.js'
2
+ import { VAT_STATUSES } from './vat-statuses-types.js'
3
+ import { ENTITY_CATEGORY_MAP } from './entity-category-map-types.js'
4
+ export { ENTITY_TYPES, VAT_STATUSES, ENTITY_CATEGORY_MAP }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * VAT status types for counterparties.
3
+ * These represent VAT status only (סטטוס מע״מ בלבד).
4
+ */
5
+ export type VAT_STATUSES = string
6
+ /**
7
+ * VAT status types for counterparties.
8
+ * These represent VAT status only (סטטוס מע״מ בלבד).
9
+ *
10
+ * @readonly
11
+ * @enum {string}
12
+ */
13
+ export const VAT_STATUSES: Readonly<{
14
+ EXEMPT: 'exempt'
15
+ FOREIGN: 'foreign'
16
+ REGISTERED: 'registered'
17
+ NOT_APPLICABLE: 'not_applicable'
18
+ }>
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Document type enum values.
3
+ * These are the internal document type identifiers used throughout the system.
4
+ */
5
+ export type LEGAL_DOCUMENT_TYPES = string
6
+ /**
7
+ * Document type constants.
8
+ * Defines all valid document types in the system.
9
+ *
10
+ * @module document-types.constants
11
+ */
12
+ /**
13
+ * Document type enum values.
14
+ * These are the internal document type identifiers used throughout the system.
15
+ *
16
+ * @readonly
17
+ * @enum {string}
18
+ */
19
+ export const LEGAL_DOCUMENT_TYPES: Readonly<{
20
+ RECEIPT: 'receipt'
21
+ TAX_INVOICE: 'tax_invoice'
22
+ CREDIT_INVOICE: 'credit_invoice'
23
+ TAX_INVOICE_RECEIPT: 'tax_invoice_receipt'
24
+ }>
25
+ /**
26
+ * Document type enum values.
27
+ * These are the internal document type identifiers used throughout the system.
28
+ */
29
+ export type OPERATIONAL_DOCUMENT_TYPES = string
30
+ /**
31
+ * Document type enum values.
32
+ * These are the internal document type identifiers used throughout the system.
33
+ *
34
+ * @readonly
35
+ * @enum {string}
36
+ */
37
+ export const OPERATIONAL_DOCUMENT_TYPES: Readonly<{
38
+ ORDER: 'order'
39
+ QUOTE: 'quote'
40
+ INVOICE: 'invoice'
41
+ DELIVERY_NOTE: 'delivery_note'
42
+ PURCHASE_ORDER: 'purchase_order'
43
+ PAYMENT_REQUEST: 'payment_request'
44
+ PROFORMA_INVOICE: 'proforma_invoice'
45
+ }>
46
+ /**
47
+ * Document type enum values.
48
+ * These are the internal document type identifiers used throughout the system.
49
+ */
50
+ export type DOCUMENT_TYPES = string
51
+ /**
52
+ * Document type enum values.
53
+ * These are the internal document type identifiers used throughout the system.
54
+ *
55
+ * @readonly
56
+ * @enum {string}
57
+ */
58
+ export const DOCUMENT_TYPES: Readonly<{
59
+ ORDER: 'order'
60
+ QUOTE: 'quote'
61
+ INVOICE: 'invoice'
62
+ DELIVERY_NOTE: 'delivery_note'
63
+ PURCHASE_ORDER: 'purchase_order'
64
+ PAYMENT_REQUEST: 'payment_request'
65
+ PROFORMA_INVOICE: 'proforma_invoice'
66
+ RECEIPT: 'receipt'
67
+ TAX_INVOICE: 'tax_invoice'
68
+ CREDIT_INVOICE: 'credit_invoice'
69
+ TAX_INVOICE_RECEIPT: 'tax_invoice_receipt'
70
+ }>
@@ -0,0 +1,8 @@
1
+ export namespace DocumentTypes {
2
+ export { DOCUMENT_TYPES as ALL }
3
+ export { LEGAL_DOCUMENT_TYPES as LEGAL }
4
+ export { OPERATIONAL_DOCUMENT_TYPES as OPERATIONAL }
5
+ }
6
+ import { DOCUMENT_TYPES } from './document-types.js'
7
+ import { LEGAL_DOCUMENT_TYPES } from './document-types.js'
8
+ import { OPERATIONAL_DOCUMENT_TYPES } from './document-types.js'