@spaceinvoices/react-ui 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +340 -0
- package/cli/dist/index.js +922 -0
- package/package.json +87 -0
- package/registry.json +600 -0
- package/spaceinvoices.schema.json +47 -0
- package/src/app.tsx +25 -0
- package/src/common/autocomplete.tsx +135 -0
- package/src/components/activities/activity-timeline.tsx +160 -0
- package/src/components/activities/index.ts +1 -0
- package/src/components/activities/locales/de.ts +30 -0
- package/src/components/activities/locales/sl.ts +30 -0
- package/src/components/advance-invoices/advance-invoices.hooks.ts +75 -0
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +702 -0
- package/src/components/advance-invoices/create/locales/de.ts +29 -0
- package/src/components/advance-invoices/create/locales/sl.ts +25 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +74 -0
- package/src/components/advance-invoices/index.ts +5 -0
- package/src/components/advance-invoices/list/index.ts +3 -0
- package/src/components/advance-invoices/list/list-row-actions.tsx +119 -0
- package/src/components/advance-invoices/list/list-table.tsx +178 -0
- package/src/components/advance-invoices/list/locales/de.ts +32 -0
- package/src/components/advance-invoices/list/locales/sl.ts +32 -0
- package/src/components/advance-invoices/list/use-advance-invoice-download.ts +63 -0
- package/src/components/button-loader.tsx +11 -0
- package/src/components/combobox.tsx +96 -0
- package/src/components/company-registry/company-registry-autocomplete.tsx +151 -0
- package/src/components/company-registry/company-registry.hooks.ts +67 -0
- package/src/components/company-registry/index.ts +7 -0
- package/src/components/credit-notes/create/create-credit-note-form.tsx +332 -0
- package/src/components/credit-notes/create/index.ts +1 -0
- package/src/components/credit-notes/create/locales/de.ts +69 -0
- package/src/components/credit-notes/create/locales/sl.ts +67 -0
- package/src/components/credit-notes/credit-notes.hooks.ts +22 -0
- package/src/components/credit-notes/index.ts +10 -0
- package/src/components/credit-notes/list/index.ts +3 -0
- package/src/components/credit-notes/list/list-row-actions.tsx +116 -0
- package/src/components/credit-notes/list/list-table.tsx +183 -0
- package/src/components/credit-notes/list/locales/de.ts +33 -0
- package/src/components/credit-notes/list/locales/sl.ts +33 -0
- package/src/components/credit-notes/list/use-credit-note-download.ts +65 -0
- package/src/components/customers/create-customer-form/create-customer-form.tsx +134 -0
- package/src/components/customers/create-customer-form/locales/de.ts +20 -0
- package/src/components/customers/create-customer-form/locales/sl.ts +20 -0
- package/src/components/customers/customer-autocomplete.tsx +173 -0
- package/src/components/customers/customer-combobox.tsx +130 -0
- package/src/components/customers/customer-list-table/customer-list-row-actions.tsx +48 -0
- package/src/components/customers/customer-list-table/customer-list-table.tsx +124 -0
- package/src/components/customers/customer-list-table/index.ts +2 -0
- package/src/components/customers/customer-list-table/locales/de.ts +16 -0
- package/src/components/customers/customer-list-table/locales/sl.ts +16 -0
- package/src/components/customers/customers.hooks.test.ts +348 -0
- package/src/components/customers/customers.hooks.ts +57 -0
- package/src/components/customers/index.ts +5 -0
- package/src/components/dashboard/chart-empty-state.tsx +29 -0
- package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +80 -0
- package/src/components/dashboard/collection-rate-card/index.ts +4 -0
- package/src/components/dashboard/collection-rate-card/locales/sl.ts +3 -0
- package/src/components/dashboard/collection-rate-card/use-collection-rate.ts +74 -0
- package/src/components/dashboard/index.ts +54 -0
- package/src/components/dashboard/invoice-status-chart/index.ts +4 -0
- package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +130 -0
- package/src/components/dashboard/invoice-status-chart/locales/sl.ts +9 -0
- package/src/components/dashboard/invoice-status-chart/use-invoice-status.ts +105 -0
- package/src/components/dashboard/loading-card.tsx +19 -0
- package/src/components/dashboard/payment-methods-chart/index.ts +4 -0
- package/src/components/dashboard/payment-methods-chart/locales/sl.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +152 -0
- package/src/components/dashboard/payment-methods-chart/use-payment-methods.ts +50 -0
- package/src/components/dashboard/payment-trend-chart/index.ts +4 -0
- package/src/components/dashboard/payment-trend-chart/locales/sl.ts +5 -0
- package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +137 -0
- package/src/components/dashboard/payment-trend-chart/use-payment-trend.ts +92 -0
- package/src/components/dashboard/revenue-card.tsx +49 -0
- package/src/components/dashboard/revenue-trend-chart/index.ts +4 -0
- package/src/components/dashboard/revenue-trend-chart/locales/sl.ts +5 -0
- package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +137 -0
- package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +93 -0
- package/src/components/dashboard/shared/index.ts +5 -0
- package/src/components/dashboard/shared/use-revenue-data.ts +160 -0
- package/src/components/dashboard/shared/use-stats-counts.ts +89 -0
- package/src/components/dashboard/shared/use-stats-query.ts +38 -0
- package/src/components/dashboard/stat-card.tsx +41 -0
- package/src/components/dashboard/tax-collected-card/index.ts +2 -0
- package/src/components/dashboard/tax-collected-card/tax-collected-card.tsx +77 -0
- package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +145 -0
- package/src/components/dashboard/top-customers-chart/index.ts +4 -0
- package/src/components/dashboard/top-customers-chart/locales/sl.ts +5 -0
- package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +130 -0
- package/src/components/dashboard/top-customers-chart/use-top-customers.ts +72 -0
- package/src/components/documents/create/document-add-item-form.tsx +379 -0
- package/src/components/documents/create/document-add-item-tax-rate-field.tsx +120 -0
- package/src/components/documents/create/document-details-section.tsx +597 -0
- package/src/components/documents/create/document-items-section.tsx +133 -0
- package/src/components/documents/create/document-recipient-section.tsx +101 -0
- package/src/components/documents/create/form-types.ts +36 -0
- package/src/components/documents/create/index.ts +9 -0
- package/src/components/documents/create/live-preview.tsx +235 -0
- package/src/components/documents/create/mark-as-paid-section.tsx +82 -0
- package/src/components/documents/create/prepare-document-submission.test.ts +132 -0
- package/src/components/documents/create/prepare-document-submission.ts +187 -0
- package/src/components/documents/create/prepare-preview-data.test.ts +155 -0
- package/src/components/documents/create/prepare-preview-data.ts +16 -0
- package/src/components/documents/create/smart-code-insert-button.tsx +139 -0
- package/src/components/documents/create/use-document-customer-form.ts +161 -0
- package/src/components/documents/document-preview.tsx +13 -0
- package/src/components/documents/documents.hooks.ts +146 -0
- package/src/components/documents/index.ts +23 -0
- package/src/components/documents/shared/document-preview-display.tsx +172 -0
- package/src/components/documents/shared/index.ts +3 -0
- package/src/components/documents/shared/scaled-document-preview.tsx +70 -0
- package/src/components/documents/shared/use-a4-scaling.ts +62 -0
- package/src/components/documents/types.ts +61 -0
- package/src/components/documents/view/document-actions-bar.tsx +328 -0
- package/src/components/documents/view/document-details-card.tsx +179 -0
- package/src/components/documents/view/document-payments-list.tsx +256 -0
- package/src/components/documents/view/index.ts +4 -0
- package/src/components/documents/view/locales/de.ts +85 -0
- package/src/components/documents/view/locales/sl.ts +84 -0
- package/src/components/documents/view/use-document-download.ts +125 -0
- package/src/components/entities/create-entity-form.tsx +105 -0
- package/src/components/entities/entities.hooks.ts +50 -0
- package/src/components/entities/entity-settings-form/email-template-variables-info.tsx +103 -0
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +1326 -0
- package/src/components/entities/entity-settings-form/image-upload-with-crop.tsx +222 -0
- package/src/components/entities/entity-settings-form/index.ts +2 -0
- package/src/components/entities/entity-settings-form/input-with-preview.tsx +190 -0
- package/src/components/entities/entity-settings-form/locales/de.ts +192 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +188 -0
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +410 -0
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +320 -0
- package/src/components/entities/furs-settings-form/index.ts +3 -0
- package/src/components/entities/furs-settings-form/locales/de.ts +233 -0
- package/src/components/entities/furs-settings-form/locales/en.ts +194 -0
- package/src/components/entities/furs-settings-form/locales/sl.ts +196 -0
- package/src/components/entities/furs-settings-form/sections/certificate-settings-section.tsx +242 -0
- package/src/components/entities/furs-settings-form/sections/enable-fiscalization-section.tsx +139 -0
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +252 -0
- package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +370 -0
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +420 -0
- package/src/components/entities/keys.ts +2 -0
- package/src/components/entities/settings/branding-settings-form.tsx +274 -0
- package/src/components/entities/settings/company-settings-form.tsx +256 -0
- package/src/components/entities/settings/defaults-settings-form.tsx +501 -0
- package/src/components/entities/settings/email-settings-form.tsx +288 -0
- package/src/components/entities/settings/eslog-settings-form.tsx +113 -0
- package/src/components/entities/settings/index.ts +8 -0
- package/src/components/entities/settings/number-format-settings-form.tsx +244 -0
- package/src/components/entities/settings/pdf-template-selector/demo-invoice-data.ts +164 -0
- package/src/components/entities/settings/pdf-template-selector/index.ts +2 -0
- package/src/components/entities/settings/pdf-template-selector/locales/de.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/locales/sl.ts +18 -0
- package/src/components/entities/settings/pdf-template-selector/pdf-template-cards.tsx +49 -0
- package/src/components/entities/settings/settings-footer.tsx +16 -0
- package/src/components/entities/settings/tax-rules-settings-form.tsx +346 -0
- package/src/components/estimates/create/create-estimate-form.tsx +384 -0
- package/src/components/estimates/create/locales/de.ts +64 -0
- package/src/components/estimates/create/locales/sl.ts +63 -0
- package/src/components/estimates/create/prepare-estimate-submission.ts +39 -0
- package/src/components/estimates/create/use-estimate-customer-form.ts +5 -0
- package/src/components/estimates/estimates.hooks.ts +15 -0
- package/src/components/estimates/index.ts +6 -0
- package/src/components/estimates/list/index.ts +3 -0
- package/src/components/estimates/list/list-row-actions.tsx +103 -0
- package/src/components/estimates/list/list-table.tsx +171 -0
- package/src/components/estimates/list/locales/de.ts +26 -0
- package/src/components/estimates/list/locales/sl.ts +26 -0
- package/src/components/estimates/list/use-estimate-download.ts +63 -0
- package/src/components/export/document-export-form.tsx +288 -0
- package/src/components/export/index.ts +2 -0
- package/src/components/form/form-input.tsx +89 -0
- package/src/components/form/index.ts +1 -0
- package/src/components/invoices/create/create-invoice-form.tsx +852 -0
- package/src/components/invoices/create/eslog-validation.test.ts +242 -0
- package/src/components/invoices/create/eslog-validation.ts +208 -0
- package/src/components/invoices/create/locales/de.ts +118 -0
- package/src/components/invoices/create/locales/sl.ts +114 -0
- package/src/components/invoices/create/prepare-invoice-submission.test.ts +777 -0
- package/src/components/invoices/create/prepare-invoice-submission.ts +79 -0
- package/src/components/invoices/create/use-invoice-customer-form.ts +5 -0
- package/src/components/invoices/index.ts +9 -0
- package/src/components/invoices/invoices-furs.hooks.ts +28 -0
- package/src/components/invoices/invoices.hooks.ts +110 -0
- package/src/components/invoices/list/index.ts +3 -0
- package/src/components/invoices/list/list-row-actions.tsx +132 -0
- package/src/components/invoices/list/list-table.tsx +165 -0
- package/src/components/invoices/list/locales/de.ts +33 -0
- package/src/components/invoices/list/locales/sl.ts +33 -0
- package/src/components/invoices/list/use-invoice-download.ts +62 -0
- package/src/components/invoices/send-email-dialog/index.ts +1 -0
- package/src/components/invoices/send-email-dialog/locales/de.ts +18 -0
- package/src/components/invoices/send-email-dialog/locales/sl.ts +17 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +289 -0
- package/src/components/invoices/send-email-dialog.tsx +2 -0
- package/src/components/invoices/shared/index.ts +2 -0
- package/src/components/invoices/shared/scaled-document-preview.tsx +32 -0
- package/src/components/invoices/shared/use-a4-scaling.tsx +39 -0
- package/src/components/invoices/view/eslog-info-display.tsx +160 -0
- package/src/components/invoices/view/furs-info-display.tsx +213 -0
- package/src/components/items/create-item-form/create-item-form.tsx +155 -0
- package/src/components/items/create-item-form/locales/de.ts +14 -0
- package/src/components/items/create-item-form/locales/en.ts +9 -0
- package/src/components/items/create-item-form/locales/sl.ts +14 -0
- package/src/components/items/item-combobox.tsx +147 -0
- package/src/components/items/item-list-table/item-list-header.tsx +33 -0
- package/src/components/items/item-list-table/item-list-row-actions.tsx +48 -0
- package/src/components/items/item-list-table/item-list-row.tsx +32 -0
- package/src/components/items/item-list-table/item-list-table.tsx +76 -0
- package/src/components/items/item-list-table/locales/de.ts +10 -0
- package/src/components/items/item-list-table/locales/en.ts +10 -0
- package/src/components/items/item-list-table/locales/sl.ts +10 -0
- package/src/components/items/items.hooks.ts +63 -0
- package/src/components/loading-spinner.tsx +24 -0
- package/src/components/payments/create-payment-form/create-payment-form.tsx +222 -0
- package/src/components/payments/create-payment-form/locales/de.ts +20 -0
- package/src/components/payments/create-payment-form/locales/sl.ts +20 -0
- package/src/components/payments/edit-payment-form/edit-payment-form.tsx +230 -0
- package/src/components/payments/edit-payment-form/index.ts +1 -0
- package/src/components/payments/edit-payment-form/locales/de.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/sl.ts +20 -0
- package/src/components/payments/index.ts +4 -0
- package/src/components/payments/list/index.ts +2 -0
- package/src/components/payments/list/list-row-actions.tsx +98 -0
- package/src/components/payments/list/list-table.tsx +186 -0
- package/src/components/payments/list/locales/de.ts +19 -0
- package/src/components/payments/list/locales/sl.ts +19 -0
- package/src/components/payments/payments.hooks.ts +15 -0
- package/src/components/request-logs/index.ts +3 -0
- package/src/components/request-logs/request-log-detail.tsx +242 -0
- package/src/components/request-logs/request-log-list-table.tsx +266 -0
- package/src/components/request-logs/request-logs-page.tsx +10 -0
- package/src/components/table/README.md +410 -0
- package/src/components/table/data-table.tsx +251 -0
- package/src/components/table/date-cell.tsx +35 -0
- package/src/components/table/filter-bar.tsx +114 -0
- package/src/components/table/filter-panel.tsx +407 -0
- package/src/components/table/hooks/use-table-fetch.ts +17 -0
- package/src/components/table/hooks/use-table-query.ts +36 -0
- package/src/components/table/hooks/use-table-state.ts +293 -0
- package/src/components/table/index.ts +35 -0
- package/src/components/table/search-input.tsx +85 -0
- package/src/components/table/sortable-header.tsx +56 -0
- package/src/components/table/table-empty-state.tsx +40 -0
- package/src/components/table/table-no-results.tsx +41 -0
- package/src/components/table/table-pagination.tsx +42 -0
- package/src/components/table/table-skeleton.tsx +54 -0
- package/src/components/table/types.ts +136 -0
- package/src/components/tax-reports/index.ts +1 -0
- package/src/components/tax-reports/kir-export-form.tsx +172 -0
- package/src/components/taxes/create-tax-form/create-tax-form.tsx +112 -0
- package/src/components/taxes/create-tax-form/locales/de.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/en.ts +7 -0
- package/src/components/taxes/create-tax-form/locales/sl.ts +8 -0
- package/src/components/taxes/tax-list-table/locales/de.ts +11 -0
- package/src/components/taxes/tax-list-table/locales/en.ts +10 -0
- package/src/components/taxes/tax-list-table/locales/sl.ts +11 -0
- package/src/components/taxes/tax-list-table/tax-list-header.tsx +29 -0
- package/src/components/taxes/tax-list-table/tax-list-row-actions.tsx +43 -0
- package/src/components/taxes/tax-list-table/tax-list-row.tsx +46 -0
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +59 -0
- package/src/components/taxes/taxes.hooks.ts +35 -0
- package/src/components/ui/alert-dialog.tsx +61 -0
- package/src/components/ui/alert.tsx +72 -0
- package/src/components/ui/badge.tsx +48 -0
- package/src/components/ui/breadcrumb.tsx +132 -0
- package/src/components/ui/button.tsx +61 -0
- package/src/components/ui/calendar.tsx +213 -0
- package/src/components/ui/card.tsx +94 -0
- package/src/components/ui/chart.tsx +380 -0
- package/src/components/ui/checkbox.tsx +27 -0
- package/src/components/ui/collapsible.tsx +56 -0
- package/src/components/ui/command.tsx +187 -0
- package/src/components/ui/dialog.tsx +187 -0
- package/src/components/ui/drawer.tsx +123 -0
- package/src/components/ui/dropdown-menu.tsx +291 -0
- package/src/components/ui/form.tsx +166 -0
- package/src/components/ui/input-group.tsx +149 -0
- package/src/components/ui/input.tsx +20 -0
- package/src/components/ui/label.tsx +18 -0
- package/src/components/ui/loading-spinner.tsx +16 -0
- package/src/components/ui/popover.tsx +108 -0
- package/src/components/ui/radio-group.tsx +37 -0
- package/src/components/ui/select.tsx +200 -0
- package/src/components/ui/separator.tsx +23 -0
- package/src/components/ui/sheet.tsx +145 -0
- package/src/components/ui/sidebar.tsx +771 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/sonner.tsx +60 -0
- package/src/components/ui/spinner.tsx +10 -0
- package/src/components/ui/sticky-form-footer.tsx +55 -0
- package/src/components/ui/switch.tsx +30 -0
- package/src/components/ui/table.tsx +101 -0
- package/src/components/ui/tabs.tsx +80 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/tooltip.tsx +89 -0
- package/src/components/wl-subscription/index.ts +2 -0
- package/src/components/wl-subscription/locked-feature.tsx +173 -0
- package/src/components/wl-subscription/upgrade-modal.tsx +209 -0
- package/src/frontend.tsx +28 -0
- package/src/generate-schemas.ts +265 -0
- package/src/generated/schemas/advanceinvoice.ts +177 -0
- package/src/generated/schemas/creditnote.ts +187 -0
- package/src/generated/schemas/customer.ts +29 -0
- package/src/generated/schemas/entity.ts +252 -0
- package/src/generated/schemas/estimate.ts +159 -0
- package/src/generated/schemas/furssettings.ts +25 -0
- package/src/generated/schemas/index.ts +24 -0
- package/src/generated/schemas/invoice.ts +167 -0
- package/src/generated/schemas/item.ts +38 -0
- package/src/generated/schemas/payment.ts +44 -0
- package/src/generated/schemas/previewadvanceinvoice_body.ts +354 -0
- package/src/generated/schemas/previewestimate_body.ts +309 -0
- package/src/generated/schemas/registerfursmovablepremise_body.ts +22 -0
- package/src/generated/schemas/registerfursrealestatepremise_body.ts +32 -0
- package/src/generated/schemas/renderdocument_body.ts +594 -0
- package/src/generated/schemas/sendemail_body.ts +26 -0
- package/src/generated/schemas/startpdfexport_body.ts +20 -0
- package/src/generated/schemas/tax.ts +48 -0
- package/src/generated/schemas/uploadfile_body.ts +23 -0
- package/src/generated/schemas/uploadfurscertificate_body.ts +20 -0
- package/src/generated/schemas/userfurssettings.ts +19 -0
- package/src/hooks/create-resource-hooks.test.ts +483 -0
- package/src/hooks/create-resource-hooks.ts +300 -0
- package/src/hooks/use-debounce.ts +12 -0
- package/src/hooks/use-duplicate-document.ts +185 -0
- package/src/hooks/use-media-query.tsx +19 -0
- package/src/hooks/use-mobile.ts +39 -0
- package/src/hooks/use-next-document-number.ts +57 -0
- package/src/hooks/use-resource-mutation.ts +118 -0
- package/src/hooks/use-vies-check.ts +130 -0
- package/src/index.css +11 -0
- package/src/index.html +13 -0
- package/src/index.tsx +12 -0
- package/src/lib/auth.ts +4 -0
- package/src/lib/browser-cookies.ts +70 -0
- package/src/lib/constants.ts +287 -0
- package/src/lib/cookies.ts +36 -0
- package/src/lib/schemas/advance-invoice.ts +43 -0
- package/src/lib/schemas/credit-note.ts +32 -0
- package/src/lib/schemas/estimate.ts +31 -0
- package/src/lib/schemas/index.ts +18 -0
- package/src/lib/schemas/invoice.ts +43 -0
- package/src/lib/schemas/shared.ts +79 -0
- package/src/lib/translation.ts +38 -0
- package/src/lib/utils.ts +6 -0
- package/src/providers/entities-context.tsx +41 -0
- package/src/providers/entities-provider.tsx +201 -0
- package/src/providers/form-footer-context.tsx +72 -0
- package/src/providers/sdk-provider.tsx +164 -0
- package/src/providers/white-label-provider.tsx +91 -0
- package/src/providers/wl-subscription-provider.tsx +277 -0
- package/src/utils/string-helpers.ts +111 -0
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated using 'bun generate-schemas'.
|
|
3
|
+
* Do not edit this file manually. To update, run the generator again.
|
|
4
|
+
* @generated
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
// Schemas for renderdocument_body endpoints
|
|
10
|
+
|
|
11
|
+
// Dependency schema for renderdocument_body
|
|
12
|
+
const LineDiscount = z.object({
|
|
13
|
+
value: z.number().gte(0),
|
|
14
|
+
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
// Dependency schema for renderdocument_body
|
|
19
|
+
const CompleteEstimatePreview = z.object({
|
|
20
|
+
is_draft: z.boolean().optional(),
|
|
21
|
+
date: z
|
|
22
|
+
.string()
|
|
23
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
24
|
+
.optional(),
|
|
25
|
+
issuer: z
|
|
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
|
+
bank_account: z.union([
|
|
38
|
+
z
|
|
39
|
+
.object({
|
|
40
|
+
type: z
|
|
41
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
42
|
+
.default("iban"),
|
|
43
|
+
name: z.string(),
|
|
44
|
+
bank_name: z.string(),
|
|
45
|
+
iban: z.string(),
|
|
46
|
+
account_number: z.string(),
|
|
47
|
+
bic: z.string(),
|
|
48
|
+
routing_number: z.string(),
|
|
49
|
+
sort_code: z.string(),
|
|
50
|
+
})
|
|
51
|
+
.partial()
|
|
52
|
+
.passthrough(),
|
|
53
|
+
z.null(),
|
|
54
|
+
]),
|
|
55
|
+
})
|
|
56
|
+
.partial()
|
|
57
|
+
.passthrough()
|
|
58
|
+
.optional(),
|
|
59
|
+
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
60
|
+
customer: z
|
|
61
|
+
.union([
|
|
62
|
+
z
|
|
63
|
+
.object({
|
|
64
|
+
name: z.union([z.string(), z.null()]),
|
|
65
|
+
email: z.union([z.string(), z.null()]),
|
|
66
|
+
address: z.union([z.string(), z.null()]),
|
|
67
|
+
address_2: z.union([z.string(), z.null()]),
|
|
68
|
+
post_code: z.union([z.string(), z.null()]),
|
|
69
|
+
city: z.union([z.string(), z.null()]),
|
|
70
|
+
state: z.union([z.string(), z.null()]),
|
|
71
|
+
country: z.union([z.string(), z.null()]),
|
|
72
|
+
country_code: z.union([z.string(), z.null()]),
|
|
73
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
74
|
+
bank_account: z.union([
|
|
75
|
+
z
|
|
76
|
+
.object({
|
|
77
|
+
type: z
|
|
78
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
79
|
+
.default("iban"),
|
|
80
|
+
name: z.string(),
|
|
81
|
+
bank_name: z.string(),
|
|
82
|
+
iban: z.string(),
|
|
83
|
+
account_number: z.string(),
|
|
84
|
+
bic: z.string(),
|
|
85
|
+
routing_number: z.string(),
|
|
86
|
+
sort_code: z.string(),
|
|
87
|
+
})
|
|
88
|
+
.partial()
|
|
89
|
+
.passthrough(),
|
|
90
|
+
z.null(),
|
|
91
|
+
]),
|
|
92
|
+
save_customer: z.boolean().default(true),
|
|
93
|
+
})
|
|
94
|
+
.partial()
|
|
95
|
+
.passthrough(),
|
|
96
|
+
z.null(),
|
|
97
|
+
])
|
|
98
|
+
.optional(),
|
|
99
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
100
|
+
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
101
|
+
currency_code: z.string().max(3).optional(),
|
|
102
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
103
|
+
date_valid_till: z.union([z.string(), z.null()]).optional(),
|
|
104
|
+
title_type: z.union([z.enum(["estimate", "quote"]), z.null()]).optional(),
|
|
105
|
+
date_due: z.union([z.string(), z.null()]).optional(),
|
|
106
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
107
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
108
|
+
items: z
|
|
109
|
+
.array(
|
|
110
|
+
z.object({
|
|
111
|
+
name: z.string().min(1),
|
|
112
|
+
description: z.union([z.string(), z.null()]).optional(),
|
|
113
|
+
price: z.number().optional(),
|
|
114
|
+
gross_price: z.number().optional(),
|
|
115
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
116
|
+
unit: z.union([z.string(), z.null()]).optional(),
|
|
117
|
+
taxes: z
|
|
118
|
+
.array(
|
|
119
|
+
z
|
|
120
|
+
.object({
|
|
121
|
+
rate: z.number(),
|
|
122
|
+
tax_id: z.string(),
|
|
123
|
+
classification: z.string(),
|
|
124
|
+
reverse_charge: z.boolean(),
|
|
125
|
+
amount: z.number(),
|
|
126
|
+
})
|
|
127
|
+
.partial()
|
|
128
|
+
)
|
|
129
|
+
.optional(),
|
|
130
|
+
discounts: z.array(LineDiscount).max(5).optional(),
|
|
131
|
+
metadata: z
|
|
132
|
+
.union([
|
|
133
|
+
z.string(),
|
|
134
|
+
z.number(),
|
|
135
|
+
z.boolean(),
|
|
136
|
+
z.null(),
|
|
137
|
+
z.object({}).partial().passthrough(),
|
|
138
|
+
z.array(z.unknown()),
|
|
139
|
+
z.null(),
|
|
140
|
+
])
|
|
141
|
+
.optional(),
|
|
142
|
+
})
|
|
143
|
+
)
|
|
144
|
+
.min(1),
|
|
145
|
+
eslog: z
|
|
146
|
+
.union([
|
|
147
|
+
z
|
|
148
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
149
|
+
.partial()
|
|
150
|
+
.passthrough(),
|
|
151
|
+
z.null(),
|
|
152
|
+
])
|
|
153
|
+
.optional(),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
// Dependency schema for renderdocument_body
|
|
158
|
+
const PartialEstimatePreview = z.object({
|
|
159
|
+
is_draft: z.boolean().optional(),
|
|
160
|
+
date: z
|
|
161
|
+
.string()
|
|
162
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
163
|
+
.optional(),
|
|
164
|
+
issuer: z
|
|
165
|
+
.object({
|
|
166
|
+
name: z.union([z.string(), z.null()]),
|
|
167
|
+
email: z.union([z.string(), z.null()]),
|
|
168
|
+
address: z.union([z.string(), z.null()]),
|
|
169
|
+
address_2: z.union([z.string(), z.null()]),
|
|
170
|
+
post_code: z.union([z.string(), z.null()]),
|
|
171
|
+
city: z.union([z.string(), z.null()]),
|
|
172
|
+
state: z.union([z.string(), z.null()]),
|
|
173
|
+
country: z.union([z.string(), z.null()]),
|
|
174
|
+
country_code: z.union([z.string(), z.null()]),
|
|
175
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
176
|
+
bank_account: z.union([
|
|
177
|
+
z
|
|
178
|
+
.object({
|
|
179
|
+
type: z
|
|
180
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
181
|
+
.default("iban"),
|
|
182
|
+
name: z.string(),
|
|
183
|
+
bank_name: z.string(),
|
|
184
|
+
iban: z.string(),
|
|
185
|
+
account_number: z.string(),
|
|
186
|
+
bic: z.string(),
|
|
187
|
+
routing_number: z.string(),
|
|
188
|
+
sort_code: z.string(),
|
|
189
|
+
})
|
|
190
|
+
.partial()
|
|
191
|
+
.passthrough(),
|
|
192
|
+
z.null(),
|
|
193
|
+
]),
|
|
194
|
+
})
|
|
195
|
+
.partial()
|
|
196
|
+
.passthrough()
|
|
197
|
+
.optional(),
|
|
198
|
+
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
199
|
+
customer: z
|
|
200
|
+
.union([
|
|
201
|
+
z
|
|
202
|
+
.object({
|
|
203
|
+
name: z.union([z.string(), z.null()]),
|
|
204
|
+
email: z.union([z.string(), z.null()]),
|
|
205
|
+
address: z.union([z.string(), z.null()]),
|
|
206
|
+
address_2: z.union([z.string(), z.null()]),
|
|
207
|
+
post_code: z.union([z.string(), z.null()]),
|
|
208
|
+
city: z.union([z.string(), z.null()]),
|
|
209
|
+
state: z.union([z.string(), z.null()]),
|
|
210
|
+
country: z.union([z.string(), z.null()]),
|
|
211
|
+
country_code: z.union([z.string(), z.null()]),
|
|
212
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
213
|
+
bank_account: z.union([
|
|
214
|
+
z
|
|
215
|
+
.object({
|
|
216
|
+
type: z
|
|
217
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
218
|
+
.default("iban"),
|
|
219
|
+
name: z.string(),
|
|
220
|
+
bank_name: z.string(),
|
|
221
|
+
iban: z.string(),
|
|
222
|
+
account_number: z.string(),
|
|
223
|
+
bic: z.string(),
|
|
224
|
+
routing_number: z.string(),
|
|
225
|
+
sort_code: z.string(),
|
|
226
|
+
})
|
|
227
|
+
.partial()
|
|
228
|
+
.passthrough(),
|
|
229
|
+
z.null(),
|
|
230
|
+
]),
|
|
231
|
+
save_customer: z.boolean().default(true),
|
|
232
|
+
})
|
|
233
|
+
.partial()
|
|
234
|
+
.passthrough(),
|
|
235
|
+
z.null(),
|
|
236
|
+
])
|
|
237
|
+
.optional(),
|
|
238
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
239
|
+
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
240
|
+
currency_code: z.string().max(3).optional(),
|
|
241
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
242
|
+
date_valid_till: z.union([z.string(), z.null()]).optional(),
|
|
243
|
+
title_type: z.union([z.enum(["estimate", "quote"]), z.null()]).optional(),
|
|
244
|
+
date_due: z.union([z.string(), z.null()]).optional(),
|
|
245
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
246
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
247
|
+
items: z
|
|
248
|
+
.array(
|
|
249
|
+
z
|
|
250
|
+
.object({
|
|
251
|
+
name: z.string(),
|
|
252
|
+
quantity: z.number(),
|
|
253
|
+
price: z.number(),
|
|
254
|
+
gross_price: z.number(),
|
|
255
|
+
description: z.string(),
|
|
256
|
+
taxes: z.array(
|
|
257
|
+
z
|
|
258
|
+
.object({ rate: z.number(), tax_id: z.string() })
|
|
259
|
+
.partial()
|
|
260
|
+
.passthrough()
|
|
261
|
+
),
|
|
262
|
+
metadata: z.record(z.string(), z.any()),
|
|
263
|
+
})
|
|
264
|
+
.partial()
|
|
265
|
+
.passthrough()
|
|
266
|
+
)
|
|
267
|
+
.min(1),
|
|
268
|
+
eslog: z
|
|
269
|
+
.union([
|
|
270
|
+
z
|
|
271
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
272
|
+
.partial()
|
|
273
|
+
.passthrough(),
|
|
274
|
+
z.null(),
|
|
275
|
+
])
|
|
276
|
+
.optional(),
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
// Dependency schema for renderdocument_body
|
|
281
|
+
const CompleteDocumentPreview = z.object({
|
|
282
|
+
is_draft: z.boolean().optional(),
|
|
283
|
+
date: z
|
|
284
|
+
.string()
|
|
285
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
286
|
+
.optional(),
|
|
287
|
+
issuer: z
|
|
288
|
+
.object({
|
|
289
|
+
name: z.union([z.string(), z.null()]),
|
|
290
|
+
email: z.union([z.string(), z.null()]),
|
|
291
|
+
address: z.union([z.string(), z.null()]),
|
|
292
|
+
address_2: z.union([z.string(), z.null()]),
|
|
293
|
+
post_code: z.union([z.string(), z.null()]),
|
|
294
|
+
city: z.union([z.string(), z.null()]),
|
|
295
|
+
state: z.union([z.string(), z.null()]),
|
|
296
|
+
country: z.union([z.string(), z.null()]),
|
|
297
|
+
country_code: z.union([z.string(), z.null()]),
|
|
298
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
299
|
+
bank_account: z.union([
|
|
300
|
+
z
|
|
301
|
+
.object({
|
|
302
|
+
type: z
|
|
303
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
304
|
+
.default("iban"),
|
|
305
|
+
name: z.string(),
|
|
306
|
+
bank_name: z.string(),
|
|
307
|
+
iban: z.string(),
|
|
308
|
+
account_number: z.string(),
|
|
309
|
+
bic: z.string(),
|
|
310
|
+
routing_number: z.string(),
|
|
311
|
+
sort_code: z.string(),
|
|
312
|
+
})
|
|
313
|
+
.partial()
|
|
314
|
+
.passthrough(),
|
|
315
|
+
z.null(),
|
|
316
|
+
]),
|
|
317
|
+
})
|
|
318
|
+
.partial()
|
|
319
|
+
.passthrough()
|
|
320
|
+
.optional(),
|
|
321
|
+
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
322
|
+
customer: z
|
|
323
|
+
.union([
|
|
324
|
+
z
|
|
325
|
+
.object({
|
|
326
|
+
name: z.union([z.string(), z.null()]),
|
|
327
|
+
email: z.union([z.string(), z.null()]),
|
|
328
|
+
address: z.union([z.string(), z.null()]),
|
|
329
|
+
address_2: z.union([z.string(), z.null()]),
|
|
330
|
+
post_code: z.union([z.string(), z.null()]),
|
|
331
|
+
city: z.union([z.string(), z.null()]),
|
|
332
|
+
state: z.union([z.string(), z.null()]),
|
|
333
|
+
country: z.union([z.string(), z.null()]),
|
|
334
|
+
country_code: z.union([z.string(), z.null()]),
|
|
335
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
336
|
+
bank_account: z.union([
|
|
337
|
+
z
|
|
338
|
+
.object({
|
|
339
|
+
type: z
|
|
340
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
341
|
+
.default("iban"),
|
|
342
|
+
name: z.string(),
|
|
343
|
+
bank_name: z.string(),
|
|
344
|
+
iban: z.string(),
|
|
345
|
+
account_number: z.string(),
|
|
346
|
+
bic: z.string(),
|
|
347
|
+
routing_number: z.string(),
|
|
348
|
+
sort_code: z.string(),
|
|
349
|
+
})
|
|
350
|
+
.partial()
|
|
351
|
+
.passthrough(),
|
|
352
|
+
z.null(),
|
|
353
|
+
]),
|
|
354
|
+
save_customer: z.boolean().default(true),
|
|
355
|
+
})
|
|
356
|
+
.partial()
|
|
357
|
+
.passthrough(),
|
|
358
|
+
z.null(),
|
|
359
|
+
])
|
|
360
|
+
.optional(),
|
|
361
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
362
|
+
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
363
|
+
currency_code: z.string().max(3).optional(),
|
|
364
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
365
|
+
date_due: z.union([z.string(), z.null()]).optional(),
|
|
366
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
367
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
368
|
+
items: z
|
|
369
|
+
.array(
|
|
370
|
+
z.object({
|
|
371
|
+
name: z.string().min(1),
|
|
372
|
+
description: z.union([z.string(), z.null()]).optional(),
|
|
373
|
+
price: z.number().optional(),
|
|
374
|
+
gross_price: z.number().optional(),
|
|
375
|
+
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
376
|
+
unit: z.union([z.string(), z.null()]).optional(),
|
|
377
|
+
taxes: z
|
|
378
|
+
.array(
|
|
379
|
+
z
|
|
380
|
+
.object({
|
|
381
|
+
rate: z.number(),
|
|
382
|
+
tax_id: z.string(),
|
|
383
|
+
classification: z.string(),
|
|
384
|
+
reverse_charge: z.boolean(),
|
|
385
|
+
amount: z.number(),
|
|
386
|
+
})
|
|
387
|
+
.partial()
|
|
388
|
+
)
|
|
389
|
+
.optional(),
|
|
390
|
+
discounts: z.array(LineDiscount).max(5).optional(),
|
|
391
|
+
metadata: z
|
|
392
|
+
.union([
|
|
393
|
+
z.string(),
|
|
394
|
+
z.number(),
|
|
395
|
+
z.boolean(),
|
|
396
|
+
z.null(),
|
|
397
|
+
z.object({}).partial().passthrough(),
|
|
398
|
+
z.array(z.unknown()),
|
|
399
|
+
z.null(),
|
|
400
|
+
])
|
|
401
|
+
.optional(),
|
|
402
|
+
})
|
|
403
|
+
)
|
|
404
|
+
.min(1),
|
|
405
|
+
linked_documents: z.array(z.string().min(1)).optional(),
|
|
406
|
+
payment: z
|
|
407
|
+
.union([
|
|
408
|
+
z.object({
|
|
409
|
+
credit_note_id: z.union([z.string(), z.null()]).optional(),
|
|
410
|
+
advance_invoice_id: z.union([z.string(), z.null()]).optional(),
|
|
411
|
+
amount: z.number().gt(0).optional(),
|
|
412
|
+
type: z.string().max(20),
|
|
413
|
+
date: z.string().optional(),
|
|
414
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
415
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
416
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
417
|
+
}),
|
|
418
|
+
z.null(),
|
|
419
|
+
])
|
|
420
|
+
.optional(),
|
|
421
|
+
furs: z
|
|
422
|
+
.union([
|
|
423
|
+
z
|
|
424
|
+
.object({
|
|
425
|
+
business_premise_name: z.string().min(1),
|
|
426
|
+
electronic_device_name: z.string().min(1),
|
|
427
|
+
operator_tax_number: z.string(),
|
|
428
|
+
operator_label: z.string(),
|
|
429
|
+
skip: z.boolean(),
|
|
430
|
+
})
|
|
431
|
+
.partial(),
|
|
432
|
+
z.null(),
|
|
433
|
+
])
|
|
434
|
+
.optional(),
|
|
435
|
+
eslog: z
|
|
436
|
+
.union([
|
|
437
|
+
z
|
|
438
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
439
|
+
.partial()
|
|
440
|
+
.passthrough(),
|
|
441
|
+
z.null(),
|
|
442
|
+
])
|
|
443
|
+
.optional(),
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
// Dependency schema for renderdocument_body
|
|
448
|
+
const PartialDocumentPreview = z.object({
|
|
449
|
+
is_draft: z.boolean().optional(),
|
|
450
|
+
date: z
|
|
451
|
+
.string()
|
|
452
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/)
|
|
453
|
+
.optional(),
|
|
454
|
+
issuer: z
|
|
455
|
+
.object({
|
|
456
|
+
name: z.union([z.string(), z.null()]),
|
|
457
|
+
email: z.union([z.string(), z.null()]),
|
|
458
|
+
address: z.union([z.string(), z.null()]),
|
|
459
|
+
address_2: z.union([z.string(), z.null()]),
|
|
460
|
+
post_code: z.union([z.string(), z.null()]),
|
|
461
|
+
city: z.union([z.string(), z.null()]),
|
|
462
|
+
state: z.union([z.string(), z.null()]),
|
|
463
|
+
country: z.union([z.string(), z.null()]),
|
|
464
|
+
country_code: z.union([z.string(), z.null()]),
|
|
465
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
466
|
+
bank_account: z.union([
|
|
467
|
+
z
|
|
468
|
+
.object({
|
|
469
|
+
type: z
|
|
470
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
471
|
+
.default("iban"),
|
|
472
|
+
name: z.string(),
|
|
473
|
+
bank_name: z.string(),
|
|
474
|
+
iban: z.string(),
|
|
475
|
+
account_number: z.string(),
|
|
476
|
+
bic: z.string(),
|
|
477
|
+
routing_number: z.string(),
|
|
478
|
+
sort_code: z.string(),
|
|
479
|
+
})
|
|
480
|
+
.partial()
|
|
481
|
+
.passthrough(),
|
|
482
|
+
z.null(),
|
|
483
|
+
]),
|
|
484
|
+
})
|
|
485
|
+
.partial()
|
|
486
|
+
.passthrough()
|
|
487
|
+
.optional(),
|
|
488
|
+
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
489
|
+
customer: z
|
|
490
|
+
.union([
|
|
491
|
+
z
|
|
492
|
+
.object({
|
|
493
|
+
name: z.union([z.string(), z.null()]),
|
|
494
|
+
email: z.union([z.string(), z.null()]),
|
|
495
|
+
address: z.union([z.string(), z.null()]),
|
|
496
|
+
address_2: z.union([z.string(), z.null()]),
|
|
497
|
+
post_code: z.union([z.string(), z.null()]),
|
|
498
|
+
city: z.union([z.string(), z.null()]),
|
|
499
|
+
state: z.union([z.string(), z.null()]),
|
|
500
|
+
country: z.union([z.string(), z.null()]),
|
|
501
|
+
country_code: z.union([z.string(), z.null()]),
|
|
502
|
+
tax_number: z.union([z.string(), z.null()]),
|
|
503
|
+
bank_account: z.union([
|
|
504
|
+
z
|
|
505
|
+
.object({
|
|
506
|
+
type: z
|
|
507
|
+
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
508
|
+
.default("iban"),
|
|
509
|
+
name: z.string(),
|
|
510
|
+
bank_name: z.string(),
|
|
511
|
+
iban: z.string(),
|
|
512
|
+
account_number: z.string(),
|
|
513
|
+
bic: z.string(),
|
|
514
|
+
routing_number: z.string(),
|
|
515
|
+
sort_code: z.string(),
|
|
516
|
+
})
|
|
517
|
+
.partial()
|
|
518
|
+
.passthrough(),
|
|
519
|
+
z.null(),
|
|
520
|
+
]),
|
|
521
|
+
save_customer: z.boolean().default(true),
|
|
522
|
+
})
|
|
523
|
+
.partial()
|
|
524
|
+
.passthrough(),
|
|
525
|
+
z.null(),
|
|
526
|
+
])
|
|
527
|
+
.optional(),
|
|
528
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
529
|
+
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
530
|
+
currency_code: z.string().max(3).optional(),
|
|
531
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
532
|
+
date_due: z.union([z.string(), z.null()]).optional(),
|
|
533
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
534
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
535
|
+
items: z
|
|
536
|
+
.array(
|
|
537
|
+
z
|
|
538
|
+
.object({
|
|
539
|
+
name: z.string(),
|
|
540
|
+
quantity: z.number(),
|
|
541
|
+
price: z.number(),
|
|
542
|
+
gross_price: z.number(),
|
|
543
|
+
description: z.string(),
|
|
544
|
+
taxes: z.array(
|
|
545
|
+
z
|
|
546
|
+
.object({ rate: z.number(), tax_id: z.string() })
|
|
547
|
+
.partial()
|
|
548
|
+
.passthrough()
|
|
549
|
+
),
|
|
550
|
+
metadata: z.record(z.string(), z.any()),
|
|
551
|
+
})
|
|
552
|
+
.partial()
|
|
553
|
+
.passthrough()
|
|
554
|
+
)
|
|
555
|
+
.min(1),
|
|
556
|
+
linked_documents: z.array(z.string().min(1)).optional(),
|
|
557
|
+
furs: z
|
|
558
|
+
.union([
|
|
559
|
+
z
|
|
560
|
+
.object({
|
|
561
|
+
business_premise_name: z.string().min(1),
|
|
562
|
+
electronic_device_name: z.string().min(1),
|
|
563
|
+
operator_tax_number: z.string(),
|
|
564
|
+
operator_label: z.string(),
|
|
565
|
+
skip: z.boolean(),
|
|
566
|
+
})
|
|
567
|
+
.partial(),
|
|
568
|
+
z.null(),
|
|
569
|
+
])
|
|
570
|
+
.optional(),
|
|
571
|
+
eslog: z
|
|
572
|
+
.union([
|
|
573
|
+
z
|
|
574
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
575
|
+
.partial()
|
|
576
|
+
.passthrough(),
|
|
577
|
+
z.null(),
|
|
578
|
+
])
|
|
579
|
+
.optional(),
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
// Schema for render document operation
|
|
584
|
+
const renderDocumentSchemaDefinition = z.union([
|
|
585
|
+
PartialDocumentPreview,
|
|
586
|
+
CompleteDocumentPreview,
|
|
587
|
+
PartialEstimatePreview,
|
|
588
|
+
CompleteEstimatePreview,
|
|
589
|
+
]);
|
|
590
|
+
|
|
591
|
+
// Type for render document operation
|
|
592
|
+
export type RenderDocumentSchema = z.infer<typeof renderDocumentSchemaDefinition>;
|
|
593
|
+
|
|
594
|
+
export const renderDocumentSchema = renderDocumentSchemaDefinition;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated using 'bun generate-schemas'.
|
|
3
|
+
* Do not edit this file manually. To update, run the generator again.
|
|
4
|
+
* @generated
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
// Schemas for sendemail_body endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for send email operation
|
|
12
|
+
const sendEmailSchemaDefinition = z
|
|
13
|
+
.object({
|
|
14
|
+
to: z.string().email(),
|
|
15
|
+
subject: z.string().min(1).max(255).optional(),
|
|
16
|
+
bodyText: z.string().min(1).optional(),
|
|
17
|
+
documentId: z.string().optional(),
|
|
18
|
+
attachPdf: z.boolean().optional().default(false),
|
|
19
|
+
attachEslog: z.boolean().optional().default(false),
|
|
20
|
+
})
|
|
21
|
+
.passthrough();
|
|
22
|
+
|
|
23
|
+
// Type for send email operation
|
|
24
|
+
export type SendEmailSchema = z.infer<typeof sendEmailSchemaDefinition>;
|
|
25
|
+
|
|
26
|
+
export const sendEmailSchema = sendEmailSchemaDefinition;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated using 'bun generate-schemas'.
|
|
3
|
+
* Do not edit this file manually. To update, run the generator again.
|
|
4
|
+
* @generated
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
// Schemas for startpdfexport_body endpoints
|
|
10
|
+
|
|
11
|
+
// Dependency schema for startpdfexport_body
|
|
12
|
+
const startPdfExport_Body = z
|
|
13
|
+
.object({
|
|
14
|
+
type: z.enum(["invoice", "estimate", "credit_note"]),
|
|
15
|
+
date_from: z.string().optional(),
|
|
16
|
+
date_to: z.string().optional(),
|
|
17
|
+
})
|
|
18
|
+
.passthrough();
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated using 'bun generate-schemas'.
|
|
3
|
+
* Do not edit this file manually. To update, run the generator again.
|
|
4
|
+
* @generated
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
// Schemas for tax endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for create tax operation
|
|
12
|
+
const createTaxSchemaDefinition = z.object({
|
|
13
|
+
name: z.string().max(100).optional(),
|
|
14
|
+
tax_rates: z
|
|
15
|
+
.array(
|
|
16
|
+
z.object({
|
|
17
|
+
rate: z.number().gte(0).lte(100),
|
|
18
|
+
valid_from: z.union([z.string(), z.null()]).optional(),
|
|
19
|
+
})
|
|
20
|
+
)
|
|
21
|
+
.min(1),
|
|
22
|
+
is_default: z.boolean().optional(),
|
|
23
|
+
classification: z.union([z.string(), z.null()]).optional(),
|
|
24
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Type for create tax operation
|
|
28
|
+
export type CreateTaxSchema = z.infer<typeof createTaxSchemaDefinition>;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Schema for update tax operation
|
|
32
|
+
const updateTaxSchemaDefinition = z.object({
|
|
33
|
+
tax_rates: z
|
|
34
|
+
.array(
|
|
35
|
+
z.object({
|
|
36
|
+
rate: z.number().gte(0).lte(100),
|
|
37
|
+
valid_from: z.union([z.string(), z.null()]).optional(),
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
.min(1),
|
|
41
|
+
is_default: z.boolean().optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Type for update tax operation
|
|
45
|
+
export type UpdateTaxSchema = z.infer<typeof updateTaxSchemaDefinition>;
|
|
46
|
+
|
|
47
|
+
export const createTaxSchema = createTaxSchemaDefinition;
|
|
48
|
+
export const updateTaxSchema = updateTaxSchemaDefinition;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated using 'bun generate-schemas'.
|
|
3
|
+
* Do not edit this file manually. To update, run the generator again.
|
|
4
|
+
* @generated
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
// Schemas for uploadfile_body endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for upload file operation
|
|
12
|
+
const uploadFileSchemaDefinition = z
|
|
13
|
+
.object({
|
|
14
|
+
file: z.instanceof(File).optional(),
|
|
15
|
+
category: z.enum(["logo", "signature", "attachment"]),
|
|
16
|
+
account_payable_id: z.string().optional(),
|
|
17
|
+
})
|
|
18
|
+
.passthrough();
|
|
19
|
+
|
|
20
|
+
// Type for upload file operation
|
|
21
|
+
export type UploadFileSchema = z.infer<typeof uploadFileSchemaDefinition>;
|
|
22
|
+
|
|
23
|
+
export const uploadFileSchema = uploadFileSchemaDefinition;
|