taxdrop-core 1.0.3 → 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/index.js +1 -0
- package/package.json +2 -2
- package/src/counterparties/types/entity-category-map-types.js +56 -0
- package/src/counterparties/types/entity-types.js +24 -0
- package/src/counterparties/types/index.js +5 -0
- package/src/counterparties/types/vat-statuses-types.js +13 -0
- package/src/invoices/document-types/document-types.js +2 -1
- package/tests/counterparties/types.test.js +133 -0
- package/tests/invoices/{document-types.js/document-types.test.js → document-types.test.js} +9 -6
- package/tests/invoices/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/types/counterparties/types/entity-category-map-types.d.ts +58 -0
- package/types/counterparties/types/entity-types.d.ts +28 -0
- package/types/counterparties/types/index.d.ts +4 -0
- package/types/counterparties/types/vat-statuses-types.d.ts +18 -0
- package/types/invoices/document-types/document-types.d.ts +70 -0
- package/types/invoices/document-types/index.d.ts +8 -0
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity category map.
|
|
3
|
+
* Maps entity categories to their corresponding entity type and VAT status.
|
|
4
|
+
*
|
|
5
|
+
* @readonly
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Entity type enum values.
|
|
10
|
+
* These are the internal entity type identifiers used throughout the system.
|
|
11
|
+
*
|
|
12
|
+
* @readonly
|
|
13
|
+
* @enum {object}
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Entity category map constants.
|
|
18
|
+
* Maps entity categories to their corresponding entity type and VAT status.
|
|
19
|
+
*
|
|
20
|
+
* @module entity-category-map-types.constants
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export const ENTITY_CATEGORY_MAP = Object.freeze({
|
|
24
|
+
INDIVIDUAL: {
|
|
25
|
+
entityType: 'individual',
|
|
26
|
+
vatStatus: 'not_applicable',
|
|
27
|
+
},
|
|
28
|
+
SOLE_EXEMPT: {
|
|
29
|
+
entityType: 'sole_proprietor',
|
|
30
|
+
vatStatus: 'exempt',
|
|
31
|
+
},
|
|
32
|
+
SOLE_REGISTERED: {
|
|
33
|
+
entityType: 'sole_proprietor',
|
|
34
|
+
vatStatus: 'registered',
|
|
35
|
+
},
|
|
36
|
+
COMPANY: {
|
|
37
|
+
entityType: 'company',
|
|
38
|
+
vatStatus: 'registered',
|
|
39
|
+
},
|
|
40
|
+
NON_PROFIT_EXEMPT: {
|
|
41
|
+
entityType: 'non_profit',
|
|
42
|
+
vatStatus: 'exempt',
|
|
43
|
+
},
|
|
44
|
+
NON_PROFIT_REG: {
|
|
45
|
+
entityType: 'non_profit',
|
|
46
|
+
vatStatus: 'registered',
|
|
47
|
+
},
|
|
48
|
+
FOREIGN: {
|
|
49
|
+
entityType: 'foreign_entity',
|
|
50
|
+
vatStatus: 'foreign',
|
|
51
|
+
},
|
|
52
|
+
GOVERNMENT: {
|
|
53
|
+
entityType: 'government',
|
|
54
|
+
vatStatus: 'not_applicable',
|
|
55
|
+
},
|
|
56
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity type constants.
|
|
3
|
+
* Defines all valid entity types in the system.
|
|
4
|
+
*
|
|
5
|
+
* @module entity-types.constants
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Entity type enum values.
|
|
10
|
+
* These are the internal entity type identifiers used throughout the system.
|
|
11
|
+
*
|
|
12
|
+
* @readonly
|
|
13
|
+
* @enum {string}
|
|
14
|
+
*/
|
|
15
|
+
export const ENTITY_TYPES = Object.freeze({
|
|
16
|
+
OTHER: 'other',
|
|
17
|
+
COMPANY: 'company',
|
|
18
|
+
INDIVIDUAL: 'individual',
|
|
19
|
+
NON_PROFIT: 'non_profit',
|
|
20
|
+
GOVERNMENT: 'government',
|
|
21
|
+
PARTNERSHIP: 'partnership',
|
|
22
|
+
SOLE_PROPRIETOR: 'sole_proprietor',
|
|
23
|
+
FOREIGN_ENTITY: 'foreign_entity',
|
|
24
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VAT status types for counterparties.
|
|
3
|
+
* These represent VAT status only (סטטוס מע״מ בלבד).
|
|
4
|
+
*
|
|
5
|
+
* @readonly
|
|
6
|
+
* @enum {string}
|
|
7
|
+
*/
|
|
8
|
+
export const VAT_STATUSES = Object.freeze({
|
|
9
|
+
EXEMPT: 'exempt',
|
|
10
|
+
FOREIGN: 'foreign',
|
|
11
|
+
REGISTERED: 'registered',
|
|
12
|
+
NOT_APPLICABLE: 'not_applicable',
|
|
13
|
+
})
|
|
@@ -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
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
ENTITY_TYPES,
|
|
4
|
+
VAT_STATUSES,
|
|
5
|
+
ENTITY_CATEGORY_MAP,
|
|
6
|
+
} from '../../src/counterparties/types/index.js'
|
|
7
|
+
|
|
8
|
+
describe('counterparties/types', () => {
|
|
9
|
+
describe('ENTITY_TYPES', () => {
|
|
10
|
+
it('should be a frozen object', () => {
|
|
11
|
+
expect(Object.isFrozen(ENTITY_TYPES)).toBe(true)
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('should contain all expected entity types', () => {
|
|
15
|
+
expect(ENTITY_TYPES).toEqual({
|
|
16
|
+
OTHER: 'other',
|
|
17
|
+
COMPANY: 'company',
|
|
18
|
+
INDIVIDUAL: 'individual',
|
|
19
|
+
NON_PROFIT: 'non_profit',
|
|
20
|
+
GOVERNMENT: 'government',
|
|
21
|
+
PARTNERSHIP: 'partnership',
|
|
22
|
+
SOLE_PROPRIETOR: 'sole_proprietor',
|
|
23
|
+
FOREIGN_ENTITY: 'foreign_entity',
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('should have all values as strings', () => {
|
|
28
|
+
Object.values(ENTITY_TYPES).forEach((value) => {
|
|
29
|
+
expect(typeof value).toBe('string')
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('should be immutable', () => {
|
|
34
|
+
expect(() => {
|
|
35
|
+
// @ts-expect-error - we want to test the immutability
|
|
36
|
+
ENTITY_TYPES.NEW_TYPE = 'new_type'
|
|
37
|
+
}).toThrow()
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
describe('VAT_STATUSES', () => {
|
|
42
|
+
it('should be a frozen object', () => {
|
|
43
|
+
expect(Object.isFrozen(VAT_STATUSES)).toBe(true)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('should contain all expected VAT statuses', () => {
|
|
47
|
+
expect(VAT_STATUSES).toEqual({
|
|
48
|
+
EXEMPT: 'exempt',
|
|
49
|
+
FOREIGN: 'foreign',
|
|
50
|
+
REGISTERED: 'registered',
|
|
51
|
+
NOT_APPLICABLE: 'not_applicable',
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('should have all values as strings', () => {
|
|
56
|
+
Object.values(VAT_STATUSES).forEach((value) => {
|
|
57
|
+
expect(typeof value).toBe('string')
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('should be immutable', () => {
|
|
62
|
+
expect(() => {
|
|
63
|
+
// @ts-expect-error - we want to test the immutability
|
|
64
|
+
VAT_STATUSES.NEW_STATUS = 'new_status'
|
|
65
|
+
}).toThrow()
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('ENTITY_CATEGORY_MAP', () => {
|
|
70
|
+
it('should be a frozen object', () => {
|
|
71
|
+
expect(Object.isFrozen(ENTITY_CATEGORY_MAP)).toBe(true)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('should contain all expected entity categories', () => {
|
|
75
|
+
expect(ENTITY_CATEGORY_MAP).toEqual({
|
|
76
|
+
INDIVIDUAL: {
|
|
77
|
+
entityType: 'individual',
|
|
78
|
+
vatStatus: 'not_applicable',
|
|
79
|
+
},
|
|
80
|
+
SOLE_EXEMPT: {
|
|
81
|
+
entityType: 'sole_proprietor',
|
|
82
|
+
vatStatus: 'exempt',
|
|
83
|
+
},
|
|
84
|
+
SOLE_REGISTERED: {
|
|
85
|
+
entityType: 'sole_proprietor',
|
|
86
|
+
vatStatus: 'registered',
|
|
87
|
+
},
|
|
88
|
+
COMPANY: {
|
|
89
|
+
entityType: 'company',
|
|
90
|
+
vatStatus: 'registered',
|
|
91
|
+
},
|
|
92
|
+
NON_PROFIT_EXEMPT: {
|
|
93
|
+
entityType: 'non_profit',
|
|
94
|
+
vatStatus: 'exempt',
|
|
95
|
+
},
|
|
96
|
+
NON_PROFIT_REG: {
|
|
97
|
+
entityType: 'non_profit',
|
|
98
|
+
vatStatus: 'registered',
|
|
99
|
+
},
|
|
100
|
+
FOREIGN: {
|
|
101
|
+
entityType: 'foreign_entity',
|
|
102
|
+
vatStatus: 'foreign',
|
|
103
|
+
},
|
|
104
|
+
GOVERNMENT: {
|
|
105
|
+
entityType: 'government',
|
|
106
|
+
vatStatus: 'not_applicable',
|
|
107
|
+
},
|
|
108
|
+
})
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it('should have all entityType values be valid ENTITY_TYPES', () => {
|
|
112
|
+
Object.values(ENTITY_CATEGORY_MAP).forEach((category) => {
|
|
113
|
+
expect(Object.values(ENTITY_TYPES)).toContain(category.entityType)
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('should have all vatStatus values be valid VAT_STATUSES', () => {
|
|
118
|
+
Object.values(ENTITY_CATEGORY_MAP).forEach((category) => {
|
|
119
|
+
expect(Object.values(VAT_STATUSES)).toContain(category.vatStatus)
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it('should be immutable', () => {
|
|
124
|
+
expect(() => {
|
|
125
|
+
// @ts-expect-error - we want to test the immutability
|
|
126
|
+
ENTITY_CATEGORY_MAP.NEW_CATEGORY = {
|
|
127
|
+
entityType: 'other',
|
|
128
|
+
vatStatus: 'exempt',
|
|
129
|
+
}
|
|
130
|
+
}).toThrow()
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
2
|
import {
|
|
3
|
+
DOCUMENT_TYPES,
|
|
3
4
|
LEGAL_DOCUMENT_TYPES,
|
|
4
5
|
OPERATIONAL_DOCUMENT_TYPES,
|
|
5
|
-
|
|
6
|
-
} from '../../../src/invoices/document-types/document-types.js'
|
|
6
|
+
} from '../../src/invoices/document-types/document-types.js'
|
|
7
7
|
|
|
8
8
|
describe('document-types', () => {
|
|
9
9
|
describe('LEGAL_DOCUMENT_TYPES', () => {
|
|
@@ -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
|
-
|
|
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,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'
|