@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,36 +8,6 @@ import { z } from 'zod';
|
|
|
8
8
|
|
|
9
9
|
// Schemas for customestimate endpoints
|
|
10
10
|
|
|
11
|
-
// Dependency schema for customestimate
|
|
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 customestimate
|
|
19
|
-
const DocumentItemTax = z
|
|
20
|
-
.object({
|
|
21
|
-
rate: z.number(),
|
|
22
|
-
tax_id: z.string(),
|
|
23
|
-
classification: z.string(),
|
|
24
|
-
reverse_charge: z.boolean(),
|
|
25
|
-
amount: z.number(),
|
|
26
|
-
})
|
|
27
|
-
.partial();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// Dependency schema for customestimate
|
|
31
|
-
const DocumentSummaryTax = z
|
|
32
|
-
.object({
|
|
33
|
-
rate: z.number(),
|
|
34
|
-
base: z.number(),
|
|
35
|
-
amount: z.number(),
|
|
36
|
-
reverse_charge: z.boolean().optional(),
|
|
37
|
-
})
|
|
38
|
-
.passthrough();
|
|
39
|
-
|
|
40
|
-
|
|
41
11
|
// Dependency schema for customestimate
|
|
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,77 +49,130 @@ const DocumentEntity = z
|
|
|
76
49
|
.passthrough();
|
|
77
50
|
|
|
78
51
|
|
|
79
|
-
//
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
52
|
+
// Dependency schema for customestimate
|
|
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 customestimate
|
|
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 customestimate
|
|
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 customestimate
|
|
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()]),
|
|
94
93
|
z.null(),
|
|
95
|
-
])
|
|
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 customestimate
|
|
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 customestimate
|
|
123
|
+
const EslogInput = z.union([
|
|
124
|
+
z
|
|
125
|
+
.object({ validation_enabled: z.union([z.boolean(), z.null()]) })
|
|
126
|
+
.partial()
|
|
127
|
+
.passthrough(),
|
|
128
|
+
z.null(),
|
|
129
|
+
]);
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
// Schema for createCustomEstimate operation
|
|
133
|
+
const createCustomEstimateSchemaDefinition = z.object({
|
|
134
|
+
is_draft: z.union([z.boolean(), z.null()]).optional(),
|
|
135
|
+
date: z.union([z.string(), z.null()]).optional(),
|
|
136
|
+
issuer: DocumentEntity.and(
|
|
137
|
+
z.union([z.object({}).partial().passthrough(), z.null()])
|
|
96
138
|
).optional(),
|
|
139
|
+
customer_id: z.union([z.string(), z.null()]).optional(),
|
|
140
|
+
customer: CreateDocumentCustomer.optional(),
|
|
97
141
|
note: z.union([z.string(), z.null()]).optional(),
|
|
98
142
|
payment_terms: z.union([z.string(), z.null()]).optional(),
|
|
99
143
|
tax_clause: z.union([z.string(), z.null()]).optional(),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
144
|
+
footer: z.union([z.string(), z.null()]).optional(),
|
|
145
|
+
signature: z.union([z.string(), z.null()]).optional(),
|
|
146
|
+
calculation_mode: z
|
|
147
|
+
.union([z.union([z.enum(["b2b_standard", "b2c_gross_discount"]), z.null()]), z.null()])
|
|
148
|
+
.optional(),
|
|
149
|
+
currency_code: z.union([z.string(), z.null()]).optional(),
|
|
104
150
|
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
date_due: z.union([z.string(), z.null()]).optional(),
|
|
108
|
-
date_service: z.union([z.string(), z.null()]).optional(),
|
|
109
|
-
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
110
|
-
items: z
|
|
111
|
-
.array(
|
|
112
|
-
z.object({
|
|
113
|
-
name: z.string().min(1).optional(),
|
|
114
|
-
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
115
|
-
price: z.number().optional(),
|
|
116
|
-
gross_price: z.number().optional(),
|
|
117
|
-
quantity: z.number().gte(-140737488355328).lte(140737488355327),
|
|
118
|
-
unit: z.union([z.string(), z.null()]).optional(),
|
|
119
|
-
taxes: z.array(DocumentItemTax).optional(),
|
|
120
|
-
discounts: z.array(LineDiscount).max(5).optional(),
|
|
121
|
-
total: z.number(),
|
|
122
|
-
total_with_tax: z.number(),
|
|
123
|
-
metadata: z
|
|
124
|
-
.union([
|
|
125
|
-
z.string(),
|
|
126
|
-
z.number(),
|
|
127
|
-
z.boolean(),
|
|
128
|
-
z.null(),
|
|
129
|
-
z.object({}).partial().passthrough(),
|
|
130
|
-
z.array(z.unknown()),
|
|
131
|
-
z.null(),
|
|
132
|
-
])
|
|
133
|
-
.optional(),
|
|
134
|
-
item_id: z.string().optional(),
|
|
135
|
-
})
|
|
136
|
-
)
|
|
137
|
-
.min(1),
|
|
138
|
-
eslog: z
|
|
151
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
152
|
+
pt: z
|
|
139
153
|
.union([
|
|
140
|
-
z
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
.passthrough(),
|
|
154
|
+
z.string(),
|
|
155
|
+
z.number(),
|
|
156
|
+
z.boolean(),
|
|
144
157
|
z.null(),
|
|
158
|
+
z.object({}).partial().passthrough(),
|
|
159
|
+
z.array(z.unknown()),
|
|
145
160
|
])
|
|
146
161
|
.optional(),
|
|
162
|
+
date_valid_till: z.union([z.string(), z.null()]).optional(),
|
|
163
|
+
title_type: z
|
|
164
|
+
.union([z.union([z.enum(["estimate", "proforma_invoice"]), z.null()]), z.null()])
|
|
165
|
+
.optional(),
|
|
166
|
+
date_due: z.union([z.string(), z.null()]).optional(),
|
|
167
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
168
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
169
|
+
items: z.array(CustomDocumentItem).min(1),
|
|
170
|
+
total: z.number(),
|
|
171
|
+
total_with_tax: z.number(),
|
|
172
|
+
total_discount: z.union([z.number(), z.null()]).optional(),
|
|
173
|
+
taxes: z.array(DocumentSummaryTax).optional(),
|
|
174
|
+
eslog: EslogInput.optional(),
|
|
147
175
|
});
|
|
148
176
|
|
|
149
|
-
// Type for create customestimate operation
|
|
150
177
|
export type CreateCustomEstimateSchema = z.infer<typeof createCustomEstimateSchemaDefinition>;
|
|
151
|
-
|
|
152
178
|
export const createCustomEstimateSchema = createCustomEstimateSchemaDefinition;
|
|
@@ -0,0 +1,142 @@
|
|
|
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 customincomingpurchasedocument endpoints
|
|
10
|
+
|
|
11
|
+
// Dependency schema for customincomingpurchasedocument
|
|
12
|
+
const IncomingPurchaseDocumentSupplier = z.union([
|
|
13
|
+
z.object({
|
|
14
|
+
name: z.string().min(1),
|
|
15
|
+
email: z.union([z.string(), z.null()]).optional(),
|
|
16
|
+
address: z.union([z.string(), z.null()]).optional(),
|
|
17
|
+
address_2: z.union([z.string(), z.null()]).optional(),
|
|
18
|
+
post_code: z.union([z.string(), z.null()]).optional(),
|
|
19
|
+
city: z.union([z.string(), z.null()]).optional(),
|
|
20
|
+
state: z.union([z.string(), z.null()]).optional(),
|
|
21
|
+
country: z.union([z.string(), z.null()]).optional(),
|
|
22
|
+
country_code: z.union([z.string(), z.null()]).optional(),
|
|
23
|
+
tax_number: z.union([z.string(), z.null()]).optional(),
|
|
24
|
+
company_number: z.union([z.string(), z.null()]).optional(),
|
|
25
|
+
phone: z.union([z.string(), z.null()]).optional(),
|
|
26
|
+
peppol_id: z.union([z.string(), z.null()]).optional(),
|
|
27
|
+
is_tax_subject: z.union([z.boolean(), z.null()]).optional(),
|
|
28
|
+
}),
|
|
29
|
+
z.null(),
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// Dependency schema for customincomingpurchasedocument
|
|
34
|
+
const LineDiscount = z.object({
|
|
35
|
+
value: z.number().gte(0),
|
|
36
|
+
type: z.enum(["percent", "amount"]).optional().default("percent"),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// Dependency schema for customincomingpurchasedocument
|
|
41
|
+
const DocumentItemTax = z
|
|
42
|
+
.object({
|
|
43
|
+
rate: z.union([z.number(), z.null()]),
|
|
44
|
+
tax_id: z.union([z.string(), z.null()]),
|
|
45
|
+
classification: z.union([z.string(), z.null()]),
|
|
46
|
+
reverse_charge: z.union([z.boolean(), z.null()]),
|
|
47
|
+
amount: z.union([z.number(), z.null()]),
|
|
48
|
+
pt_exemption_code: z.union([z.string(), z.null()]),
|
|
49
|
+
pt_exemption_reason: z.union([z.string(), z.null()]),
|
|
50
|
+
})
|
|
51
|
+
.partial();
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
// Dependency schema for customincomingpurchasedocument
|
|
55
|
+
const IncomingPurchaseDocumentItem = z.object({
|
|
56
|
+
name: z.string().min(1),
|
|
57
|
+
description: z.union([z.string(), z.null()]).optional(),
|
|
58
|
+
quantity: z.number(),
|
|
59
|
+
unit: z.union([z.string(), z.null()]).optional(),
|
|
60
|
+
classification: z.enum(["product", "service"]),
|
|
61
|
+
price: z.number(),
|
|
62
|
+
gross_price: z.union([z.number(), z.null()]).optional(),
|
|
63
|
+
discounts: z.array(LineDiscount).optional().default([]),
|
|
64
|
+
taxes: z.array(DocumentItemTax).optional().default([]),
|
|
65
|
+
total: z.number(),
|
|
66
|
+
total_with_tax: z.number(),
|
|
67
|
+
total_tax: z.number(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// Dependency schema for customincomingpurchasedocument
|
|
72
|
+
const IncomingPurchaseDocumentSummaryTax = z
|
|
73
|
+
.object({
|
|
74
|
+
rate: z.union([z.number(), z.null()]),
|
|
75
|
+
tax_id: z.union([z.string(), z.null()]).optional(),
|
|
76
|
+
base: z.number(),
|
|
77
|
+
total_tax: z.number(),
|
|
78
|
+
reverse_charged: z.union([z.boolean(), z.null()]).optional(),
|
|
79
|
+
is_deductible: z.union([z.boolean(), z.null()]).optional(),
|
|
80
|
+
})
|
|
81
|
+
.passthrough();
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
// Dependency schema for customincomingpurchasedocument
|
|
85
|
+
const ExchangeRate = z.union([
|
|
86
|
+
z
|
|
87
|
+
.object({
|
|
88
|
+
rate: z.number(),
|
|
89
|
+
source: z.string(),
|
|
90
|
+
date: z.string().datetime({ offset: true }),
|
|
91
|
+
quote_currency: z.string(),
|
|
92
|
+
})
|
|
93
|
+
.passthrough(),
|
|
94
|
+
z.null(),
|
|
95
|
+
]);
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
// Dependency schema for customincomingpurchasedocument
|
|
99
|
+
const IncomingPurchaseDocumentSummaryClassification = z.union([
|
|
100
|
+
z.union([z.enum(["goods", "services"]), z.null()]),
|
|
101
|
+
z.null(),
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
// Schema for createCustomIncomingPurchaseDocument operation
|
|
106
|
+
const createCustomIncomingPurchaseDocumentSchemaDefinition = z.object({
|
|
107
|
+
type: z.enum(["invoice", "credit_note", "advance_invoice"]),
|
|
108
|
+
is_draft: z.union([z.boolean(), z.null()]).optional(),
|
|
109
|
+
supplier_id: z.union([z.string(), z.null()]).optional(),
|
|
110
|
+
supplier: IncomingPurchaseDocumentSupplier.optional(),
|
|
111
|
+
save_supplier: z.union([z.boolean(), z.null()]).optional(),
|
|
112
|
+
supplier_document_number: z.union([z.string(), z.null()]).optional(),
|
|
113
|
+
date: z.union([z.string(), z.null()]).optional(),
|
|
114
|
+
date_received: z.union([z.string(), z.null()]).optional(),
|
|
115
|
+
date_due: z.union([z.string(), z.null()]).optional(),
|
|
116
|
+
date_service: z.union([z.string(), z.null()]).optional(),
|
|
117
|
+
date_service_to: z.union([z.string(), z.null()]).optional(),
|
|
118
|
+
currency_code: z.union([z.string(), z.null()]).optional(),
|
|
119
|
+
transaction_type: z
|
|
120
|
+
.union([
|
|
121
|
+
z.union([z.enum(["domestic", "intra_eu_b2b", "intra_eu_b2c", "3w_b2b", "3w_b2c", "export"]), z.null()]),
|
|
122
|
+
z.null(),
|
|
123
|
+
])
|
|
124
|
+
.optional(),
|
|
125
|
+
reference: z.union([z.string(), z.null()]).optional(),
|
|
126
|
+
note: z.union([z.string(), z.null()]).optional(),
|
|
127
|
+
items: z.union([z.array(IncomingPurchaseDocumentItem), z.null()]).optional(),
|
|
128
|
+
taxes: z
|
|
129
|
+
.union([z.array(IncomingPurchaseDocumentSummaryTax), z.null()])
|
|
130
|
+
.optional(),
|
|
131
|
+
total: z.union([z.number(), z.null()]).optional(),
|
|
132
|
+
total_with_tax: z.union([z.number(), z.null()]).optional(),
|
|
133
|
+
total_discount: z.union([z.number(), z.null()]).optional(),
|
|
134
|
+
exchange_rate: ExchangeRate.optional(),
|
|
135
|
+
summary_classification:
|
|
136
|
+
IncomingPurchaseDocumentSummaryClassification.optional(),
|
|
137
|
+
cancelled_at: z.union([z.string(), z.null()]).optional(),
|
|
138
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export type CreateCustomIncomingPurchaseDocumentSchema = z.infer<typeof createCustomIncomingPurchaseDocumentSchemaDefinition>;
|
|
142
|
+
export const createCustomIncomingPurchaseDocumentSchema = createCustomIncomingPurchaseDocumentSchemaDefinition;
|