@spaceinvoices/react-ui 0.4.0 → 0.4.2
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/cli/dist/index.js +1 -1
- package/package.json +1 -1
- package/registry.json +23 -27
- package/src/components/advance-invoices/advance-invoices.hooks.ts +32 -2
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +109 -4
- package/src/components/advance-invoices/create/locales/de.ts +2 -0
- package/src/components/advance-invoices/create/locales/es.ts +2 -0
- package/src/components/advance-invoices/create/locales/fr.ts +2 -0
- package/src/components/advance-invoices/create/locales/hr.ts +2 -0
- package/src/components/advance-invoices/create/locales/it.ts +2 -0
- package/src/components/advance-invoices/create/locales/nl.ts +2 -0
- package/src/components/advance-invoices/create/locales/pl.ts +2 -0
- package/src/components/advance-invoices/create/locales/pt.ts +2 -0
- package/src/components/advance-invoices/create/locales/sl.ts +2 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +17 -0
- package/src/components/advance-invoices/list/list-row-actions.tsx +3 -6
- package/src/components/advance-invoices/list/list-table.tsx +45 -2
- package/src/components/advance-invoices/list/locales/de.ts +3 -0
- package/src/components/advance-invoices/list/locales/en.ts +3 -0
- package/src/components/advance-invoices/list/locales/es.ts +3 -0
- package/src/components/advance-invoices/list/locales/fr.ts +3 -0
- package/src/components/advance-invoices/list/locales/hr.ts +3 -0
- package/src/components/advance-invoices/list/locales/it.ts +3 -0
- package/src/components/advance-invoices/list/locales/nl.ts +3 -0
- package/src/components/advance-invoices/list/locales/pl.ts +3 -0
- package/src/components/advance-invoices/list/locales/pt.ts +3 -0
- package/src/components/advance-invoices/list/locales/sl.ts +3 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +177 -6
- package/src/components/credit-notes/create/locales/de.ts +8 -0
- package/src/components/credit-notes/create/locales/es.ts +8 -0
- package/src/components/credit-notes/create/locales/fr.ts +7 -0
- package/src/components/credit-notes/create/locales/hr.ts +7 -0
- package/src/components/credit-notes/create/locales/it.ts +9 -0
- package/src/components/credit-notes/create/locales/nl.ts +7 -0
- package/src/components/credit-notes/create/locales/pl.ts +7 -0
- package/src/components/credit-notes/create/locales/pt.ts +7 -0
- package/src/components/credit-notes/create/locales/sl.ts +7 -0
- package/src/components/credit-notes/credit-notes.hooks.ts +30 -0
- package/src/components/credit-notes/list/list-row-actions.tsx +3 -6
- package/src/components/credit-notes/list/list-table.tsx +45 -2
- package/src/components/credit-notes/list/locales/de.ts +3 -0
- package/src/components/credit-notes/list/locales/en.ts +3 -0
- package/src/components/credit-notes/list/locales/es.ts +3 -0
- package/src/components/credit-notes/list/locales/fr.ts +3 -0
- package/src/components/credit-notes/list/locales/hr.ts +3 -0
- package/src/components/credit-notes/list/locales/it.ts +3 -0
- package/src/components/credit-notes/list/locales/nl.ts +3 -0
- package/src/components/credit-notes/list/locales/pl.ts +3 -0
- package/src/components/credit-notes/list/locales/pt.ts +3 -0
- package/src/components/credit-notes/list/locales/sl.ts +3 -0
- package/src/components/customers/create-customer-form/create-customer-form.tsx +0 -1
- package/src/components/documents/create/document-details-section.tsx +67 -1
- package/src/components/documents/create/mark-as-paid-section.tsx +11 -2
- package/src/components/documents/view/document-actions-bar.tsx +30 -0
- package/src/components/documents/view/locales/de.ts +5 -0
- package/src/components/documents/view/locales/es.ts +5 -0
- package/src/components/documents/view/locales/fr.ts +5 -0
- package/src/components/documents/view/locales/hr.ts +5 -0
- package/src/components/documents/view/locales/it.ts +5 -0
- package/src/components/documents/view/locales/nl.ts +5 -0
- package/src/components/documents/view/locales/pl.ts +5 -0
- package/src/components/documents/view/locales/pt.ts +5 -0
- package/src/components/documents/view/locales/sl.ts +5 -0
- package/src/components/entities/create-entity-form.tsx +1 -1
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +2 -3
- package/src/components/entities/entity-settings-form/locales/es.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +2 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +2 -0
- package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +109 -0
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +365 -35
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +101 -20
- package/src/components/entities/fina-settings-form/index.ts +1 -0
- package/src/components/entities/fina-settings-form/locales/de.ts +54 -34
- package/src/components/entities/fina-settings-form/locales/en.ts +51 -34
- package/src/components/entities/fina-settings-form/locales/es.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/fr.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/hr.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/it.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/nl.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/pl.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/pt.ts +50 -34
- package/src/components/entities/fina-settings-form/locales/sl.ts +50 -34
- package/src/components/entities/fina-settings-form/sections/certificate-settings-section.tsx +18 -0
- package/src/components/entities/fina-settings-form/sections/premises-management-section.tsx +64 -89
- package/src/components/entities/fina-settings-form/sections/register-premise-dialog.tsx +51 -323
- package/src/components/entities/furs-settings-form/furs-operator-required-dialog.tsx +106 -0
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +24 -10
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +5 -9
- package/src/components/entities/furs-settings-form/index.ts +1 -0
- package/src/components/entities/furs-settings-form/locales/de.ts +27 -3
- package/src/components/entities/furs-settings-form/locales/en.ts +17 -3
- package/src/components/entities/furs-settings-form/locales/es.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/fr.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/hr.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/it.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/nl.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/pl.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/pt.ts +26 -3
- package/src/components/entities/furs-settings-form/locales/sl.ts +16 -3
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +22 -0
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +15 -2
- package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +1 -0
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +58 -34
- package/src/components/entities/settings/tax-rules-settings-form.tsx +4 -4
- package/src/components/estimates/list/list-row-actions.tsx +3 -7
- package/src/components/estimates/list/list-table.tsx +35 -2
- package/src/components/estimates/list/locales/de.ts +3 -0
- package/src/components/estimates/list/locales/en.ts +3 -0
- package/src/components/estimates/list/locales/es.ts +3 -0
- package/src/components/estimates/list/locales/fr.ts +3 -0
- package/src/components/estimates/list/locales/hr.ts +3 -0
- package/src/components/estimates/list/locales/it.ts +3 -0
- package/src/components/estimates/list/locales/nl.ts +3 -0
- package/src/components/estimates/list/locales/pl.ts +3 -0
- package/src/components/estimates/list/locales/pt.ts +3 -0
- package/src/components/estimates/list/locales/sl.ts +3 -0
- package/src/components/export/document-export-form.tsx +34 -34
- package/src/components/invoices/create/create-invoice-form.tsx +107 -5
- package/src/components/invoices/create/prepare-invoice-submission.ts +17 -0
- package/src/components/invoices/invoices.hooks.ts +32 -2
- package/src/components/invoices/list/list-row-actions.tsx +23 -8
- package/src/components/invoices/list/list-table.tsx +53 -2
- package/src/components/invoices/list/locales/de.ts +4 -0
- package/src/components/invoices/list/locales/en.ts +4 -0
- package/src/components/invoices/list/locales/es.ts +4 -0
- package/src/components/invoices/list/locales/fr.ts +4 -0
- package/src/components/invoices/list/locales/hr.ts +4 -0
- package/src/components/invoices/list/locales/it.ts +4 -0
- package/src/components/invoices/list/locales/nl.ts +4 -0
- package/src/components/invoices/list/locales/pl.ts +4 -0
- package/src/components/invoices/list/locales/pt.ts +4 -0
- package/src/components/invoices/list/locales/sl.ts +4 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +4 -1
- package/src/components/items/item-list-table/item-list-row-actions.tsx +3 -7
- package/src/components/items/item-list-table/item-list-row.tsx +3 -2
- package/src/components/items/item-list-table/item-list-table.tsx +5 -1
- package/src/components/recurring-invoices/create-recurring-invoice-form/create-recurring-invoice-form.tsx +418 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/de.ts +45 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/es.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/fr.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/hr.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/it.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/nl.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/pl.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/pt.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sl.ts +44 -0
- package/src/components/recurring-invoices/index.ts +3 -0
- package/src/components/recurring-invoices/list/index.ts +2 -0
- package/src/components/recurring-invoices/list/list-row-actions.tsx +139 -0
- package/src/components/recurring-invoices/list/list-table.tsx +179 -0
- package/src/components/recurring-invoices/list/locales/de.ts +27 -0
- package/src/components/recurring-invoices/list/locales/en.ts +5 -0
- package/src/components/recurring-invoices/list/locales/es.ts +27 -0
- package/src/components/recurring-invoices/list/locales/fr.ts +27 -0
- package/src/components/recurring-invoices/list/locales/hr.ts +27 -0
- package/src/components/recurring-invoices/list/locales/it.ts +27 -0
- package/src/components/recurring-invoices/list/locales/nl.ts +27 -0
- package/src/components/recurring-invoices/list/locales/pl.ts +27 -0
- package/src/components/recurring-invoices/list/locales/pt.ts +27 -0
- package/src/components/recurring-invoices/list/locales/sl.ts +27 -0
- package/src/components/recurring-invoices/recurring-invoices.hooks.ts +28 -0
- package/src/components/table/data-table.tsx +122 -5
- package/src/components/table/selection-toolbar.tsx +36 -0
- package/src/components/tax-reports/kir-export-form.tsx +75 -55
- package/src/components/taxes/tax-list-table/tax-list-row-actions.tsx +3 -6
- package/src/components/taxes/tax-list-table/tax-list-row.tsx +3 -2
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +5 -1
- package/src/components/ui/checkbox.tsx +5 -5
- package/src/generate-schemas.ts +46 -7
- package/src/generated/schemas/advanceinvoice.ts +79 -187
- package/src/generated/schemas/authorizeshopify_body.ts +22 -0
- package/src/generated/schemas/creditnote.ts +60 -88
- package/src/generated/schemas/customadvanceinvoice.ts +70 -97
- package/src/generated/schemas/customcreditnote.ts +70 -97
- package/src/generated/schemas/customestimate.ts +68 -97
- package/src/generated/schemas/custominvoice.ts +70 -97
- package/src/generated/schemas/entity.ts +1 -1
- package/src/generated/schemas/estimate.ts +67 -172
- package/src/generated/schemas/index.ts +39 -28
- package/src/generated/schemas/invoice.ts +79 -187
- package/src/generated/schemas/order.ts +127 -0
- package/src/generated/schemas/orderintegration.ts +51 -0
- package/src/generated/schemas/payment.ts +2 -0
- package/src/generated/schemas/recurringinvoice.ts +61 -0
- package/src/generated/schemas/registerfursrealestatepremise_body.ts +11 -7
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +140 -269
- package/src/generated/schemas/rendercreditnotepreview_body.ts +141 -270
- package/src/generated/schemas/renderestimatepreview_body.ts +112 -212
- package/src/generated/schemas/renderinvoicepreview_body.ts +141 -270
- package/src/generated/schemas/webhook.ts +42 -0
- package/src/lib/furs-error-utils.ts +36 -0
- package/src/lib/schemas/advance-invoice.ts +3 -3
- package/src/lib/schemas/credit-note.ts +3 -3
- package/src/lib/schemas/estimate.ts +3 -3
- package/src/lib/schemas/invoice.ts +3 -3
- package/src/providers/white-label-provider.tsx +3 -0
|
@@ -15,6 +15,67 @@ const LineDiscount = z.object({
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
// Dependency schema for customestimate
|
|
19
|
+
const DocumentItemTax = z
|
|
20
|
+
.object({
|
|
21
|
+
rate: z.number(),
|
|
22
|
+
tax_id: z.string(),
|
|
23
|
+
classification: z.string(),
|
|
24
|
+
reverse_charge: z.boolean(),
|
|
25
|
+
amount: z.number(),
|
|
26
|
+
})
|
|
27
|
+
.partial();
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Dependency schema for customestimate
|
|
31
|
+
const DocumentSummaryTax = z
|
|
32
|
+
.object({
|
|
33
|
+
rate: z.number(),
|
|
34
|
+
base: z.number(),
|
|
35
|
+
amount: z.number(),
|
|
36
|
+
reverse_charge: z.boolean().optional(),
|
|
37
|
+
})
|
|
38
|
+
.passthrough();
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// Dependency schema for customestimate
|
|
42
|
+
const DocumentEntity = z
|
|
43
|
+
.object({
|
|
44
|
+
name: z.union([z.string(), z.null()]),
|
|
45
|
+
email: z.union([z.string(), z.null()]),
|
|
46
|
+
address: z.union([z.string(), z.null()]),
|
|
47
|
+
address_2: z.union([z.string(), z.null()]),
|
|
48
|
+
post_code: z.union([z.string(), z.null()]),
|
|
49
|
+
city: z.union([z.string(), z.null()]),
|
|
50
|
+
state: z.union([z.string(), z.null()]),
|
|
51
|
+
country: z.union([z.string(), z.null()]),
|
|
52
|
+
country_code: z.union([z.string(), z.null()]),
|
|
53
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
54
|
+
tax_number_2: z.union([z.string(), z.null()]),
|
|
55
|
+
company_number: z.union([z.string(), z.null()]),
|
|
56
|
+
bank_account: z.union([
|
|
57
|
+
z
|
|
58
|
+
.object({
|
|
59
|
+
type: z
|
|
60
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
61
|
+
.default("iban"),
|
|
62
|
+
name: z.string(),
|
|
63
|
+
bank_name: z.string(),
|
|
64
|
+
iban: z.string(),
|
|
65
|
+
account_number: z.string(),
|
|
66
|
+
bic: z.string(),
|
|
67
|
+
routing_number: z.string(),
|
|
68
|
+
sort_code: z.string(),
|
|
69
|
+
})
|
|
70
|
+
.partial()
|
|
71
|
+
.passthrough(),
|
|
72
|
+
z.null(),
|
|
73
|
+
]),
|
|
74
|
+
})
|
|
75
|
+
.partial()
|
|
76
|
+
.passthrough();
|
|
77
|
+
|
|
78
|
+
|
|
18
79
|
// Schema for create customestimate operation
|
|
19
80
|
const createCustomEstimateSchemaDefinition = z.object({
|
|
20
81
|
is_draft: z.boolean().optional(),
|
|
@@ -22,101 +83,23 @@ const createCustomEstimateSchemaDefinition = z.object({
|
|
|
22
83
|
.string()
|
|
23
84
|
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
24
85
|
.optional(),
|
|
25
|
-
issuer:
|
|
26
|
-
.object({
|
|
27
|
-
name: z.union([z.string(), z.null()]),
|
|
28
|
-
email: z.union([z.string(), z.null()]),
|
|
29
|
-
address: z.union([z.string(), z.null()]),
|
|
30
|
-
address_2: z.union([z.string(), z.null()]),
|
|
31
|
-
post_code: z.union([z.string(), z.null()]),
|
|
32
|
-
city: z.union([z.string(), z.null()]),
|
|
33
|
-
state: z.union([z.string(), z.null()]),
|
|
34
|
-
country: z.union([z.string(), z.null()]),
|
|
35
|
-
country_code: z.union([z.string(), z.null()]),
|
|
36
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
37
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
38
|
-
company_number: z.union([z.string(), z.null()]),
|
|
39
|
-
bank_account: z.union([
|
|
40
|
-
z
|
|
41
|
-
.object({
|
|
42
|
-
type: z
|
|
43
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
44
|
-
.default("iban"),
|
|
45
|
-
name: z.string(),
|
|
46
|
-
bank_name: z.string(),
|
|
47
|
-
iban: z.string(),
|
|
48
|
-
account_number: z.string(),
|
|
49
|
-
bic: z.string(),
|
|
50
|
-
routing_number: z.string(),
|
|
51
|
-
sort_code: z.string(),
|
|
52
|
-
})
|
|
53
|
-
.partial()
|
|
54
|
-
.passthrough(),
|
|
55
|
-
z.null(),
|
|
56
|
-
]),
|
|
57
|
-
})
|
|
58
|
-
.partial()
|
|
59
|
-
.passthrough()
|
|
60
|
-
.optional(),
|
|
86
|
+
issuer: DocumentEntity.optional(),
|
|
61
87
|
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
62
|
-
customer:
|
|
63
|
-
.union([
|
|
88
|
+
customer: DocumentEntity.and(
|
|
89
|
+
z.union([
|
|
64
90
|
z
|
|
65
|
-
.object({
|
|
66
|
-
name: z.union([z.string(), z.null()]),
|
|
67
|
-
email: z.union([z.string(), z.null()]),
|
|
68
|
-
address: z.union([z.string(), z.null()]),
|
|
69
|
-
address_2: z.union([z.string(), z.null()]),
|
|
70
|
-
post_code: z.union([z.string(), z.null()]),
|
|
71
|
-
city: z.union([z.string(), z.null()]),
|
|
72
|
-
state: z.union([z.string(), z.null()]),
|
|
73
|
-
country: z.union([z.string(), z.null()]),
|
|
74
|
-
country_code: z.union([z.string(), z.null()]),
|
|
75
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
76
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
77
|
-
company_number: z.union([z.string(), z.null()]),
|
|
78
|
-
bank_account: z.union([
|
|
79
|
-
z
|
|
80
|
-
.object({
|
|
81
|
-
type: z
|
|
82
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
83
|
-
.default("iban"),
|
|
84
|
-
name: z.string(),
|
|
85
|
-
bank_name: z.string(),
|
|
86
|
-
iban: z.string(),
|
|
87
|
-
account_number: z.string(),
|
|
88
|
-
bic: z.string(),
|
|
89
|
-
routing_number: z.string(),
|
|
90
|
-
sort_code: z.string(),
|
|
91
|
-
})
|
|
92
|
-
.partial()
|
|
93
|
-
.passthrough(),
|
|
94
|
-
z.null(),
|
|
95
|
-
]),
|
|
96
|
-
save_customer: z.boolean().default(true),
|
|
97
|
-
})
|
|
91
|
+
.object({ save_customer: z.boolean().default(true) })
|
|
98
92
|
.partial()
|
|
99
93
|
.passthrough(),
|
|
100
94
|
z.null(),
|
|
101
95
|
])
|
|
102
|
-
|
|
96
|
+
).optional(),
|
|
103
97
|
note: z.union([z.string(), z.null()]).optional(),
|
|
104
98
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
105
99
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
106
100
|
total: z.number(),
|
|
107
101
|
total_with_tax: z.number(),
|
|
108
|
-
taxes: z
|
|
109
|
-
.array(
|
|
110
|
-
z
|
|
111
|
-
.object({
|
|
112
|
-
rate: z.number(),
|
|
113
|
-
base: z.number(),
|
|
114
|
-
amount: z.number(),
|
|
115
|
-
reverse_charge: z.boolean().optional(),
|
|
116
|
-
})
|
|
117
|
-
.passthrough()
|
|
118
|
-
)
|
|
119
|
-
.optional(),
|
|
102
|
+
taxes: z.array(DocumentSummaryTax).optional(),
|
|
120
103
|
currency_code: z.string().max(3).optional(),
|
|
121
104
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
122
105
|
date_valid_till: z.union([z.string(), z.null()]).optional(),
|
|
@@ -133,19 +116,7 @@ const createCustomEstimateSchemaDefinition = z.object({
|
|
|
133
116
|
gross_price: z.number().optional(),
|
|
134
117
|
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
135
118
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
136
|
-
taxes: z
|
|
137
|
-
.array(
|
|
138
|
-
z
|
|
139
|
-
.object({
|
|
140
|
-
rate: z.number(),
|
|
141
|
-
tax_id: z.string(),
|
|
142
|
-
classification: z.string(),
|
|
143
|
-
reverse_charge: z.boolean(),
|
|
144
|
-
amount: z.number(),
|
|
145
|
-
})
|
|
146
|
-
.partial()
|
|
147
|
-
)
|
|
148
|
-
.optional(),
|
|
119
|
+
taxes: z.array(DocumentItemTax).optional(),
|
|
149
120
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
150
121
|
total: z.number(),
|
|
151
122
|
total_with_tax: z.number(),
|
|
@@ -15,6 +15,18 @@ const LineDiscount = z.object({
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
// Dependency schema for custominvoice
|
|
19
|
+
const DocumentItemTax = z
|
|
20
|
+
.object({
|
|
21
|
+
rate: z.number(),
|
|
22
|
+
tax_id: z.string(),
|
|
23
|
+
classification: z.string(),
|
|
24
|
+
reverse_charge: z.boolean(),
|
|
25
|
+
amount: z.number(),
|
|
26
|
+
})
|
|
27
|
+
.partial();
|
|
28
|
+
|
|
29
|
+
|
|
18
30
|
// Dependency schema for custominvoice
|
|
19
31
|
const FinaFiscalizationResponse = z.union([
|
|
20
32
|
z
|
|
@@ -35,6 +47,8 @@ const FinaFiscalizationResponse = z.union([
|
|
|
35
47
|
numbering_sequence: z.string().optional(),
|
|
36
48
|
payload: z.object({}).partial().passthrough(),
|
|
37
49
|
subsequent_submit: z.boolean().optional(),
|
|
50
|
+
issuer_oib: z.string().optional(),
|
|
51
|
+
operator_label: z.string().optional(),
|
|
38
52
|
})
|
|
39
53
|
.passthrough()
|
|
40
54
|
.optional(),
|
|
@@ -44,6 +58,55 @@ const FinaFiscalizationResponse = z.union([
|
|
|
44
58
|
]);
|
|
45
59
|
|
|
46
60
|
|
|
61
|
+
// Dependency schema for custominvoice
|
|
62
|
+
const DocumentSummaryTax = z
|
|
63
|
+
.object({
|
|
64
|
+
rate: z.number(),
|
|
65
|
+
base: z.number(),
|
|
66
|
+
amount: z.number(),
|
|
67
|
+
reverse_charge: z.boolean().optional(),
|
|
68
|
+
})
|
|
69
|
+
.passthrough();
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
// Dependency schema for custominvoice
|
|
73
|
+
const DocumentEntity = z
|
|
74
|
+
.object({
|
|
75
|
+
name: z.union([z.string(), z.null()]),
|
|
76
|
+
email: z.union([z.string(), z.null()]),
|
|
77
|
+
address: z.union([z.string(), z.null()]),
|
|
78
|
+
address_2: z.union([z.string(), z.null()]),
|
|
79
|
+
post_code: z.union([z.string(), z.null()]),
|
|
80
|
+
city: z.union([z.string(), z.null()]),
|
|
81
|
+
state: z.union([z.string(), z.null()]),
|
|
82
|
+
country: z.union([z.string(), z.null()]),
|
|
83
|
+
country_code: z.union([z.string(), z.null()]),
|
|
84
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
85
|
+
tax_number_2: z.union([z.string(), z.null()]),
|
|
86
|
+
company_number: z.union([z.string(), z.null()]),
|
|
87
|
+
bank_account: z.union([
|
|
88
|
+
z
|
|
89
|
+
.object({
|
|
90
|
+
type: z
|
|
91
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
92
|
+
.default("iban"),
|
|
93
|
+
name: z.string(),
|
|
94
|
+
bank_name: z.string(),
|
|
95
|
+
iban: z.string(),
|
|
96
|
+
account_number: z.string(),
|
|
97
|
+
bic: z.string(),
|
|
98
|
+
routing_number: z.string(),
|
|
99
|
+
sort_code: z.string(),
|
|
100
|
+
})
|
|
101
|
+
.partial()
|
|
102
|
+
.passthrough(),
|
|
103
|
+
z.null(),
|
|
104
|
+
]),
|
|
105
|
+
})
|
|
106
|
+
.partial()
|
|
107
|
+
.passthrough();
|
|
108
|
+
|
|
109
|
+
|
|
47
110
|
// Schema for create custominvoice operation
|
|
48
111
|
const createCustomInvoiceSchemaDefinition = z.object({
|
|
49
112
|
is_draft: z.boolean().optional(),
|
|
@@ -51,101 +114,23 @@ const createCustomInvoiceSchemaDefinition = z.object({
|
|
|
51
114
|
.string()
|
|
52
115
|
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
53
116
|
.optional(),
|
|
54
|
-
issuer:
|
|
55
|
-
.object({
|
|
56
|
-
name: z.union([z.string(), z.null()]),
|
|
57
|
-
email: z.union([z.string(), z.null()]),
|
|
58
|
-
address: z.union([z.string(), z.null()]),
|
|
59
|
-
address_2: z.union([z.string(), z.null()]),
|
|
60
|
-
post_code: z.union([z.string(), z.null()]),
|
|
61
|
-
city: z.union([z.string(), z.null()]),
|
|
62
|
-
state: z.union([z.string(), z.null()]),
|
|
63
|
-
country: z.union([z.string(), z.null()]),
|
|
64
|
-
country_code: z.union([z.string(), z.null()]),
|
|
65
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
66
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
67
|
-
company_number: z.union([z.string(), z.null()]),
|
|
68
|
-
bank_account: z.union([
|
|
69
|
-
z
|
|
70
|
-
.object({
|
|
71
|
-
type: z
|
|
72
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
73
|
-
.default("iban"),
|
|
74
|
-
name: z.string(),
|
|
75
|
-
bank_name: z.string(),
|
|
76
|
-
iban: z.string(),
|
|
77
|
-
account_number: z.string(),
|
|
78
|
-
bic: z.string(),
|
|
79
|
-
routing_number: z.string(),
|
|
80
|
-
sort_code: z.string(),
|
|
81
|
-
})
|
|
82
|
-
.partial()
|
|
83
|
-
.passthrough(),
|
|
84
|
-
z.null(),
|
|
85
|
-
]),
|
|
86
|
-
})
|
|
87
|
-
.partial()
|
|
88
|
-
.passthrough()
|
|
89
|
-
.optional(),
|
|
117
|
+
issuer: DocumentEntity.optional(),
|
|
90
118
|
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
91
|
-
customer:
|
|
92
|
-
.union([
|
|
119
|
+
customer: DocumentEntity.and(
|
|
120
|
+
z.union([
|
|
93
121
|
z
|
|
94
|
-
.object({
|
|
95
|
-
name: z.union([z.string(), z.null()]),
|
|
96
|
-
email: z.union([z.string(), z.null()]),
|
|
97
|
-
address: z.union([z.string(), z.null()]),
|
|
98
|
-
address_2: z.union([z.string(), z.null()]),
|
|
99
|
-
post_code: z.union([z.string(), z.null()]),
|
|
100
|
-
city: z.union([z.string(), z.null()]),
|
|
101
|
-
state: z.union([z.string(), z.null()]),
|
|
102
|
-
country: z.union([z.string(), z.null()]),
|
|
103
|
-
country_code: z.union([z.string(), z.null()]),
|
|
104
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
105
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
106
|
-
company_number: z.union([z.string(), z.null()]),
|
|
107
|
-
bank_account: z.union([
|
|
108
|
-
z
|
|
109
|
-
.object({
|
|
110
|
-
type: z
|
|
111
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
112
|
-
.default("iban"),
|
|
113
|
-
name: z.string(),
|
|
114
|
-
bank_name: z.string(),
|
|
115
|
-
iban: z.string(),
|
|
116
|
-
account_number: z.string(),
|
|
117
|
-
bic: z.string(),
|
|
118
|
-
routing_number: z.string(),
|
|
119
|
-
sort_code: z.string(),
|
|
120
|
-
})
|
|
121
|
-
.partial()
|
|
122
|
-
.passthrough(),
|
|
123
|
-
z.null(),
|
|
124
|
-
]),
|
|
125
|
-
save_customer: z.boolean().default(true),
|
|
126
|
-
})
|
|
122
|
+
.object({ save_customer: z.boolean().default(true) })
|
|
127
123
|
.partial()
|
|
128
124
|
.passthrough(),
|
|
129
125
|
z.null(),
|
|
130
126
|
])
|
|
131
|
-
|
|
127
|
+
).optional(),
|
|
132
128
|
note: z.union([z.string(), z.null()]).optional(),
|
|
133
129
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
134
130
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
135
131
|
total: z.number(),
|
|
136
132
|
total_with_tax: z.number(),
|
|
137
|
-
taxes: z
|
|
138
|
-
.array(
|
|
139
|
-
z
|
|
140
|
-
.object({
|
|
141
|
-
rate: z.number(),
|
|
142
|
-
base: z.number(),
|
|
143
|
-
amount: z.number(),
|
|
144
|
-
reverse_charge: z.boolean().optional(),
|
|
145
|
-
})
|
|
146
|
-
.passthrough()
|
|
147
|
-
)
|
|
148
|
-
.optional(),
|
|
133
|
+
taxes: z.array(DocumentSummaryTax).optional(),
|
|
149
134
|
currency_code: z.string().max(3).optional(),
|
|
150
135
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
151
136
|
date_due: z.union([z.string(), z.null()]).optional(),
|
|
@@ -161,19 +146,7 @@ const createCustomInvoiceSchemaDefinition = z.object({
|
|
|
161
146
|
gross_price: z.number().optional(),
|
|
162
147
|
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
163
148
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
164
|
-
taxes: z
|
|
165
|
-
.array(
|
|
166
|
-
z
|
|
167
|
-
.object({
|
|
168
|
-
rate: z.number(),
|
|
169
|
-
tax_id: z.string(),
|
|
170
|
-
classification: z.string(),
|
|
171
|
-
reverse_charge: z.boolean(),
|
|
172
|
-
amount: z.number(),
|
|
173
|
-
})
|
|
174
|
-
.partial()
|
|
175
|
-
)
|
|
176
|
-
.optional(),
|
|
149
|
+
taxes: z.array(DocumentItemTax).optional(),
|
|
177
150
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
178
151
|
total: z.number(),
|
|
179
152
|
total_with_tax: z.number(),
|
|
@@ -24,7 +24,7 @@ const createEntitySchemaDefinition = z.object({
|
|
|
24
24
|
tax_number_2: z.union([z.string(), z.null()]).optional(),
|
|
25
25
|
company_number: z.union([z.string(), z.null()]).optional(),
|
|
26
26
|
email: z.union([z.string(), z.null()]).optional(),
|
|
27
|
-
environment: z.
|
|
27
|
+
environment: z.enum(["live", "sandbox"]).optional(),
|
|
28
28
|
is_tax_subject: z.boolean().optional(),
|
|
29
29
|
is_enabled: z.boolean().optional(),
|
|
30
30
|
settings: z
|
|
@@ -15,6 +15,56 @@ const LineDiscount = z.object({
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
// Dependency schema for estimate
|
|
19
|
+
const DocumentItemTax = z
|
|
20
|
+
.object({
|
|
21
|
+
rate: z.number(),
|
|
22
|
+
tax_id: z.string(),
|
|
23
|
+
classification: z.string(),
|
|
24
|
+
reverse_charge: z.boolean(),
|
|
25
|
+
amount: z.number(),
|
|
26
|
+
})
|
|
27
|
+
.partial();
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Dependency schema for estimate
|
|
31
|
+
const DocumentEntity = z
|
|
32
|
+
.object({
|
|
33
|
+
name: z.union([z.string(), z.null()]),
|
|
34
|
+
email: z.union([z.string(), z.null()]),
|
|
35
|
+
address: z.union([z.string(), z.null()]),
|
|
36
|
+
address_2: z.union([z.string(), z.null()]),
|
|
37
|
+
post_code: z.union([z.string(), z.null()]),
|
|
38
|
+
city: z.union([z.string(), z.null()]),
|
|
39
|
+
state: z.union([z.string(), z.null()]),
|
|
40
|
+
country: z.union([z.string(), z.null()]),
|
|
41
|
+
country_code: z.union([z.string(), z.null()]),
|
|
42
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
43
|
+
tax_number_2: z.union([z.string(), z.null()]),
|
|
44
|
+
company_number: z.union([z.string(), z.null()]),
|
|
45
|
+
bank_account: z.union([
|
|
46
|
+
z
|
|
47
|
+
.object({
|
|
48
|
+
type: z
|
|
49
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
50
|
+
.default("iban"),
|
|
51
|
+
name: z.string(),
|
|
52
|
+
bank_name: z.string(),
|
|
53
|
+
iban: z.string(),
|
|
54
|
+
account_number: z.string(),
|
|
55
|
+
bic: z.string(),
|
|
56
|
+
routing_number: z.string(),
|
|
57
|
+
sort_code: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.partial()
|
|
60
|
+
.passthrough(),
|
|
61
|
+
z.null(),
|
|
62
|
+
]),
|
|
63
|
+
})
|
|
64
|
+
.partial()
|
|
65
|
+
.passthrough();
|
|
66
|
+
|
|
67
|
+
|
|
18
68
|
// Schema for create estimate operation
|
|
19
69
|
const createEstimateSchemaDefinition = z.object({
|
|
20
70
|
is_draft: z.boolean().optional(),
|
|
@@ -22,84 +72,17 @@ const createEstimateSchemaDefinition = z.object({
|
|
|
22
72
|
.string()
|
|
23
73
|
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
24
74
|
.optional(),
|
|
25
|
-
issuer:
|
|
26
|
-
.object({
|
|
27
|
-
name: z.union([z.string(), z.null()]),
|
|
28
|
-
email: z.union([z.string(), z.null()]),
|
|
29
|
-
address: z.union([z.string(), z.null()]),
|
|
30
|
-
address_2: z.union([z.string(), z.null()]),
|
|
31
|
-
post_code: z.union([z.string(), z.null()]),
|
|
32
|
-
city: z.union([z.string(), z.null()]),
|
|
33
|
-
state: z.union([z.string(), z.null()]),
|
|
34
|
-
country: z.union([z.string(), z.null()]),
|
|
35
|
-
country_code: z.union([z.string(), z.null()]),
|
|
36
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
37
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
38
|
-
company_number: z.union([z.string(), z.null()]),
|
|
39
|
-
bank_account: z.union([
|
|
40
|
-
z
|
|
41
|
-
.object({
|
|
42
|
-
type: z
|
|
43
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
44
|
-
.default("iban"),
|
|
45
|
-
name: z.string(),
|
|
46
|
-
bank_name: z.string(),
|
|
47
|
-
iban: z.string(),
|
|
48
|
-
account_number: z.string(),
|
|
49
|
-
bic: z.string(),
|
|
50
|
-
routing_number: z.string(),
|
|
51
|
-
sort_code: z.string(),
|
|
52
|
-
})
|
|
53
|
-
.partial()
|
|
54
|
-
.passthrough(),
|
|
55
|
-
z.null(),
|
|
56
|
-
]),
|
|
57
|
-
})
|
|
58
|
-
.partial()
|
|
59
|
-
.passthrough()
|
|
60
|
-
.optional(),
|
|
75
|
+
issuer: DocumentEntity.optional(),
|
|
61
76
|
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
62
|
-
customer:
|
|
63
|
-
.union([
|
|
77
|
+
customer: DocumentEntity.and(
|
|
78
|
+
z.union([
|
|
64
79
|
z
|
|
65
|
-
.object({
|
|
66
|
-
name: z.union([z.string(), z.null()]),
|
|
67
|
-
email: z.union([z.string(), z.null()]),
|
|
68
|
-
address: z.union([z.string(), z.null()]),
|
|
69
|
-
address_2: z.union([z.string(), z.null()]),
|
|
70
|
-
post_code: z.union([z.string(), z.null()]),
|
|
71
|
-
city: z.union([z.string(), z.null()]),
|
|
72
|
-
state: z.union([z.string(), z.null()]),
|
|
73
|
-
country: z.union([z.string(), z.null()]),
|
|
74
|
-
country_code: z.union([z.string(), z.null()]),
|
|
75
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
76
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
77
|
-
company_number: z.union([z.string(), z.null()]),
|
|
78
|
-
bank_account: z.union([
|
|
79
|
-
z
|
|
80
|
-
.object({
|
|
81
|
-
type: z
|
|
82
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
83
|
-
.default("iban"),
|
|
84
|
-
name: z.string(),
|
|
85
|
-
bank_name: z.string(),
|
|
86
|
-
iban: z.string(),
|
|
87
|
-
account_number: z.string(),
|
|
88
|
-
bic: z.string(),
|
|
89
|
-
routing_number: z.string(),
|
|
90
|
-
sort_code: z.string(),
|
|
91
|
-
})
|
|
92
|
-
.partial()
|
|
93
|
-
.passthrough(),
|
|
94
|
-
z.null(),
|
|
95
|
-
]),
|
|
96
|
-
save_customer: z.boolean().default(true),
|
|
97
|
-
})
|
|
80
|
+
.object({ save_customer: z.boolean().default(true) })
|
|
98
81
|
.partial()
|
|
99
82
|
.passthrough(),
|
|
100
83
|
z.null(),
|
|
101
84
|
])
|
|
102
|
-
|
|
85
|
+
).optional(),
|
|
103
86
|
note: z.union([z.string(), z.null()]).optional(),
|
|
104
87
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
105
88
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
@@ -119,19 +102,7 @@ const createEstimateSchemaDefinition = z.object({
|
|
|
119
102
|
gross_price: z.number().optional(),
|
|
120
103
|
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
121
104
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
122
|
-
taxes: z
|
|
123
|
-
.array(
|
|
124
|
-
z
|
|
125
|
-
.object({
|
|
126
|
-
rate: z.number(),
|
|
127
|
-
tax_id: z.string(),
|
|
128
|
-
classification: z.string(),
|
|
129
|
-
reverse_charge: z.boolean(),
|
|
130
|
-
amount: z.number(),
|
|
131
|
-
})
|
|
132
|
-
.partial()
|
|
133
|
-
)
|
|
134
|
-
.optional(),
|
|
105
|
+
taxes: z.array(DocumentItemTax).optional(),
|
|
135
106
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
136
107
|
metadata: z
|
|
137
108
|
.union([
|
|
@@ -170,81 +141,17 @@ const updateEstimateSchemaDefinition = z
|
|
|
170
141
|
date: z
|
|
171
142
|
.string()
|
|
172
143
|
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/),
|
|
173
|
-
issuer: z
|
|
174
|
-
.object({
|
|
175
|
-
name: z.union([z.string(), z.null()]),
|
|
176
|
-
email: z.union([z.string(), z.null()]),
|
|
177
|
-
address: z.union([z.string(), z.null()]),
|
|
178
|
-
address_2: z.union([z.string(), z.null()]),
|
|
179
|
-
post_code: z.union([z.string(), z.null()]),
|
|
180
|
-
city: z.union([z.string(), z.null()]),
|
|
181
|
-
state: z.union([z.string(), z.null()]),
|
|
182
|
-
country: z.union([z.string(), z.null()]),
|
|
183
|
-
country_code: z.union([z.string(), z.null()]),
|
|
184
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
185
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
186
|
-
company_number: z.union([z.string(), z.null()]),
|
|
187
|
-
bank_account: z.union([
|
|
188
|
-
z
|
|
189
|
-
.object({
|
|
190
|
-
type: z
|
|
191
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
192
|
-
.default("iban"),
|
|
193
|
-
name: z.string(),
|
|
194
|
-
bank_name: z.string(),
|
|
195
|
-
iban: z.string(),
|
|
196
|
-
account_number: z.string(),
|
|
197
|
-
bic: z.string(),
|
|
198
|
-
routing_number: z.string(),
|
|
199
|
-
sort_code: z.string(),
|
|
200
|
-
})
|
|
201
|
-
.partial()
|
|
202
|
-
.passthrough(),
|
|
203
|
-
z.null(),
|
|
204
|
-
]),
|
|
205
|
-
})
|
|
206
|
-
.partial()
|
|
207
|
-
.passthrough(),
|
|
144
|
+
issuer: DocumentEntity.and(z.unknown()),
|
|
208
145
|
customer_id: z.union([z.string(), z.null()]),
|
|
209
|
-
customer:
|
|
210
|
-
z
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
state: z.union([z.string(), z.null()]),
|
|
219
|
-
country: z.union([z.string(), z.null()]),
|
|
220
|
-
country_code: z.union([z.string(), z.null()]),
|
|
221
|
-
tax_number: z.union([z.string(), z.null()]),
|
|
222
|
-
tax_number_2: z.union([z.string(), z.null()]),
|
|
223
|
-
company_number: z.union([z.string(), z.null()]),
|
|
224
|
-
bank_account: z.union([
|
|
225
|
-
z
|
|
226
|
-
.object({
|
|
227
|
-
type: z
|
|
228
|
-
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
229
|
-
.default("iban"),
|
|
230
|
-
name: z.string(),
|
|
231
|
-
bank_name: z.string(),
|
|
232
|
-
iban: z.string(),
|
|
233
|
-
account_number: z.string(),
|
|
234
|
-
bic: z.string(),
|
|
235
|
-
routing_number: z.string(),
|
|
236
|
-
sort_code: z.string(),
|
|
237
|
-
})
|
|
238
|
-
.partial()
|
|
239
|
-
.passthrough(),
|
|
240
|
-
z.null(),
|
|
241
|
-
]),
|
|
242
|
-
save_customer: z.boolean().default(true),
|
|
243
|
-
})
|
|
244
|
-
.partial()
|
|
245
|
-
.passthrough(),
|
|
246
|
-
z.null(),
|
|
247
|
-
]),
|
|
146
|
+
customer: DocumentEntity.and(
|
|
147
|
+
z.union([
|
|
148
|
+
z
|
|
149
|
+
.object({ save_customer: z.boolean().default(true) })
|
|
150
|
+
.partial()
|
|
151
|
+
.passthrough(),
|
|
152
|
+
z.null(),
|
|
153
|
+
])
|
|
154
|
+
),
|
|
248
155
|
items: z
|
|
249
156
|
.array(
|
|
250
157
|
z.object({
|
|
@@ -254,19 +161,7 @@ const updateEstimateSchemaDefinition = z
|
|
|
254
161
|
gross_price: z.number().optional(),
|
|
255
162
|
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
256
163
|
unit: z.union([z.string(), z.null()]).optional(),
|
|
257
|
-
taxes: z
|
|
258
|
-
.array(
|
|
259
|
-
z
|
|
260
|
-
.object({
|
|
261
|
-
rate: z.number(),
|
|
262
|
-
tax_id: z.string(),
|
|
263
|
-
classification: z.string(),
|
|
264
|
-
reverse_charge: z.boolean(),
|
|
265
|
-
amount: z.number(),
|
|
266
|
-
})
|
|
267
|
-
.partial()
|
|
268
|
-
)
|
|
269
|
-
.optional(),
|
|
164
|
+
taxes: z.array(DocumentItemTax).optional(),
|
|
270
165
|
discounts: z.array(LineDiscount).max(5).optional(),
|
|
271
166
|
metadata: z
|
|
272
167
|
.union([
|