@spaceinvoices/react-ui 0.4.11 → 0.4.12
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 +3 -2
- package/registry.json +30 -31
- package/src/common/autocomplete.tsx +41 -25
- package/src/components/activities/locales/bg.ts +21 -0
- package/src/components/activities/locales/cs.ts +21 -0
- package/src/components/activities/locales/en.ts +21 -0
- package/src/components/activities/locales/et.ts +21 -0
- package/src/components/activities/locales/fi.ts +21 -0
- package/src/components/activities/locales/is.ts +21 -0
- package/src/components/activities/locales/nb.ts +21 -0
- package/src/components/activities/locales/sk.ts +21 -0
- package/src/components/activities/locales/sv.ts +21 -0
- package/src/components/advance-invoices/advance-invoices.hooks.ts +2 -3
- package/src/components/advance-invoices/create/create-advance-invoice-form.tsx +290 -69
- package/src/components/advance-invoices/create/locales/bg.ts +48 -0
- package/src/components/advance-invoices/create/locales/cs.ts +48 -0
- package/src/components/advance-invoices/create/locales/en.ts +48 -0
- package/src/components/advance-invoices/create/locales/et.ts +48 -0
- package/src/components/advance-invoices/create/locales/fi.ts +48 -0
- package/src/components/advance-invoices/create/locales/hr.ts +17 -17
- package/src/components/advance-invoices/create/locales/is.ts +48 -0
- package/src/components/advance-invoices/create/locales/nb.ts +48 -0
- package/src/components/advance-invoices/create/locales/sk.ts +48 -0
- package/src/components/advance-invoices/create/locales/sl.ts +9 -7
- package/src/components/advance-invoices/create/locales/sv.ts +48 -0
- package/src/components/advance-invoices/create/prepare-advance-invoice-submission.ts +16 -2
- package/src/components/advance-invoices/list/list-row-actions.tsx +48 -16
- package/src/components/advance-invoices/list/list-table.tsx +33 -8
- package/src/components/advance-invoices/list/locales/bg.ts +51 -0
- package/src/components/advance-invoices/list/locales/cs.ts +51 -0
- package/src/components/advance-invoices/list/locales/en.ts +33 -2
- package/src/components/advance-invoices/list/locales/et.ts +51 -0
- package/src/components/advance-invoices/list/locales/fi.ts +51 -0
- package/src/components/advance-invoices/list/locales/hr.ts +15 -15
- package/src/components/advance-invoices/list/locales/is.ts +51 -0
- package/src/components/advance-invoices/list/locales/nb.ts +51 -0
- package/src/components/advance-invoices/list/locales/sk.ts +51 -0
- package/src/components/advance-invoices/list/locales/sv.ts +51 -0
- package/src/components/advance-invoices/list/use-advance-invoice-download.ts +3 -5
- package/src/components/common/autocomplete-locales.ts +101 -0
- package/src/components/company-registry/company-registry.hooks.ts +3 -7
- package/src/components/credit-notes/create/create-credit-note-form.tsx +211 -22
- package/src/components/credit-notes/create/locales/bg.ts +87 -0
- package/src/components/credit-notes/create/locales/cs.ts +87 -0
- package/src/components/credit-notes/create/locales/en.ts +87 -0
- package/src/components/credit-notes/create/locales/et.ts +87 -0
- package/src/components/credit-notes/create/locales/fi.ts +87 -0
- package/src/components/credit-notes/create/locales/hr.ts +24 -24
- package/src/components/credit-notes/create/locales/is.ts +87 -0
- package/src/components/credit-notes/create/locales/nb.ts +87 -0
- package/src/components/credit-notes/create/locales/sk.ts +87 -0
- package/src/components/credit-notes/create/locales/sl.ts +9 -9
- package/src/components/credit-notes/create/locales/sv.ts +87 -0
- package/src/components/credit-notes/create/prepare-credit-note-submission.ts +32 -0
- package/src/components/credit-notes/credit-notes.hooks.ts +15 -3
- package/src/components/credit-notes/list/list-row-actions.tsx +19 -7
- package/src/components/credit-notes/list/list-table.tsx +58 -7
- package/src/components/credit-notes/list/locales/bg.ts +48 -0
- package/src/components/credit-notes/list/locales/cs.ts +48 -0
- package/src/components/credit-notes/list/locales/en.ts +31 -2
- package/src/components/credit-notes/list/locales/et.ts +48 -0
- package/src/components/credit-notes/list/locales/fi.ts +48 -0
- package/src/components/credit-notes/list/locales/hr.ts +12 -12
- package/src/components/credit-notes/list/locales/is.ts +48 -0
- package/src/components/credit-notes/list/locales/nb.ts +48 -0
- package/src/components/credit-notes/list/locales/sk.ts +48 -0
- package/src/components/credit-notes/list/locales/sv.ts +48 -0
- package/src/components/credit-notes/list/use-credit-note-download.ts +3 -5
- package/src/components/customers/create-customer-form/locales/bg.ts +21 -0
- package/src/components/customers/create-customer-form/locales/cs.ts +21 -0
- package/src/components/customers/create-customer-form/locales/en.ts +21 -0
- package/src/components/customers/create-customer-form/locales/et.ts +21 -0
- package/src/components/customers/create-customer-form/locales/fi.ts +21 -0
- package/src/components/customers/create-customer-form/locales/hr.ts +11 -11
- package/src/components/customers/create-customer-form/locales/is.ts +21 -0
- package/src/components/customers/create-customer-form/locales/nb.ts +21 -0
- package/src/components/customers/create-customer-form/locales/sk.ts +21 -0
- package/src/components/customers/create-customer-form/locales/sv.ts +21 -0
- package/src/components/customers/customer-autocomplete.tsx +32 -4
- package/src/components/customers/customer-list-table/customer-list-table.tsx +8 -6
- package/src/components/customers/customer-list-table/locales/bg.ts +25 -0
- package/src/components/customers/customer-list-table/locales/cs.ts +25 -0
- package/src/components/customers/customer-list-table/locales/en.ts +17 -2
- package/src/components/customers/customer-list-table/locales/et.ts +25 -0
- package/src/components/customers/customer-list-table/locales/fi.ts +25 -0
- package/src/components/customers/customer-list-table/locales/hr.ts +11 -11
- package/src/components/customers/customer-list-table/locales/is.ts +25 -0
- package/src/components/customers/customer-list-table/locales/nb.ts +25 -0
- package/src/components/customers/customer-list-table/locales/sk.ts +25 -0
- package/src/components/customers/customer-list-table/locales/sv.ts +25 -0
- package/src/components/customers/customers.hooks.ts +14 -17
- package/src/components/customers/edit-customer-form/locales/bg.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/cs.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/en.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/et.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/fi.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/hr.ts +5 -5
- package/src/components/customers/edit-customer-form/locales/is.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/nb.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/sk.ts +13 -0
- package/src/components/customers/edit-customer-form/locales/sv.ts +13 -0
- package/src/components/dashboard/collection-rate-card/collection-rate-card.tsx +7 -6
- package/src/components/dashboard/collection-rate-card/locales/en.ts +3 -0
- package/src/components/dashboard/collection-rate-card/use-collection-rate.ts +8 -7
- package/src/components/dashboard/invoice-status-chart/invoice-status-chart.tsx +7 -4
- package/src/components/dashboard/invoice-status-chart/locales/bg.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/cs.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/de.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/en.ts +10 -0
- package/src/components/dashboard/invoice-status-chart/locales/es.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/et.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/fi.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/fr.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/hr.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/is.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/it.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/nb.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/nl.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/pl.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/pt.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/sk.ts +5 -5
- package/src/components/dashboard/invoice-status-chart/locales/sl.ts +1 -1
- package/src/components/dashboard/invoice-status-chart/locales/sv.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/bg.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/cs.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/en.ts +12 -0
- package/src/components/dashboard/payment-methods-chart/locales/et.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/fi.ts +6 -6
- package/src/components/dashboard/payment-methods-chart/locales/hr.ts +3 -3
- package/src/components/dashboard/payment-methods-chart/locales/is.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/nb.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/sk.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/locales/sv.ts +5 -5
- package/src/components/dashboard/payment-methods-chart/payment-methods-chart.tsx +4 -3
- package/src/components/dashboard/payment-trend-chart/locales/bg.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/cs.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/en.ts +6 -0
- package/src/components/dashboard/payment-trend-chart/locales/et.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/fi.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/is.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/nb.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/sk.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/locales/sv.ts +1 -1
- package/src/components/dashboard/payment-trend-chart/payment-trend-chart.tsx +4 -3
- package/src/components/dashboard/payment-trend-chart/use-payment-trend.ts +12 -9
- package/src/components/dashboard/revenue-card.tsx +3 -3
- package/src/components/dashboard/revenue-trend-chart/locales/bg.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/cs.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/en.ts +6 -0
- package/src/components/dashboard/revenue-trend-chart/locales/et.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/fi.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/is.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/nb.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/sk.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/locales/sv.ts +1 -1
- package/src/components/dashboard/revenue-trend-chart/revenue-trend-chart.tsx +4 -3
- package/src/components/dashboard/revenue-trend-chart/use-revenue-trend.ts +4 -3
- package/src/components/dashboard/shared/local-date.ts +11 -0
- package/src/components/dashboard/shared/use-revenue-data.ts +6 -5
- package/src/components/dashboard/shared/use-stats-query.ts +7 -11
- package/src/components/dashboard/stat-card.tsx +3 -3
- package/src/components/dashboard/tax-collected-card/tax-collected-card.tsx +11 -9
- package/src/components/dashboard/tax-collected-card/use-tax-collected.ts +3 -2
- package/src/components/dashboard/top-customers-chart/locales/bg.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/cs.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/en.ts +7 -0
- package/src/components/dashboard/top-customers-chart/locales/et.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/fi.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/is.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/nb.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/sk.ts +2 -2
- package/src/components/dashboard/top-customers-chart/locales/sv.ts +2 -2
- package/src/components/dashboard/top-customers-chart/top-customers-chart.tsx +4 -3
- package/src/components/dashboard/top-customers-chart/use-top-customers.ts +7 -20
- package/src/components/delivery-notes/create/create-delivery-note-form.tsx +61 -31
- package/src/components/delivery-notes/create/locales/bg.ts +68 -0
- package/src/components/delivery-notes/create/locales/cs.ts +68 -0
- package/src/components/delivery-notes/create/locales/en.ts +68 -0
- package/src/components/delivery-notes/create/locales/et.ts +68 -0
- package/src/components/delivery-notes/create/locales/fi.ts +68 -0
- package/src/components/delivery-notes/create/locales/hr.ts +6 -6
- package/src/components/delivery-notes/create/locales/is.ts +68 -0
- package/src/components/delivery-notes/create/locales/nb.ts +68 -0
- package/src/components/delivery-notes/create/locales/sk.ts +68 -0
- package/src/components/delivery-notes/create/locales/sl.ts +5 -5
- package/src/components/delivery-notes/create/locales/sv.ts +68 -0
- package/src/components/delivery-notes/delivery-notes.hooks.ts +20 -3
- package/src/components/delivery-notes/list/list-row-actions.tsx +62 -16
- package/src/components/delivery-notes/list/list-table.tsx +42 -9
- package/src/components/delivery-notes/list/locales/bg.ts +40 -0
- package/src/components/delivery-notes/list/locales/cs.ts +40 -0
- package/src/components/delivery-notes/list/locales/et.ts +40 -0
- package/src/components/delivery-notes/list/locales/fi.ts +40 -0
- package/src/components/delivery-notes/list/locales/is.ts +40 -0
- package/src/components/delivery-notes/list/locales/nb.ts +40 -0
- package/src/components/delivery-notes/list/locales/sk.ts +40 -0
- package/src/components/delivery-notes/list/locales/sv.ts +40 -0
- package/src/components/delivery-notes/list/use-delivery-note-download.ts +3 -5
- package/src/components/documents/create/document-add-item-form.tsx +256 -147
- package/src/components/documents/create/document-add-item-tax-rate-field.tsx +2 -1
- package/src/components/documents/create/document-details-section.tsx +30 -12
- package/src/components/documents/create/document-item-validation.ts +50 -0
- package/src/components/documents/create/document-items-section.tsx +44 -6
- package/src/components/documents/create/document-recipient-section.tsx +10 -2
- package/src/components/documents/create/linked-documents-info.tsx +4 -3
- package/src/components/documents/create/live-preview.tsx +19 -15
- package/src/components/documents/create/mark-as-paid-section.tsx +77 -20
- package/src/components/documents/create/payment-rows.ts +291 -0
- package/src/components/documents/create/prepare-document-submission.ts +24 -13
- package/src/components/documents/create/scroll-to-first-invalid-field.ts +27 -0
- package/src/components/documents/create/smart-code-insert-button.tsx +5 -53
- package/src/components/documents/create/use-document-customer-form.ts +74 -25
- package/src/components/documents/documents.hooks.ts +3 -5
- package/src/components/documents/index.ts +1 -0
- package/src/components/documents/public/index.ts +1 -0
- package/src/components/documents/public/public-document-summary.tsx +343 -0
- package/src/components/documents/shared/document-preview-display.tsx +65 -39
- package/src/components/documents/shared/index.ts +6 -1
- package/src/components/documents/shared/scaled-document-preview.tsx +33 -19
- package/src/components/documents/types.ts +24 -0
- package/src/components/documents/view/document-actions-bar.tsx +241 -62
- package/src/components/documents/view/document-activities-list.tsx +23 -11
- package/src/components/documents/view/document-details-card.tsx +7 -27
- package/src/components/documents/view/document-payments-list.tsx +114 -57
- package/src/components/documents/view/document-relations-list.tsx +26 -6
- package/src/components/documents/view/document-sidebar.tsx +25 -3
- package/src/components/documents/view/document-version-history.tsx +137 -0
- package/src/components/documents/view/index.ts +1 -0
- package/src/components/documents/view/locales/bg.ts +143 -0
- package/src/components/documents/view/locales/cs.ts +143 -0
- package/src/components/documents/view/locales/de.ts +13 -0
- package/src/components/documents/view/locales/en.ts +143 -0
- package/src/components/documents/view/locales/es.ts +13 -0
- package/src/components/documents/view/locales/et.ts +143 -0
- package/src/components/documents/view/locales/fi.ts +143 -0
- package/src/components/documents/view/locales/fr.ts +13 -0
- package/src/components/documents/view/locales/hr.ts +13 -0
- package/src/components/documents/view/locales/is.ts +143 -0
- package/src/components/documents/view/locales/it.ts +13 -0
- package/src/components/documents/view/locales/nb.ts +143 -0
- package/src/components/documents/view/locales/nl.ts +13 -0
- package/src/components/documents/view/locales/pl.ts +13 -0
- package/src/components/documents/view/locales/pt.ts +13 -0
- package/src/components/documents/view/locales/sk.ts +143 -0
- package/src/components/documents/view/locales/sl.ts +13 -0
- package/src/components/documents/view/locales/sv.ts +143 -0
- package/src/components/documents/view/use-document-download.ts +18 -17
- package/src/components/entities/create-entity-form.tsx +200 -12
- package/src/components/entities/entities.hooks.ts +15 -7
- package/src/components/entities/entity-settings-form/entity-settings-form.tsx +121 -65
- package/src/components/entities/entity-settings-form/input-with-preview.tsx +28 -4
- package/src/components/entities/entity-settings-form/locales/bg.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/cs.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/de.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/en.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/es.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/et.ts +198 -0
- package/src/components/entities/entity-settings-form/locales/fi.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/fr.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/hr.ts +16 -11
- package/src/components/entities/entity-settings-form/locales/is.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/it.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/nb.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/nl.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/pl.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/pt.ts +8 -3
- package/src/components/entities/entity-settings-form/locales/sk.ts +199 -0
- package/src/components/entities/entity-settings-form/locales/sl.ts +20 -15
- package/src/components/entities/entity-settings-form/locales/sv.ts +205 -0
- package/src/components/entities/fina-settings-form/fina-operator-required-dialog.tsx +34 -9
- package/src/components/entities/fina-settings-form/fina-settings-form.tsx +2 -0
- package/src/components/entities/fina-settings-form/fina-settings.hooks.ts +14 -45
- package/src/components/entities/fina-settings-form/locales/bg.ts +163 -0
- package/src/components/entities/fina-settings-form/locales/cs.ts +163 -0
- package/src/components/entities/fina-settings-form/locales/et.ts +163 -0
- package/src/components/entities/fina-settings-form/locales/fi.ts +163 -0
- package/src/components/entities/fina-settings-form/locales/hr.ts +11 -10
- package/src/components/entities/fina-settings-form/locales/is.ts +164 -0
- package/src/components/entities/fina-settings-form/locales/nb.ts +163 -0
- package/src/components/entities/fina-settings-form/locales/sk.ts +163 -0
- package/src/components/entities/fina-settings-form/locales/sl.ts +8 -7
- package/src/components/entities/fina-settings-form/locales/sv.ts +165 -0
- package/src/components/entities/furs-settings-form/furs-operator-required-dialog.tsx +34 -9
- package/src/components/entities/furs-settings-form/furs-settings-form.tsx +13 -1
- package/src/components/entities/furs-settings-form/furs-settings.hooks.ts +141 -42
- package/src/components/entities/furs-settings-form/locales/bg.ts +242 -0
- package/src/components/entities/furs-settings-form/locales/cs.ts +241 -0
- package/src/components/entities/furs-settings-form/locales/de.ts +42 -15
- package/src/components/entities/furs-settings-form/locales/en.ts +24 -0
- package/src/components/entities/furs-settings-form/locales/es.ts +42 -15
- package/src/components/entities/furs-settings-form/locales/et.ts +242 -0
- package/src/components/entities/furs-settings-form/locales/fi.ts +243 -0
- package/src/components/entities/furs-settings-form/locales/fr.ts +43 -15
- package/src/components/entities/furs-settings-form/locales/hr.ts +44 -19
- package/src/components/entities/furs-settings-form/locales/is.ts +242 -0
- package/src/components/entities/furs-settings-form/locales/it.ts +42 -15
- package/src/components/entities/furs-settings-form/locales/nb.ts +242 -0
- package/src/components/entities/furs-settings-form/locales/nl.ts +42 -15
- package/src/components/entities/furs-settings-form/locales/pl.ts +40 -15
- package/src/components/entities/furs-settings-form/locales/pt.ts +42 -15
- package/src/components/entities/furs-settings-form/locales/sk.ts +243 -0
- package/src/components/entities/furs-settings-form/locales/sl.ts +34 -10
- package/src/components/entities/furs-settings-form/locales/sv.ts +242 -0
- package/src/components/entities/furs-settings-form/sections/enable-fiscalization-section.tsx +11 -0
- package/src/components/entities/furs-settings-form/sections/furs-internal-act-download-card.tsx +111 -0
- package/src/components/entities/furs-settings-form/sections/general-settings-section.tsx +27 -0
- package/src/components/entities/furs-settings-form/sections/premises-management-section.tsx +23 -16
- package/src/components/entities/furs-settings-form/sections/register-premise-dialog.tsx +89 -31
- package/src/components/entities/settings/branding-settings-form.tsx +11 -30
- package/src/components/entities/settings/company-settings-form.tsx +2 -1
- package/src/components/entities/settings/defaults-settings-form.tsx +106 -3
- package/src/components/entities/settings/email-settings-form.tsx +245 -3
- package/src/components/entities/settings/eslog-settings-form.tsx +2 -1
- package/src/components/entities/settings/number-format-settings-form.tsx +2 -1
- package/src/components/entities/settings/pdf-template-selector/locales/bg.ts +20 -0
- package/src/components/entities/settings/pdf-template-selector/locales/cs.ts +20 -0
- package/src/components/entities/settings/pdf-template-selector/locales/en.ts +20 -0
- package/src/components/entities/settings/pdf-template-selector/locales/et.ts +19 -0
- package/src/components/entities/settings/pdf-template-selector/locales/fi.ts +20 -0
- package/src/components/entities/settings/pdf-template-selector/locales/is.ts +19 -0
- package/src/components/entities/settings/pdf-template-selector/locales/nb.ts +19 -0
- package/src/components/entities/settings/pdf-template-selector/locales/sk.ts +20 -0
- package/src/components/entities/settings/pdf-template-selector/locales/sv.ts +19 -0
- package/src/components/entities/settings/tax-rules-settings-form.tsx +21 -6
- package/src/components/estimates/create/create-estimate-form.tsx +70 -34
- package/src/components/estimates/create/locales/bg.ts +76 -0
- package/src/components/estimates/create/locales/cs.ts +76 -0
- package/src/components/estimates/create/locales/en.ts +76 -0
- package/src/components/estimates/create/locales/et.ts +76 -0
- package/src/components/estimates/create/locales/fi.ts +76 -0
- package/src/components/estimates/create/locales/hr.ts +8 -8
- package/src/components/estimates/create/locales/is.ts +76 -0
- package/src/components/estimates/create/locales/nb.ts +76 -0
- package/src/components/estimates/create/locales/sk.ts +76 -0
- package/src/components/estimates/create/locales/sl.ts +8 -8
- package/src/components/estimates/create/locales/sv.ts +76 -0
- package/src/components/estimates/create/prepare-estimate-submission.ts +4 -1
- package/src/components/estimates/estimates.hooks.ts +15 -3
- package/src/components/estimates/list/list-row-actions.tsx +34 -7
- package/src/components/estimates/list/list-table.tsx +78 -10
- package/src/components/estimates/list/locales/bg.ts +38 -0
- package/src/components/estimates/list/locales/cs.ts +38 -0
- package/src/components/estimates/list/locales/en.ts +27 -2
- package/src/components/estimates/list/locales/et.ts +38 -0
- package/src/components/estimates/list/locales/fi.ts +38 -0
- package/src/components/estimates/list/locales/hr.ts +2 -2
- package/src/components/estimates/list/locales/is.ts +38 -0
- package/src/components/estimates/list/locales/nb.ts +38 -0
- package/src/components/estimates/list/locales/sk.ts +38 -0
- package/src/components/estimates/list/locales/sv.ts +38 -0
- package/src/components/estimates/list/use-estimate-download.ts +3 -5
- package/src/components/export/document-export-form.tsx +72 -15
- package/src/components/export/sales-per-item-export-form.tsx +3 -2
- package/src/components/invoices/create/create-invoice-form.tsx +294 -76
- package/src/components/invoices/create/eslog-validation.ts +97 -8
- package/src/components/invoices/create/locales/bg.ts +164 -0
- package/src/components/invoices/create/locales/cs.ts +164 -0
- package/src/components/invoices/create/locales/de.ts +24 -0
- package/src/components/invoices/create/locales/en.ts +164 -0
- package/src/components/invoices/create/locales/es.ts +24 -0
- package/src/components/invoices/create/locales/et.ts +164 -0
- package/src/components/invoices/create/locales/fi.ts +164 -0
- package/src/components/invoices/create/locales/fr.ts +23 -0
- package/src/components/invoices/create/locales/hr.ts +32 -9
- package/src/components/invoices/create/locales/is.ts +164 -0
- package/src/components/invoices/create/locales/it.ts +24 -0
- package/src/components/invoices/create/locales/nb.ts +164 -0
- package/src/components/invoices/create/locales/nl.ts +23 -0
- package/src/components/invoices/create/locales/pl.ts +23 -0
- package/src/components/invoices/create/locales/pt.ts +24 -0
- package/src/components/invoices/create/locales/sk.ts +164 -0
- package/src/components/invoices/create/locales/sl.ts +32 -9
- package/src/components/invoices/create/locales/sv.ts +166 -0
- package/src/components/invoices/create/prepare-invoice-submission.ts +19 -2
- package/src/components/invoices/invoices-furs.hooks.ts +11 -8
- package/src/components/invoices/invoices.hooks.ts +27 -10
- package/src/components/invoices/list/list-row-actions.tsx +54 -21
- package/src/components/invoices/list/list-table.tsx +92 -11
- package/src/components/invoices/list/locales/bg.ts +49 -0
- package/src/components/invoices/list/locales/cs.ts +49 -0
- package/src/components/invoices/list/locales/en.ts +34 -2
- package/src/components/invoices/list/locales/et.ts +49 -0
- package/src/components/invoices/list/locales/fi.ts +49 -0
- package/src/components/invoices/list/locales/is.ts +49 -0
- package/src/components/invoices/list/locales/nb.ts +49 -0
- package/src/components/invoices/list/locales/sk.ts +49 -0
- package/src/components/invoices/list/locales/sv.ts +49 -0
- package/src/components/invoices/list/use-invoice-download.ts +3 -5
- package/src/components/invoices/send-email-dialog/locales/bg.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/cs.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/de.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/en.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/es.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/et.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/fi.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/fr.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/hr.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/is.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/it.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/nb.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/nl.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/pl.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/pt.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/sk.ts +58 -0
- package/src/components/invoices/send-email-dialog/locales/sl.ts +21 -0
- package/src/components/invoices/send-email-dialog/locales/sv.ts +58 -0
- package/src/components/invoices/send-email-dialog/send-email-dialog.tsx +188 -93
- package/src/components/invoices/view/eslog-info-display.tsx +2 -0
- package/src/components/invoices/view/fiscalization-status-card.tsx +2 -0
- package/src/components/items/create-item-form/create-item-form.tsx +29 -0
- package/src/components/items/create-item-form/locales/bg.ts +13 -0
- package/src/components/items/create-item-form/locales/cs.ts +13 -0
- package/src/components/items/create-item-form/locales/et.ts +13 -0
- package/src/components/items/create-item-form/locales/fi.ts +13 -0
- package/src/components/items/create-item-form/locales/is.ts +13 -0
- package/src/components/items/create-item-form/locales/nb.ts +13 -0
- package/src/components/items/create-item-form/locales/sk.ts +13 -0
- package/src/components/items/create-item-form/locales/sv.ts +13 -0
- package/src/components/items/edit-item-form/edit-item-form.tsx +39 -1
- package/src/components/items/edit-item-form/locales/bg.ts +12 -0
- package/src/components/items/edit-item-form/locales/cs.ts +12 -0
- package/src/components/items/edit-item-form/locales/en.ts +12 -0
- package/src/components/items/edit-item-form/locales/et.ts +12 -0
- package/src/components/items/edit-item-form/locales/fi.ts +12 -0
- package/src/components/items/edit-item-form/locales/is.ts +12 -0
- package/src/components/items/edit-item-form/locales/nb.ts +12 -0
- package/src/components/items/edit-item-form/locales/sk.ts +12 -0
- package/src/components/items/edit-item-form/locales/sv.ts +12 -0
- package/src/components/items/item-combobox.tsx +51 -18
- package/src/components/items/item-list-table/item-list-table.tsx +47 -23
- package/src/components/items/item-list-table/locales/bg.ts +16 -0
- package/src/components/items/item-list-table/locales/cs.ts +16 -0
- package/src/components/items/item-list-table/locales/en.ts +4 -3
- package/src/components/items/item-list-table/locales/et.ts +16 -0
- package/src/components/items/item-list-table/locales/fi.ts +16 -0
- package/src/components/items/item-list-table/locales/is.ts +16 -0
- package/src/components/items/item-list-table/locales/nb.ts +16 -0
- package/src/components/items/item-list-table/locales/sk.ts +16 -0
- package/src/components/items/item-list-table/locales/sv.ts +16 -0
- package/src/components/items/items.hooks.ts +15 -15
- package/src/components/payments/create-payment-form/create-payment-form.tsx +11 -7
- package/src/components/payments/create-payment-form/locales/bg.ts +20 -0
- package/src/components/payments/create-payment-form/locales/cs.ts +20 -0
- package/src/components/payments/create-payment-form/locales/en.ts +20 -0
- package/src/components/payments/create-payment-form/locales/et.ts +20 -0
- package/src/components/payments/create-payment-form/locales/fi.ts +20 -0
- package/src/components/payments/create-payment-form/locales/hr.ts +2 -2
- package/src/components/payments/create-payment-form/locales/is.ts +20 -0
- package/src/components/payments/create-payment-form/locales/nb.ts +20 -0
- package/src/components/payments/create-payment-form/locales/sk.ts +20 -0
- package/src/components/payments/create-payment-form/locales/sl.ts +4 -4
- package/src/components/payments/create-payment-form/locales/sv.ts +20 -0
- package/src/components/payments/edit-payment-form/edit-payment-form.tsx +5 -1
- package/src/components/payments/edit-payment-form/locales/bg.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/cs.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/en.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/et.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/fi.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/hr.ts +2 -2
- package/src/components/payments/edit-payment-form/locales/is.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/nb.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/sk.ts +20 -0
- package/src/components/payments/edit-payment-form/locales/sl.ts +4 -4
- package/src/components/payments/edit-payment-form/locales/sv.ts +20 -0
- package/src/components/payments/list/list-row-actions.tsx +10 -2
- package/src/components/payments/list/list-table.tsx +51 -45
- package/src/components/payments/list/locales/bg.ts +42 -0
- package/src/components/payments/list/locales/cs.ts +42 -0
- package/src/components/payments/list/locales/de.ts +18 -0
- package/src/components/payments/list/locales/en.ts +37 -2
- package/src/components/payments/list/locales/es.ts +18 -0
- package/src/components/payments/list/locales/et.ts +42 -0
- package/src/components/payments/list/locales/fi.ts +42 -0
- package/src/components/payments/list/locales/fr.ts +18 -0
- package/src/components/payments/list/locales/hr.ts +18 -0
- package/src/components/payments/list/locales/is.ts +42 -0
- package/src/components/payments/list/locales/it.ts +18 -0
- package/src/components/payments/list/locales/nb.ts +42 -0
- package/src/components/payments/list/locales/nl.ts +18 -0
- package/src/components/payments/list/locales/pl.ts +18 -0
- package/src/components/payments/list/locales/pt.ts +18 -0
- package/src/components/payments/list/locales/sk.ts +42 -0
- package/src/components/payments/list/locales/sl.ts +18 -1
- package/src/components/payments/list/locales/sv.ts +42 -0
- package/src/components/payments/payments.hooks.ts +13 -6
- package/src/components/recurring-invoices/create-recurring-invoice-form/create-recurring-invoice-form.tsx +23 -17
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/bg.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/cs.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/en.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/et.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/fi.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/hr.ts +6 -6
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/is.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/nb.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sk.ts +44 -0
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sl.ts +4 -4
- package/src/components/recurring-invoices/create-recurring-invoice-form/locales/sv.ts +44 -0
- package/src/components/recurring-invoices/list/list-row-actions.tsx +3 -5
- package/src/components/recurring-invoices/list/list-table.tsx +10 -7
- package/src/components/recurring-invoices/list/locales/bg.ts +28 -0
- package/src/components/recurring-invoices/list/locales/cs.ts +28 -0
- package/src/components/recurring-invoices/list/locales/en.ts +23 -0
- package/src/components/recurring-invoices/list/locales/et.ts +28 -0
- package/src/components/recurring-invoices/list/locales/fi.ts +28 -0
- package/src/components/recurring-invoices/list/locales/is.ts +28 -0
- package/src/components/recurring-invoices/list/locales/nb.ts +28 -0
- package/src/components/recurring-invoices/list/locales/sk.ts +28 -0
- package/src/components/recurring-invoices/list/locales/sv.ts +28 -0
- package/src/components/recurring-invoices/recurring-invoices.hooks.ts +11 -8
- package/src/components/request-logs/request-log-detail.tsx +30 -23
- package/src/components/request-logs/request-log-list-table.tsx +88 -45
- package/src/components/table/README.md +47 -9
- package/src/components/table/data-table.tsx +232 -92
- package/src/components/table/filter-bar.tsx +1 -1
- package/src/components/table/filter-panel.tsx +51 -22
- package/src/components/table/hooks/use-table-state.ts +64 -11
- package/src/components/table/index.ts +3 -0
- package/src/components/table/locales.ts +119 -4
- package/src/components/table/selection-toolbar.tsx +65 -9
- package/src/components/table/sorting.ts +80 -0
- package/src/components/table/table-skeleton.tsx +15 -9
- package/src/components/table/types.ts +17 -0
- package/src/components/tax-reports/index.ts +8 -0
- package/src/components/tax-reports/kir-export-form.tsx +4 -5
- package/src/components/tax-reports/slovenia-accounting-mappings-fields.tsx +271 -0
- package/src/components/tax-reports/slovenia-tax-profile-step.tsx +21 -10
- package/src/components/tax-reports/slovenia-vod-export-form.tsx +452 -0
- package/src/components/tax-reports/slovenia-yearly-export-form.tsx +17 -16
- package/src/components/tax-reports/slovenia-yearly-review-step.tsx +40 -18
- package/src/components/taxes/create-tax-form/create-tax-form.tsx +48 -2
- package/src/components/taxes/create-tax-form/locales/bg.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/cs.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/et.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/fi.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/is.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/nb.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/sk.ts +8 -0
- package/src/components/taxes/create-tax-form/locales/sv.ts +8 -0
- package/src/components/taxes/edit-tax-form/edit-tax-form.tsx +80 -11
- package/src/components/taxes/edit-tax-form/locales/bg.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/cs.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/en.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/et.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/fi.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/is.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/nb.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/sk.ts +6 -0
- package/src/components/taxes/edit-tax-form/locales/sv.ts +6 -0
- package/src/components/taxes/tax-list-table/locales/bg.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/cs.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/en.ts +4 -3
- package/src/components/taxes/tax-list-table/locales/et.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/fi.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/is.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/nb.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/sk.ts +17 -0
- package/src/components/taxes/tax-list-table/locales/sv.ts +17 -0
- package/src/components/taxes/tax-list-table/tax-list-table.tsx +53 -19
- package/src/components/taxes/taxes.hooks.ts +53 -12
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/drawer.tsx +2 -2
- package/src/components/ui/form.tsx +118 -2
- package/src/components/ui/progress.tsx +6 -4
- package/src/components/ui/select.tsx +118 -1
- package/src/components/ui/sonner.tsx +17 -36
- package/src/components/ui/sticky-form-footer.tsx +6 -1
- package/src/components/ui/tooltip.tsx +15 -2
- package/src/components/webhook-logs/webhook-delivery-detail.tsx +22 -22
- package/src/components/webhook-logs/webhook-delivery-list-table.tsx +92 -17
- package/src/components/wl-subscription/locked-feature.tsx +11 -10
- package/src/components/wl-subscription/paywall.tsx +184 -72
- package/src/components/wl-subscription/upgrade-modal.tsx +28 -31
- package/src/generate-schemas.ts +14 -4
- package/src/generated/schemas/account_webhook.ts +43 -0
- package/src/generated/schemas/accountwebhook.ts +67 -0
- package/src/generated/schemas/entity.ts +255 -16
- package/src/generated/schemas/exportsloveniavodxml_body.ts +16 -0
- package/src/generated/schemas/furssettings.ts +1 -0
- package/src/generated/schemas/incomingpurchasedocument.ts +198 -0
- package/src/generated/schemas/incomingpurchasedocumentpayment.ts +38 -0
- package/src/generated/schemas/index.ts +10 -0
- package/src/generated/schemas/item.ts +36 -0
- package/src/generated/schemas/me.ts +23 -19
- package/src/generated/schemas/order.ts +2 -0
- package/src/generated/schemas/orderintegration.ts +8 -4
- package/src/generated/schemas/payment.ts +5 -0
- package/src/generated/schemas/ptatcudseries.ts +30 -0
- package/src/generated/schemas/renderadvanceinvoicepreview_body.ts +35 -3
- package/src/generated/schemas/rendercreditnotepreview_body.ts +35 -3
- package/src/generated/schemas/renderdeliverynotepreview_body.ts +12 -5
- package/src/generated/schemas/renderestimatepreview_body.ts +38 -5
- package/src/generated/schemas/renderinvoicepreview_body.ts +39 -5
- package/src/generated/schemas/senddocument_body.ts +1 -0
- package/src/generated/schemas/sendemail_body.ts +67 -39
- package/src/generated/schemas/sloveniataxprofile.ts +97 -21
- package/src/generated/schemas/starteslogexport_body.ts +33 -0
- package/src/generated/schemas/startpdfexport_body.ts +94 -78
- package/src/generated/schemas/supplier.ts +59 -0
- package/src/generated/schemas/syncshopifyorders_body.ts +20 -0
- package/src/generated/schemas/tax.ts +2 -0
- package/src/generated/schemas/uploadfile_body.ts +1 -0
- package/src/generated/schemas/userptsettings.ts +26 -0
- package/src/generated/schemas/voidinvoice_body.ts +20 -0
- package/src/generated/schemas/webhook.ts +2 -0
- package/src/hooks/create-resource-hooks.ts +22 -19
- package/src/hooks/use-duplicate-document.ts +10 -8
- package/src/hooks/use-eslog-validation.ts +5 -1
- package/src/hooks/use-next-document-number.ts +13 -6
- package/src/hooks/use-resolved-entity-id.ts +14 -0
- package/src/hooks/use-resource-mutation.ts +11 -30
- package/src/hooks/use-transaction-type-check.ts +3 -8
- package/src/lib/browser-cookies.ts +1 -1
- package/src/lib/country-capabilities.ts +114 -0
- package/src/lib/date-fns-locale.ts +1 -20
- package/src/lib/eslog-export.ts +32 -0
- package/src/lib/fiscalization-options.ts +21 -1
- package/src/lib/formatting.ts +27 -0
- package/src/lib/furs-error-utils.ts +29 -0
- package/src/lib/locale.ts +4 -0
- package/src/lib/payment-display.ts +95 -0
- package/src/lib/pt-document-input.ts +67 -0
- package/src/lib/schemas/shared.ts +1 -0
- package/src/lib/template-variables.tsx +102 -4
- package/src/lib/translation.ts +51 -33
- package/src/lib/white-label-capabilities.ts +626 -0
- package/src/lib/zod-validation-message.ts +291 -0
- package/src/providers/entities-provider.tsx +32 -14
- package/src/providers/sdk-provider.tsx +112 -12
- package/src/providers/space-invoices-provider.tsx +129 -0
- package/src/providers/white-label-provider.tsx +96 -4
- package/src/providers/wl-subscription-provider.tsx +144 -10
|
@@ -1,12 +1,74 @@
|
|
|
1
1
|
import { Check, Crown, Loader2, Sparkles, Zap } from "lucide-react";
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
|
|
4
|
+
import type { ComponentTranslationProps } from "@/ui/lib/translation";
|
|
5
|
+
import { createTranslation } from "@/ui/lib/translation";
|
|
4
6
|
import { useWLSubscription, type WhiteLabelPlan } from "../../providers/wl-subscription-provider";
|
|
5
7
|
import { Badge } from "../ui/badge";
|
|
6
8
|
import { Button } from "../ui/button";
|
|
7
9
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../ui/card";
|
|
8
10
|
import { Switch } from "../ui/switch";
|
|
9
11
|
|
|
12
|
+
type TranslateValues = Record<string, string | number>;
|
|
13
|
+
|
|
14
|
+
function interpolateTranslation(template: string, values?: TranslateValues) {
|
|
15
|
+
if (!values) return template;
|
|
16
|
+
|
|
17
|
+
return Object.entries(values).reduce(
|
|
18
|
+
(result, [key, value]) => result.replaceAll(`{{${key}}}`, String(value)),
|
|
19
|
+
template,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function createPaywallTranslation({ t, namespace, locale, translationLocale }: ComponentTranslationProps) {
|
|
24
|
+
const fallbackTranslation = createTranslation({ t, namespace, locale, translationLocale });
|
|
25
|
+
|
|
26
|
+
return (key: string, options?: { defaultValue?: string } & TranslateValues) => {
|
|
27
|
+
const fullKey = namespace ? `${namespace}.${key}` : key;
|
|
28
|
+
|
|
29
|
+
if (t) {
|
|
30
|
+
const translated = (t as (key: string, options?: Record<string, unknown>) => string)(fullKey, options);
|
|
31
|
+
if (translated !== fullKey && translated !== key) {
|
|
32
|
+
return translated;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const fallback = fallbackTranslation(key);
|
|
37
|
+
if (fallback !== key) {
|
|
38
|
+
return interpolateTranslation(fallback, options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return options?.defaultValue ? interpolateTranslation(options.defaultValue, options) : fallback;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getPaywallFeatureKeys(slug: string): string[] {
|
|
46
|
+
switch (slug) {
|
|
47
|
+
case "simple":
|
|
48
|
+
return ["simple.estimates-and-delivery-notes", "simple.email-sending", "simple.users", "simple.templates"];
|
|
49
|
+
case "advanced":
|
|
50
|
+
return [
|
|
51
|
+
"advanced.fiscalization",
|
|
52
|
+
"advanced.e-invoicing",
|
|
53
|
+
"advanced.recurring",
|
|
54
|
+
"advanced.email-sending",
|
|
55
|
+
"advanced.priority-support",
|
|
56
|
+
"advanced.users",
|
|
57
|
+
];
|
|
58
|
+
case "pro":
|
|
59
|
+
return [
|
|
60
|
+
"pro.connected-store",
|
|
61
|
+
"pro.extra-stores",
|
|
62
|
+
"pro.integrations",
|
|
63
|
+
"pro.api-and-webhooks",
|
|
64
|
+
"pro.custom-templates",
|
|
65
|
+
"pro.overage",
|
|
66
|
+
];
|
|
67
|
+
default:
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
10
72
|
/**
|
|
11
73
|
* Paywall component
|
|
12
74
|
*
|
|
@@ -14,14 +76,16 @@ import { Switch } from "../ui/switch";
|
|
|
14
76
|
* or for paid-only configs with no active subscription.
|
|
15
77
|
* Displays plan cards with monthly/yearly toggle and checkout buttons.
|
|
16
78
|
*/
|
|
17
|
-
export function Paywall() {
|
|
18
|
-
const {
|
|
79
|
+
export function Paywall({ t: translateFn, namespace, locale, translationLocale, onCheckoutRequested }: PaywallProps) {
|
|
80
|
+
const t = createPaywallTranslation({ t: translateFn, namespace, locale, translationLocale });
|
|
81
|
+
const { subscription, isTrialExpired, availablePlans, createCheckout } = useWLSubscription();
|
|
19
82
|
const [isYearly, setIsYearly] = useState(false);
|
|
20
83
|
const [isRedirecting, setIsRedirecting] = useState<string | null>(null);
|
|
21
84
|
const [checkoutError, setCheckoutError] = useState<string | null>(null);
|
|
22
85
|
|
|
23
86
|
// Only show paid plans
|
|
24
87
|
const paidPlans = [...availablePlans].filter((p) => !p.is_free).sort((a, b) => a.display_order - b.display_order);
|
|
88
|
+
const popularPlanIndex = paidPlans.length > 0 ? Math.ceil(paidPlans.length / 2) - 1 : -1;
|
|
25
89
|
|
|
26
90
|
const handleCheckout = async (planSlug: string) => {
|
|
27
91
|
try {
|
|
@@ -29,34 +93,51 @@ export function Paywall() {
|
|
|
29
93
|
setCheckoutError(null);
|
|
30
94
|
const billingInterval = isYearly ? "yearly" : "monthly";
|
|
31
95
|
const checkoutUrl = await createCheckout(planSlug, billingInterval);
|
|
96
|
+
const handled = await onCheckoutRequested?.({
|
|
97
|
+
planSlug,
|
|
98
|
+
billingInterval,
|
|
99
|
+
checkoutUrl,
|
|
100
|
+
needsCard: !subscription?.payment_method?.has_card,
|
|
101
|
+
});
|
|
102
|
+
if (handled) {
|
|
103
|
+
setIsRedirecting(null);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
32
107
|
window.location.href = checkoutUrl;
|
|
33
108
|
} catch (err) {
|
|
34
|
-
setCheckoutError(err instanceof Error ? err.message : "
|
|
109
|
+
setCheckoutError(err instanceof Error ? err.message : t("entity-billing-page.paywall.checkout-failed"));
|
|
35
110
|
setIsRedirecting(null);
|
|
36
111
|
}
|
|
37
112
|
};
|
|
38
113
|
|
|
39
114
|
return (
|
|
40
|
-
<div className="flex
|
|
41
|
-
<div className="mx-auto max-w-
|
|
42
|
-
<Sparkles className="mx-auto mb-
|
|
43
|
-
<h1 className="mb-2 font-
|
|
44
|
-
{isTrialExpired
|
|
115
|
+
<div className="flex w-full flex-col items-center px-4 py-6 lg:py-8">
|
|
116
|
+
<div className="mx-auto w-full max-w-5xl text-center">
|
|
117
|
+
<Sparkles className="mx-auto mb-3 h-8 w-8 text-primary/80" />
|
|
118
|
+
<h1 className="mb-2 font-semibold text-2xl tracking-tight">
|
|
119
|
+
{isTrialExpired
|
|
120
|
+
? t("entity-billing-page.paywall.title.expired")
|
|
121
|
+
: t("entity-billing-page.paywall.title.choose")}
|
|
45
122
|
</h1>
|
|
46
|
-
<p className="mb-8 text-
|
|
123
|
+
<p className="mx-auto mb-8 max-w-2xl text-foreground/70 text-sm">
|
|
47
124
|
{isTrialExpired
|
|
48
|
-
? "
|
|
49
|
-
: "
|
|
125
|
+
? t("entity-billing-page.paywall.description.expired")
|
|
126
|
+
: t("entity-billing-page.paywall.description.choose")}
|
|
50
127
|
</p>
|
|
51
128
|
|
|
52
129
|
{/* Monthly/Yearly toggle */}
|
|
53
130
|
<div className="mb-8 flex items-center justify-center gap-3">
|
|
54
|
-
<span className={`text-sm ${!isYearly ? "font-medium" : "text-
|
|
131
|
+
<span className={`text-sm ${!isYearly ? "font-medium text-foreground" : "text-foreground/70"}`}>
|
|
132
|
+
{t("entity-billing-page.plans.monthly")}
|
|
133
|
+
</span>
|
|
55
134
|
<Switch checked={isYearly} onCheckedChange={setIsYearly} />
|
|
56
|
-
<span className={`text-sm ${isYearly ? "font-medium" : "text-
|
|
135
|
+
<span className={`text-sm ${isYearly ? "font-medium text-foreground" : "text-foreground/70"}`}>
|
|
136
|
+
{t("entity-billing-page.plans.yearly")}
|
|
137
|
+
</span>
|
|
57
138
|
{isYearly && (
|
|
58
139
|
<Badge variant="secondary" className="ml-1">
|
|
59
|
-
|
|
140
|
+
{t("entity-billing-page.paywall.yearly-discount")}
|
|
60
141
|
</Badge>
|
|
61
142
|
)}
|
|
62
143
|
</div>
|
|
@@ -65,13 +146,17 @@ export function Paywall() {
|
|
|
65
146
|
<p className="mb-4 rounded-md bg-destructive/10 px-3 py-2 text-destructive text-sm">{checkoutError}</p>
|
|
66
147
|
)}
|
|
67
148
|
|
|
68
|
-
<div className="grid gap-6
|
|
149
|
+
<div className="grid gap-6 pt-3 lg:grid-cols-3">
|
|
69
150
|
{paidPlans.map((plan, index) => (
|
|
70
151
|
<PaywallPlanCard
|
|
71
152
|
key={plan.id}
|
|
72
153
|
plan={plan}
|
|
154
|
+
t={translateFn}
|
|
155
|
+
namespace={namespace}
|
|
156
|
+
locale={locale}
|
|
157
|
+
translationLocale={translationLocale}
|
|
73
158
|
isYearly={isYearly}
|
|
74
|
-
isPopular={index ===
|
|
159
|
+
isPopular={index === popularPlanIndex}
|
|
75
160
|
isLoading={isRedirecting === plan.slug}
|
|
76
161
|
isDisabled={isRedirecting !== null}
|
|
77
162
|
onSelect={() => handleCheckout(plan.slug)}
|
|
@@ -80,13 +165,22 @@ export function Paywall() {
|
|
|
80
165
|
</div>
|
|
81
166
|
|
|
82
167
|
{paidPlans.length === 0 && (
|
|
83
|
-
<p className="py-8 text-
|
|
168
|
+
<p className="py-8 text-foreground/70 text-sm">{t("entity-billing-page.paywall.no-plans")}</p>
|
|
84
169
|
)}
|
|
85
170
|
</div>
|
|
86
171
|
</div>
|
|
87
172
|
);
|
|
88
173
|
}
|
|
89
174
|
|
|
175
|
+
type PaywallProps = ComponentTranslationProps & {
|
|
176
|
+
onCheckoutRequested?: (selection: {
|
|
177
|
+
planSlug: string;
|
|
178
|
+
billingInterval: "monthly" | "yearly";
|
|
179
|
+
checkoutUrl: string;
|
|
180
|
+
needsCard: boolean;
|
|
181
|
+
}) => boolean | Promise<boolean>;
|
|
182
|
+
};
|
|
183
|
+
|
|
90
184
|
// ============================================
|
|
91
185
|
// PLAN CARD
|
|
92
186
|
// ============================================
|
|
@@ -98,52 +192,95 @@ type PaywallPlanCardProps = {
|
|
|
98
192
|
isLoading: boolean;
|
|
99
193
|
isDisabled: boolean;
|
|
100
194
|
onSelect: () => void;
|
|
101
|
-
};
|
|
195
|
+
} & ComponentTranslationProps;
|
|
102
196
|
|
|
103
|
-
function PaywallPlanCard({
|
|
197
|
+
function PaywallPlanCard({
|
|
198
|
+
plan,
|
|
199
|
+
isYearly,
|
|
200
|
+
isPopular,
|
|
201
|
+
isLoading,
|
|
202
|
+
isDisabled,
|
|
203
|
+
onSelect,
|
|
204
|
+
t: translateFn,
|
|
205
|
+
namespace,
|
|
206
|
+
locale,
|
|
207
|
+
translationLocale,
|
|
208
|
+
}: PaywallPlanCardProps) {
|
|
209
|
+
const t = createPaywallTranslation({ t: translateFn, namespace, locale, translationLocale });
|
|
104
210
|
const monthlyPrice = plan.base_price_cents ? plan.base_price_cents / 100 : 0;
|
|
105
|
-
const
|
|
211
|
+
const annualPriceCents = plan.limits?.annual_price_cents;
|
|
212
|
+
const yearlyTotal =
|
|
213
|
+
annualPriceCents != null ? annualPriceCents / 100 : Math.round(monthlyPrice * 12 * 0.8 * 100) / 100;
|
|
106
214
|
const yearlyMonthly = Math.round((yearlyTotal / 12) * 100) / 100;
|
|
107
215
|
|
|
108
216
|
const displayPrice = isYearly ? yearlyMonthly : monthlyPrice;
|
|
109
|
-
const
|
|
217
|
+
const planName = t(`entity-billing-page.plan-names.${plan.slug}`, { defaultValue: plan.name });
|
|
218
|
+
const invoiceLimit = plan.limits?.invoices_per_month ?? plan.limits?.documents_per_month;
|
|
219
|
+
const includedStores = plan.limits?.included_store_count ?? null;
|
|
220
|
+
let planDescription = t("entity-billing-page.plan-description.unlimited");
|
|
221
|
+
|
|
222
|
+
if (invoiceLimit != null && includedStores != null) {
|
|
223
|
+
planDescription = t("entity-billing-page.plan-description.invoices-and-stores", {
|
|
224
|
+
invoices: invoiceLimit,
|
|
225
|
+
stores: includedStores,
|
|
226
|
+
});
|
|
227
|
+
} else if (invoiceLimit != null) {
|
|
228
|
+
planDescription = t("entity-billing-page.plan-description.invoices-only", { invoices: invoiceLimit });
|
|
229
|
+
} else if (includedStores != null) {
|
|
230
|
+
planDescription = t("entity-billing-page.plan-description.stores-only", { stores: includedStores });
|
|
231
|
+
}
|
|
232
|
+
const featureItems = getPaywallFeatureKeys(plan.slug).map((featureKey) =>
|
|
233
|
+
t(`entity-billing-page.paywall.features.${featureKey}`),
|
|
234
|
+
);
|
|
110
235
|
|
|
111
236
|
return (
|
|
112
|
-
<Card
|
|
237
|
+
<Card
|
|
238
|
+
className={`relative flex h-full flex-col overflow-visible text-left ${
|
|
239
|
+
isPopular ? "border-primary ring-2 ring-primary" : ""
|
|
240
|
+
}`}
|
|
241
|
+
>
|
|
113
242
|
{isPopular && (
|
|
114
243
|
<div className="absolute -top-3 left-1/2 -translate-x-1/2">
|
|
115
|
-
<Badge className="bg-primary text-primary-foreground">
|
|
244
|
+
<Badge className="bg-primary text-primary-foreground">{t("entity-billing-page.paywall.popular")}</Badge>
|
|
116
245
|
</div>
|
|
117
246
|
)}
|
|
118
|
-
<CardHeader className="pb-
|
|
247
|
+
<CardHeader className="pb-3">
|
|
119
248
|
<div className="flex items-center gap-2">
|
|
120
249
|
<PaywallPlanIcon slug={plan.slug} />
|
|
121
|
-
<CardTitle className="text-
|
|
250
|
+
<CardTitle className="font-semibold text-lg">{planName}</CardTitle>
|
|
122
251
|
</div>
|
|
123
|
-
<CardDescription>{
|
|
252
|
+
<CardDescription className="text-foreground/70 text-sm">{planDescription}</CardDescription>
|
|
124
253
|
</CardHeader>
|
|
125
254
|
<CardContent className="flex-1">
|
|
126
|
-
<div className="
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
255
|
+
<div className="space-y-4">
|
|
256
|
+
<div>
|
|
257
|
+
<span className="font-semibold text-3xl">€{displayPrice.toFixed(2)}</span>
|
|
258
|
+
<span className="text-foreground/70 text-sm">{t("entity-billing-page.pricing.per-month")}</span>
|
|
259
|
+
</div>
|
|
260
|
+
{isYearly ? (
|
|
261
|
+
<p className="text-foreground/70 text-sm">
|
|
262
|
+
€{yearlyTotal.toFixed(2)} {t("entity-billing-page.paywall.billed-yearly")}
|
|
263
|
+
</p>
|
|
264
|
+
) : null}
|
|
133
265
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
266
|
+
{featureItems.length > 0 ? (
|
|
267
|
+
<ul className="space-y-2 pt-1">
|
|
268
|
+
{featureItems.map((featureText) => (
|
|
269
|
+
<li key={featureText} className="flex items-start gap-2 text-foreground/80 text-sm">
|
|
270
|
+
<Check className="mt-0.5 h-4 w-4 flex-shrink-0 text-green-600" />
|
|
271
|
+
<span>{featureText}</span>
|
|
272
|
+
</li>
|
|
273
|
+
))}
|
|
274
|
+
</ul>
|
|
275
|
+
) : null}
|
|
276
|
+
</div>
|
|
142
277
|
</CardContent>
|
|
143
278
|
<CardFooter>
|
|
144
279
|
<Button className="w-full" variant={isPopular ? "default" : "outline"} disabled={isDisabled} onClick={onSelect}>
|
|
145
280
|
{isLoading ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : null}
|
|
146
|
-
{isLoading
|
|
281
|
+
{isLoading
|
|
282
|
+
? t("entity-billing-page.paywall.redirecting")
|
|
283
|
+
: t("entity-billing-page.paywall.get-plan", { plan: planName })}
|
|
147
284
|
</Button>
|
|
148
285
|
</CardFooter>
|
|
149
286
|
</Card>
|
|
@@ -156,38 +293,13 @@ function PaywallPlanCard({ plan, isYearly, isPopular, isLoading, isDisabled, onS
|
|
|
156
293
|
|
|
157
294
|
function PaywallPlanIcon({ slug }: { slug: string }) {
|
|
158
295
|
switch (slug) {
|
|
159
|
-
case "
|
|
160
|
-
return <
|
|
296
|
+
case "simple":
|
|
297
|
+
return <Sparkles className="h-5 w-5 text-blue-500" />;
|
|
161
298
|
case "advanced":
|
|
162
299
|
return <Crown className="h-5 w-5 text-amber-500" />;
|
|
300
|
+
case "pro":
|
|
301
|
+
return <Zap className="h-5 w-5 text-primary" />;
|
|
163
302
|
default:
|
|
164
|
-
return <
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function getPaywallFeatures(slug: string): string[] {
|
|
169
|
-
switch (slug) {
|
|
170
|
-
case "basic":
|
|
171
|
-
return [
|
|
172
|
-
"Invoices & estimates",
|
|
173
|
-
"Customer management",
|
|
174
|
-
"PDF export",
|
|
175
|
-
"FURS fiscalization",
|
|
176
|
-
"eSlog export",
|
|
177
|
-
"Recurring invoices",
|
|
178
|
-
"Email sending",
|
|
179
|
-
];
|
|
180
|
-
case "advanced":
|
|
181
|
-
return [
|
|
182
|
-
"Everything in Basic",
|
|
183
|
-
"All features unlocked",
|
|
184
|
-
"Custom templates",
|
|
185
|
-
"API access",
|
|
186
|
-
"Webhooks",
|
|
187
|
-
"Priority support",
|
|
188
|
-
"Overage billing (pay per doc)",
|
|
189
|
-
];
|
|
190
|
-
default:
|
|
191
|
-
return [];
|
|
303
|
+
return <Zap className="h-5 w-5 text-muted-foreground" />;
|
|
192
304
|
}
|
|
193
305
|
}
|
|
@@ -21,7 +21,7 @@ type UpgradeModalProps = {
|
|
|
21
21
|
*
|
|
22
22
|
* Shows available plans and allows users to upgrade their subscription.
|
|
23
23
|
* Highlights the feature that triggered the modal and which plans include it.
|
|
24
|
-
* Includes monthly/yearly toggle
|
|
24
|
+
* Includes monthly/yearly toggle for white-label pricing.
|
|
25
25
|
*/
|
|
26
26
|
export function UpgradeModal({ isOpen, onClose, feature, onUpgrade }: UpgradeModalProps) {
|
|
27
27
|
const { plan: currentPlan, availablePlans, createCheckout } = useWLSubscription();
|
|
@@ -76,7 +76,7 @@ export function UpgradeModal({ isOpen, onClose, feature, onUpgrade }: UpgradeMod
|
|
|
76
76
|
<span className={`text-sm ${isYearly ? "font-medium" : "text-muted-foreground"}`}>Yearly</span>
|
|
77
77
|
{isYearly && (
|
|
78
78
|
<Badge variant="secondary" className="ml-1">
|
|
79
|
-
|
|
79
|
+
2 months free
|
|
80
80
|
</Badge>
|
|
81
81
|
)}
|
|
82
82
|
</div>
|
|
@@ -139,11 +139,13 @@ function PlanCard({
|
|
|
139
139
|
onSelect,
|
|
140
140
|
}: PlanCardProps) {
|
|
141
141
|
const monthlyPrice = plan.base_price_cents ? plan.base_price_cents / 100 : 0;
|
|
142
|
-
const
|
|
142
|
+
const annualPriceCents = plan.limits?.annual_price_cents;
|
|
143
|
+
const yearlyTotal =
|
|
144
|
+
annualPriceCents != null ? annualPriceCents / 100 : Math.round(monthlyPrice * 12 * 0.8 * 100) / 100;
|
|
143
145
|
const yearlyMonthly = Math.round((yearlyTotal / 12) * 100) / 100;
|
|
144
146
|
|
|
145
147
|
const displayPrice = isYearly ? yearlyMonthly : monthlyPrice;
|
|
146
|
-
const documentsLimit = plan.limits?.documents_per_month ?? "Unlimited";
|
|
148
|
+
const documentsLimit = plan.limits?.invoices_per_month ?? plan.limits?.documents_per_month ?? "Unlimited";
|
|
147
149
|
|
|
148
150
|
return (
|
|
149
151
|
<div
|
|
@@ -169,7 +171,7 @@ function PlanCard({
|
|
|
169
171
|
|
|
170
172
|
{isYearly && <p className="mb-1 text-muted-foreground text-xs">€{yearlyTotal.toFixed(0)} billed yearly</p>}
|
|
171
173
|
|
|
172
|
-
<p className="mb-4 text-muted-foreground text-sm">{documentsLimit}
|
|
174
|
+
<p className="mb-4 text-muted-foreground text-sm">{documentsLimit} invoices/month</p>
|
|
173
175
|
|
|
174
176
|
<ul className="mb-4 flex-1 space-y-2">
|
|
175
177
|
{getPlanFeatures(plan.slug).map((featureText) => (
|
|
@@ -206,14 +208,12 @@ function PlanCard({
|
|
|
206
208
|
|
|
207
209
|
function PlanIcon({ slug }: { slug: string }) {
|
|
208
210
|
switch (slug) {
|
|
209
|
-
case "
|
|
210
|
-
return <Zap className="h-5 w-5 text-muted-foreground" />;
|
|
211
|
-
case "basic":
|
|
212
|
-
return <Zap className="h-5 w-5 text-blue-500" />;
|
|
213
|
-
case "starter":
|
|
211
|
+
case "simple":
|
|
214
212
|
return <Sparkles className="h-5 w-5 text-blue-500" />;
|
|
215
213
|
case "advanced":
|
|
216
214
|
return <Crown className="h-5 w-5 text-amber-500" />;
|
|
215
|
+
case "pro":
|
|
216
|
+
return <Zap className="h-5 w-5 text-primary" />;
|
|
217
217
|
default:
|
|
218
218
|
return <Zap className="h-5 w-5 text-muted-foreground" />;
|
|
219
219
|
}
|
|
@@ -237,36 +237,33 @@ function getFeatureDisplayName(feature: GatedFeature): string {
|
|
|
237
237
|
|
|
238
238
|
function getPlanFeatures(slug: string): string[] {
|
|
239
239
|
switch (slug) {
|
|
240
|
-
case "
|
|
241
|
-
return ["Basic invoicing", "Estimates & quotes", "Customer management", "PDF export"];
|
|
242
|
-
case "basic":
|
|
240
|
+
case "simple":
|
|
243
241
|
return [
|
|
244
|
-
"
|
|
245
|
-
"
|
|
246
|
-
"PDF export",
|
|
247
|
-
"FURS fiscalization",
|
|
248
|
-
"eSlog export",
|
|
249
|
-
"Recurring invoices",
|
|
242
|
+
"15 invoices per month",
|
|
243
|
+
"Unlimited estimates and delivery notes",
|
|
250
244
|
"Email sending",
|
|
245
|
+
"1 user",
|
|
246
|
+
"Clean invoice templates",
|
|
251
247
|
];
|
|
252
|
-
case "
|
|
248
|
+
case "advanced":
|
|
253
249
|
return [
|
|
254
|
-
"
|
|
255
|
-
"FURS fiscalization",
|
|
256
|
-
"eSlog
|
|
250
|
+
"500 invoices per month",
|
|
251
|
+
"FURS and FINA fiscalization",
|
|
252
|
+
"eSlog and Peppol e-invoicing",
|
|
257
253
|
"Recurring invoices",
|
|
258
254
|
"Email sending",
|
|
259
|
-
"
|
|
255
|
+
"Priority support",
|
|
256
|
+
"3 users",
|
|
260
257
|
];
|
|
261
|
-
case "
|
|
258
|
+
case "pro":
|
|
262
259
|
return [
|
|
263
|
-
"
|
|
264
|
-
"
|
|
260
|
+
"1,000 invoices per month",
|
|
261
|
+
"1 connected store included",
|
|
262
|
+
"Extra stores at €5.99/month",
|
|
263
|
+
"Shopify and WooCommerce integrations",
|
|
264
|
+
"API access and webhooks",
|
|
265
265
|
"Custom templates",
|
|
266
|
-
"
|
|
267
|
-
"Webhooks",
|
|
268
|
-
"Priority support",
|
|
269
|
-
"2,500 docs/month",
|
|
266
|
+
"Overage billed at €0.01/invoice",
|
|
270
267
|
];
|
|
271
268
|
default:
|
|
272
269
|
return [];
|
package/src/generate-schemas.ts
CHANGED
|
@@ -294,10 +294,20 @@ ${exports}
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
// Create index file - export ALL schema files (not just schemasByGroup)
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
297
|
+
const normalizedSchemaFiles = new Map<string, string>();
|
|
298
|
+
for (const file of await fs.readdir(SCHEMAS_DIR)) {
|
|
299
|
+
if (!file.endsWith(".ts") || file === "index.ts") continue;
|
|
300
|
+
|
|
301
|
+
const name = file.replace(".ts", "");
|
|
302
|
+
const normalizedName = name.replace(/_/g, "").toLowerCase();
|
|
303
|
+
const existing = normalizedSchemaFiles.get(normalizedName);
|
|
304
|
+
|
|
305
|
+
if (!existing || (existing.includes("_") && !name.includes("_"))) {
|
|
306
|
+
normalizedSchemaFiles.set(normalizedName, name);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const allSchemaFiles = [...normalizedSchemaFiles.values()].sort();
|
|
301
311
|
|
|
302
312
|
const indexContent = `/**
|
|
303
313
|
* This file was automatically generated using 'bun generate-schemas'.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was manually added to mirror generated webhook account schemas.
|
|
3
|
+
* Regenerate schemas when the generator supports account-webhooks.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
|
|
8
|
+
const accountWebhookEvents = z.enum([
|
|
9
|
+
"white_label_subscription.subscribed",
|
|
10
|
+
"white_label_subscription.upgraded",
|
|
11
|
+
"white_label_subscription.downgrade_scheduled",
|
|
12
|
+
"white_label_subscription.downgraded",
|
|
13
|
+
"white_label_subscription.cancellation_scheduled",
|
|
14
|
+
"white_label_subscription.cancelled",
|
|
15
|
+
"white_label_subscription.renewed",
|
|
16
|
+
"white_label_subscription.expired",
|
|
17
|
+
"white_label_subscription.payment_failed",
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
const createAccountWebhookSchemaDefinition = z.object({
|
|
21
|
+
url: z.string().max(2048).url(),
|
|
22
|
+
description: z.string().max(500).optional(),
|
|
23
|
+
events: z.array(accountWebhookEvents).min(1),
|
|
24
|
+
active: z.boolean().optional().default(true),
|
|
25
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type CreateAccountWebhookSchema = z.infer<typeof createAccountWebhookSchemaDefinition>;
|
|
29
|
+
|
|
30
|
+
const updateAccountWebhookSchemaDefinition = z
|
|
31
|
+
.object({
|
|
32
|
+
url: z.string().max(2048).url(),
|
|
33
|
+
description: z.union([z.string().max(500), z.null()]),
|
|
34
|
+
events: z.array(accountWebhookEvents).min(1),
|
|
35
|
+
active: z.boolean(),
|
|
36
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
37
|
+
})
|
|
38
|
+
.partial();
|
|
39
|
+
|
|
40
|
+
export type UpdateAccountWebhookSchema = z.infer<typeof updateAccountWebhookSchemaDefinition>;
|
|
41
|
+
|
|
42
|
+
export const createAccountWebhookSchema = createAccountWebhookSchemaDefinition;
|
|
43
|
+
export const updateAccountWebhookSchema = updateAccountWebhookSchemaDefinition;
|
|
@@ -0,0 +1,67 @@
|
|
|
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 accountwebhook endpoints
|
|
10
|
+
|
|
11
|
+
// Schema for create accountwebhook operation
|
|
12
|
+
const createAccountWebhookSchemaDefinition = z.object({
|
|
13
|
+
url: z.string().max(2048).url(),
|
|
14
|
+
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]).optional(),
|
|
15
|
+
events: z
|
|
16
|
+
.array(
|
|
17
|
+
z.enum([
|
|
18
|
+
"white_label_subscription.subscribed",
|
|
19
|
+
"white_label_subscription.upgraded",
|
|
20
|
+
"white_label_subscription.downgrade_scheduled",
|
|
21
|
+
"white_label_subscription.downgraded",
|
|
22
|
+
"white_label_subscription.cancellation_scheduled",
|
|
23
|
+
"white_label_subscription.cancelled",
|
|
24
|
+
"white_label_subscription.renewed",
|
|
25
|
+
"white_label_subscription.expired",
|
|
26
|
+
"white_label_subscription.payment_failed",
|
|
27
|
+
])
|
|
28
|
+
)
|
|
29
|
+
.min(1),
|
|
30
|
+
active: z.boolean().optional().default(true),
|
|
31
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]).optional(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Type for create accountwebhook operation
|
|
35
|
+
export type CreateAccountWebhookSchema = z.infer<typeof createAccountWebhookSchemaDefinition>;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
// Schema for update accountwebhook operation
|
|
39
|
+
const updateAccountWebhookSchemaDefinition = z
|
|
40
|
+
.object({
|
|
41
|
+
url: z.string().max(2048).url(),
|
|
42
|
+
description: z.union([z.string().max(4000, "Description must not exceed 4000 characters"), z.null()]),
|
|
43
|
+
events: z
|
|
44
|
+
.array(
|
|
45
|
+
z.enum([
|
|
46
|
+
"white_label_subscription.subscribed",
|
|
47
|
+
"white_label_subscription.upgraded",
|
|
48
|
+
"white_label_subscription.downgrade_scheduled",
|
|
49
|
+
"white_label_subscription.downgraded",
|
|
50
|
+
"white_label_subscription.cancellation_scheduled",
|
|
51
|
+
"white_label_subscription.cancelled",
|
|
52
|
+
"white_label_subscription.renewed",
|
|
53
|
+
"white_label_subscription.expired",
|
|
54
|
+
"white_label_subscription.payment_failed",
|
|
55
|
+
])
|
|
56
|
+
)
|
|
57
|
+
.min(1),
|
|
58
|
+
active: z.boolean(),
|
|
59
|
+
metadata: z.union([z.record(z.string(), z.any()), z.null()]),
|
|
60
|
+
})
|
|
61
|
+
.partial();
|
|
62
|
+
|
|
63
|
+
// Type for update accountwebhook operation
|
|
64
|
+
export type UpdateAccountWebhookSchema = z.infer<typeof updateAccountWebhookSchemaDefinition>;
|
|
65
|
+
|
|
66
|
+
export const createAccountWebhookSchema = createAccountWebhookSchemaDefinition;
|
|
67
|
+
export const updateAccountWebhookSchema = updateAccountWebhookSchemaDefinition;
|