@spaceinvoices/react-ui 0.4.12 → 0.4.32
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/src/common/autocomplete.tsx +7 -1
- package/src/components/advance-invoices/advance-invoices.hooks.ts +35 -44
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +190 -73
- package/src/components/advance-invoices/create/locales/bg.ts +17 -9
- package/src/components/advance-invoices/create/locales/cs.ts +17 -9
- package/src/components/advance-invoices/create/locales/de.ts +15 -7
- package/src/components/advance-invoices/create/locales/en.ts +15 -7
- package/src/components/advance-invoices/create/locales/es.ts +15 -7
- package/src/components/advance-invoices/create/locales/et.ts +17 -9
- package/src/components/advance-invoices/create/locales/fi.ts +18 -10
- package/src/components/advance-invoices/create/locales/fr.ts +16 -8
- package/src/components/advance-invoices/create/locales/hr.ts +15 -7
- package/src/components/advance-invoices/create/locales/is.ts +17 -9
- package/src/components/advance-invoices/create/locales/it.ts +15 -7
- package/src/components/advance-invoices/create/locales/nb.ts +17 -9
- package/src/components/advance-invoices/create/locales/nl.ts +15 -7
- package/src/components/advance-invoices/create/locales/pl.ts +17 -9
- package/src/components/advance-invoices/create/locales/pt.ts +16 -8
- package/src/components/advance-invoices/create/locales/sk.ts +17 -9
- package/src/components/advance-invoices/create/locales/sl.ts +14 -5
- package/src/components/advance-invoices/create/locales/sv.ts +17 -9
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +47 -1
- package/src/components/advance-invoices/list/list-table.tsx +2 -1
- package/src/components/credit-notes/create/create-credit-note-form.tsx +254 -85
- package/src/components/credit-notes/create/locales/bg.ts +22 -8
- package/src/components/credit-notes/create/locales/cs.ts +22 -8
- package/src/components/credit-notes/create/locales/de.ts +20 -7
- package/src/components/credit-notes/create/locales/en.ts +19 -5
- package/src/components/credit-notes/create/locales/es.ts +20 -7
- package/src/components/credit-notes/create/locales/et.ts +22 -8
- package/src/components/credit-notes/create/locales/fi.ts +23 -9
- package/src/components/credit-notes/create/locales/fr.ts +21 -8
- package/src/components/credit-notes/create/locales/hr.ts +20 -7
- package/src/components/credit-notes/create/locales/is.ts +22 -8
- package/src/components/credit-notes/create/locales/it.ts +20 -7
- package/src/components/credit-notes/create/locales/nb.ts +22 -8
- package/src/components/credit-notes/create/locales/nl.ts +20 -7
- package/src/components/credit-notes/create/locales/pl.ts +22 -9
- package/src/components/credit-notes/create/locales/pt.ts +21 -8
- package/src/components/credit-notes/create/locales/sk.ts +22 -8
- package/src/components/credit-notes/create/locales/sl.ts +19 -5
- package/src/components/credit-notes/create/locales/sv.ts +22 -8
- package/src/components/credit-notes/create/prepare-credit-note-submission.ts +35 -1
- package/src/components/credit-notes/credit-notes.hooks.ts +21 -2
- package/src/components/credit-notes/list/list-table.tsx +2 -1
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +133 -30
- package/src/components/delivery-notes/create/locales/bg.ts +1 -0
- package/src/components/delivery-notes/create/locales/cs.ts +1 -0
- package/src/components/delivery-notes/create/locales/de.ts +1 -0
- package/src/components/delivery-notes/create/locales/en.ts +1 -0
- package/src/components/delivery-notes/create/locales/es.ts +1 -0
- package/src/components/delivery-notes/create/locales/et.ts +1 -0
- package/src/components/delivery-notes/create/locales/fi.ts +1 -0
- package/src/components/delivery-notes/create/locales/fr.ts +1 -0
- package/src/components/delivery-notes/create/locales/hr.ts +1 -0
- package/src/components/delivery-notes/create/locales/is.ts +1 -0
- package/src/components/delivery-notes/create/locales/it.ts +1 -0
- package/src/components/delivery-notes/create/locales/nb.ts +1 -0
- package/src/components/delivery-notes/create/locales/nl.ts +1 -0
- package/src/components/delivery-notes/create/locales/pl.ts +1 -0
- package/src/components/delivery-notes/create/locales/pt.ts +1 -0
- package/src/components/delivery-notes/create/locales/sk.ts +1 -0
- package/src/components/delivery-notes/create/locales/sl.ts +1 -0
- package/src/components/delivery-notes/create/locales/sv.ts +1 -0
- package/src/components/delivery-notes/create/prepare-delivery-note-submission.ts +34 -1
- package/src/components/delivery-notes/delivery-notes.hooks.ts +15 -1
- package/src/components/delivery-notes/list/list-table.tsx +2 -1
- package/src/components/documents/create/custom-create-template.ts +151 -0
- package/src/components/documents/create/document-add-item-form.tsx +12 -8
- package/src/components/documents/create/document-add-item-tax-rate-field.tsx +1 -2
- package/src/components/documents/create/document-date-validation.ts +111 -0
- package/src/components/documents/create/document-details-section.tsx +93 -48
- package/src/components/documents/create/document-form-item.ts +67 -0
- package/src/components/documents/create/document-item-validation.ts +6 -2
- package/src/components/documents/create/form-types.ts +2 -2
- package/src/components/documents/create/linked-documents-info.tsx +2 -11
- package/src/components/documents/create/live-preview.tsx +3 -3
- package/src/components/documents/create/mark-as-paid-section.tsx +14 -11
- package/src/components/documents/create/payment-rows.ts +30 -0
- package/src/components/documents/create/prepare-document-submission.ts +143 -103
- package/src/components/documents/create/prepare-preview-data.ts +12 -0
- package/src/components/documents/create/preserved-expected-total.ts +90 -0
- package/src/components/documents/public/public-document-summary.tsx +6 -13
- package/src/components/documents/view/document-actions-bar.tsx +10 -1
- package/src/components/documents/view/document-details-card.tsx +4 -12
- package/src/components/documents/view/document-relations-list.tsx +4 -4
- package/src/components/documents/view/locales/bg.ts +8 -8
- package/src/components/documents/view/locales/cs.ts +8 -8
- package/src/components/documents/view/locales/de.ts +1 -1
- package/src/components/documents/view/locales/en.ts +14 -14
- package/src/components/documents/view/locales/es.ts +1 -1
- package/src/components/documents/view/locales/et.ts +8 -8
- package/src/components/documents/view/locales/fi.ts +10 -10
- package/src/components/documents/view/locales/fr.ts +1 -1
- package/src/components/documents/view/locales/hr.ts +6 -6
- package/src/components/documents/view/locales/is.ts +8 -8
- package/src/components/documents/view/locales/it.ts +1 -1
- package/src/components/documents/view/locales/nb.ts +8 -8
- package/src/components/documents/view/locales/nl.ts +1 -1
- package/src/components/documents/view/locales/pl.ts +1 -1
- package/src/components/documents/view/locales/pt.ts +1 -1
- package/src/components/documents/view/locales/sk.ts +8 -8
- package/src/components/documents/view/locales/sl.ts +9 -9
- package/src/components/documents/view/locales/sv.ts +1 -1
- package/src/components/documents/view/use-document-download.ts +2 -2
- package/src/components/entities/entity-settings-form/locales/bg.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/cs.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/de.ts +9 -0
- package/src/components/entities/entity-settings-form/locales/en.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/es.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/et.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/fi.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/hr.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/is.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/nb.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/pl.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/pt.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/sk.ts +7 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +12 -4
- package/src/components/entities/entity-settings-form/locales/sv.ts +7 -0
- package/src/components/entities/settings/tax-rules-settings-form.tsx +36 -0
- package/src/components/estimates/create/create-estimate-form.tsx +196 -47
- package/src/components/estimates/create/locales/bg.ts +6 -5
- package/src/components/estimates/create/locales/cs.ts +6 -5
- package/src/components/estimates/create/locales/de.ts +4 -3
- package/src/components/estimates/create/locales/en.ts +4 -3
- package/src/components/estimates/create/locales/es.ts +4 -3
- package/src/components/estimates/create/locales/et.ts +6 -5
- package/src/components/estimates/create/locales/fi.ts +9 -8
- package/src/components/estimates/create/locales/fr.ts +4 -3
- package/src/components/estimates/create/locales/hr.ts +7 -6
- package/src/components/estimates/create/locales/is.ts +6 -5
- package/src/components/estimates/create/locales/it.ts +4 -3
- package/src/components/estimates/create/locales/nb.ts +6 -5
- package/src/components/estimates/create/locales/nl.ts +4 -3
- package/src/components/estimates/create/locales/pl.ts +4 -3
- package/src/components/estimates/create/locales/pt.ts +4 -3
- package/src/components/estimates/create/locales/sk.ts +6 -5
- package/src/components/estimates/create/locales/sl.ts +7 -6
- package/src/components/estimates/create/locales/sv.ts +6 -5
- package/src/components/estimates/create/prepare-estimate-submission.ts +37 -3
- package/src/components/estimates/estimates.hooks.ts +11 -2
- package/src/components/estimates/list/list-table.tsx +11 -1
- package/src/components/estimates/list/locales/bg.ts +2 -0
- package/src/components/estimates/list/locales/cs.ts +2 -0
- package/src/components/estimates/list/locales/de.ts +2 -0
- package/src/components/estimates/list/locales/en.ts +2 -0
- package/src/components/estimates/list/locales/es.ts +2 -0
- package/src/components/estimates/list/locales/et.ts +2 -0
- package/src/components/estimates/list/locales/fi.ts +2 -0
- package/src/components/estimates/list/locales/fr.ts +2 -0
- package/src/components/estimates/list/locales/hr.ts +7 -5
- package/src/components/estimates/list/locales/is.ts +2 -0
- package/src/components/estimates/list/locales/it.ts +2 -0
- package/src/components/estimates/list/locales/nb.ts +2 -0
- package/src/components/estimates/list/locales/nl.ts +2 -0
- package/src/components/estimates/list/locales/pl.ts +2 -0
- package/src/components/estimates/list/locales/pt.ts +2 -0
- package/src/components/estimates/list/locales/sk.ts +2 -0
- package/src/components/estimates/list/locales/sl.ts +9 -7
- package/src/components/estimates/list/locales/sv.ts +2 -0
- package/src/components/invoices/create/create-invoice-form.tsx +231 -60
- package/src/components/invoices/create/locales/bg.ts +23 -14
- package/src/components/invoices/create/locales/cs.ts +23 -14
- package/src/components/invoices/create/locales/de.ts +17 -9
- package/src/components/invoices/create/locales/en.ts +16 -7
- package/src/components/invoices/create/locales/es.ts +18 -9
- package/src/components/invoices/create/locales/et.ts +23 -14
- package/src/components/invoices/create/locales/fi.ts +24 -15
- package/src/components/invoices/create/locales/fr.ts +19 -11
- package/src/components/invoices/create/locales/hr.ts +18 -9
- package/src/components/invoices/create/locales/is.ts +23 -14
- package/src/components/invoices/create/locales/it.ts +19 -11
- package/src/components/invoices/create/locales/nb.ts +23 -14
- package/src/components/invoices/create/locales/nl.ts +19 -10
- package/src/components/invoices/create/locales/pl.ts +19 -11
- package/src/components/invoices/create/locales/pt.ts +19 -10
- package/src/components/invoices/create/locales/sk.ts +23 -14
- package/src/components/invoices/create/locales/sl.ts +17 -9
- package/src/components/invoices/create/locales/sv.ts +17 -8
- package/src/components/invoices/create/prepare-invoice-submission.ts +55 -1
- package/src/components/invoices/invoices.hooks.ts +11 -2
- package/src/components/invoices/list/list-table.tsx +2 -1
- package/src/components/invoices/send-email-dialog/locales/bg.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/cs.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/de.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/en.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/es.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/et.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/fi.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/fr.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/hr.ts +8 -3
- package/src/components/invoices/send-email-dialog/locales/is.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/it.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/nb.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/nl.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/pl.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/pt.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/sk.ts +5 -0
- package/src/components/invoices/send-email-dialog/locales/sl.ts +8 -3
- package/src/components/invoices/send-email-dialog/locales/sv.ts +5 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +2 -1
- package/src/components/items/item-combobox.tsx +4 -4
- package/src/components/payments/create-payment-form/create-payment-form.tsx +5 -2
- package/src/components/payments/edit-payment-form/edit-payment-form.tsx +5 -1
- package/src/components/recurring-invoices/create-recurring-invoice-form/create-recurring-invoice-form.tsx +98 -22
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/bg.ts +26 -26
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/cs.ts +25 -25
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/et.ts +26 -26
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/fi.ts +36 -36
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/is.ts +26 -26
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/nb.ts +26 -26
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sk.ts +25 -25
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sv.ts +26 -26
- package/src/components/recurring-invoices/list/list-row-actions.tsx +9 -1
- package/src/components/recurring-invoices/list/list-table.tsx +53 -5
- package/src/components/recurring-invoices/list/locales/bg.ts +4 -0
- package/src/components/recurring-invoices/list/locales/cs.ts +4 -0
- package/src/components/recurring-invoices/list/locales/de.ts +4 -0
- package/src/components/recurring-invoices/list/locales/en.ts +4 -0
- package/src/components/recurring-invoices/list/locales/es.ts +4 -0
- package/src/components/recurring-invoices/list/locales/et.ts +4 -0
- package/src/components/recurring-invoices/list/locales/fi.ts +4 -0
- package/src/components/recurring-invoices/list/locales/fr.ts +4 -0
- package/src/components/recurring-invoices/list/locales/hr.ts +4 -0
- package/src/components/recurring-invoices/list/locales/is.ts +4 -0
- package/src/components/recurring-invoices/list/locales/it.ts +4 -0
- package/src/components/recurring-invoices/list/locales/nb.ts +4 -0
- package/src/components/recurring-invoices/list/locales/nl.ts +4 -0
- package/src/components/recurring-invoices/list/locales/pl.ts +4 -0
- package/src/components/recurring-invoices/list/locales/pt.ts +4 -0
- package/src/components/recurring-invoices/list/locales/sk.ts +4 -0
- package/src/components/recurring-invoices/list/locales/sl.ts +4 -0
- package/src/components/recurring-invoices/list/locales/sv.ts +4 -0
- package/src/components/tax-reports/slovenia-tax-profile-step.tsx +4 -1
- package/src/components/tax-reports/slovenia-yearly-export-form.tsx +3 -0
- package/src/components/tax-reports/slovenia-yearly-review-step.tsx +2 -1
- package/src/components/ui/form.tsx +5 -13
- package/src/components/ui/select.tsx +0 -1
- package/src/components/ui/sidebar.tsx +2 -2
- package/src/generate-schemas.ts +132 -99
- package/src/generated/schemas/acceptentityinvitation_body.ts +4 -3
- package/src/generated/schemas/accountwebhook.ts +4 -8
- package/src/generated/schemas/addentityuser_body.ts +4 -3
- package/src/generated/schemas/advanceinvoice.ts +167 -168
- package/src/generated/schemas/authorizeshopify_body.ts +4 -3
- package/src/generated/schemas/calculatedocumentpreview.ts +120 -0
- package/src/generated/schemas/checktransactiontype.ts +35 -0
- package/src/generated/schemas/creditnote.ts +203 -76
- package/src/generated/schemas/customadvanceinvoice.ts +172 -165
- package/src/generated/schemas/customcreditnote.ts +183 -155
- package/src/generated/schemas/customdeliverynote.ts +166 -0
- package/src/generated/schemas/customer.ts +4 -8
- package/src/generated/schemas/customestimate.ts +123 -97
- package/src/generated/schemas/customincomingpurchasedocument.ts +142 -0
- package/src/generated/schemas/custominvoice.ts +183 -154
- package/src/generated/schemas/deliverynote.ts +124 -79
- package/src/generated/schemas/einvoice.ts +19 -0
- package/src/generated/schemas/einvoicingsettings.ts +21 -0
- package/src/generated/schemas/einvoicingsupplier.ts +45 -0
- package/src/generated/schemas/entity.ts +44 -40
- package/src/generated/schemas/entityapikey.ts +1 -3
- package/src/generated/schemas/entityuserrole.ts +1 -3
- package/src/generated/schemas/estimate.ts +120 -127
- package/src/generated/schemas/exportsloveniavodxml_body.ts +4 -3
- package/src/generated/schemas/exportsloveniayearlynormiranireport_body.ts +4 -3
- package/src/generated/schemas/finadevice.ts +15 -0
- package/src/generated/schemas/finalizedocument.ts +52 -0
- package/src/generated/schemas/finapremise.ts +15 -0
- package/src/generated/schemas/finasettings.ts +1 -3
- package/src/generated/schemas/furselectronicdevice.ts +15 -0
- package/src/generated/schemas/furssettings.ts +1 -3
- package/src/generated/schemas/image.ts +15 -0
- package/src/generated/schemas/incomingpurchasedocument.ts +7 -27
- package/src/generated/schemas/incomingpurchasedocumentattachment.ts +15 -0
- package/src/generated/schemas/incomingpurchasedocumentpayment.ts +1 -3
- package/src/generated/schemas/index.ts +20 -5
- package/src/generated/schemas/invoice.ts +182 -183
- package/src/generated/schemas/item.ts +6 -10
- package/src/generated/schemas/legacymigrationauth.ts +18 -0
- package/src/generated/schemas/me.ts +2 -24
- package/src/generated/schemas/migrationjob.ts +20 -0
- package/src/generated/schemas/order.ts +4 -8
- package/src/generated/schemas/orderintegration.ts +4 -8
- package/src/generated/schemas/payment.ts +4 -8
- package/src/generated/schemas/ptatcudseries.ts +1 -3
- package/src/generated/schemas/queryentitystats.ts +15 -0
- package/src/generated/schemas/recurringinvoice.ts +4 -8
- package/src/generated/schemas/registerfursmovablepremise_body.ts +1 -3
- package/src/generated/schemas/registerfursrealestatepremise_body.ts +1 -3
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +10 -16
- package/src/generated/schemas/rendercreditnotepreview_body.ts +10 -16
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +9 -5
- package/src/generated/schemas/renderestimatepreview_body.ts +11 -7
- package/src/generated/schemas/renderinvoicepreview_body.ts +10 -16
- package/src/generated/schemas/reviewsloveniayearlynormiranireport.ts +15 -0
- package/src/generated/schemas/searcheinvoicingcustomer.ts +18 -0
- package/src/generated/schemas/senddocument_body.ts +1 -3
- package/src/generated/schemas/sendemail_body.ts +2 -24
- package/src/generated/schemas/sloveniataxprofile.ts +8 -10
- package/src/generated/schemas/starteslogexport_body.ts +4 -3
- package/src/generated/schemas/startpdfexport_body.ts +8 -87
- package/src/generated/schemas/stripeappconnect_body.ts +4 -3
- package/src/generated/schemas/stripeappcreateinvoice_body.ts +4 -6
- package/src/generated/schemas/stripeappmarketplaceauthorize.ts +15 -0
- package/src/generated/schemas/stripeappupdatesettings_body.ts +6 -6
- package/src/generated/schemas/supplier.ts +4 -8
- package/src/generated/schemas/syncshopifyorders_body.ts +4 -3
- package/src/generated/schemas/tax.ts +6 -8
- package/src/generated/schemas/uploadfile_body.ts +1 -3
- package/src/generated/schemas/uploadfurscertificate_body.ts +6 -6
- package/src/generated/schemas/userfinasettings.ts +1 -3
- package/src/generated/schemas/userfurssettings.ts +1 -3
- package/src/generated/schemas/userptsettings.ts +1 -3
- package/src/generated/schemas/voidinvoice_body.ts +8 -3
- package/src/generated/schemas/webhook.ts +4 -8
- package/src/generated/schemas/wlsubscriptionbillingemail.ts +17 -0
- package/src/hooks/use-duplicate-document.ts +74 -32
- package/src/lib/date-only.ts +58 -0
- package/src/lib/document-display.ts +18 -0
- package/src/lib/payment-display.ts +5 -3
- package/src/lib/schemas/shared.ts +11 -0
- package/src/providers/wl-subscription-provider.tsx +5 -0
- package/src/generated/schemas/account_webhook.ts +0 -43
- package/src/generated/schemas/previewadvanceinvoice_body.ts +0 -354
- package/src/generated/schemas/previewestimate_body.ts +0 -309
- package/src/generated/schemas/registerfinamovablepremise_body.ts +0 -26
- package/src/generated/schemas/registerfinarealestatepremise_body.ts +0 -37
- package/src/generated/schemas/renderdocument_body.ts +0 -594
|
@@ -8,67 +8,6 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for custominvoice endpoints
|
|
10
10
|
|
|
11
|
-
// Dependency schema for custominvoice
|
|
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 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
|
-
|
|
30
|
-
// Dependency schema for custominvoice
|
|
31
|
-
const FinaFiscalizationResponse = z.union([
|
|
32
|
-
z
|
|
33
|
-
.object({
|
|
34
|
-
status: z.enum(["pending", "success", "failed"]),
|
|
35
|
-
fiscalized_at: z.string().datetime({ offset: true }).optional(),
|
|
36
|
-
error: z.string().optional(),
|
|
37
|
-
data: z
|
|
38
|
-
.object({
|
|
39
|
-
zki: z.string(),
|
|
40
|
-
jir: z.string().optional(),
|
|
41
|
-
qr_code_url: z.string().optional(),
|
|
42
|
-
premise_id: z.string(),
|
|
43
|
-
device_id: z.string(),
|
|
44
|
-
invoice_number: z.string(),
|
|
45
|
-
operator_oib: z.string().optional(),
|
|
46
|
-
payment_type: z.string().optional(),
|
|
47
|
-
numbering_sequence: z.string().optional(),
|
|
48
|
-
payload: z.object({}).partial().passthrough(),
|
|
49
|
-
subsequent_submit: z.boolean().optional(),
|
|
50
|
-
issuer_oib: z.string().optional(),
|
|
51
|
-
operator_label: z.string().optional(),
|
|
52
|
-
})
|
|
53
|
-
.passthrough()
|
|
54
|
-
.optional(),
|
|
55
|
-
})
|
|
56
|
-
.passthrough(),
|
|
57
|
-
z.null(),
|
|
58
|
-
]);
|
|
59
|
-
|
|
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
11
|
// Dependency schema for custominvoice
|
|
73
12
|
const DocumentEntity = z
|
|
74
13
|
.object({
|
|
@@ -84,19 +23,22 @@ const DocumentEntity = z
|
|
|
84
23
|
tax_number: z.union([z.string(), z.null()]),
|
|
85
24
|
tax_number_2: z.union([z.string(), z.null()]),
|
|
86
25
|
company_number: z.union([z.string(), z.null()]),
|
|
26
|
+
phone: z.union([z.string(), z.null()]),
|
|
27
|
+
peppol_id: z.union([z.string(), z.null()]),
|
|
28
|
+
is_end_consumer: z.union([z.boolean(), z.null()]),
|
|
87
29
|
bank_account: z.union([
|
|
88
30
|
z
|
|
89
31
|
.object({
|
|
90
32
|
type: z
|
|
91
33
|
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
92
34
|
.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(),
|
|
35
|
+
name: z.union([z.string(), z.null()]),
|
|
36
|
+
bank_name: z.union([z.string(), z.null()]),
|
|
37
|
+
iban: z.union([z.string(), z.null()]),
|
|
38
|
+
account_number: z.union([z.string(), z.null()]),
|
|
39
|
+
bic: z.union([z.string(), z.null()]),
|
|
40
|
+
routing_number: z.union([z.string(), z.null()]),
|
|
41
|
+
sort_code: z.union([z.string(), z.null()]),
|
|
100
42
|
})
|
|
101
43
|
.partial()
|
|
102
44
|
.passthrough(),
|
|
@@ -107,104 +49,191 @@ const DocumentEntity = z
|
|
|
107
49
|
.passthrough();
|
|
108
50
|
|
|
109
51
|
|
|
110
|
-
//
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
52
|
+
// Dependency schema for custominvoice
|
|
53
|
+
const CreateDocumentCustomer = DocumentEntity.and(
|
|
54
|
+
z.union([
|
|
55
|
+
z
|
|
56
|
+
.object({ save_customer: z.union([z.boolean(), z.null()]) })
|
|
57
|
+
.partial()
|
|
58
|
+
.passthrough(),
|
|
59
|
+
z.null(),
|
|
60
|
+
])
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// Dependency schema for custominvoice
|
|
65
|
+
const DocumentItemTax = z
|
|
66
|
+
.object({
|
|
67
|
+
rate: z.union([z.number(), z.null()]),
|
|
68
|
+
tax_id: z.union([z.string(), z.null()]),
|
|
69
|
+
classification: z.union([z.string(), z.null()]),
|
|
70
|
+
reverse_charge: z.union([z.boolean(), z.null()]),
|
|
71
|
+
amount: z.union([z.number(), z.null()]),
|
|
72
|
+
pt_exemption_code: z.union([z.string(), z.null()]),
|
|
73
|
+
pt_exemption_reason: z.union([z.string(), z.null()]),
|
|
74
|
+
})
|
|
75
|
+
.partial();
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// Dependency schema for custominvoice
|
|
79
|
+
const LineDiscount = z.object({
|
|
80
|
+
value: z.number().gte(0),
|
|
81
|
+
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// Dependency schema for custominvoice
|
|
86
|
+
const CustomDocumentItem = z
|
|
87
|
+
.object({
|
|
88
|
+
type: z.union([z.union([z.enum(["separator"]), z.null()]), z.null()]),
|
|
89
|
+
name: z.union([z.string(), z.null()]),
|
|
90
|
+
description: z.union([z.string(), z.null()]),
|
|
91
|
+
classification: z.union([
|
|
92
|
+
z.union([z.enum(["product", "service", "advance"]), z.null()]),
|
|
125
93
|
z.null(),
|
|
126
|
-
])
|
|
94
|
+
]),
|
|
95
|
+
price: z.union([z.number(), z.null()]),
|
|
96
|
+
gross_price: z.union([z.number(), z.null()]),
|
|
97
|
+
quantity: z.union([z.number(), z.null()]),
|
|
98
|
+
unit: z.union([z.string(), z.null()]),
|
|
99
|
+
taxes: z.array(DocumentItemTax),
|
|
100
|
+
discounts: z.array(LineDiscount).max(5),
|
|
101
|
+
total: z.union([z.number(), z.null()]),
|
|
102
|
+
total_with_tax: z.union([z.number(), z.null()]),
|
|
103
|
+
item_id: z.union([z.string(), z.null()]),
|
|
104
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
105
|
+
save_item: z.union([z.boolean(), z.null()]),
|
|
106
|
+
})
|
|
107
|
+
.partial();
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
// Dependency schema for custominvoice
|
|
111
|
+
const DocumentSummaryTax = z
|
|
112
|
+
.object({
|
|
113
|
+
rate: z.union([z.number(), z.null()]),
|
|
114
|
+
tax_id: z.union([z.string(), z.null()]).optional(),
|
|
115
|
+
base: z.number(),
|
|
116
|
+
amount: z.number(),
|
|
117
|
+
reverse_charge: z.union([z.boolean(), z.null()]).optional(),
|
|
118
|
+
})
|
|
119
|
+
.passthrough();
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
// Dependency schema for custominvoice
|
|
123
|
+
const CreateDocumentPayment = z.object({
|
|
124
|
+
incoming_purchase_document_id: z.union([z.string(), z.null()]).optional(),
|
|
125
|
+
applied_to_incoming_purchase_document_id: z
|
|
126
|
+
.union([z.string(), z.null()])
|
|
127
|
+
.optional(),
|
|
128
|
+
amount: z.union([z.number(), z.null()]).optional(),
|
|
129
|
+
type: z.enum([
|
|
130
|
+
"cash",
|
|
131
|
+
"bank_transfer",
|
|
132
|
+
"card",
|
|
133
|
+
"check",
|
|
134
|
+
"paypal",
|
|
135
|
+
"coupon",
|
|
136
|
+
"other",
|
|
137
|
+
"credit_note",
|
|
138
|
+
"advance",
|
|
139
|
+
]),
|
|
140
|
+
date: z.union([z.string(), z.null()]).optional(),
|
|
141
|
+
tag: z.union([z.string(), z.null()]).optional(),
|
|
142
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
143
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
144
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
// Dependency schema for custominvoice
|
|
149
|
+
const CreateFursDocumentData = z.union([
|
|
150
|
+
z
|
|
151
|
+
.object({
|
|
152
|
+
business_premise_name: z.union([z.string(), z.null()]),
|
|
153
|
+
electronic_device_name: z.union([z.string(), z.null()]),
|
|
154
|
+
operator_tax_number: z.union([z.string(), z.null()]),
|
|
155
|
+
operator_label: z.union([z.string(), z.null()]),
|
|
156
|
+
skip: z.union([z.boolean(), z.null()]),
|
|
157
|
+
})
|
|
158
|
+
.partial(),
|
|
159
|
+
z.null(),
|
|
160
|
+
]);
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
// Dependency schema for custominvoice
|
|
164
|
+
const CreateFinaInvoiceData = z.union([
|
|
165
|
+
z
|
|
166
|
+
.object({
|
|
167
|
+
business_premise_name: z.union([z.string(), z.null()]),
|
|
168
|
+
electronic_device_name: z.union([z.string(), z.null()]),
|
|
169
|
+
operator_oib: z.union([z.string(), z.null()]),
|
|
170
|
+
operator_label: z.union([z.string(), z.null()]),
|
|
171
|
+
payment_type: z.union([
|
|
172
|
+
z.union([z.enum(["cash", "card", "online", "bank_transfer", "paypal", "crypto", "coupon", "other"]), z.null()]),
|
|
173
|
+
z.null(),
|
|
174
|
+
]),
|
|
175
|
+
subsequent_submit: z.union([z.boolean(), z.null()]),
|
|
176
|
+
})
|
|
177
|
+
.partial(),
|
|
178
|
+
z.null(),
|
|
179
|
+
]);
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
// Dependency schema for custominvoice
|
|
183
|
+
const EslogInput = z.union([
|
|
184
|
+
z
|
|
185
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
186
|
+
.partial()
|
|
187
|
+
.passthrough(),
|
|
188
|
+
z.null(),
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
// Schema for createCustomInvoice operation
|
|
193
|
+
const createCustomInvoiceSchemaDefinition = z.object({
|
|
194
|
+
is_draft: z.union([z.boolean(), z.null()]).optional(),
|
|
195
|
+
date: z.union([z.string(), z.null()]).optional(),
|
|
196
|
+
issuer: DocumentEntity.and(
|
|
197
|
+
z.union([z.object({}).partial().passthrough(), z.null()])
|
|
127
198
|
).optional(),
|
|
199
|
+
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
200
|
+
customer: CreateDocumentCustomer.optional(),
|
|
128
201
|
note: z.union([z.string(), z.null()]).optional(),
|
|
129
202
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
130
203
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
204
|
+
footer: z.union([z.string(), z.null()]).optional(),
|
|
205
|
+
signature: z.union([z.string(), z.null()]).optional(),
|
|
206
|
+
calculation_mode: z
|
|
207
|
+
.union([z.union([z.enum(["b2b_standard", "b2c_gross_discount"]), z.null()]), z.null()])
|
|
208
|
+
.optional(),
|
|
209
|
+
currency_code: z.union([z.string(), z.null()]).optional(),
|
|
135
210
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
211
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
136
212
|
date_due: z.union([z.string(), z.null()]).optional(),
|
|
137
|
-
|
|
138
|
-
date_service: z.union([z.string(), z.null()]).optional(),
|
|
139
|
-
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
140
|
-
items: z
|
|
141
|
-
.array(
|
|
142
|
-
z.object({
|
|
143
|
-
name: z.string().min(1).optional(),
|
|
144
|
-
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
145
|
-
price: z.number().optional(),
|
|
146
|
-
gross_price: z.number().optional(),
|
|
147
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
148
|
-
unit: z.union([z.string(), z.null()]).optional(),
|
|
149
|
-
taxes: z.array(DocumentItemTax).optional(),
|
|
150
|
-
discounts: z.array(LineDiscount).max(5).optional(),
|
|
151
|
-
total: z.number(),
|
|
152
|
-
total_with_tax: z.number(),
|
|
153
|
-
metadata: z
|
|
154
|
-
.union([
|
|
155
|
-
z.string(),
|
|
156
|
-
z.number(),
|
|
157
|
-
z.boolean(),
|
|
158
|
-
z.null(),
|
|
159
|
-
z.object({}).partial().passthrough(),
|
|
160
|
-
z.array(z.unknown()),
|
|
161
|
-
z.null(),
|
|
162
|
-
])
|
|
163
|
-
.optional(),
|
|
164
|
-
item_id: z.string().optional(),
|
|
165
|
-
})
|
|
166
|
-
)
|
|
167
|
-
.min(1),
|
|
168
|
-
linked_documents: z.array(z.string().min(1)).optional(),
|
|
169
|
-
payment: z
|
|
213
|
+
pt: z
|
|
170
214
|
.union([
|
|
171
|
-
z.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
date: z.string().optional(),
|
|
175
|
-
reference: z.union([z.string(), z.null()]).optional(),
|
|
176
|
-
note: z.union([z.string(), z.null()]).optional(),
|
|
177
|
-
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
178
|
-
}),
|
|
179
|
-
z.null(),
|
|
180
|
-
])
|
|
181
|
-
.optional(),
|
|
182
|
-
furs: z
|
|
183
|
-
.union([
|
|
184
|
-
z
|
|
185
|
-
.object({
|
|
186
|
-
business_premise_name: z.string().min(1),
|
|
187
|
-
electronic_device_name: z.string().min(1),
|
|
188
|
-
operator_tax_number: z.string(),
|
|
189
|
-
operator_label: z.string(),
|
|
190
|
-
skip: z.boolean(),
|
|
191
|
-
})
|
|
192
|
-
.partial(),
|
|
193
|
-
z.null(),
|
|
194
|
-
])
|
|
195
|
-
.optional(),
|
|
196
|
-
eslog: z
|
|
197
|
-
.union([
|
|
198
|
-
z
|
|
199
|
-
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
200
|
-
.partial()
|
|
201
|
-
.passthrough(),
|
|
215
|
+
z.string(),
|
|
216
|
+
z.number(),
|
|
217
|
+
z.boolean(),
|
|
202
218
|
z.null(),
|
|
219
|
+
z.object({}).partial().passthrough(),
|
|
220
|
+
z.array(z.unknown()),
|
|
203
221
|
])
|
|
204
222
|
.optional(),
|
|
223
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
224
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
225
|
+
items: z.array(CustomDocumentItem).min(1),
|
|
226
|
+
total: z.number(),
|
|
227
|
+
total_with_tax: z.number(),
|
|
228
|
+
total_discount: z.union([z.number(), z.null()]).optional(),
|
|
229
|
+
taxes: z.array(DocumentSummaryTax).optional(),
|
|
230
|
+
linked_documents: z.union([z.array(z.string().min(1)), z.null()]).optional(),
|
|
231
|
+
payments: z.union([z.array(CreateDocumentPayment), z.null()]).optional(),
|
|
232
|
+
furs: CreateFursDocumentData.optional(),
|
|
233
|
+
fina: CreateFinaInvoiceData.optional(),
|
|
234
|
+
eslog: EslogInput.optional(),
|
|
235
|
+
force_linked_documents: z.union([z.boolean(), z.null()]).optional(),
|
|
205
236
|
});
|
|
206
237
|
|
|
207
|
-
// Type for create custominvoice operation
|
|
208
238
|
export type CreateCustomInvoiceSchema = z.infer<typeof createCustomInvoiceSchemaDefinition>;
|
|
209
|
-
|
|
210
239
|
export const createCustomInvoiceSchema = createCustomInvoiceSchemaDefinition;
|
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
9
|
-
//
|
|
10
|
-
const LineDiscount = z.object({
|
|
11
|
-
value: z.number().gte(0),
|
|
12
|
-
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// Dependency schema for delivery note
|
|
17
|
-
const DocumentItemTax = z
|
|
18
|
-
.object({
|
|
19
|
-
rate: z.number(),
|
|
20
|
-
tax_id: z.string(),
|
|
21
|
-
classification: z.string(),
|
|
22
|
-
reverse_charge: z.boolean(),
|
|
23
|
-
amount: z.number(),
|
|
24
|
-
})
|
|
25
|
-
.partial();
|
|
26
|
-
|
|
9
|
+
// Schemas for deliverynote endpoints
|
|
27
10
|
|
|
28
|
-
// Dependency schema for
|
|
11
|
+
// Dependency schema for deliverynote
|
|
29
12
|
const DocumentEntity = z
|
|
30
13
|
.object({
|
|
31
14
|
name: z.union([z.string(), z.null()]),
|
|
@@ -40,19 +23,22 @@ const DocumentEntity = z
|
|
|
40
23
|
tax_number: z.union([z.string(), z.null()]),
|
|
41
24
|
tax_number_2: z.union([z.string(), z.null()]),
|
|
42
25
|
company_number: z.union([z.string(), z.null()]),
|
|
26
|
+
phone: z.union([z.string(), z.null()]),
|
|
27
|
+
peppol_id: z.union([z.string(), z.null()]),
|
|
28
|
+
is_end_consumer: z.union([z.boolean(), z.null()]),
|
|
43
29
|
bank_account: z.union([
|
|
44
30
|
z
|
|
45
31
|
.object({
|
|
46
32
|
type: z
|
|
47
33
|
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
48
34
|
.default("iban"),
|
|
49
|
-
name: z.string(),
|
|
50
|
-
bank_name: z.string(),
|
|
51
|
-
iban: z.string(),
|
|
52
|
-
account_number: z.string(),
|
|
53
|
-
bic: z.string(),
|
|
54
|
-
routing_number: z.string(),
|
|
55
|
-
sort_code: z.string(),
|
|
35
|
+
name: z.union([z.string(), z.null()]),
|
|
36
|
+
bank_name: z.union([z.string(), z.null()]),
|
|
37
|
+
iban: z.union([z.string(), z.null()]),
|
|
38
|
+
account_number: z.union([z.string(), z.null()]),
|
|
39
|
+
bic: z.union([z.string(), z.null()]),
|
|
40
|
+
routing_number: z.union([z.string(), z.null()]),
|
|
41
|
+
sort_code: z.union([z.string(), z.null()]),
|
|
56
42
|
})
|
|
57
43
|
.partial()
|
|
58
44
|
.passthrough(),
|
|
@@ -63,7 +49,73 @@ const DocumentEntity = z
|
|
|
63
49
|
.passthrough();
|
|
64
50
|
|
|
65
51
|
|
|
66
|
-
//
|
|
52
|
+
// Dependency schema for deliverynote
|
|
53
|
+
const CreateDocumentCustomer = DocumentEntity.and(
|
|
54
|
+
z.union([
|
|
55
|
+
z
|
|
56
|
+
.object({ save_customer: z.union([z.boolean(), z.null()]) })
|
|
57
|
+
.partial()
|
|
58
|
+
.passthrough(),
|
|
59
|
+
z.null(),
|
|
60
|
+
])
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// Dependency schema for deliverynote
|
|
65
|
+
const DocumentItemTax = z
|
|
66
|
+
.object({
|
|
67
|
+
rate: z.union([z.number(), z.null()]),
|
|
68
|
+
tax_id: z.union([z.string(), z.null()]),
|
|
69
|
+
classification: z.union([z.string(), z.null()]),
|
|
70
|
+
reverse_charge: z.union([z.boolean(), z.null()]),
|
|
71
|
+
amount: z.union([z.number(), z.null()]),
|
|
72
|
+
pt_exemption_code: z.union([z.string(), z.null()]),
|
|
73
|
+
pt_exemption_reason: z.union([z.string(), z.null()]),
|
|
74
|
+
})
|
|
75
|
+
.partial();
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// Dependency schema for deliverynote
|
|
79
|
+
const LineDiscount = z.object({
|
|
80
|
+
value: z.number().gte(0),
|
|
81
|
+
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// Dependency schema for deliverynote
|
|
86
|
+
const CreateDocumentItem = z
|
|
87
|
+
.object({
|
|
88
|
+
type: z.union([z.union([z.enum(["separator"]), z.null()]), z.null()]),
|
|
89
|
+
name: z.union([z.string(), z.null()]),
|
|
90
|
+
description: z.union([z.string(), z.null()]),
|
|
91
|
+
classification: z.union([
|
|
92
|
+
z.union([z.enum(["product", "service", "advance"]), z.null()]),
|
|
93
|
+
z.null(),
|
|
94
|
+
]),
|
|
95
|
+
price: z.union([z.number(), z.null()]),
|
|
96
|
+
gross_price: z.union([z.number(), z.null()]),
|
|
97
|
+
quantity: z.union([z.number(), z.null()]),
|
|
98
|
+
unit: z.union([z.string(), z.null()]),
|
|
99
|
+
taxes: z.array(DocumentItemTax),
|
|
100
|
+
discounts: z.array(LineDiscount).max(5),
|
|
101
|
+
item_id: z.union([z.string(), z.null()]),
|
|
102
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
103
|
+
save_item: z.union([z.boolean(), z.null()]),
|
|
104
|
+
})
|
|
105
|
+
.partial();
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
// Dependency schema for deliverynote
|
|
109
|
+
const EslogInput = z.union([
|
|
110
|
+
z
|
|
111
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
112
|
+
.partial()
|
|
113
|
+
.passthrough(),
|
|
114
|
+
z.null(),
|
|
115
|
+
]);
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
// Schema for createDeliveryNote operation
|
|
67
119
|
const createDeliveryNoteSchemaDefinition = z.object({
|
|
68
120
|
is_draft: z.boolean().optional(),
|
|
69
121
|
date: z
|
|
@@ -72,67 +124,60 @@ const createDeliveryNoteSchemaDefinition = z.object({
|
|
|
72
124
|
.optional(),
|
|
73
125
|
issuer: DocumentEntity.optional(),
|
|
74
126
|
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
75
|
-
customer:
|
|
76
|
-
z.union([
|
|
77
|
-
z
|
|
78
|
-
.object({ save_customer: z.boolean().default(true) })
|
|
79
|
-
.partial()
|
|
80
|
-
.passthrough(),
|
|
81
|
-
z.null(),
|
|
82
|
-
])
|
|
83
|
-
).optional(),
|
|
127
|
+
customer: CreateDocumentCustomer.optional(),
|
|
84
128
|
note: z.union([z.string(), z.null()]).optional(),
|
|
85
129
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
86
130
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
87
131
|
footer: z.union([z.string(), z.null()]).optional(),
|
|
88
132
|
signature: z.union([z.string(), z.null()]).optional(),
|
|
89
|
-
|
|
133
|
+
calculation_mode: z
|
|
134
|
+
.union([z.union([z.enum(["b2b_standard", "b2c_gross_discount"]), z.null()]), z.null()])
|
|
135
|
+
.optional(),
|
|
90
136
|
currency_code: z.string().max(3).optional(),
|
|
91
137
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
138
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
92
139
|
hide_prices: z.boolean().optional(),
|
|
93
140
|
date_due: z.union([z.string(), z.null()]).optional(),
|
|
94
141
|
date_service: z.union([z.string(), z.null()]).optional(),
|
|
95
142
|
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
96
|
-
items: z
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
name: z.string().min(1).optional(),
|
|
101
|
-
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
102
|
-
price: z.number().optional(),
|
|
103
|
-
gross_price: z.number().optional(),
|
|
104
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
105
|
-
unit: z.union([z.string(), z.null()]).optional(),
|
|
106
|
-
taxes: z.array(DocumentItemTax).optional(),
|
|
107
|
-
discounts: z.array(LineDiscount).max(5).optional(),
|
|
108
|
-
metadata: z
|
|
109
|
-
.union([
|
|
110
|
-
z.string(),
|
|
111
|
-
z.number(),
|
|
112
|
-
z.boolean(),
|
|
113
|
-
z.null(),
|
|
114
|
-
z.object({}).partial().passthrough(),
|
|
115
|
-
z.array(z.unknown()),
|
|
116
|
-
z.null(),
|
|
117
|
-
])
|
|
118
|
-
.optional(),
|
|
119
|
-
item_id: z.string().optional(),
|
|
120
|
-
})
|
|
121
|
-
)
|
|
122
|
-
.min(1),
|
|
123
|
-
eslog: z
|
|
124
|
-
.union([
|
|
125
|
-
z
|
|
126
|
-
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
127
|
-
.partial()
|
|
128
|
-
.passthrough(),
|
|
129
|
-
z.null(),
|
|
130
|
-
])
|
|
131
|
-
.optional(),
|
|
132
|
-
expected_total_with_tax: z.number().gt(0).optional(),
|
|
143
|
+
items: z.array(CreateDocumentItem).min(1),
|
|
144
|
+
eslog: EslogInput.optional(),
|
|
145
|
+
linked_documents: z.union([z.array(z.string().min(1)), z.null()]).optional(),
|
|
146
|
+
expected_total_with_tax: z.union([z.number(), z.null()]).optional(),
|
|
133
147
|
});
|
|
134
148
|
|
|
135
|
-
// Type for create delivery note operation
|
|
136
|
-
export type CreateDeliveryNoteSchema = z.infer<typeof createDeliveryNoteSchemaDefinition>;
|
|
137
149
|
|
|
150
|
+
// Schema for updateDeliveryNote operation
|
|
151
|
+
const updateDeliveryNoteSchemaDefinition = z
|
|
152
|
+
.object({
|
|
153
|
+
date: z
|
|
154
|
+
.string()
|
|
155
|
+
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/),
|
|
156
|
+
issuer: DocumentEntity.and(z.unknown()),
|
|
157
|
+
customer_id: z.union([z.string(), z.null()]),
|
|
158
|
+
customer: CreateDocumentCustomer,
|
|
159
|
+
items: z.array(CreateDocumentItem).min(1),
|
|
160
|
+
note: z.union([z.string(), z.null()]),
|
|
161
|
+
payment_terms: z.union([z.string(), z.null()]),
|
|
162
|
+
tax_clause: z.union([z.string(), z.null()]),
|
|
163
|
+
footer: z.union([z.string(), z.null()]),
|
|
164
|
+
signature: z.union([z.string(), z.null()]),
|
|
165
|
+
currency_code: z.string(),
|
|
166
|
+
reference: z.union([z.string(), z.null()]),
|
|
167
|
+
metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
|
|
168
|
+
change_reason: z.string().max(500),
|
|
169
|
+
hide_prices: z.boolean(),
|
|
170
|
+
linked_documents: z.union([z.array(z.string().min(1)), z.null()]),
|
|
171
|
+
})
|
|
172
|
+
.partial();
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
// Schema for voidDeliveryNote operation
|
|
176
|
+
const voidDeliveryNoteSchemaDefinition = z.object({ code: z.string(), message: z.string() }).passthrough();
|
|
177
|
+
|
|
178
|
+
export type CreateDeliveryNoteSchema = z.infer<typeof createDeliveryNoteSchemaDefinition>;
|
|
138
179
|
export const createDeliveryNoteSchema = createDeliveryNoteSchemaDefinition;
|
|
180
|
+
export type UpdateDeliveryNoteSchema = z.infer<typeof updateDeliveryNoteSchemaDefinition>;
|
|
181
|
+
export const updateDeliveryNoteSchema = updateDeliveryNoteSchemaDefinition;
|
|
182
|
+
export type VoidDeliveryNoteSchema = z.infer<typeof voidDeliveryNoteSchemaDefinition>;
|
|
183
|
+
export const voidDeliveryNoteSchema = voidDeliveryNoteSchemaDefinition;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 einvoice endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for sendEInvoice operation
|
|
12
|
+
const sendEInvoiceSchemaDefinition = z.object({
|
|
13
|
+
recipient_peppol_id: z.string().min(1),
|
|
14
|
+
recipient_scheme_id: z.string().min(1).max(10),
|
|
15
|
+
recipient_name: z.string().max(255).optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type SendEInvoiceSchema = z.infer<typeof sendEInvoiceSchemaDefinition>;
|
|
19
|
+
export const sendEInvoiceSchema = sendEInvoiceSchemaDefinition;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 einvoicingsettings endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for updateEInvoicingSettings operation
|
|
12
|
+
const updateEInvoicingSettingsSchemaDefinition = z
|
|
13
|
+
.object({
|
|
14
|
+
enabled: z.boolean(),
|
|
15
|
+
auto_send: z.boolean(),
|
|
16
|
+
default_scheme_id: z.string().max(10),
|
|
17
|
+
})
|
|
18
|
+
.partial();
|
|
19
|
+
|
|
20
|
+
export type UpdateEInvoicingSettingsSchema = z.infer<typeof updateEInvoicingSettingsSchemaDefinition>;
|
|
21
|
+
export const updateEInvoicingSettingsSchema = updateEInvoicingSettingsSchemaDefinition;
|