@cosmicdrift/kumiko-samples 0.378.0 → 0.379.0
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/package.json +1 -1
- package/packages/bundled-features/package.json +18 -17
- package/packages/bundled-features/src/account-security/feature.ts +2 -2
- package/packages/bundled-features/src/account-security/index.ts +8 -8
- package/packages/bundled-features/src/account-security/{constants.ts → web/constants.ts} +0 -2
- package/packages/bundled-features/src/account-security/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/feature.ts +10 -9
- package/packages/bundled-features/src/admin-shell/index.ts +8 -8
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/admin-shell/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/web/default-translations.ts +10 -0
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +51 -9
- package/packages/bundled-features/src/admin-shell/web/index.ts +0 -1
- package/packages/bundled-features/src/audit/changes.json +7 -0
- package/packages/bundled-features/src/audit/feature.ts +72 -64
- package/packages/bundled-features/src/audit/handlers/audit-events.ts +153 -0
- package/packages/bundled-features/src/audit/handlers/audit-system-db.ts +13 -0
- package/packages/bundled-features/src/audit/handlers/details-all-tenants.query.ts +26 -0
- package/packages/bundled-features/src/audit/handlers/details.query.ts +11 -39
- package/packages/bundled-features/src/audit/handlers/list-all-tenants.query.ts +47 -0
- package/packages/bundled-features/src/audit/handlers/list.query.ts +16 -123
- package/packages/bundled-features/src/audit/handlers/resolve-audit-tenant.ts +21 -7
- package/packages/bundled-features/src/audit/index.ts +1 -1
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +4 -4
- package/packages/bundled-features/src/audit/screens.ts +82 -0
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/audit/{constants.ts → web/constants.ts} +11 -1
- package/packages/bundled-features/src/audit/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +33 -7
- package/packages/bundled-features/src/audit/web/index.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/changes.json +6 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/feature.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +38 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/index.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/signup-activation.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-logic.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-actions.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{i18n.ts → web/i18n.ts} +3 -4
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{mail-i18n.ts → web/mail-i18n.ts} +0 -1
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/changes.json +6 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/index.ts +8 -8
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/screens.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/index.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +21 -23
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +0 -1
- package/packages/bundled-features/src/billing-foundation/changes.json +18 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts +11 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts +11 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +12 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/stored-user-email.ts +12 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +6 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +167 -28
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +102 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +43 -12
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +202 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +70 -0
- package/packages/bundled-features/src/billing-foundation/events.ts +20 -2
- package/packages/bundled-features/src/billing-foundation/feature.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +82 -9
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/index.ts +27 -27
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/screens.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/types.ts +17 -3
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-contact-plan.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +5 -7
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/billing-foundation/{constants.ts → web/constants.ts} +37 -31
- package/packages/bundled-features/src/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.ts +0 -1
- package/packages/bundled-features/src/billing-foundation/{contact-card.ts → web/contact-card.ts} +0 -2
- package/packages/bundled-features/src/billing-foundation/web/index.ts +14 -15
- package/packages/bundled-features/src/billing-foundation/web/localized-params.ts +0 -2
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +5 -2
- package/packages/bundled-features/src/cap-overview/feature.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +2 -2
- package/packages/bundled-features/src/cap-overview/index.ts +9 -9
- package/packages/bundled-features/src/cap-overview/screens.ts +2 -2
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +0 -2
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +3 -4
- package/packages/bundled-features/src/cap-overview/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/cap-overview/web/index.ts +0 -1
- package/packages/bundled-features/src/cap-overview/{usage-math.ts → web/usage-math.ts} +1 -2
- package/packages/bundled-features/src/compliance-profiles/feature.ts +5 -5
- package/packages/bundled-features/src/compliance-profiles/index.ts +6 -6
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +1 -2
- package/packages/bundled-features/src/compliance-profiles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +0 -1
- package/packages/bundled-features/src/config/index.ts +6 -6
- package/packages/bundled-features/src/config/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/config/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/config/web/i18n.ts +0 -1
- package/packages/bundled-features/src/config/web/index.ts +1 -3
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +8 -8
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +4 -4
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/index.ts +8 -8
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +1 -1
- package/packages/bundled-features/src/custom-fields/schemas.ts +1 -1
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/{constants.ts → web/constants.ts} +18 -19
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/web/i18n.ts +0 -1
- package/packages/bundled-features/src/custom-fields/web/index.ts +2 -3
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +1 -2
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -1
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +24 -8
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/constants.ts +2 -2
- package/packages/bundled-features/src/delivery/i18n.ts +1 -1
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +1 -1
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +6 -7
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -2
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/index.ts +0 -1
- package/packages/bundled-features/src/delivery/{public-names.ts → web/public-names.ts} +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +4 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +2 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +18 -4
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +1 -0
- package/packages/bundled-features/src/feature-toggles/feature.ts +7 -7
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/index.ts +6 -6
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/feature-toggles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/feature-toggles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/feature-toggles/web/index.ts +0 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/feature.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/index.ts +8 -8
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/folders/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +1 -2
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -2
- package/packages/bundled-features/src/folders/web/i18n.ts +0 -1
- package/packages/bundled-features/src/folders/web/index.ts +1 -2
- package/packages/bundled-features/src/folders/web/tree.ts +0 -1
- package/packages/bundled-features/src/form-draft/changes.json +7 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +25 -11
- package/packages/bundled-features/src/form-draft/decrypt-draft.ts +24 -0
- package/packages/bundled-features/src/form-draft/entity.ts +6 -9
- package/packages/bundled-features/src/form-draft/feature.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +26 -5
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +6 -7
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +13 -7
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +5 -5
- package/packages/bundled-features/src/form-draft/index.ts +8 -8
- package/packages/bundled-features/src/form-draft/lookup.ts +10 -4
- package/packages/bundled-features/src/form-draft/schemas.ts +1 -1
- package/packages/bundled-features/src/form-draft/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +10 -10
- package/packages/bundled-features/src/jobs/feature.ts +7 -7
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +1 -1
- package/packages/bundled-features/src/jobs/index.ts +1 -1
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/jobs/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/jobs/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/jobs/web/i18n.ts +53 -7
- package/packages/bundled-features/src/jobs/web/index.ts +0 -1
- package/packages/bundled-features/src/ledger/changes.json +7 -0
- package/packages/bundled-features/src/ledger/entity.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +2 -10
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/index.ts +13 -13
- package/packages/bundled-features/src/ledger/recurring.ts +1 -1
- package/packages/bundled-features/src/ledger/reports.ts +1 -1
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/ledger/web/index.ts +11 -12
- package/packages/bundled-features/src/legal-pages/README.md +1 -1
- package/packages/bundled-features/src/legal-pages/feature.ts +5 -5
- package/packages/bundled-features/src/legal-pages/index.ts +11 -11
- package/packages/bundled-features/src/legal-pages/lib/boot-check.ts +1 -1
- package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +1 -1
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/legal-pages/{constants.ts → web/constants.ts} +6 -8
- package/packages/bundled-features/src/legal-pages/web/index.ts +0 -1
- package/packages/bundled-features/src/managed-pages/feature.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/managed-pages/web/default-translations.ts +17 -0
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +59 -16
- package/packages/bundled-features/src/managed-pages/web/index.ts +1 -2
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/feature.ts +6 -6
- package/packages/bundled-features/src/metrics/index.ts +8 -8
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +1 -1
- package/packages/bundled-features/src/metrics/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/metrics/window.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +1 -1
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
- package/packages/bundled-features/src/notes-history/index.ts +8 -8
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/notes-history/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/notes-history/web/i18n.ts +0 -1
- package/packages/bundled-features/src/notes-history/web/index.ts +2 -3
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +2 -3
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +12 -10
- package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/hash.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/index.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/personal-access-tokens/{scopes.ts → web/scopes.ts} +0 -1
- package/packages/bundled-features/src/presets/changes.json +7 -0
- package/packages/bundled-features/src/presets/index.ts +0 -1
- package/packages/bundled-features/src/presets/security-baseline.ts +1 -1
- package/packages/bundled-features/src/renderer-foundation/types.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/secrets/i18n.ts +1 -1
- package/packages/bundled-features/src/secrets/index.ts +8 -8
- package/packages/bundled-features/src/secrets/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/secrets/write-gate.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +7 -4
- package/packages/bundled-features/src/sessions/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/purge-files-reaching-subject.ts +10 -2
- package/packages/bundled-features/src/shared/web/translate-or-raw.ts +0 -1
- package/packages/bundled-features/src/subscription-stripe/feature.ts +2 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +19 -0
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +1 -0
- package/packages/bundled-features/src/tags/changes.json +6 -0
- package/packages/bundled-features/src/tags/feature.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +11 -7
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +4 -1
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/index.ts +12 -12
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/tags/{constants.ts → web/constants.ts} +4 -1
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +1 -2
- package/packages/bundled-features/src/tags/web/i18n.ts +2 -2
- package/packages/bundled-features/src/tags/web/index.ts +2 -3
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +5 -4
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +1 -2
- package/packages/bundled-features/src/template-resolver/README.md +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +75 -28
- package/packages/bundled-features/src/template-resolver/changes.json +43 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +1 -1
- package/packages/bundled-features/src/template-resolver/compile-steps-block.ts +2 -2
- package/packages/bundled-features/src/template-resolver/document-ops.ts +5 -5
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +4 -4
- package/packages/bundled-features/src/template-resolver/feature.ts +13 -4
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +6 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +6 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +19 -2
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +7 -1
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/document-base.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/document-blocks.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +10 -5
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +68 -10
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-upload.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/template-gates.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/i18n.ts +25 -0
- package/packages/bundled-features/src/template-resolver/index.ts +60 -59
- package/packages/bundled-features/src/template-resolver/layout-appearance.ts +1 -1
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +1 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +16 -7
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +2 -2
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-bundle.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-delivery-policy.ts +82 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-edit-policy.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-meta.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-preview.ts +14 -10
- package/packages/bundled-features/src/template-resolver/template-usage.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +2 -2
- package/packages/bundled-features/src/template-resolver/testing.ts +2 -2
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/{constants.ts → web/constants.ts} +7 -10
- package/packages/bundled-features/src/template-resolver/{document-blocks.ts → web/document-blocks.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +2 -3
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/{document-images.ts → web/document-images.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{document-schema.ts → web/document-schema.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{document-steps.ts → web/document-steps.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +6 -7
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +2 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +2 -1
- package/packages/bundled-features/src/template-resolver/web/index.ts +13 -14
- package/packages/bundled-features/src/template-resolver/{mail-constants.ts → web/mail-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{pdf-constants.ts → web/pdf-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor-lazy.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor.tsx +5 -4
- package/packages/bundled-features/src/template-resolver/{placeholder-text.ts → web/placeholder-text.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{qualified-names.ts → web/qualified-names.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/use-stable-by-key.ts +0 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +1 -1
- package/packages/bundled-features/src/tenant/index.ts +7 -7
- package/packages/bundled-features/src/tenant/invitation-table.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +1 -1
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +1 -1
- package/packages/bundled-features/src/tenant/member-role-options.ts +1 -1
- package/packages/bundled-features/src/tenant/screens.ts +2 -2
- package/packages/bundled-features/src/tenant/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/tenant/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/tenant/web/index.ts +0 -1
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +2 -2
- package/packages/bundled-features/src/tier-engine/entity.ts +1 -1
- package/packages/bundled-features/src/tier-engine/feature.ts +7 -7
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +1 -1
- package/packages/bundled-features/src/tier-engine/index.ts +8 -8
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/tier-engine/{constants.ts → web/constants.ts} +2 -3
- package/packages/bundled-features/src/tier-engine/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/tier-engine/web/index.ts +0 -1
- package/packages/bundled-features/src/user/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update.write.ts +1 -1
- package/packages/bundled-features/src/user/index.ts +1 -1
- package/packages/bundled-features/src/user/invited-global-roles.ts +1 -1
- package/packages/bundled-features/src/user/schema/user.ts +1 -1
- package/packages/bundled-features/src/user/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-data-rights/changes.json +14 -0
- package/packages/bundled-features/src/user-data-rights/env.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +9 -9
- package/packages/bundled-features/src/user-data-rights/index.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/{constants.ts → web/constants.ts} +11 -12
- package/packages/bundled-features/src/user-data-rights/web/default-translations.ts +91 -0
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +41 -91
- package/packages/bundled-features/src/user-data-rights/web/index.ts +1 -2
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -2
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +10 -1
- package/packages/bundled-features/src/user-profile/feature.ts +2 -2
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +1 -1
- package/packages/bundled-features/src/user-profile/index.ts +3 -2
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +2 -3
- package/packages/bundled-features/src/user-profile/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-profile/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/entity.ts +1 -1
- package/packages/bundled-features/src/waitlist/feature.ts +5 -5
- package/packages/bundled-features/src/waitlist/handlers/export-purge.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +5 -1
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/import.ts +1 -1
- package/packages/bundled-features/src/waitlist/index.ts +11 -11
- package/packages/bundled-features/src/waitlist/legacy-migrate.ts +1 -1
- package/packages/bundled-features/src/waitlist/link-on-signup.ts +1 -1
- package/packages/bundled-features/src/waitlist/mail.ts +7 -6
- package/packages/bundled-features/src/waitlist/payloads.ts +1 -1
- package/packages/bundled-features/src/waitlist/screens.ts +1 -1
- package/packages/bundled-features/src/waitlist/{constants.ts → web/constants.ts} +0 -1
- package/samples/apps/styleguide/src/features/content/web.tsx +0 -1
- package/samples/apps/ui-walkthrough/src/app/client.tsx +2 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +17 -1
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +11 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +2 -1
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +35 -7
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +6 -0
- package/samples/apps/ui-walkthrough/src/features/rental/entities.ts +27 -0
- package/samples/apps/ui-walkthrough/src/features/rental/feature.ts +61 -7
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +48 -24
- package/samples/apps/ui-walkthrough/src/features/rental/invoice-receive.ts +0 -1
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +17 -1
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +3 -0
- package/samples/apps/ui-walkthrough/src/features/rental/receipts-upload.ts +70 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +90 -13
- package/samples/apps/ui-walkthrough/src/features/rental/web/index.ts +0 -2
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +103 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/i18n.ts +36 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/seed.ts +21 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +11 -0
- package/samples/apps/use-all-bundled/e2e-billing-gallery/server.ts +1 -1
- package/samples/apps/use-all-bundled/feature-manifest.json +4 -4
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +3 -1
- package/samples/recipes/compose-stacks/README.md +1 -2
- package/samples/recipes/embedded/README.md +5 -5
- package/samples/recipes/embedded/src/handlers/invoice-receive.write.ts +0 -1
- package/samples/recipes/embedded/src/screens/invoice-receive.screen.ts +9 -12
- package/samples/recipes/legal-pages/README.md +2 -2
- package/samples/recipes/legal-pages/src/feature.ts +1 -1
- package/samples/recipes/reference-data/src/feature.ts +3 -7
- package/packages/bundled-features/src/admin-shell/i18n.ts +0 -54
- package/packages/bundled-features/src/audit/i18n.ts +0 -25
- package/packages/bundled-features/src/auth-mfa/web/qrcode-browser.d.ts +0 -11
- package/packages/bundled-features/src/jobs/i18n.ts +0 -55
- package/packages/bundled-features/src/managed-pages/i18n.ts +0 -63
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +0 -35
- package/packages/bundled-features/src/user-data-rights/i18n.ts +0 -44
- package/samples/apps/ui-walkthrough/src/features/rental/web/upload-standard-layout.tsx +0 -61
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { canonicalizeLocaleTag, isValidLocaleTag } from "@cosmicdrift/kumiko-framework/i18n";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { WAITLIST_FIELD_LIMITS } from "./constants.ts";
|
|
3
|
+
import { WAITLIST_FIELD_LIMITS } from "./web/constants.ts";
|
|
4
4
|
|
|
5
5
|
// Submitted text lands in a mail subject; CR/LF there would allow header injection.
|
|
6
6
|
const NO_CONTROL_CHARS = /^\P{Cc}*$/u;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EntityListScreenDefinition, i18nKey } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { WAITLIST_STATUS, WaitlistHandlers } from "./constants.ts";
|
|
3
2
|
import { adminAccess } from "./lib.ts";
|
|
3
|
+
import { WAITLIST_STATUS, WaitlistHandlers } from "./web/constants.ts";
|
|
4
4
|
|
|
5
5
|
export const waitlistListScreen: EntityListScreenDefinition = {
|
|
6
6
|
id: "waitlist-list",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// übergibt Shell + clientFeatures an createKumikoApp.
|
|
3
3
|
|
|
4
4
|
import { emailPasswordClient } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/web";
|
|
5
|
+
import { billingFoundationClient } from "@cosmicdrift/kumiko-bundled-features/billing-foundation/web";
|
|
5
6
|
import { textBlocksClient } from "@cosmicdrift/kumiko-bundled-features/template-resolver/web";
|
|
6
7
|
import { documentDesignerClient } from "@cosmicdrift/kumiko-document-designer/web";
|
|
7
8
|
import { localeDeClient } from "@cosmicdrift/kumiko-locale-de/web";
|
|
@@ -21,6 +22,7 @@ createKumikoApp({
|
|
|
21
22
|
rentalClient,
|
|
22
23
|
vehiclesClient,
|
|
23
24
|
billingClient,
|
|
25
|
+
billingFoundationClient(),
|
|
24
26
|
textBlocksClient(),
|
|
25
27
|
documentDesignerClient(),
|
|
26
28
|
],
|
|
@@ -5,7 +5,12 @@ import type { SeedFn } from "@cosmicdrift/kumiko-dev-server";
|
|
|
5
5
|
import { createTenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
6
6
|
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
7
7
|
import { countRowsForTenant } from "../db/queries/row-counts";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
leaseExecutor,
|
|
10
|
+
managementProfileExecutor,
|
|
11
|
+
partyExecutor,
|
|
12
|
+
positionExecutor,
|
|
13
|
+
} from "../features/rental/lease-support";
|
|
9
14
|
|
|
10
15
|
type BoardLease = {
|
|
11
16
|
readonly mieter: string;
|
|
@@ -269,4 +274,15 @@ export const seedRental: SeedFn = async (stack) => {
|
|
|
269
274
|
db,
|
|
270
275
|
);
|
|
271
276
|
if (!position.isSuccess) throw new Error("seed position failed");
|
|
277
|
+
|
|
278
|
+
const profile = await managementProfileExecutor.create(
|
|
279
|
+
{
|
|
280
|
+
name: "Nordlicht Immobilien GmbH",
|
|
281
|
+
anschrift: "Hafenstraße 12, 24103 Kiel",
|
|
282
|
+
zahlungsziel: 14,
|
|
283
|
+
},
|
|
284
|
+
TestUsers.admin,
|
|
285
|
+
db,
|
|
286
|
+
);
|
|
287
|
+
if (!profile.isSuccess) throw new Error("seed management profile failed");
|
|
272
288
|
};
|
|
@@ -212,6 +212,17 @@ export const seedTemplates: SeedFn = async (stack) => {
|
|
|
212
212
|
await upsertTenant(INVOICE_CORRECTED_DRAFT, "draft");
|
|
213
213
|
for (const reminder of PAYMENT_REMINDER_TEMPLATES) await upsertTenant(reminder, "active");
|
|
214
214
|
await upsertTenant(TENANT_UTILITY_STATEMENT, "active");
|
|
215
|
+
// The platform admin adapted the Exposé for Nordlicht, but the template is not unlocked for
|
|
216
|
+
// tenants, so the stored copy is not delivered; the SystemAdmin overview flags it.
|
|
217
|
+
await upsert(
|
|
218
|
+
TemplateResolverHandlers.upsertTenant,
|
|
219
|
+
{
|
|
220
|
+
...SYSTEM_PROPERTY_EXPOSE,
|
|
221
|
+
content: SYSTEM_PROPERTY_EXPOSE.content.replace("Exposé", "Objektexposé"),
|
|
222
|
+
},
|
|
223
|
+
platformAdmin,
|
|
224
|
+
{ status: "active" },
|
|
225
|
+
);
|
|
215
226
|
|
|
216
227
|
// Other tenants with their own invoice copy: what the SystemAdmin sees in the overrides drawer.
|
|
217
228
|
for (const override of TENANT_INVOICE_OVERRIDES) {
|
|
@@ -13,6 +13,7 @@ import { createUnsubscribeRoutes } from "@cosmicdrift/kumiko-bundled-features/de
|
|
|
13
13
|
import { runDevApp } from "@cosmicdrift/kumiko-dev-server";
|
|
14
14
|
import type { TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
15
15
|
import { createInMemoryFileProvider } from "@cosmicdrift/kumiko-framework/files";
|
|
16
|
+
import { seedPlanTerms } from "../features/subscription-plans";
|
|
16
17
|
import { APP_FEATURES } from "../run-config";
|
|
17
18
|
import {
|
|
18
19
|
ADMIN_EMAIL,
|
|
@@ -34,7 +35,7 @@ import { seedVehicles } from "./seed-vehicles";
|
|
|
34
35
|
|
|
35
36
|
await runDevApp({
|
|
36
37
|
features: [...APP_FEATURES],
|
|
37
|
-
seeds: [seedTasks, seedRental, seedVehicles, seedTemplates],
|
|
38
|
+
seeds: [seedTasks, seedRental, seedVehicles, seedTemplates, seedPlanTerms],
|
|
38
39
|
// PORT env-var override für Playwright-e2e-Runs (config zeigt auf 4174);
|
|
39
40
|
// sonst lokal-Default 4173.
|
|
40
41
|
port: Number.parseInt(process.env["PORT"] ?? "4173", 10),
|
|
@@ -66,16 +66,44 @@ const INVOICE_ISSUED_VARIABLES = {
|
|
|
66
66
|
} as const;
|
|
67
67
|
|
|
68
68
|
const PAYMENT_REMINDER_VARIABLES = {
|
|
69
|
-
customerName: templateVariable.text({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
customerName: templateVariable.text({
|
|
70
|
+
label: "billing:mail.variable.customerName",
|
|
71
|
+
required: true,
|
|
72
|
+
example: "Familie Yilmaz",
|
|
73
|
+
}),
|
|
74
|
+
invoiceNumber: templateVariable.text({
|
|
75
|
+
label: "billing:mail.variable.invoiceNumber",
|
|
76
|
+
required: true,
|
|
77
|
+
example: "RE-2026-0142",
|
|
78
|
+
}),
|
|
79
|
+
amount: templateVariable.money({
|
|
80
|
+
label: "billing:mail.variable.amountDue",
|
|
81
|
+
required: true,
|
|
82
|
+
example: { amount: 128450, currency: "EUR" },
|
|
83
|
+
}),
|
|
84
|
+
dueDate: templateVariable.date({
|
|
85
|
+
label: "billing:mail.variable.dueDate",
|
|
86
|
+
required: true,
|
|
87
|
+
example: "2026-10-30",
|
|
88
|
+
}),
|
|
89
|
+
invoiceUrl: templateVariable.link({
|
|
90
|
+
label: "billing:mail.variable.invoiceUrl",
|
|
91
|
+
required: true,
|
|
92
|
+
example: "https://nordlicht-immobilien.de/rechnungen/RE-2026-0142",
|
|
93
|
+
}),
|
|
74
94
|
} as const;
|
|
75
95
|
|
|
76
96
|
const TERMS_CHANGED_VARIABLES = {
|
|
77
|
-
customerName: templateVariable.text({
|
|
78
|
-
|
|
97
|
+
customerName: templateVariable.text({
|
|
98
|
+
label: "billing:mail.variable.customerName",
|
|
99
|
+
required: true,
|
|
100
|
+
example: "Familie Yilmaz",
|
|
101
|
+
}),
|
|
102
|
+
effectiveDate: templateVariable.date({
|
|
103
|
+
label: "billing:mail.variable.effectiveDate",
|
|
104
|
+
required: true,
|
|
105
|
+
example: "2026-12-01",
|
|
106
|
+
}),
|
|
79
107
|
} as const;
|
|
80
108
|
|
|
81
109
|
export const billingFeature = defineFeature("billing", (r) => {
|
|
@@ -11,6 +11,9 @@ export const billingTranslations: TranslationsByLocale = {
|
|
|
11
11
|
"billing:notify.payment-reminder.label": "Mahnlauf",
|
|
12
12
|
"billing:notify.terms-changed.label": "AGB-Änderung",
|
|
13
13
|
"billing:mail.variable.recipientName": "Empfängername",
|
|
14
|
+
"billing:mail.variable.customerName": "Kundenname",
|
|
15
|
+
"billing:mail.variable.amountDue": "Offener Betrag",
|
|
16
|
+
"billing:mail.variable.effectiveDate": "Gültig ab",
|
|
14
17
|
"billing:mail.variable.recipientEmail": "Empfänger-Adresse",
|
|
15
18
|
"billing:mail.variable.invoiceNumber": "Rechnungsnummer",
|
|
16
19
|
"billing:mail.variable.invoiceTotal": "Rechnungsbetrag",
|
|
@@ -31,6 +34,9 @@ export const billingTranslations: TranslationsByLocale = {
|
|
|
31
34
|
"billing:notify.payment-reminder.label": "Dunning run",
|
|
32
35
|
"billing:notify.terms-changed.label": "Terms update",
|
|
33
36
|
"billing:mail.variable.recipientName": "Recipient name",
|
|
37
|
+
"billing:mail.variable.customerName": "Customer name",
|
|
38
|
+
"billing:mail.variable.amountDue": "Amount due",
|
|
39
|
+
"billing:mail.variable.effectiveDate": "Effective date",
|
|
34
40
|
"billing:mail.variable.recipientEmail": "Recipient address",
|
|
35
41
|
"billing:mail.variable.invoiceNumber": "Invoice number",
|
|
36
42
|
"billing:mail.variable.invoiceTotal": "Invoice total",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createDateField,
|
|
3
3
|
createEntity,
|
|
4
|
+
createFileField,
|
|
4
5
|
createMoneyField,
|
|
5
6
|
createNumberField,
|
|
6
7
|
createSelectField,
|
|
@@ -9,6 +10,9 @@ import {
|
|
|
9
10
|
|
|
10
11
|
const DEMO_DATA = { personal: false, reason: "is_business_data" } as const;
|
|
11
12
|
|
|
13
|
+
// Server-side accept lists are extensions, not MIME types.
|
|
14
|
+
export const RECEIPT_ACCEPT = ["pdf", "png", "jpg"] as const;
|
|
15
|
+
|
|
12
16
|
export const LEASE_STATUSES = ["active", "terminated"] as const;
|
|
13
17
|
|
|
14
18
|
export const leaseEntity = createEntity({
|
|
@@ -56,3 +60,26 @@ export const leasePartyEntity = createEntity({
|
|
|
56
60
|
rolle: createTextField({ ...DEMO_DATA, filterable: true }),
|
|
57
61
|
},
|
|
58
62
|
});
|
|
63
|
+
|
|
64
|
+
// A receipt keeps the uploaded file as its own record; dateiname is a copy for the success list.
|
|
65
|
+
export const receiptEntity = createEntity({
|
|
66
|
+
table: "read_ui_walkthrough_receipts",
|
|
67
|
+
fields: {
|
|
68
|
+
datei: createFileField({
|
|
69
|
+
...DEMO_DATA,
|
|
70
|
+
required: true,
|
|
71
|
+
accept: RECEIPT_ACCEPT,
|
|
72
|
+
maxSize: "10MB",
|
|
73
|
+
}),
|
|
74
|
+
dateiname: createTextField({ ...DEMO_DATA, required: true }),
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const managementProfileEntity = createEntity({
|
|
79
|
+
table: "read_ui_walkthrough_management_profiles",
|
|
80
|
+
fields: {
|
|
81
|
+
name: createTextField({ ...DEMO_DATA, required: true }),
|
|
82
|
+
anschrift: createTextField(DEMO_DATA),
|
|
83
|
+
zahlungsziel: createNumberField({ integer: true, required: true }),
|
|
84
|
+
},
|
|
85
|
+
});
|
|
@@ -7,7 +7,13 @@ import {
|
|
|
7
7
|
} from "@cosmicdrift/kumiko-renderer-puppeteer-client";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { openToAllSignedIn, toKeyFirst } from "../translations";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
leaseEntity,
|
|
12
|
+
leasePartyEntity,
|
|
13
|
+
leasePositionEntity,
|
|
14
|
+
managementProfileEntity,
|
|
15
|
+
receiptEntity,
|
|
16
|
+
} from "./entities";
|
|
11
17
|
import { rentalTranslations } from "./i18n";
|
|
12
18
|
import { receiveInvoicePayloadSchema } from "./invoice-receive";
|
|
13
19
|
import {
|
|
@@ -18,6 +24,7 @@ import {
|
|
|
18
24
|
germanStatusLabel,
|
|
19
25
|
idPayloadSchema,
|
|
20
26
|
leaseExecutor,
|
|
27
|
+
managementProfileExecutor,
|
|
21
28
|
noticePeriodEnd,
|
|
22
29
|
parseLeaseRow,
|
|
23
30
|
partyExecutor,
|
|
@@ -28,7 +35,9 @@ import {
|
|
|
28
35
|
type RecordedPositionItem,
|
|
29
36
|
recordPositionsPayloadSchema,
|
|
30
37
|
rentAdjustPayloadSchema,
|
|
38
|
+
saveManagementProfilePayloadSchema,
|
|
31
39
|
} from "./lease-support";
|
|
40
|
+
import { receiptsUploadPayloadSchema, uploadReceipts } from "./receipts-upload";
|
|
32
41
|
import {
|
|
33
42
|
adjustRentScreen,
|
|
34
43
|
leaseDetailGapsScreen,
|
|
@@ -40,11 +49,13 @@ import {
|
|
|
40
49
|
leaseListShortScreen,
|
|
41
50
|
leaseSuccessionListScreen,
|
|
42
51
|
leaseUnterlagenScreen,
|
|
52
|
+
managementProfileScreen,
|
|
43
53
|
partyEditScreen,
|
|
44
54
|
positionEditScreen,
|
|
45
55
|
receiveInvoiceScreen,
|
|
46
56
|
recordPositionsScreen,
|
|
47
57
|
rentalDashboardScreen,
|
|
58
|
+
uploadReceiptsScreen,
|
|
48
59
|
} from "./screens";
|
|
49
60
|
|
|
50
61
|
export { leaseEntity, leasePartyEntity, leasePositionEntity };
|
|
@@ -237,6 +248,46 @@ export const rentalFeature = defineFeature("rental", (r) => {
|
|
|
237
248
|
...open,
|
|
238
249
|
});
|
|
239
250
|
|
|
251
|
+
r.entity({ name: "receipt", ...receiptEntity });
|
|
252
|
+
// One row per tenant: the profile screen loads it without a record id.
|
|
253
|
+
r.entity({ name: "managementProfile", ...managementProfileEntity });
|
|
254
|
+
|
|
255
|
+
r.queryHandler({
|
|
256
|
+
name: "profile:current",
|
|
257
|
+
schema: z.object({}),
|
|
258
|
+
handler: async (query, ctx) => {
|
|
259
|
+
const page = await managementProfileExecutor.list({ limit: 1 }, query.user, ctx.db);
|
|
260
|
+
return page.rows[0] ?? null;
|
|
261
|
+
},
|
|
262
|
+
...open,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
r.writeHandler({
|
|
266
|
+
name: "profile:save",
|
|
267
|
+
schema: saveManagementProfilePayloadSchema,
|
|
268
|
+
handler: async (event, ctx) => {
|
|
269
|
+
const page = await managementProfileExecutor.list({ limit: 1 }, event.user, ctx.db);
|
|
270
|
+
const existing = page.rows[0];
|
|
271
|
+
if (existing === undefined) {
|
|
272
|
+
return managementProfileExecutor.create(event.payload, event.user, ctx.db);
|
|
273
|
+
}
|
|
274
|
+
return managementProfileExecutor.update(
|
|
275
|
+
{ id: String(existing["id"]), changes: event.payload },
|
|
276
|
+
event.user,
|
|
277
|
+
ctx.db,
|
|
278
|
+
{ skipOptimisticLock: true },
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
...open,
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
r.writeHandler({
|
|
285
|
+
name: "receipts-upload",
|
|
286
|
+
schema: receiptsUploadPayloadSchema,
|
|
287
|
+
handler: uploadReceipts,
|
|
288
|
+
...open,
|
|
289
|
+
});
|
|
290
|
+
|
|
240
291
|
r.writeHandler({
|
|
241
292
|
name: "invoice:receive",
|
|
242
293
|
schema: receiveInvoicePayloadSchema,
|
|
@@ -314,12 +365,8 @@ export const rentalFeature = defineFeature("rental", (r) => {
|
|
|
314
365
|
r.screen(recordPositionsScreen);
|
|
315
366
|
r.screen(receiveInvoiceScreen);
|
|
316
367
|
r.screen(leaseUnterlagenScreen);
|
|
317
|
-
r.screen(
|
|
318
|
-
|
|
319
|
-
type: "custom",
|
|
320
|
-
renderer: { react: { __component: "upload-standard-layout" } },
|
|
321
|
-
description: "Receipt upload on the standard form screen layout.",
|
|
322
|
-
});
|
|
368
|
+
r.screen(uploadReceiptsScreen);
|
|
369
|
+
r.screen(managementProfileScreen);
|
|
323
370
|
|
|
324
371
|
r.nav({
|
|
325
372
|
id: "contracts",
|
|
@@ -340,6 +387,13 @@ export const rentalFeature = defineFeature("rental", (r) => {
|
|
|
340
387
|
screen: "rental:screen:rental-dashboard",
|
|
341
388
|
order: 20,
|
|
342
389
|
});
|
|
390
|
+
r.nav({
|
|
391
|
+
id: "management-profile",
|
|
392
|
+
label: i18nKey("rental.nav.managementProfile"),
|
|
393
|
+
parent: "rental:nav:contracts",
|
|
394
|
+
screen: "rental:screen:management-profile",
|
|
395
|
+
order: 50,
|
|
396
|
+
});
|
|
343
397
|
r.nav({
|
|
344
398
|
id: "receive-invoice",
|
|
345
399
|
label: i18nKey("rental.nav.receiveInvoice"),
|
|
@@ -13,14 +13,14 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
13
13
|
"screen:upload-standard-layout.title": "Belege hochladen",
|
|
14
14
|
"rental.upload.description":
|
|
15
15
|
"Laden Sie Rechnungen und Nebenkostenbelege zum Mietvertrag hoch. Danach gehen sie zur Prüfung.",
|
|
16
|
+
"rental.upload.screenDescription": "Belege hochladen; sie werden dem Vorgang zugeordnet.",
|
|
16
17
|
"rental.upload.zoneTitle": "Belege auswählen",
|
|
17
|
-
"rental.upload.
|
|
18
|
-
"rental.upload.
|
|
19
|
-
"rental.upload.
|
|
20
|
-
"rental.upload.
|
|
21
|
-
|
|
22
|
-
"rental
|
|
23
|
-
"rental.upload.toReview": "Zur Prüfung",
|
|
18
|
+
"rental.upload.submit": "Zur Prüfung übernehmen",
|
|
19
|
+
"rental.upload.factCount": "Übernommene Belege",
|
|
20
|
+
"rental.upload.factFiles": "Dateien",
|
|
21
|
+
"rental.upload.unknownFile":
|
|
22
|
+
"Mindestens eine Datei gehört nicht zu Ihrem Upload. Bitte laden Sie sie erneut hoch.",
|
|
23
|
+
"rental:entity:__action-form__:field:belege": "Belege",
|
|
24
24
|
|
|
25
25
|
"screen:lease-list.title": "Mietverträge",
|
|
26
26
|
"screen:lease-list-short.title": "Mietverträge (gekündigt)",
|
|
@@ -30,6 +30,17 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
30
30
|
"screen:lease-hub.title": "Mietvertrag Hub",
|
|
31
31
|
"screen:rental-dashboard.title": "Kennzahlen",
|
|
32
32
|
"rental.nav.dashboard": "Kennzahlen",
|
|
33
|
+
"rental.nav.managementProfile": "Verwaltungsprofil",
|
|
34
|
+
"screen:management-profile.title": "Verwaltungsprofil",
|
|
35
|
+
"rental.managementProfile.hint":
|
|
36
|
+
"Diese Angaben erscheinen auf Mieterschreiben und Abrechnungen Ihrer Hausverwaltung.",
|
|
37
|
+
"rental:entity:__action-form__:field:profileName": "Name der Hausverwaltung",
|
|
38
|
+
"rental:entity:__action-form__:field:anschrift": "Anschrift",
|
|
39
|
+
"rental:entity:__action-form__:field:zahlungsziel": "Zahlungsziel in Tagen",
|
|
40
|
+
"rental.dashboard.profileHint.title": "Hinweis",
|
|
41
|
+
"rental.dashboard.profileHint.text":
|
|
42
|
+
"Auf Abrechnungen steht noch der Standardabsender. Hinterlegen Sie Name und Zahlungsziel Ihrer Hausverwaltung.",
|
|
43
|
+
"rental.dashboard.profileHint.link": "Verwaltungsprofil öffnen",
|
|
33
44
|
"rental.dashboard.debt": "Restschuld heute",
|
|
34
45
|
"rental.dashboard.rent": "Monatsmiete gesamt",
|
|
35
46
|
"rental.tab.history": "Verlauf",
|
|
@@ -115,10 +126,12 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
115
126
|
"rental.action.recordPositions": "Positionen speichern",
|
|
116
127
|
"rental.nav.receiveInvoice": "Eingangsrechnung",
|
|
117
128
|
"screen:receive-invoice.title": "Eingangsrechnung erfassen",
|
|
118
|
-
"rental.section.invoiceLines": "
|
|
119
|
-
"rental.section.
|
|
120
|
-
|
|
121
|
-
|
|
129
|
+
"rental.section.invoiceLines": "Positionen",
|
|
130
|
+
"rental.section.invoiceLines.description":
|
|
131
|
+
"Eine Zeile pro Leistung. Netto, USt. und Brutto stehen unter der Tabelle.",
|
|
132
|
+
"rental.total.net": "Netto",
|
|
133
|
+
"rental.total.vat": "USt.",
|
|
134
|
+
"rental.total.gross": "Brutto",
|
|
122
135
|
"rental.action.receiveInvoice": "Rechnung erfassen",
|
|
123
136
|
"rental:entity:__action-form__:field:supplier": "Lieferant",
|
|
124
137
|
"rental:entity:__action-form__:field:invoiceNumber": "Rechnungsnummer",
|
|
@@ -128,7 +141,6 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
128
141
|
"rental:entity:__action-form__:field:lines:cell:vatRate": "USt. in %",
|
|
129
142
|
"rental:entity:__action-form__:field:lines:cell:vatAmount": "USt.",
|
|
130
143
|
"rental:entity:__action-form__:field:netTotal": "Netto gesamt",
|
|
131
|
-
"rental:entity:__action-form__:field:vatRate": "USt.-Satz in %",
|
|
132
144
|
"rental:entity:__action-form__:field:vatTotal": "USt. gesamt",
|
|
133
145
|
"rental:entity:__action-form__:field:grossTotal": "Brutto gesamt",
|
|
134
146
|
"rental:entity:__action-form__:field:lease": "Mietvertrag",
|
|
@@ -165,14 +177,14 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
165
177
|
"screen:upload-standard-layout.title": "Upload receipts",
|
|
166
178
|
"rental.upload.description":
|
|
167
179
|
"Upload invoices and service charge receipts for the lease. They then go to review.",
|
|
180
|
+
"rental.upload.screenDescription": "Upload receipts; they are attached to the record.",
|
|
168
181
|
"rental.upload.zoneTitle": "Choose receipts",
|
|
169
|
-
"rental.upload.
|
|
170
|
-
"rental.upload.
|
|
171
|
-
"rental.upload.
|
|
172
|
-
"rental.upload.
|
|
173
|
-
|
|
174
|
-
"rental
|
|
175
|
-
"rental.upload.toReview": "To review",
|
|
182
|
+
"rental.upload.submit": "Send to review",
|
|
183
|
+
"rental.upload.factCount": "Receipts accepted",
|
|
184
|
+
"rental.upload.factFiles": "Files",
|
|
185
|
+
"rental.upload.unknownFile":
|
|
186
|
+
"At least one file is not part of your upload. Please upload it again.",
|
|
187
|
+
"rental:entity:__action-form__:field:belege": "Receipts",
|
|
176
188
|
|
|
177
189
|
"screen:lease-list.title": "Leases",
|
|
178
190
|
"screen:lease-list-short.title": "Leases (terminated)",
|
|
@@ -182,6 +194,17 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
182
194
|
"screen:lease-hub.title": "Lease hub",
|
|
183
195
|
"screen:rental-dashboard.title": "Key figures",
|
|
184
196
|
"rental.nav.dashboard": "Key figures",
|
|
197
|
+
"rental.nav.managementProfile": "Management profile",
|
|
198
|
+
"screen:management-profile.title": "Management profile",
|
|
199
|
+
"rental.managementProfile.hint":
|
|
200
|
+
"These details appear on tenant letters and statements of your property management.",
|
|
201
|
+
"rental:entity:__action-form__:field:profileName": "Property management name",
|
|
202
|
+
"rental:entity:__action-form__:field:anschrift": "Address",
|
|
203
|
+
"rental:entity:__action-form__:field:zahlungsziel": "Payment term in days",
|
|
204
|
+
"rental.dashboard.profileHint.title": "Note",
|
|
205
|
+
"rental.dashboard.profileHint.text":
|
|
206
|
+
"Statements still carry the default sender. Enter the name and payment term of your property management.",
|
|
207
|
+
"rental.dashboard.profileHint.link": "Open management profile",
|
|
185
208
|
"rental.dashboard.debt": "Remaining debt today",
|
|
186
209
|
"rental.dashboard.rent": "Total monthly rent",
|
|
187
210
|
"rental.tab.history": "History",
|
|
@@ -264,10 +287,12 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
264
287
|
"rental.action.recordPositions": "Save positions",
|
|
265
288
|
"rental.nav.receiveInvoice": "Incoming invoice",
|
|
266
289
|
"screen:receive-invoice.title": "Record incoming invoice",
|
|
267
|
-
"rental.section.invoiceLines": "
|
|
268
|
-
"rental.section.
|
|
269
|
-
|
|
270
|
-
|
|
290
|
+
"rental.section.invoiceLines": "Lines",
|
|
291
|
+
"rental.section.invoiceLines.description":
|
|
292
|
+
"One row per service. Net, VAT and gross are shown below the table.",
|
|
293
|
+
"rental.total.net": "Net",
|
|
294
|
+
"rental.total.vat": "VAT",
|
|
295
|
+
"rental.total.gross": "Gross",
|
|
271
296
|
"rental.action.receiveInvoice": "Record invoice",
|
|
272
297
|
"rental:entity:__action-form__:field:supplier": "Supplier",
|
|
273
298
|
"rental:entity:__action-form__:field:invoiceNumber": "Invoice number",
|
|
@@ -277,7 +302,6 @@ export const rentalTranslations: TranslationsByLocale = {
|
|
|
277
302
|
"rental:entity:__action-form__:field:lines:cell:vatRate": "VAT in %",
|
|
278
303
|
"rental:entity:__action-form__:field:lines:cell:vatAmount": "VAT",
|
|
279
304
|
"rental:entity:__action-form__:field:netTotal": "Net total",
|
|
280
|
-
"rental:entity:__action-form__:field:vatRate": "VAT rate in %",
|
|
281
305
|
"rental:entity:__action-form__:field:vatTotal": "VAT total",
|
|
282
306
|
"rental:entity:__action-form__:field:grossTotal": "Gross total",
|
|
283
307
|
"rental:entity:__action-form__:field:lease": "Lease",
|
|
@@ -12,7 +12,6 @@ export const receiveInvoicePayloadSchema = withFormDerivations(
|
|
|
12
12
|
invoiceNumber: z.string().min(1),
|
|
13
13
|
lines: fieldToZod(receiveInvoiceLines, ["EUR"]),
|
|
14
14
|
netTotal: moneyPayload,
|
|
15
|
-
vatRate: z.number().optional(),
|
|
16
15
|
vatTotal: moneyPayload,
|
|
17
16
|
grossTotal: moneyPayload,
|
|
18
17
|
}),
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { createEntityExecutor } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
leaseEntity,
|
|
6
|
+
leasePartyEntity,
|
|
7
|
+
leasePositionEntity,
|
|
8
|
+
managementProfileEntity,
|
|
9
|
+
} from "./entities";
|
|
5
10
|
|
|
6
11
|
export const { executor: leaseExecutor } = createEntityExecutor("lease", leaseEntity);
|
|
7
12
|
export const { executor: positionExecutor } = createEntityExecutor(
|
|
@@ -10,6 +15,17 @@ export const { executor: positionExecutor } = createEntityExecutor(
|
|
|
10
15
|
);
|
|
11
16
|
export const { executor: partyExecutor } = createEntityExecutor("leaseParty", leasePartyEntity);
|
|
12
17
|
|
|
18
|
+
export const { executor: managementProfileExecutor } = createEntityExecutor(
|
|
19
|
+
"managementProfile",
|
|
20
|
+
managementProfileEntity,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const saveManagementProfilePayloadSchema = z.object({
|
|
24
|
+
name: z.string().min(1).max(200),
|
|
25
|
+
anschrift: z.string().max(400).optional(),
|
|
26
|
+
zahlungsziel: z.number().int().min(0).max(120),
|
|
27
|
+
});
|
|
28
|
+
|
|
13
29
|
export const idPayloadSchema = z.object({ id: z.uuid() });
|
|
14
30
|
|
|
15
31
|
// Walkthrough shortcut, not the pattern: a real handler reads the photo ids from the stored record, never from the client.
|
|
@@ -4,6 +4,7 @@ export const RENTAL_QUERIES = {
|
|
|
4
4
|
partyList: "rental:query:lease-party:list",
|
|
5
5
|
positionList: "rental:query:lease:positions",
|
|
6
6
|
kennzahlen: "rental:query:lease:kennzahlen",
|
|
7
|
+
managementProfile: "rental:query:profile:current",
|
|
7
8
|
} as const;
|
|
8
9
|
|
|
9
10
|
export const RENTAL_WRITES = {
|
|
@@ -11,4 +12,6 @@ export const RENTAL_WRITES = {
|
|
|
11
12
|
rentAdjust: "rental:write:rent:adjust",
|
|
12
13
|
positionsRecord: "rental:write:lease:record-positions",
|
|
13
14
|
invoiceReceive: "rental:write:invoice:receive",
|
|
15
|
+
receiptsUpload: "rental:write:receipts-upload",
|
|
16
|
+
managementProfileSave: "rental:write:profile:save",
|
|
14
17
|
} as const;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createEntityExecutor, type WriteHandlerFn } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { UnprocessableError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
|
+
import {
|
|
4
|
+
bindPendingFileRef,
|
|
5
|
+
FILE_REF_ENTITY_NAME,
|
|
6
|
+
fileRefEntity,
|
|
7
|
+
loadPendingFileRef,
|
|
8
|
+
} from "@cosmicdrift/kumiko-framework/files";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { receiptEntity } from "./entities";
|
|
11
|
+
|
|
12
|
+
const UPLOAD_SCREEN_QN = "rental:screen:upload-standard-layout";
|
|
13
|
+
const UPLOAD_FIELD = "belege";
|
|
14
|
+
|
|
15
|
+
const { executor: receiptExecutor } = createEntityExecutor("receipt", receiptEntity);
|
|
16
|
+
const { executor: fileRefExecutor } = createEntityExecutor(FILE_REF_ENTITY_NAME, fileRefEntity);
|
|
17
|
+
|
|
18
|
+
export const receiptsUploadPayloadSchema = z.object({
|
|
19
|
+
belege: z.array(z.uuid()).min(1).max(10),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const unknownFile = () =>
|
|
23
|
+
new UnprocessableError("unknown_upload", { i18nKey: "rental.upload.unknownFile" });
|
|
24
|
+
|
|
25
|
+
// The form only carries file ids. Each one must be the caller's own, still unbound upload of this
|
|
26
|
+
// form; everything is checked before the first receipt is written so a bad id creates nothing.
|
|
27
|
+
export const uploadReceipts: WriteHandlerFn<z.infer<typeof receiptsUploadPayloadSchema>> = async (
|
|
28
|
+
event,
|
|
29
|
+
ctx,
|
|
30
|
+
) => {
|
|
31
|
+
const { user, payload } = event;
|
|
32
|
+
const pendingNames: { readonly fileRefId: string; readonly fileName: string }[] = [];
|
|
33
|
+
for (const fileRefId of new Set(payload.belege)) {
|
|
34
|
+
const pending = await loadPendingFileRef({
|
|
35
|
+
fileRefId,
|
|
36
|
+
entityName: UPLOAD_SCREEN_QN,
|
|
37
|
+
fieldName: UPLOAD_FIELD,
|
|
38
|
+
user,
|
|
39
|
+
db: ctx.db,
|
|
40
|
+
});
|
|
41
|
+
if (pending === undefined) throw unknownFile();
|
|
42
|
+
// fileName is personal data and may be encrypted, so only the executor's detail returns it.
|
|
43
|
+
const row = await fileRefExecutor.detail({ id: fileRefId }, user, ctx.db);
|
|
44
|
+
if (row === null) throw unknownFile();
|
|
45
|
+
pendingNames.push({ fileRefId, fileName: String(row["fileName"]) });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const belege: { readonly label: string }[] = [];
|
|
49
|
+
for (const { fileRefId, fileName } of pendingNames) {
|
|
50
|
+
const created = await receiptExecutor.create(
|
|
51
|
+
{ datei: fileRefId, dateiname: fileName },
|
|
52
|
+
user,
|
|
53
|
+
ctx.db,
|
|
54
|
+
);
|
|
55
|
+
if (!created.isSuccess) return created;
|
|
56
|
+
const outcome = await bindPendingFileRef({
|
|
57
|
+
fileRefId,
|
|
58
|
+
entityName: UPLOAD_SCREEN_QN,
|
|
59
|
+
fieldName: UPLOAD_FIELD,
|
|
60
|
+
entityId: String(created.data.id),
|
|
61
|
+
bindTo: { entityName: "receipt", fieldName: "datei" },
|
|
62
|
+
registry: ctx.registry,
|
|
63
|
+
user,
|
|
64
|
+
db: ctx.db,
|
|
65
|
+
});
|
|
66
|
+
if (outcome !== "bound") throw unknownFile();
|
|
67
|
+
belege.push({ label: fileName });
|
|
68
|
+
}
|
|
69
|
+
return { isSuccess: true, data: { count: belege.length, belege } };
|
|
70
|
+
};
|