@spaceinvoices/react-ui 0.4.12 → 0.4.31
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 +189 -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 +253 -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 +132 -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 +114 -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 +195 -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 +230 -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 +61 -30
- 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,36 +8,6 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for invoice endpoints
|
|
10
10
|
|
|
11
|
-
// Dependency schema for invoice
|
|
12
|
-
const CreateDocumentPayment = z.object({
|
|
13
|
-
amount: z.number().gt(0).optional(),
|
|
14
|
-
type: z.string().max(20),
|
|
15
|
-
date: z.string().optional(),
|
|
16
|
-
reference: z.union([z.string(), z.null()]).optional(),
|
|
17
|
-
note: z.union([z.string(), z.null()]).optional(),
|
|
18
|
-
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// Dependency schema for invoice
|
|
23
|
-
const LineDiscount = z.object({
|
|
24
|
-
value: z.number().gte(0),
|
|
25
|
-
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// Dependency schema for invoice
|
|
30
|
-
const DocumentItemTax = z
|
|
31
|
-
.object({
|
|
32
|
-
rate: z.number(),
|
|
33
|
-
tax_id: z.string(),
|
|
34
|
-
classification: z.string(),
|
|
35
|
-
reverse_charge: z.boolean(),
|
|
36
|
-
amount: z.number(),
|
|
37
|
-
})
|
|
38
|
-
.partial();
|
|
39
|
-
|
|
40
|
-
|
|
41
11
|
// Dependency schema for invoice
|
|
42
12
|
const DocumentEntity = z
|
|
43
13
|
.object({
|
|
@@ -53,19 +23,22 @@ const DocumentEntity = z
|
|
|
53
23
|
tax_number: z.union([z.string(), z.null()]),
|
|
54
24
|
tax_number_2: z.union([z.string(), z.null()]),
|
|
55
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()]),
|
|
56
29
|
bank_account: z.union([
|
|
57
30
|
z
|
|
58
31
|
.object({
|
|
59
32
|
type: z
|
|
60
33
|
.enum(["iban", "us_domestic", "uk_domestic", "other"])
|
|
61
34
|
.default("iban"),
|
|
62
|
-
name: z.string(),
|
|
63
|
-
bank_name: z.string(),
|
|
64
|
-
iban: z.string(),
|
|
65
|
-
account_number: z.string(),
|
|
66
|
-
bic: z.string(),
|
|
67
|
-
routing_number: z.string(),
|
|
68
|
-
sort_code: z.string(),
|
|
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()]),
|
|
69
42
|
})
|
|
70
43
|
.partial()
|
|
71
44
|
.passthrough(),
|
|
@@ -76,7 +49,153 @@ const DocumentEntity = z
|
|
|
76
49
|
.passthrough();
|
|
77
50
|
|
|
78
51
|
|
|
79
|
-
//
|
|
52
|
+
// Dependency schema for invoice
|
|
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 invoice
|
|
65
|
+
const PtDocumentInput = z.union([
|
|
66
|
+
z
|
|
67
|
+
.object({
|
|
68
|
+
series_id: z.union([z.string(), z.null()]),
|
|
69
|
+
manual: z.union([z.boolean(), z.null()]),
|
|
70
|
+
manual_sequential_number: z.union([z.number(), z.null()]),
|
|
71
|
+
manual_series_code: z.union([z.string(), z.null()]),
|
|
72
|
+
operator_first_name: z.union([z.string(), z.null()]),
|
|
73
|
+
operator_last_name: z.union([z.string(), z.null()]),
|
|
74
|
+
operator_tax_number: z.union([z.string(), z.null()]),
|
|
75
|
+
account_first_name: z.union([z.string(), z.null()]),
|
|
76
|
+
account_last_name: z.union([z.string(), z.null()]),
|
|
77
|
+
account_tax_number: z.union([z.string(), z.null()]),
|
|
78
|
+
})
|
|
79
|
+
.partial(),
|
|
80
|
+
z.null(),
|
|
81
|
+
]);
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
// Dependency schema for invoice
|
|
85
|
+
const DocumentItemTax = z
|
|
86
|
+
.object({
|
|
87
|
+
rate: z.union([z.number(), z.null()]),
|
|
88
|
+
tax_id: z.union([z.string(), z.null()]),
|
|
89
|
+
classification: z.union([z.string(), z.null()]),
|
|
90
|
+
reverse_charge: z.union([z.boolean(), z.null()]),
|
|
91
|
+
amount: z.union([z.number(), z.null()]),
|
|
92
|
+
pt_exemption_code: z.union([z.string(), z.null()]),
|
|
93
|
+
pt_exemption_reason: z.union([z.string(), z.null()]),
|
|
94
|
+
})
|
|
95
|
+
.partial();
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
// Dependency schema for invoice
|
|
99
|
+
const LineDiscount = z.object({
|
|
100
|
+
value: z.number().gte(0),
|
|
101
|
+
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
// Dependency schema for invoice
|
|
106
|
+
const CreateDocumentItem = z
|
|
107
|
+
.object({
|
|
108
|
+
type: z.union([z.union([z.enum(["separator"]), z.null()]), z.null()]),
|
|
109
|
+
name: z.union([z.string(), z.null()]),
|
|
110
|
+
description: z.union([z.string(), z.null()]),
|
|
111
|
+
classification: z.union([
|
|
112
|
+
z.union([z.enum(["product", "service", "advance"]), z.null()]),
|
|
113
|
+
z.null(),
|
|
114
|
+
]),
|
|
115
|
+
price: z.union([z.number(), z.null()]),
|
|
116
|
+
gross_price: z.union([z.number(), z.null()]),
|
|
117
|
+
quantity: z.union([z.number(), z.null()]),
|
|
118
|
+
unit: z.union([z.string(), z.null()]),
|
|
119
|
+
taxes: z.array(DocumentItemTax),
|
|
120
|
+
discounts: z.array(LineDiscount).max(5),
|
|
121
|
+
item_id: z.union([z.string(), z.null()]),
|
|
122
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
123
|
+
save_item: z.union([z.boolean(), z.null()]),
|
|
124
|
+
})
|
|
125
|
+
.partial();
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
// Dependency schema for invoice
|
|
129
|
+
const CreateDocumentPayment = z.object({
|
|
130
|
+
incoming_purchase_document_id: z.union([z.string(), z.null()]).optional(),
|
|
131
|
+
applied_to_incoming_purchase_document_id: z
|
|
132
|
+
.union([z.string(), z.null()])
|
|
133
|
+
.optional(),
|
|
134
|
+
amount: z.union([z.number(), z.null()]).optional(),
|
|
135
|
+
type: z.enum([
|
|
136
|
+
"cash",
|
|
137
|
+
"bank_transfer",
|
|
138
|
+
"card",
|
|
139
|
+
"check",
|
|
140
|
+
"paypal",
|
|
141
|
+
"coupon",
|
|
142
|
+
"other",
|
|
143
|
+
"credit_note",
|
|
144
|
+
"advance",
|
|
145
|
+
]),
|
|
146
|
+
date: z.union([z.string(), z.null()]).optional(),
|
|
147
|
+
tag: z.union([z.string(), z.null()]).optional(),
|
|
148
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
149
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
150
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
// Dependency schema for invoice
|
|
155
|
+
const CreateFursDocumentData = z.union([
|
|
156
|
+
z
|
|
157
|
+
.object({
|
|
158
|
+
business_premise_name: z.union([z.string(), z.null()]),
|
|
159
|
+
electronic_device_name: z.union([z.string(), z.null()]),
|
|
160
|
+
operator_tax_number: z.union([z.string(), z.null()]),
|
|
161
|
+
operator_label: z.union([z.string(), z.null()]),
|
|
162
|
+
skip: z.union([z.boolean(), z.null()]),
|
|
163
|
+
})
|
|
164
|
+
.partial(),
|
|
165
|
+
z.null(),
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
// Dependency schema for invoice
|
|
170
|
+
const CreateFinaInvoiceData = z.union([
|
|
171
|
+
z
|
|
172
|
+
.object({
|
|
173
|
+
business_premise_name: z.union([z.string(), z.null()]),
|
|
174
|
+
electronic_device_name: z.union([z.string(), z.null()]),
|
|
175
|
+
operator_oib: z.union([z.string(), z.null()]),
|
|
176
|
+
operator_label: z.union([z.string(), z.null()]),
|
|
177
|
+
payment_type: z.union([
|
|
178
|
+
z.union([z.enum(["cash", "card", "online", "bank_transfer", "paypal", "crypto", "coupon", "other"]), z.null()]),
|
|
179
|
+
z.null(),
|
|
180
|
+
]),
|
|
181
|
+
subsequent_submit: z.union([z.boolean(), z.null()]),
|
|
182
|
+
})
|
|
183
|
+
.partial(),
|
|
184
|
+
z.null(),
|
|
185
|
+
]);
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
// Dependency schema for invoice
|
|
189
|
+
const EslogInput = z.union([
|
|
190
|
+
z
|
|
191
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
192
|
+
.partial()
|
|
193
|
+
.passthrough(),
|
|
194
|
+
z.null(),
|
|
195
|
+
]);
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
// Schema for createInvoice operation
|
|
80
199
|
const createInvoiceSchemaDefinition = z.object({
|
|
81
200
|
is_draft: z.boolean().optional(),
|
|
82
201
|
date: z
|
|
@@ -85,118 +204,34 @@ const createInvoiceSchemaDefinition = z.object({
|
|
|
85
204
|
.optional(),
|
|
86
205
|
issuer: DocumentEntity.optional(),
|
|
87
206
|
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
88
|
-
customer:
|
|
89
|
-
z.union([
|
|
90
|
-
z
|
|
91
|
-
.object({ save_customer: z.boolean().default(true) })
|
|
92
|
-
.partial()
|
|
93
|
-
.passthrough(),
|
|
94
|
-
z.null(),
|
|
95
|
-
])
|
|
96
|
-
).optional(),
|
|
207
|
+
customer: CreateDocumentCustomer.optional(),
|
|
97
208
|
note: z.union([z.string(), z.null()]).optional(),
|
|
98
209
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
99
210
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
100
211
|
footer: z.union([z.string(), z.null()]).optional(),
|
|
101
212
|
signature: z.union([z.string(), z.null()]).optional(),
|
|
102
|
-
|
|
213
|
+
calculation_mode: z
|
|
214
|
+
.union([z.union([z.enum(["b2b_standard", "b2c_gross_discount"]), z.null()]), z.null()])
|
|
215
|
+
.optional(),
|
|
103
216
|
currency_code: z.string().max(3).optional(),
|
|
104
217
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
218
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
105
219
|
date_due: z.union([z.string(), z.null()]).optional(),
|
|
220
|
+
pt: PtDocumentInput.optional(),
|
|
106
221
|
date_service: z.union([z.string(), z.null()]).optional(),
|
|
107
222
|
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
108
|
-
items: z
|
|
109
|
-
|
|
110
|
-
z.object({
|
|
111
|
-
type: z.enum(["separator"]).optional(),
|
|
112
|
-
name: z.string().min(1).optional(),
|
|
113
|
-
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
114
|
-
price: z.number().optional(),
|
|
115
|
-
gross_price: z.number().optional(),
|
|
116
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327).optional(),
|
|
117
|
-
unit: z.union([z.string(), z.null()]).optional(),
|
|
118
|
-
taxes: z.array(DocumentItemTax).optional(),
|
|
119
|
-
discounts: z.array(LineDiscount).max(5).optional(),
|
|
120
|
-
metadata: z
|
|
121
|
-
.union([
|
|
122
|
-
z.string(),
|
|
123
|
-
z.number(),
|
|
124
|
-
z.boolean(),
|
|
125
|
-
z.null(),
|
|
126
|
-
z.object({}).partial().passthrough(),
|
|
127
|
-
z.array(z.unknown()),
|
|
128
|
-
z.null(),
|
|
129
|
-
])
|
|
130
|
-
.optional(),
|
|
131
|
-
item_id: z.string().optional(),
|
|
132
|
-
})
|
|
133
|
-
)
|
|
134
|
-
.min(1),
|
|
135
|
-
linked_documents: z.array(z.string().min(1)).optional(),
|
|
223
|
+
items: z.array(CreateDocumentItem).min(1),
|
|
224
|
+
linked_documents: z.union([z.array(z.string().min(1)), z.null()]).optional(),
|
|
136
225
|
payments: z.union([z.array(CreateDocumentPayment), z.null()]).optional(),
|
|
137
|
-
furs:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
electronic_device_name: z.string().min(1),
|
|
143
|
-
operator_tax_number: z.string(),
|
|
144
|
-
operator_label: z.string(),
|
|
145
|
-
skip: z.boolean(),
|
|
146
|
-
})
|
|
147
|
-
.partial(),
|
|
148
|
-
z.null(),
|
|
149
|
-
])
|
|
150
|
-
.optional(),
|
|
151
|
-
fina: z
|
|
152
|
-
.union([
|
|
153
|
-
z
|
|
154
|
-
.object({
|
|
155
|
-
premise_id: z
|
|
156
|
-
.string()
|
|
157
|
-
.min(1)
|
|
158
|
-
.max(20)
|
|
159
|
-
.regex(/^[0-9a-zA-Z]{1,20}$/),
|
|
160
|
-
device_id: z
|
|
161
|
-
.string()
|
|
162
|
-
.min(1)
|
|
163
|
-
.max(20)
|
|
164
|
-
.regex(/^\d{1,20}$/),
|
|
165
|
-
operator_oib: z.string().min(11).max(11),
|
|
166
|
-
is_end_consumer: z.boolean(),
|
|
167
|
-
payment_type: z.enum([
|
|
168
|
-
"cash",
|
|
169
|
-
"card",
|
|
170
|
-
"online",
|
|
171
|
-
"bank_transfer",
|
|
172
|
-
"paypal",
|
|
173
|
-
"crypto",
|
|
174
|
-
"coupon",
|
|
175
|
-
"other",
|
|
176
|
-
]),
|
|
177
|
-
subsequent_submit: z.boolean(),
|
|
178
|
-
})
|
|
179
|
-
.partial(),
|
|
180
|
-
z.null(),
|
|
181
|
-
])
|
|
182
|
-
.optional(),
|
|
183
|
-
eslog: z
|
|
184
|
-
.union([
|
|
185
|
-
z
|
|
186
|
-
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
187
|
-
.partial()
|
|
188
|
-
.passthrough(),
|
|
189
|
-
z.null(),
|
|
190
|
-
])
|
|
191
|
-
.optional(),
|
|
192
|
-
expected_total_with_tax: z.number().gt(0).optional(),
|
|
226
|
+
furs: CreateFursDocumentData.optional(),
|
|
227
|
+
fina: CreateFinaInvoiceData.optional(),
|
|
228
|
+
eslog: EslogInput.optional(),
|
|
229
|
+
expected_total_with_tax: z.union([z.number(), z.null()]).optional(),
|
|
230
|
+
force_linked_documents: z.union([z.boolean(), z.null()]).optional(),
|
|
193
231
|
});
|
|
194
232
|
|
|
195
|
-
// Type for create invoice operation
|
|
196
|
-
export type CreateInvoiceSchema = z.infer<typeof createInvoiceSchemaDefinition>;
|
|
197
|
-
|
|
198
233
|
|
|
199
|
-
// Schema for
|
|
234
|
+
// Schema for updateInvoice operation
|
|
200
235
|
const updateInvoiceSchemaDefinition = z
|
|
201
236
|
.object({
|
|
202
237
|
date: z
|
|
@@ -204,63 +239,27 @@ const updateInvoiceSchemaDefinition = z
|
|
|
204
239
|
.regex(/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?)?$/),
|
|
205
240
|
issuer: DocumentEntity.and(z.unknown()),
|
|
206
241
|
customer_id: z.union([z.string(), z.null()]),
|
|
207
|
-
customer:
|
|
208
|
-
|
|
209
|
-
z
|
|
210
|
-
.object({ save_customer: z.boolean().default(true) })
|
|
211
|
-
.partial()
|
|
212
|
-
.passthrough(),
|
|
213
|
-
z.null(),
|
|
214
|
-
])
|
|
215
|
-
),
|
|
216
|
-
items: z
|
|
217
|
-
.array(
|
|
218
|
-
z.object({
|
|
219
|
-
name: z.string().min(1).optional(),
|
|
220
|
-
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
221
|
-
price: z.number().optional(),
|
|
222
|
-
gross_price: z.number().optional(),
|
|
223
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
224
|
-
unit: z.union([z.string(), z.null()]).optional(),
|
|
225
|
-
taxes: z.array(DocumentItemTax).optional(),
|
|
226
|
-
discounts: z.array(LineDiscount).max(5).optional(),
|
|
227
|
-
metadata: z
|
|
228
|
-
.union([
|
|
229
|
-
z.string(),
|
|
230
|
-
z.number(),
|
|
231
|
-
z.boolean(),
|
|
232
|
-
z.null(),
|
|
233
|
-
z.object({}).partial().passthrough(),
|
|
234
|
-
z.array(z.unknown()),
|
|
235
|
-
z.null(),
|
|
236
|
-
])
|
|
237
|
-
.optional(),
|
|
238
|
-
item_id: z.string().optional(),
|
|
239
|
-
})
|
|
240
|
-
)
|
|
241
|
-
.min(1),
|
|
242
|
+
customer: CreateDocumentCustomer,
|
|
243
|
+
items: z.array(CreateDocumentItem).min(1),
|
|
242
244
|
note: z.union([z.string(), z.null()]),
|
|
243
|
-
footer: z.union([z.string(), z.null()]),
|
|
244
245
|
payment_terms: z.union([z.string(), z.null()]),
|
|
246
|
+
tax_clause: z.union([z.string(), z.null()]),
|
|
247
|
+
footer: z.union([z.string(), z.null()]),
|
|
248
|
+
signature: z.union([z.string(), z.null()]),
|
|
245
249
|
currency_code: z.string(),
|
|
250
|
+
reference: z.union([z.string(), z.null()]),
|
|
246
251
|
metadata: z.union([z.object({}).partial().passthrough(), z.null()]),
|
|
247
252
|
change_reason: z.string().max(500),
|
|
248
253
|
date_due: z.union([z.string(), z.null()]),
|
|
249
254
|
date_service: z.union([z.string(), z.null()]),
|
|
250
255
|
date_service_to: z.union([z.string(), z.null()]),
|
|
251
|
-
linked_documents: z.array(z.string().min(1)),
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
255
|
-
.partial()
|
|
256
|
-
.passthrough(),
|
|
257
|
-
z.null(),
|
|
258
|
-
]),
|
|
256
|
+
linked_documents: z.union([z.array(z.string().min(1)), z.null()]),
|
|
257
|
+
force_linked_documents: z.boolean(),
|
|
258
|
+
eslog: EslogInput,
|
|
259
259
|
})
|
|
260
260
|
.partial();
|
|
261
261
|
|
|
262
|
-
|
|
263
|
-
export type UpdateInvoiceSchema = z.infer<typeof updateInvoiceSchemaDefinition>;
|
|
264
|
-
|
|
262
|
+
export type CreateInvoiceSchema = z.infer<typeof createInvoiceSchemaDefinition>;
|
|
265
263
|
export const createInvoiceSchema = createInvoiceSchemaDefinition;
|
|
264
|
+
export type UpdateInvoiceSchema = z.infer<typeof updateInvoiceSchemaDefinition>;
|
|
266
265
|
export const updateInvoiceSchema = updateInvoiceSchemaDefinition;
|
|
@@ -8,12 +8,12 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for item endpoints
|
|
10
10
|
|
|
11
|
-
// Schema for
|
|
11
|
+
// Schema for createItem operation
|
|
12
12
|
const createItemSchemaDefinition = z.object({
|
|
13
13
|
name: z.string().min(1),
|
|
14
14
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
15
15
|
classification: z
|
|
16
|
-
.union([z.enum(["product", "service", "advance", null]), z.null()])
|
|
16
|
+
.union([z.union([z.enum(["product", "service", "advance"]), z.null()]), z.null()])
|
|
17
17
|
.optional(),
|
|
18
18
|
price: z.number().optional(),
|
|
19
19
|
gross_price: z.number().optional(),
|
|
@@ -35,17 +35,14 @@ const createItemSchemaDefinition = z.object({
|
|
|
35
35
|
.optional(),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
// Type for create item operation
|
|
39
|
-
export type CreateItemSchema = z.infer<typeof createItemSchemaDefinition>;
|
|
40
|
-
|
|
41
38
|
|
|
42
|
-
// Schema for
|
|
39
|
+
// Schema for updateItem operation
|
|
43
40
|
const updateItemSchemaDefinition = z
|
|
44
41
|
.object({
|
|
45
42
|
name: z.string().min(1),
|
|
46
43
|
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]),
|
|
47
44
|
classification: z.union([
|
|
48
|
-
z.enum(["product", "service", "advance", null]),
|
|
45
|
+
z.union([z.enum(["product", "service", "advance"]), z.null()]),
|
|
49
46
|
z.null(),
|
|
50
47
|
]),
|
|
51
48
|
price: z.number(),
|
|
@@ -67,8 +64,7 @@ const updateItemSchemaDefinition = z
|
|
|
67
64
|
})
|
|
68
65
|
.partial();
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
export type UpdateItemSchema = z.infer<typeof updateItemSchemaDefinition>;
|
|
72
|
-
|
|
67
|
+
export type CreateItemSchema = z.infer<typeof createItemSchemaDefinition>;
|
|
73
68
|
export const createItemSchema = createItemSchemaDefinition;
|
|
69
|
+
export type UpdateItemSchema = z.infer<typeof updateItemSchemaDefinition>;
|
|
74
70
|
export const updateItemSchema = updateItemSchemaDefinition;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 legacymigrationauth endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for legacyMigrationAuth operation
|
|
12
|
+
const legacyMigrationAuthSchemaDefinition = z.object({
|
|
13
|
+
email: z.string().email(),
|
|
14
|
+
password: z.string().min(1),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type LegacyMigrationAuthSchema = z.infer<typeof legacyMigrationAuthSchemaDefinition>;
|
|
18
|
+
export const legacyMigrationAuthSchema = legacyMigrationAuthSchemaDefinition;
|
|
@@ -8,38 +8,16 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for me endpoints
|
|
10
10
|
|
|
11
|
-
// Schema for
|
|
11
|
+
// Schema for patchMe operation
|
|
12
12
|
const patchMeSchemaDefinition = z
|
|
13
13
|
.object({
|
|
14
14
|
name: z.union([z.string(), z.null()]),
|
|
15
15
|
locale: z.union([
|
|
16
|
-
z.enum([
|
|
17
|
-
"en",
|
|
18
|
-
"de",
|
|
19
|
-
"sl",
|
|
20
|
-
"it",
|
|
21
|
-
"fr",
|
|
22
|
-
"es",
|
|
23
|
-
"pt",
|
|
24
|
-
"nl",
|
|
25
|
-
"pl",
|
|
26
|
-
"hr",
|
|
27
|
-
"sv",
|
|
28
|
-
"fi",
|
|
29
|
-
"et",
|
|
30
|
-
"bg",
|
|
31
|
-
"cs",
|
|
32
|
-
"sk",
|
|
33
|
-
"nb",
|
|
34
|
-
"is",
|
|
35
|
-
null,
|
|
36
|
-
]),
|
|
16
|
+
z.union([z.enum(["en", "de", "sl", "it", "fr", "es", "pt", "nl", "pl", "hr", "sv", "fi", "et", "bg", "cs", "sk", "nb", "is"]), z.null()]),
|
|
37
17
|
z.null(),
|
|
38
18
|
]),
|
|
39
19
|
})
|
|
40
20
|
.partial();
|
|
41
21
|
|
|
42
|
-
// Type for patch me operation
|
|
43
22
|
export type PatchMeSchema = z.infer<typeof patchMeSchemaDefinition>;
|
|
44
|
-
|
|
45
23
|
export const patchMeSchema = patchMeSchemaDefinition;
|
|
@@ -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 migrationjob endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for createMigrationJob operation
|
|
12
|
+
const createMigrationJobSchemaDefinition = z.object({
|
|
13
|
+
legacy_org_id: z.string().min(1),
|
|
14
|
+
legacy_session_id: z.string().min(1),
|
|
15
|
+
environment: z.enum(["live", "sandbox"]),
|
|
16
|
+
confirm_unsupported_data: z.boolean().optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type CreateMigrationJobSchema = z.infer<typeof createMigrationJobSchemaDefinition>;
|
|
20
|
+
export const createMigrationJobSchema = createMigrationJobSchemaDefinition;
|
|
@@ -63,7 +63,7 @@ const OrderItem = z
|
|
|
63
63
|
.passthrough();
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
// Schema for
|
|
66
|
+
// Schema for createOrder operation
|
|
67
67
|
const createOrderSchemaDefinition = z.object({
|
|
68
68
|
order_integration_id: z.string().max(36),
|
|
69
69
|
source: z.enum(["shopify", "woocommerce", "manual"]),
|
|
@@ -97,11 +97,8 @@ const createOrderSchemaDefinition = z.object({
|
|
|
97
97
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
// Type for create order operation
|
|
101
|
-
export type CreateOrderSchema = z.infer<typeof createOrderSchemaDefinition>;
|
|
102
|
-
|
|
103
100
|
|
|
104
|
-
// Schema for
|
|
101
|
+
// Schema for updateOrder operation
|
|
105
102
|
const updateOrderSchemaDefinition = z
|
|
106
103
|
.object({
|
|
107
104
|
source_order_number: z.union([z.string(), z.null()]),
|
|
@@ -124,8 +121,7 @@ const updateOrderSchemaDefinition = z
|
|
|
124
121
|
})
|
|
125
122
|
.partial();
|
|
126
123
|
|
|
127
|
-
|
|
128
|
-
export type UpdateOrderSchema = z.infer<typeof updateOrderSchemaDefinition>;
|
|
129
|
-
|
|
124
|
+
export type CreateOrderSchema = z.infer<typeof createOrderSchemaDefinition>;
|
|
130
125
|
export const createOrderSchema = createOrderSchemaDefinition;
|
|
126
|
+
export type UpdateOrderSchema = z.infer<typeof updateOrderSchemaDefinition>;
|
|
131
127
|
export const updateOrderSchema = updateOrderSchemaDefinition;
|
|
@@ -8,7 +8,7 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for orderintegration endpoints
|
|
10
10
|
|
|
11
|
-
// Schema for
|
|
11
|
+
// Schema for createOrderIntegration operation
|
|
12
12
|
const createOrderIntegrationSchemaDefinition = z.object({
|
|
13
13
|
name: z.string().min(1),
|
|
14
14
|
source: z
|
|
@@ -23,11 +23,8 @@ const createOrderIntegrationSchemaDefinition = z.object({
|
|
|
23
23
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
// Type for create orderintegration operation
|
|
27
|
-
export type CreateOrderIntegrationSchema = z.infer<typeof createOrderIntegrationSchemaDefinition>;
|
|
28
|
-
|
|
29
26
|
|
|
30
|
-
// Schema for
|
|
27
|
+
// Schema for updateOrderIntegration operation
|
|
31
28
|
const updateOrderIntegrationSchemaDefinition = z
|
|
32
29
|
.object({
|
|
33
30
|
name: z.string().min(1),
|
|
@@ -48,8 +45,7 @@ const updateOrderIntegrationSchemaDefinition = z
|
|
|
48
45
|
})
|
|
49
46
|
.partial();
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
export type UpdateOrderIntegrationSchema = z.infer<typeof updateOrderIntegrationSchemaDefinition>;
|
|
53
|
-
|
|
48
|
+
export type CreateOrderIntegrationSchema = z.infer<typeof createOrderIntegrationSchemaDefinition>;
|
|
54
49
|
export const createOrderIntegrationSchema = createOrderIntegrationSchemaDefinition;
|
|
50
|
+
export type UpdateOrderIntegrationSchema = z.infer<typeof updateOrderIntegrationSchemaDefinition>;
|
|
55
51
|
export const updateOrderIntegrationSchema = updateOrderIntegrationSchemaDefinition;
|
|
@@ -8,7 +8,7 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for payment endpoints
|
|
10
10
|
|
|
11
|
-
// Schema for
|
|
11
|
+
// Schema for createPayment operation
|
|
12
12
|
const createPaymentSchemaDefinition = z.object({
|
|
13
13
|
invoice_id: z.union([z.string(), z.null()]).optional(),
|
|
14
14
|
credit_note_id: z.union([z.string(), z.null()]).optional(),
|
|
@@ -37,11 +37,8 @@ const createPaymentSchemaDefinition = z.object({
|
|
|
37
37
|
document_id: z.union([z.string(), z.null()]).optional(),
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
// Type for create payment operation
|
|
41
|
-
export type CreatePaymentSchema = z.infer<typeof createPaymentSchemaDefinition>;
|
|
42
|
-
|
|
43
40
|
|
|
44
|
-
// Schema for
|
|
41
|
+
// Schema for updatePayment operation
|
|
45
42
|
const updatePaymentSchemaDefinition = z
|
|
46
43
|
.object({
|
|
47
44
|
amount: z.number().gt(0),
|
|
@@ -64,8 +61,7 @@ const updatePaymentSchemaDefinition = z
|
|
|
64
61
|
})
|
|
65
62
|
.partial();
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
export type UpdatePaymentSchema = z.infer<typeof updatePaymentSchemaDefinition>;
|
|
69
|
-
|
|
64
|
+
export type CreatePaymentSchema = z.infer<typeof createPaymentSchemaDefinition>;
|
|
70
65
|
export const createPaymentSchema = createPaymentSchemaDefinition;
|
|
66
|
+
export type UpdatePaymentSchema = z.infer<typeof updatePaymentSchemaDefinition>;
|
|
71
67
|
export const updatePaymentSchema = updatePaymentSchemaDefinition;
|
|
@@ -8,7 +8,7 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for ptatcudseries endpoints
|
|
10
10
|
|
|
11
|
-
// Schema for
|
|
11
|
+
// Schema for createPtAtcudSeries operation
|
|
12
12
|
const createPtAtcudSeriesSchemaDefinition = z.object({
|
|
13
13
|
document_type: z.enum([
|
|
14
14
|
"invoice",
|
|
@@ -24,7 +24,5 @@ const createPtAtcudSeriesSchemaDefinition = z.object({
|
|
|
24
24
|
initial_sequence: z.number().int().gte(1).optional(),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
// Type for create ptatcudseries operation
|
|
28
27
|
export type CreatePtAtcudSeriesSchema = z.infer<typeof createPtAtcudSeriesSchemaDefinition>;
|
|
29
|
-
|
|
30
28
|
export const createPtAtcudSeriesSchema = createPtAtcudSeriesSchemaDefinition;
|
|
@@ -0,0 +1,15 @@
|
|
|
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 queryentitystats endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for queryEntityStats operation
|
|
12
|
+
const queryEntityStatsSchemaDefinition = z.object({ code: z.string(), message: z.string() }).passthrough();
|
|
13
|
+
|
|
14
|
+
export type QueryEntityStatsSchema = z.infer<typeof queryEntityStatsSchemaDefinition>;
|
|
15
|
+
export const queryEntityStatsSchema = queryEntityStatsSchemaDefinition;
|