@ketvietlab/ketsuite 0.1.1
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/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/account/functions.d.ts +14 -0
- package/dist/modules/account/functions.d.ts.map +1 -0
- package/dist/modules/account/functions.js +1038 -0
- package/dist/modules/account/functions.js.map +1 -0
- package/dist/modules/account/index.d.ts +5 -0
- package/dist/modules/account/index.d.ts.map +1 -0
- package/dist/modules/account/index.js +31 -0
- package/dist/modules/account/index.js.map +1 -0
- package/dist/modules/account/models.d.ts +3 -0
- package/dist/modules/account/models.d.ts.map +1 -0
- package/dist/modules/account/models.js +151 -0
- package/dist/modules/account/models.js.map +1 -0
- package/dist/modules/account/relations.d.ts +3 -0
- package/dist/modules/account/relations.d.ts.map +1 -0
- package/dist/modules/account/relations.js +35 -0
- package/dist/modules/account/relations.js.map +1 -0
- package/dist/modules/account/setup.d.ts +4 -0
- package/dist/modules/account/setup.d.ts.map +1 -0
- package/dist/modules/account/setup.js +179 -0
- package/dist/modules/account/setup.js.map +1 -0
- package/dist/modules/account/tt99.d.ts +30 -0
- package/dist/modules/account/tt99.d.ts.map +1 -0
- package/dist/modules/account/tt99.js +1661 -0
- package/dist/modules/account/tt99.js.map +1 -0
- package/dist/modules/account_activity_backend/index.d.ts +5 -0
- package/dist/modules/account_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/account_activity_backend/index.js +27 -0
- package/dist/modules/account_activity_backend/index.js.map +1 -0
- package/dist/modules/account_backend/accounting-overview-screen.d.ts +18 -0
- package/dist/modules/account_backend/accounting-overview-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/accounting-overview-screen.js +104 -0
- package/dist/modules/account_backend/accounting-overview-screen.js.map +1 -0
- package/dist/modules/account_backend/accounts-screen.d.ts +13 -0
- package/dist/modules/account_backend/accounts-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/accounts-screen.js +49 -0
- package/dist/modules/account_backend/accounts-screen.js.map +1 -0
- package/dist/modules/account_backend/customer-invoices-screen.d.ts +14 -0
- package/dist/modules/account_backend/customer-invoices-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/customer-invoices-screen.js +63 -0
- package/dist/modules/account_backend/customer-invoices-screen.js.map +1 -0
- package/dist/modules/account_backend/general-ledger-screen.d.ts +13 -0
- package/dist/modules/account_backend/general-ledger-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/general-ledger-screen.js +56 -0
- package/dist/modules/account_backend/general-ledger-screen.js.map +1 -0
- package/dist/modules/account_backend/index.d.ts +3 -0
- package/dist/modules/account_backend/index.d.ts.map +1 -0
- package/dist/modules/account_backend/index.js +1516 -0
- package/dist/modules/account_backend/index.js.map +1 -0
- package/dist/modules/account_backend/journal-entries-screen.d.ts +14 -0
- package/dist/modules/account_backend/journal-entries-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/journal-entries-screen.js +45 -0
- package/dist/modules/account_backend/journal-entries-screen.js.map +1 -0
- package/dist/modules/account_backend/journals-screen.d.ts +14 -0
- package/dist/modules/account_backend/journals-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/journals-screen.js +53 -0
- package/dist/modules/account_backend/journals-screen.js.map +1 -0
- package/dist/modules/account_backend/move-detail-screen.d.ts +10 -0
- package/dist/modules/account_backend/move-detail-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/move-detail-screen.js +100 -0
- package/dist/modules/account_backend/move-detail-screen.js.map +1 -0
- package/dist/modules/account_backend/partner-ledger-screen.d.ts +14 -0
- package/dist/modules/account_backend/partner-ledger-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/partner-ledger-screen.js +69 -0
- package/dist/modules/account_backend/partner-ledger-screen.js.map +1 -0
- package/dist/modules/account_backend/payment-terms-screen.d.ts +14 -0
- package/dist/modules/account_backend/payment-terms-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/payment-terms-screen.js +40 -0
- package/dist/modules/account_backend/payment-terms-screen.js.map +1 -0
- package/dist/modules/account_backend/payments-screen.d.ts +14 -0
- package/dist/modules/account_backend/payments-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/payments-screen.js +54 -0
- package/dist/modules/account_backend/payments-screen.js.map +1 -0
- package/dist/modules/account_backend/screens.d.ts +7 -0
- package/dist/modules/account_backend/screens.d.ts.map +1 -0
- package/dist/modules/account_backend/screens.js +7 -0
- package/dist/modules/account_backend/screens.js.map +1 -0
- package/dist/modules/account_backend/taxes-screen.d.ts +15 -0
- package/dist/modules/account_backend/taxes-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/taxes-screen.js +73 -0
- package/dist/modules/account_backend/taxes-screen.js.map +1 -0
- package/dist/modules/account_backend/trial-balance-screen.d.ts +13 -0
- package/dist/modules/account_backend/trial-balance-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/trial-balance-screen.js +62 -0
- package/dist/modules/account_backend/trial-balance-screen.js.map +1 -0
- package/dist/modules/account_backend/vendor-bills-screen.d.ts +14 -0
- package/dist/modules/account_backend/vendor-bills-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/vendor-bills-screen.js +59 -0
- package/dist/modules/account_backend/vendor-bills-screen.js.map +1 -0
- package/dist/modules/account_mail_backend/index.d.ts +5 -0
- package/dist/modules/account_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/account_mail_backend/index.js +28 -0
- package/dist/modules/account_mail_backend/index.js.map +1 -0
- package/dist/modules/account_partner/functions.d.ts +3 -0
- package/dist/modules/account_partner/functions.d.ts.map +1 -0
- package/dist/modules/account_partner/functions.js +85 -0
- package/dist/modules/account_partner/functions.js.map +1 -0
- package/dist/modules/account_partner/index.d.ts +3 -0
- package/dist/modules/account_partner/index.d.ts.map +1 -0
- package/dist/modules/account_partner/index.js +48 -0
- package/dist/modules/account_partner/index.js.map +1 -0
- package/dist/modules/account_partner_backend/index.d.ts +4 -0
- package/dist/modules/account_partner_backend/index.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/index.js +49 -0
- package/dist/modules/account_partner_backend/index.js.map +1 -0
- package/dist/modules/account_partner_backend/routes.d.ts +3 -0
- package/dist/modules/account_partner_backend/routes.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/routes.js +69 -0
- package/dist/modules/account_partner_backend/routes.js.map +1 -0
- package/dist/modules/account_partner_backend/screens.d.ts +16 -0
- package/dist/modules/account_partner_backend/screens.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/screens.js +26 -0
- package/dist/modules/account_partner_backend/screens.js.map +1 -0
- package/dist/modules/activity/functions.d.ts +3 -0
- package/dist/modules/activity/functions.d.ts.map +1 -0
- package/dist/modules/activity/functions.js +250 -0
- package/dist/modules/activity/functions.js.map +1 -0
- package/dist/modules/activity/index.d.ts +9 -0
- package/dist/modules/activity/index.d.ts.map +1 -0
- package/dist/modules/activity/index.js +33 -0
- package/dist/modules/activity/index.js.map +1 -0
- package/dist/modules/activity/models.d.ts +3 -0
- package/dist/modules/activity/models.d.ts.map +1 -0
- package/dist/modules/activity/models.js +81 -0
- package/dist/modules/activity/models.js.map +1 -0
- package/dist/modules/activity/operations.d.ts +39 -0
- package/dist/modules/activity/operations.d.ts.map +1 -0
- package/dist/modules/activity/operations.js +226 -0
- package/dist/modules/activity/operations.js.map +1 -0
- package/dist/modules/activity/relations.d.ts +3 -0
- package/dist/modules/activity/relations.d.ts.map +1 -0
- package/dist/modules/activity/relations.js +24 -0
- package/dist/modules/activity/relations.js.map +1 -0
- package/dist/modules/activity/target.d.ts +4 -0
- package/dist/modules/activity/target.d.ts.map +1 -0
- package/dist/modules/activity/target.js +149 -0
- package/dist/modules/activity/target.js.map +1 -0
- package/dist/modules/activity/types.d.ts +9 -0
- package/dist/modules/activity/types.d.ts.map +1 -0
- package/dist/modules/activity/types.js +5 -0
- package/dist/modules/activity/types.js.map +1 -0
- package/dist/modules/activity_backend/index.d.ts +5 -0
- package/dist/modules/activity_backend/index.d.ts.map +1 -0
- package/dist/modules/activity_backend/index.js +80 -0
- package/dist/modules/activity_backend/index.js.map +1 -0
- package/dist/modules/activity_backend/islands.d.ts +3 -0
- package/dist/modules/activity_backend/islands.d.ts.map +1 -0
- package/dist/modules/activity_backend/islands.js +20 -0
- package/dist/modules/activity_backend/islands.js.map +1 -0
- package/dist/modules/activity_backend/routes.d.ts +5 -0
- package/dist/modules/activity_backend/routes.d.ts.map +1 -0
- package/dist/modules/activity_backend/routes.js +53 -0
- package/dist/modules/activity_backend/routes.js.map +1 -0
- package/dist/modules/activity_backend/screens.d.ts +5 -0
- package/dist/modules/activity_backend/screens.d.ts.map +1 -0
- package/dist/modules/activity_backend/screens.js +52 -0
- package/dist/modules/activity_backend/screens.js.map +1 -0
- package/dist/modules/address/data/VN/NOTICE.md +15 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0001.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0002.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0003.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0004.json +2842 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/manifest.json +77 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/policy.json +49 -0
- package/dist/modules/address/data/countries.json +11 -0
- package/dist/modules/address/data/index.json +14 -0
- package/dist/modules/address/format.d.ts +37 -0
- package/dist/modules/address/format.d.ts.map +1 -0
- package/dist/modules/address/format.js +146 -0
- package/dist/modules/address/format.js.map +1 -0
- package/dist/modules/address/functions.d.ts +3 -0
- package/dist/modules/address/functions.d.ts.map +1 -0
- package/dist/modules/address/functions.js +320 -0
- package/dist/modules/address/functions.js.map +1 -0
- package/dist/modules/address/index.d.ts +6 -0
- package/dist/modules/address/index.d.ts.map +1 -0
- package/dist/modules/address/index.js +20 -0
- package/dist/modules/address/index.js.map +1 -0
- package/dist/modules/address/loader.d.ts +74 -0
- package/dist/modules/address/loader.d.ts.map +1 -0
- package/dist/modules/address/loader.js +144 -0
- package/dist/modules/address/loader.js.map +1 -0
- package/dist/modules/address/messages.d.ts +51 -0
- package/dist/modules/address/messages.d.ts.map +1 -0
- package/dist/modules/address/messages.js +51 -0
- package/dist/modules/address/messages.js.map +1 -0
- package/dist/modules/address/models.d.ts +8 -0
- package/dist/modules/address/models.d.ts.map +1 -0
- package/dist/modules/address/models.js +98 -0
- package/dist/modules/address/models.js.map +1 -0
- package/dist/modules/address/relations.d.ts +3 -0
- package/dist/modules/address/relations.d.ts.map +1 -0
- package/dist/modules/address/relations.js +22 -0
- package/dist/modules/address/relations.js.map +1 -0
- package/dist/modules/address_backend/index.d.ts +4 -0
- package/dist/modules/address_backend/index.d.ts.map +1 -0
- package/dist/modules/address_backend/index.js +90 -0
- package/dist/modules/address_backend/index.js.map +1 -0
- package/dist/modules/address_backend/routes.d.ts +3 -0
- package/dist/modules/address_backend/routes.d.ts.map +1 -0
- package/dist/modules/address_backend/routes.js +87 -0
- package/dist/modules/address_backend/routes.js.map +1 -0
- package/dist/modules/address_backend/screens.d.ts +31 -0
- package/dist/modules/address_backend/screens.d.ts.map +1 -0
- package/dist/modules/address_backend/screens.js +147 -0
- package/dist/modules/address_backend/screens.js.map +1 -0
- package/dist/modules/attendance/functions.d.ts +3 -0
- package/dist/modules/attendance/functions.d.ts.map +1 -0
- package/dist/modules/attendance/functions.js +750 -0
- package/dist/modules/attendance/functions.js.map +1 -0
- package/dist/modules/attendance/index.d.ts +5 -0
- package/dist/modules/attendance/index.d.ts.map +1 -0
- package/dist/modules/attendance/index.js +20 -0
- package/dist/modules/attendance/index.js.map +1 -0
- package/dist/modules/attendance/messages.d.ts +41 -0
- package/dist/modules/attendance/messages.d.ts.map +1 -0
- package/dist/modules/attendance/messages.js +41 -0
- package/dist/modules/attendance/messages.js.map +1 -0
- package/dist/modules/attendance/models.d.ts +3 -0
- package/dist/modules/attendance/models.d.ts.map +1 -0
- package/dist/modules/attendance/models.js +158 -0
- package/dist/modules/attendance/models.js.map +1 -0
- package/dist/modules/attendance/relations.d.ts +3 -0
- package/dist/modules/attendance/relations.d.ts.map +1 -0
- package/dist/modules/attendance/relations.js +12 -0
- package/dist/modules/attendance/relations.js.map +1 -0
- package/dist/modules/attendance/types.d.ts +9 -0
- package/dist/modules/attendance/types.d.ts.map +1 -0
- package/dist/modules/attendance/types.js +5 -0
- package/dist/modules/attendance/types.js.map +1 -0
- package/dist/modules/attendance_backend/index.d.ts +4 -0
- package/dist/modules/attendance_backend/index.d.ts.map +1 -0
- package/dist/modules/attendance_backend/index.js +182 -0
- package/dist/modules/attendance_backend/index.js.map +1 -0
- package/dist/modules/attendance_backend/qr.d.ts +2 -0
- package/dist/modules/attendance_backend/qr.d.ts.map +1 -0
- package/dist/modules/attendance_backend/qr.js +120 -0
- package/dist/modules/attendance_backend/qr.js.map +1 -0
- package/dist/modules/attendance_backend/routes.d.ts +3 -0
- package/dist/modules/attendance_backend/routes.d.ts.map +1 -0
- package/dist/modules/attendance_backend/routes.js +131 -0
- package/dist/modules/attendance_backend/routes.js.map +1 -0
- package/dist/modules/attendance_backend/screens.d.ts +10 -0
- package/dist/modules/attendance_backend/screens.d.ts.map +1 -0
- package/dist/modules/attendance_backend/screens.js +227 -0
- package/dist/modules/attendance_backend/screens.js.map +1 -0
- package/dist/modules/backend/catalogue.d.ts +10 -0
- package/dist/modules/backend/catalogue.d.ts.map +1 -0
- package/dist/modules/backend/catalogue.js +615 -0
- package/dist/modules/backend/catalogue.js.map +1 -0
- package/dist/modules/backend/design/HANDOFF.md +356 -0
- package/dist/modules/backend/design/admin.css +4229 -0
- package/dist/modules/backend/design/client/relation-select-view.d.mts +5 -0
- package/dist/modules/backend/design/client/relation-select-view.d.mts.map +1 -0
- package/dist/modules/backend/design/client/relation-select-view.mjs +335 -0
- package/dist/modules/backend/design/client/relation-select-view.mjs.map +1 -0
- package/dist/modules/backend/design/client/relation-select.d.mts +5 -0
- package/dist/modules/backend/design/client/relation-select.d.mts.map +1 -0
- package/dist/modules/backend/design/client/relation-select.mjs +7 -0
- package/dist/modules/backend/design/client/relation-select.mjs.map +1 -0
- package/dist/modules/backend/design/fixtures/product-back.svg +11 -0
- package/dist/modules/backend/design/fixtures/product-front.svg +9 -0
- package/dist/modules/backend/design/screenshots/apps-desktop-dark.png +0 -0
- package/dist/modules/backend/design/screenshots/list-mobile-dark.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-favorites-desktop-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-filter-desktop-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-filter-mobile-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-grouped-desktop.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-grouped-mobile.png +0 -0
- package/dist/modules/backend/design/tokens.css +132 -0
- package/dist/modules/backend/forms.d.ts +7 -0
- package/dist/modules/backend/forms.d.ts.map +1 -0
- package/dist/modules/backend/forms.js +25 -0
- package/dist/modules/backend/forms.js.map +1 -0
- package/dist/modules/backend/index.d.ts +24 -0
- package/dist/modules/backend/index.d.ts.map +1 -0
- package/dist/modules/backend/index.js +61 -0
- package/dist/modules/backend/index.js.map +1 -0
- package/dist/modules/backend/islands.d.ts +3 -0
- package/dist/modules/backend/islands.d.ts.map +1 -0
- package/dist/modules/backend/islands.js +13 -0
- package/dist/modules/backend/islands.js.map +1 -0
- package/dist/modules/backend/joints.d.ts +13 -0
- package/dist/modules/backend/joints.d.ts.map +1 -0
- package/dist/modules/backend/joints.js +33 -0
- package/dist/modules/backend/joints.js.map +1 -0
- package/dist/modules/backend/menus.d.ts +3 -0
- package/dist/modules/backend/menus.d.ts.map +1 -0
- package/dist/modules/backend/menus.js +25 -0
- package/dist/modules/backend/menus.js.map +1 -0
- package/dist/modules/backend/messages.d.ts +11 -0
- package/dist/modules/backend/messages.d.ts.map +1 -0
- package/dist/modules/backend/messages.js +161 -0
- package/dist/modules/backend/messages.js.map +1 -0
- package/dist/modules/backend/paging.d.ts +22 -0
- package/dist/modules/backend/paging.d.ts.map +1 -0
- package/dist/modules/backend/paging.js +56 -0
- package/dist/modules/backend/paging.js.map +1 -0
- package/dist/modules/backend/relation-select.d.ts +63 -0
- package/dist/modules/backend/relation-select.d.ts.map +1 -0
- package/dist/modules/backend/relation-select.js +20 -0
- package/dist/modules/backend/relation-select.js.map +1 -0
- package/dist/modules/backend/routes.d.ts +10 -0
- package/dist/modules/backend/routes.d.ts.map +1 -0
- package/dist/modules/backend/routes.js +123 -0
- package/dist/modules/backend/routes.js.map +1 -0
- package/dist/modules/backend/saved-searches.d.ts +4 -0
- package/dist/modules/backend/saved-searches.d.ts.map +1 -0
- package/dist/modules/backend/saved-searches.js +138 -0
- package/dist/modules/backend/saved-searches.js.map +1 -0
- package/dist/modules/backend/screens.d.ts +37 -0
- package/dist/modules/backend/screens.d.ts.map +1 -0
- package/dist/modules/backend/screens.js +107 -0
- package/dist/modules/backend/screens.js.map +1 -0
- package/dist/modules/calendar/functions.d.ts +3 -0
- package/dist/modules/calendar/functions.d.ts.map +1 -0
- package/dist/modules/calendar/functions.js +259 -0
- package/dist/modules/calendar/functions.js.map +1 -0
- package/dist/modules/calendar/index.d.ts +9 -0
- package/dist/modules/calendar/index.d.ts.map +1 -0
- package/dist/modules/calendar/index.js +36 -0
- package/dist/modules/calendar/index.js.map +1 -0
- package/dist/modules/calendar/jobs.d.ts +3 -0
- package/dist/modules/calendar/jobs.d.ts.map +1 -0
- package/dist/modules/calendar/jobs.js +57 -0
- package/dist/modules/calendar/jobs.js.map +1 -0
- package/dist/modules/calendar/models.d.ts +3 -0
- package/dist/modules/calendar/models.d.ts.map +1 -0
- package/dist/modules/calendar/models.js +90 -0
- package/dist/modules/calendar/models.js.map +1 -0
- package/dist/modules/calendar/operations.d.ts +45 -0
- package/dist/modules/calendar/operations.d.ts.map +1 -0
- package/dist/modules/calendar/operations.js +280 -0
- package/dist/modules/calendar/operations.js.map +1 -0
- package/dist/modules/calendar/recurrence.d.ts +28 -0
- package/dist/modules/calendar/recurrence.d.ts.map +1 -0
- package/dist/modules/calendar/recurrence.js +175 -0
- package/dist/modules/calendar/recurrence.js.map +1 -0
- package/dist/modules/calendar/relations.d.ts +3 -0
- package/dist/modules/calendar/relations.d.ts.map +1 -0
- package/dist/modules/calendar/relations.js +22 -0
- package/dist/modules/calendar/relations.js.map +1 -0
- package/dist/modules/calendar/types.d.ts +10 -0
- package/dist/modules/calendar/types.d.ts.map +1 -0
- package/dist/modules/calendar/types.js +6 -0
- package/dist/modules/calendar/types.js.map +1 -0
- package/dist/modules/calendar_activity/index.d.ts +6 -0
- package/dist/modules/calendar_activity/index.d.ts.map +1 -0
- package/dist/modules/calendar_activity/index.js +250 -0
- package/dist/modules/calendar_activity/index.js.map +1 -0
- package/dist/modules/calendar_backend/index.d.ts +5 -0
- package/dist/modules/calendar_backend/index.d.ts.map +1 -0
- package/dist/modules/calendar_backend/index.js +47 -0
- package/dist/modules/calendar_backend/index.js.map +1 -0
- package/dist/modules/calendar_backend/islands.d.ts +3 -0
- package/dist/modules/calendar_backend/islands.d.ts.map +1 -0
- package/dist/modules/calendar_backend/islands.js +12 -0
- package/dist/modules/calendar_backend/islands.js.map +1 -0
- package/dist/modules/calendar_backend/routes.d.ts +3 -0
- package/dist/modules/calendar_backend/routes.d.ts.map +1 -0
- package/dist/modules/calendar_backend/routes.js +43 -0
- package/dist/modules/calendar_backend/routes.js.map +1 -0
- package/dist/modules/calendar_backend/screens.d.ts +5 -0
- package/dist/modules/calendar_backend/screens.d.ts.map +1 -0
- package/dist/modules/calendar_backend/screens.js +4 -0
- package/dist/modules/calendar_backend/screens.js.map +1 -0
- package/dist/modules/calendar_mail_transport/index.d.ts +6 -0
- package/dist/modules/calendar_mail_transport/index.d.ts.map +1 -0
- package/dist/modules/calendar_mail_transport/index.js +138 -0
- package/dist/modules/calendar_mail_transport/index.js.map +1 -0
- package/dist/modules/catalog/index.d.ts +3 -0
- package/dist/modules/catalog/index.d.ts.map +1 -0
- package/dist/modules/catalog/index.js +68 -0
- package/dist/modules/catalog/index.js.map +1 -0
- package/dist/modules/checkout/index.d.ts +3 -0
- package/dist/modules/checkout/index.d.ts.map +1 -0
- package/dist/modules/checkout/index.js +50 -0
- package/dist/modules/checkout/index.js.map +1 -0
- package/dist/modules/company/functions.d.ts +3 -0
- package/dist/modules/company/functions.d.ts.map +1 -0
- package/dist/modules/company/functions.js +337 -0
- package/dist/modules/company/functions.js.map +1 -0
- package/dist/modules/company/index.d.ts +3 -0
- package/dist/modules/company/index.d.ts.map +1 -0
- package/dist/modules/company/index.js +23 -0
- package/dist/modules/company/index.js.map +1 -0
- package/dist/modules/company/messages.d.ts +63 -0
- package/dist/modules/company/messages.d.ts.map +1 -0
- package/dist/modules/company/messages.js +63 -0
- package/dist/modules/company/messages.js.map +1 -0
- package/dist/modules/company/models.d.ts +19 -0
- package/dist/modules/company/models.d.ts.map +1 -0
- package/dist/modules/company/models.js +61 -0
- package/dist/modules/company/models.js.map +1 -0
- package/dist/modules/company/relations.d.ts +3 -0
- package/dist/modules/company/relations.d.ts.map +1 -0
- package/dist/modules/company/relations.js +14 -0
- package/dist/modules/company/relations.js.map +1 -0
- package/dist/modules/company_backend/index.d.ts +5 -0
- package/dist/modules/company_backend/index.d.ts.map +1 -0
- package/dist/modules/company_backend/index.js +136 -0
- package/dist/modules/company_backend/index.js.map +1 -0
- package/dist/modules/company_backend/menus.d.ts +3 -0
- package/dist/modules/company_backend/menus.d.ts.map +1 -0
- package/dist/modules/company_backend/menus.js +17 -0
- package/dist/modules/company_backend/menus.js.map +1 -0
- package/dist/modules/company_backend/routes.d.ts +3 -0
- package/dist/modules/company_backend/routes.d.ts.map +1 -0
- package/dist/modules/company_backend/routes.js +269 -0
- package/dist/modules/company_backend/routes.js.map +1 -0
- package/dist/modules/company_backend/screens.d.ts +62 -0
- package/dist/modules/company_backend/screens.d.ts.map +1 -0
- package/dist/modules/company_backend/screens.js +268 -0
- package/dist/modules/company_backend/screens.js.map +1 -0
- package/dist/modules/crm/functions.d.ts +5 -0
- package/dist/modules/crm/functions.d.ts.map +1 -0
- package/dist/modules/crm/functions.js +840 -0
- package/dist/modules/crm/functions.js.map +1 -0
- package/dist/modules/crm/index.d.ts +6 -0
- package/dist/modules/crm/index.d.ts.map +1 -0
- package/dist/modules/crm/index.js +22 -0
- package/dist/modules/crm/index.js.map +1 -0
- package/dist/modules/crm/jobs.d.ts +4 -0
- package/dist/modules/crm/jobs.d.ts.map +1 -0
- package/dist/modules/crm/jobs.js +3 -0
- package/dist/modules/crm/jobs.js.map +1 -0
- package/dist/modules/crm/messages.d.ts +37 -0
- package/dist/modules/crm/messages.d.ts.map +1 -0
- package/dist/modules/crm/messages.js +68 -0
- package/dist/modules/crm/messages.js.map +1 -0
- package/dist/modules/crm/models.d.ts +3 -0
- package/dist/modules/crm/models.d.ts.map +1 -0
- package/dist/modules/crm/models.js +215 -0
- package/dist/modules/crm/models.js.map +1 -0
- package/dist/modules/crm/operations.d.ts +121 -0
- package/dist/modules/crm/operations.d.ts.map +1 -0
- package/dist/modules/crm/operations.js +744 -0
- package/dist/modules/crm/operations.js.map +1 -0
- package/dist/modules/crm/search.d.ts +67 -0
- package/dist/modules/crm/search.d.ts.map +1 -0
- package/dist/modules/crm/search.js +89 -0
- package/dist/modules/crm/search.js.map +1 -0
- package/dist/modules/crm/types.d.ts +10 -0
- package/dist/modules/crm/types.d.ts.map +1 -0
- package/dist/modules/crm/types.js +6 -0
- package/dist/modules/crm/types.js.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.d.mts +8 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs +129 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban.d.mts +3 -0
- package/dist/modules/crm_backend/client/crm-kanban.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban.mjs +7 -0
- package/dist/modules/crm_backend/client/crm-kanban.mjs.map +1 -0
- package/dist/modules/crm_backend/client/crm.css +69 -0
- package/dist/modules/crm_backend/index.d.ts +4 -0
- package/dist/modules/crm_backend/index.d.ts.map +1 -0
- package/dist/modules/crm_backend/index.js +54 -0
- package/dist/modules/crm_backend/index.js.map +1 -0
- package/dist/modules/crm_backend/islands.d.ts +9 -0
- package/dist/modules/crm_backend/islands.d.ts.map +1 -0
- package/dist/modules/crm_backend/islands.js +13 -0
- package/dist/modules/crm_backend/islands.js.map +1 -0
- package/dist/modules/crm_backend/list-search.d.ts +21 -0
- package/dist/modules/crm_backend/list-search.d.ts.map +1 -0
- package/dist/modules/crm_backend/list-search.js +220 -0
- package/dist/modules/crm_backend/list-search.js.map +1 -0
- package/dist/modules/crm_backend/messages.d.ts +183 -0
- package/dist/modules/crm_backend/messages.d.ts.map +1 -0
- package/dist/modules/crm_backend/messages.js +182 -0
- package/dist/modules/crm_backend/messages.js.map +1 -0
- package/dist/modules/crm_backend/routes.d.ts +3 -0
- package/dist/modules/crm_backend/routes.d.ts.map +1 -0
- package/dist/modules/crm_backend/routes.js +520 -0
- package/dist/modules/crm_backend/routes.js.map +1 -0
- package/dist/modules/crm_backend/screens.d.ts +32 -0
- package/dist/modules/crm_backend/screens.d.ts.map +1 -0
- package/dist/modules/crm_backend/screens.js +405 -0
- package/dist/modules/crm_backend/screens.js.map +1 -0
- package/dist/modules/crm_sale/index.d.ts +4 -0
- package/dist/modules/crm_sale/index.d.ts.map +1 -0
- package/dist/modules/crm_sale/index.js +18 -0
- package/dist/modules/crm_sale/index.js.map +1 -0
- package/dist/modules/crm_sale/messages.d.ts +10 -0
- package/dist/modules/crm_sale/messages.d.ts.map +1 -0
- package/dist/modules/crm_sale/messages.js +14 -0
- package/dist/modules/crm_sale/messages.js.map +1 -0
- package/dist/modules/crm_sale/models.d.ts +3 -0
- package/dist/modules/crm_sale/models.d.ts.map +1 -0
- package/dist/modules/crm_sale/models.js +16 -0
- package/dist/modules/crm_sale/models.js.map +1 -0
- package/dist/modules/crm_sale/sale-functions.d.ts +15 -0
- package/dist/modules/crm_sale/sale-functions.d.ts.map +1 -0
- package/dist/modules/crm_sale/sale-functions.js +139 -0
- package/dist/modules/crm_sale/sale-functions.js.map +1 -0
- package/dist/modules/crm_website/functions.d.ts +3 -0
- package/dist/modules/crm_website/functions.d.ts.map +1 -0
- package/dist/modules/crm_website/functions.js +65 -0
- package/dist/modules/crm_website/functions.js.map +1 -0
- package/dist/modules/crm_website/index.d.ts +3 -0
- package/dist/modules/crm_website/index.d.ts.map +1 -0
- package/dist/modules/crm_website/index.js +19 -0
- package/dist/modules/crm_website/index.js.map +1 -0
- package/dist/modules/crm_website/messages.d.ts +20 -0
- package/dist/modules/crm_website/messages.d.ts.map +1 -0
- package/dist/modules/crm_website/messages.js +34 -0
- package/dist/modules/crm_website/messages.js.map +1 -0
- package/dist/modules/crm_website/models.d.ts +3 -0
- package/dist/modules/crm_website/models.d.ts.map +1 -0
- package/dist/modules/crm_website/models.js +15 -0
- package/dist/modules/crm_website/models.js.map +1 -0
- package/dist/modules/crm_website/routes.d.ts +3 -0
- package/dist/modules/crm_website/routes.d.ts.map +1 -0
- package/dist/modules/crm_website/routes.js +71 -0
- package/dist/modules/crm_website/routes.js.map +1 -0
- package/dist/modules/crm_website/screens.d.ts +5 -0
- package/dist/modules/crm_website/screens.d.ts.map +1 -0
- package/dist/modules/crm_website/screens.js +15 -0
- package/dist/modules/crm_website/screens.js.map +1 -0
- package/dist/modules/hospitality_core/calendar.d.ts +9 -0
- package/dist/modules/hospitality_core/calendar.d.ts.map +1 -0
- package/dist/modules/hospitality_core/calendar.js +41 -0
- package/dist/modules/hospitality_core/calendar.js.map +1 -0
- package/dist/modules/hospitality_core/content.d.ts +13 -0
- package/dist/modules/hospitality_core/content.d.ts.map +1 -0
- package/dist/modules/hospitality_core/content.js +345 -0
- package/dist/modules/hospitality_core/content.js.map +1 -0
- package/dist/modules/hospitality_core/functions.d.ts +3 -0
- package/dist/modules/hospitality_core/functions.d.ts.map +1 -0
- package/dist/modules/hospitality_core/functions.js +1558 -0
- package/dist/modules/hospitality_core/functions.js.map +1 -0
- package/dist/modules/hospitality_core/housekeeping.d.ts +3 -0
- package/dist/modules/hospitality_core/housekeeping.d.ts.map +1 -0
- package/dist/modules/hospitality_core/housekeeping.js +352 -0
- package/dist/modules/hospitality_core/housekeeping.js.map +1 -0
- package/dist/modules/hospitality_core/index.d.ts +5 -0
- package/dist/modules/hospitality_core/index.d.ts.map +1 -0
- package/dist/modules/hospitality_core/index.js +41 -0
- package/dist/modules/hospitality_core/index.js.map +1 -0
- package/dist/modules/hospitality_core/inventory.d.ts +40 -0
- package/dist/modules/hospitality_core/inventory.d.ts.map +1 -0
- package/dist/modules/hospitality_core/inventory.js +627 -0
- package/dist/modules/hospitality_core/inventory.js.map +1 -0
- package/dist/modules/hospitality_core/menus.d.ts +3 -0
- package/dist/modules/hospitality_core/menus.d.ts.map +1 -0
- package/dist/modules/hospitality_core/menus.js +134 -0
- package/dist/modules/hospitality_core/menus.js.map +1 -0
- package/dist/modules/hospitality_core/messages.d.ts +3 -0
- package/dist/modules/hospitality_core/messages.d.ts.map +1 -0
- package/dist/modules/hospitality_core/messages.js +2011 -0
- package/dist/modules/hospitality_core/messages.js.map +1 -0
- package/dist/modules/hospitality_core/models.d.ts +10 -0
- package/dist/modules/hospitality_core/models.d.ts.map +1 -0
- package/dist/modules/hospitality_core/models.js +657 -0
- package/dist/modules/hospitality_core/models.js.map +1 -0
- package/dist/modules/hospitality_core/night-audit.d.ts +26 -0
- package/dist/modules/hospitality_core/night-audit.d.ts.map +1 -0
- package/dist/modules/hospitality_core/night-audit.js +381 -0
- package/dist/modules/hospitality_core/night-audit.js.map +1 -0
- package/dist/modules/hospitality_core/operations.d.ts +3 -0
- package/dist/modules/hospitality_core/operations.d.ts.map +1 -0
- package/dist/modules/hospitality_core/operations.js +1562 -0
- package/dist/modules/hospitality_core/operations.js.map +1 -0
- package/dist/modules/hospitality_core/relations.d.ts +3 -0
- package/dist/modules/hospitality_core/relations.d.ts.map +1 -0
- package/dist/modules/hospitality_core/relations.js +175 -0
- package/dist/modules/hospitality_core/relations.js.map +1 -0
- package/dist/modules/hospitality_core/routes.d.ts +3 -0
- package/dist/modules/hospitality_core/routes.d.ts.map +1 -0
- package/dist/modules/hospitality_core/routes.js +1556 -0
- package/dist/modules/hospitality_core/routes.js.map +1 -0
- package/dist/modules/hospitality_core/screens.d.ts +763 -0
- package/dist/modules/hospitality_core/screens.d.ts.map +1 -0
- package/dist/modules/hospitality_core/screens.js +4138 -0
- package/dist/modules/hospitality_core/screens.js.map +1 -0
- package/dist/modules/hospitality_core/services.d.ts +9 -0
- package/dist/modules/hospitality_core/services.d.ts.map +1 -0
- package/dist/modules/hospitality_core/services.js +586 -0
- package/dist/modules/hospitality_core/services.js.map +1 -0
- package/dist/modules/hospitality_core/stay-notices.d.ts +11 -0
- package/dist/modules/hospitality_core/stay-notices.d.ts.map +1 -0
- package/dist/modules/hospitality_core/stay-notices.js +338 -0
- package/dist/modules/hospitality_core/stay-notices.js.map +1 -0
- package/dist/modules/hospitality_core/types.d.ts +61 -0
- package/dist/modules/hospitality_core/types.d.ts.map +1 -0
- package/dist/modules/hospitality_core/types.js +65 -0
- package/dist/modules/hospitality_core/types.js.map +1 -0
- package/dist/modules/hr/functions.d.ts +3 -0
- package/dist/modules/hr/functions.d.ts.map +1 -0
- package/dist/modules/hr/functions.js +711 -0
- package/dist/modules/hr/functions.js.map +1 -0
- package/dist/modules/hr/index.d.ts +5 -0
- package/dist/modules/hr/index.d.ts.map +1 -0
- package/dist/modules/hr/index.js +20 -0
- package/dist/modules/hr/index.js.map +1 -0
- package/dist/modules/hr/messages.d.ts +45 -0
- package/dist/modules/hr/messages.d.ts.map +1 -0
- package/dist/modules/hr/messages.js +45 -0
- package/dist/modules/hr/messages.js.map +1 -0
- package/dist/modules/hr/models.d.ts +3 -0
- package/dist/modules/hr/models.d.ts.map +1 -0
- package/dist/modules/hr/models.js +166 -0
- package/dist/modules/hr/models.js.map +1 -0
- package/dist/modules/hr/relations.d.ts +3 -0
- package/dist/modules/hr/relations.d.ts.map +1 -0
- package/dist/modules/hr/relations.js +19 -0
- package/dist/modules/hr/relations.js.map +1 -0
- package/dist/modules/hr/types.d.ts +9 -0
- package/dist/modules/hr/types.d.ts.map +1 -0
- package/dist/modules/hr/types.js +5 -0
- package/dist/modules/hr/types.js.map +1 -0
- package/dist/modules/hr_backend/index.d.ts +4 -0
- package/dist/modules/hr_backend/index.d.ts.map +1 -0
- package/dist/modules/hr_backend/index.js +142 -0
- package/dist/modules/hr_backend/index.js.map +1 -0
- package/dist/modules/hr_backend/routes.d.ts +3 -0
- package/dist/modules/hr_backend/routes.d.ts.map +1 -0
- package/dist/modules/hr_backend/routes.js +83 -0
- package/dist/modules/hr_backend/routes.js.map +1 -0
- package/dist/modules/hr_backend/screens.d.ts +9 -0
- package/dist/modules/hr_backend/screens.d.ts.map +1 -0
- package/dist/modules/hr_backend/screens.js +144 -0
- package/dist/modules/hr_backend/screens.js.map +1 -0
- package/dist/modules/inventory/index.d.ts +3 -0
- package/dist/modules/inventory/index.d.ts.map +1 -0
- package/dist/modules/inventory/index.js +31 -0
- package/dist/modules/inventory/index.js.map +1 -0
- package/dist/modules/loyalty/admin-functions.d.ts +3 -0
- package/dist/modules/loyalty/admin-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/admin-functions.js +692 -0
- package/dist/modules/loyalty/admin-functions.js.map +1 -0
- package/dist/modules/loyalty/engine.d.ts +31 -0
- package/dist/modules/loyalty/engine.d.ts.map +1 -0
- package/dist/modules/loyalty/engine.js +412 -0
- package/dist/modules/loyalty/engine.js.map +1 -0
- package/dist/modules/loyalty/index.d.ts +5 -0
- package/dist/modules/loyalty/index.d.ts.map +1 -0
- package/dist/modules/loyalty/index.js +24 -0
- package/dist/modules/loyalty/index.js.map +1 -0
- package/dist/modules/loyalty/jobs.d.ts +4 -0
- package/dist/modules/loyalty/jobs.d.ts.map +1 -0
- package/dist/modules/loyalty/jobs.js +103 -0
- package/dist/modules/loyalty/jobs.js.map +1 -0
- package/dist/modules/loyalty/ledger.d.ts +48 -0
- package/dist/modules/loyalty/ledger.d.ts.map +1 -0
- package/dist/modules/loyalty/ledger.js +164 -0
- package/dist/modules/loyalty/ledger.js.map +1 -0
- package/dist/modules/loyalty/membership-functions.d.ts +4 -0
- package/dist/modules/loyalty/membership-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/membership-functions.js +163 -0
- package/dist/modules/loyalty/membership-functions.js.map +1 -0
- package/dist/modules/loyalty/messages.d.ts +119 -0
- package/dist/modules/loyalty/messages.d.ts.map +1 -0
- package/dist/modules/loyalty/messages.js +119 -0
- package/dist/modules/loyalty/messages.js.map +1 -0
- package/dist/modules/loyalty/models.d.ts +3 -0
- package/dist/modules/loyalty/models.d.ts.map +1 -0
- package/dist/modules/loyalty/models.js +259 -0
- package/dist/modules/loyalty/models.js.map +1 -0
- package/dist/modules/loyalty/order-functions.d.ts +3 -0
- package/dist/modules/loyalty/order-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/order-functions.js +656 -0
- package/dist/modules/loyalty/order-functions.js.map +1 -0
- package/dist/modules/loyalty/relations.d.ts +3 -0
- package/dist/modules/loyalty/relations.d.ts.map +1 -0
- package/dist/modules/loyalty/relations.js +19 -0
- package/dist/modules/loyalty/relations.js.map +1 -0
- package/dist/modules/loyalty/types.d.ts +83 -0
- package/dist/modules/loyalty/types.d.ts.map +1 -0
- package/dist/modules/loyalty/types.js +23 -0
- package/dist/modules/loyalty/types.js.map +1 -0
- package/dist/modules/loyalty_backend/index.d.ts +3 -0
- package/dist/modules/loyalty_backend/index.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/index.js +636 -0
- package/dist/modules/loyalty_backend/index.js.map +1 -0
- package/dist/modules/loyalty_backend/messages.d.ts +162 -0
- package/dist/modules/loyalty_backend/messages.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/messages.js +318 -0
- package/dist/modules/loyalty_backend/messages.js.map +1 -0
- package/dist/modules/loyalty_backend/screens.d.ts +33 -0
- package/dist/modules/loyalty_backend/screens.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/screens.js +562 -0
- package/dist/modules/loyalty_backend/screens.js.map +1 -0
- package/dist/modules/loyalty_pos/functions.d.ts +19 -0
- package/dist/modules/loyalty_pos/functions.d.ts.map +1 -0
- package/dist/modules/loyalty_pos/functions.js +274 -0
- package/dist/modules/loyalty_pos/functions.js.map +1 -0
- package/dist/modules/loyalty_pos/index.d.ts +3 -0
- package/dist/modules/loyalty_pos/index.d.ts.map +1 -0
- package/dist/modules/loyalty_pos/index.js +45 -0
- package/dist/modules/loyalty_pos/index.js.map +1 -0
- package/dist/modules/loyalty_sale/functions.d.ts +19 -0
- package/dist/modules/loyalty_sale/functions.d.ts.map +1 -0
- package/dist/modules/loyalty_sale/functions.js +275 -0
- package/dist/modules/loyalty_sale/functions.js.map +1 -0
- package/dist/modules/loyalty_sale/index.d.ts +3 -0
- package/dist/modules/loyalty_sale/index.d.ts.map +1 -0
- package/dist/modules/loyalty_sale/index.js +45 -0
- package/dist/modules/loyalty_sale/index.js.map +1 -0
- package/dist/modules/mail/functions.d.ts +3 -0
- package/dist/modules/mail/functions.d.ts.map +1 -0
- package/dist/modules/mail/functions.js +129 -0
- package/dist/modules/mail/functions.js.map +1 -0
- package/dist/modules/mail/index.d.ts +9 -0
- package/dist/modules/mail/index.d.ts.map +1 -0
- package/dist/modules/mail/index.js +22 -0
- package/dist/modules/mail/index.js.map +1 -0
- package/dist/modules/mail/messages.d.ts +13 -0
- package/dist/modules/mail/messages.d.ts.map +1 -0
- package/dist/modules/mail/messages.js +13 -0
- package/dist/modules/mail/messages.js.map +1 -0
- package/dist/modules/mail/models.d.ts +3 -0
- package/dist/modules/mail/models.d.ts.map +1 -0
- package/dist/modules/mail/models.js +124 -0
- package/dist/modules/mail/models.js.map +1 -0
- package/dist/modules/mail/operations.d.ts +60 -0
- package/dist/modules/mail/operations.d.ts.map +1 -0
- package/dist/modules/mail/operations.js +249 -0
- package/dist/modules/mail/operations.js.map +1 -0
- package/dist/modules/mail/relations.d.ts +3 -0
- package/dist/modules/mail/relations.d.ts.map +1 -0
- package/dist/modules/mail/relations.js +41 -0
- package/dist/modules/mail/relations.js.map +1 -0
- package/dist/modules/mail/target.d.ts +16 -0
- package/dist/modules/mail/target.d.ts.map +1 -0
- package/dist/modules/mail/target.js +245 -0
- package/dist/modules/mail/target.js.map +1 -0
- package/dist/modules/mail/types.d.ts +7 -0
- package/dist/modules/mail/types.d.ts.map +1 -0
- package/dist/modules/mail/types.js +4 -0
- package/dist/modules/mail/types.js.map +1 -0
- package/dist/modules/mail_backend/index.d.ts +5 -0
- package/dist/modules/mail_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_backend/index.js +56 -0
- package/dist/modules/mail_backend/index.js.map +1 -0
- package/dist/modules/mail_backend/islands.d.ts +3 -0
- package/dist/modules/mail_backend/islands.d.ts.map +1 -0
- package/dist/modules/mail_backend/islands.js +20 -0
- package/dist/modules/mail_backend/islands.js.map +1 -0
- package/dist/modules/mail_backend/routes.d.ts +5 -0
- package/dist/modules/mail_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_backend/routes.js +37 -0
- package/dist/modules/mail_backend/routes.js.map +1 -0
- package/dist/modules/mail_backend/screens.d.ts +5 -0
- package/dist/modules/mail_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_backend/screens.js +11 -0
- package/dist/modules/mail_backend/screens.js.map +1 -0
- package/dist/modules/mail_inbound/functions.d.ts +27 -0
- package/dist/modules/mail_inbound/functions.d.ts.map +1 -0
- package/dist/modules/mail_inbound/functions.js +178 -0
- package/dist/modules/mail_inbound/functions.js.map +1 -0
- package/dist/modules/mail_inbound/index.d.ts +10 -0
- package/dist/modules/mail_inbound/index.d.ts.map +1 -0
- package/dist/modules/mail_inbound/index.js +38 -0
- package/dist/modules/mail_inbound/index.js.map +1 -0
- package/dist/modules/mail_inbound/jobs.d.ts +3 -0
- package/dist/modules/mail_inbound/jobs.d.ts.map +1 -0
- package/dist/modules/mail_inbound/jobs.js +29 -0
- package/dist/modules/mail_inbound/jobs.js.map +1 -0
- package/dist/modules/mail_inbound/models.d.ts +3 -0
- package/dist/modules/mail_inbound/models.d.ts.map +1 -0
- package/dist/modules/mail_inbound/models.js +68 -0
- package/dist/modules/mail_inbound/models.js.map +1 -0
- package/dist/modules/mail_inbound/operations.d.ts +17 -0
- package/dist/modules/mail_inbound/operations.d.ts.map +1 -0
- package/dist/modules/mail_inbound/operations.js +273 -0
- package/dist/modules/mail_inbound/operations.js.map +1 -0
- package/dist/modules/mail_inbound/relations.d.ts +3 -0
- package/dist/modules/mail_inbound/relations.d.ts.map +1 -0
- package/dist/modules/mail_inbound/relations.js +19 -0
- package/dist/modules/mail_inbound/relations.js.map +1 -0
- package/dist/modules/mail_inbound/routes.d.ts +4 -0
- package/dist/modules/mail_inbound/routes.d.ts.map +1 -0
- package/dist/modules/mail_inbound/routes.js +156 -0
- package/dist/modules/mail_inbound/routes.js.map +1 -0
- package/dist/modules/mail_inbound/types.d.ts +37 -0
- package/dist/modules/mail_inbound/types.d.ts.map +1 -0
- package/dist/modules/mail_inbound/types.js +3 -0
- package/dist/modules/mail_inbound/types.js.map +1 -0
- package/dist/modules/mail_inbound_backend/index.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/index.js +59 -0
- package/dist/modules/mail_inbound_backend/index.js.map +1 -0
- package/dist/modules/mail_inbound_backend/routes.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/routes.js +31 -0
- package/dist/modules/mail_inbound_backend/routes.js.map +1 -0
- package/dist/modules/mail_inbound_backend/screens.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/screens.js +25 -0
- package/dist/modules/mail_inbound_backend/screens.js.map +1 -0
- package/dist/modules/mail_transport/functions.d.ts +3 -0
- package/dist/modules/mail_transport/functions.d.ts.map +1 -0
- package/dist/modules/mail_transport/functions.js +280 -0
- package/dist/modules/mail_transport/functions.js.map +1 -0
- package/dist/modules/mail_transport/index.d.ts +11 -0
- package/dist/modules/mail_transport/index.d.ts.map +1 -0
- package/dist/modules/mail_transport/index.js +37 -0
- package/dist/modules/mail_transport/index.js.map +1 -0
- package/dist/modules/mail_transport/jobs.d.ts +3 -0
- package/dist/modules/mail_transport/jobs.d.ts.map +1 -0
- package/dist/modules/mail_transport/jobs.js +79 -0
- package/dist/modules/mail_transport/jobs.js.map +1 -0
- package/dist/modules/mail_transport/models.d.ts +3 -0
- package/dist/modules/mail_transport/models.d.ts.map +1 -0
- package/dist/modules/mail_transport/models.js +88 -0
- package/dist/modules/mail_transport/models.js.map +1 -0
- package/dist/modules/mail_transport/operations.d.ts +16 -0
- package/dist/modules/mail_transport/operations.d.ts.map +1 -0
- package/dist/modules/mail_transport/operations.js +122 -0
- package/dist/modules/mail_transport/operations.js.map +1 -0
- package/dist/modules/mail_transport/relations.d.ts +3 -0
- package/dist/modules/mail_transport/relations.d.ts.map +1 -0
- package/dist/modules/mail_transport/relations.js +19 -0
- package/dist/modules/mail_transport/relations.js.map +1 -0
- package/dist/modules/mail_transport/target.d.ts +8 -0
- package/dist/modules/mail_transport/target.d.ts.map +1 -0
- package/dist/modules/mail_transport/target.js +43 -0
- package/dist/modules/mail_transport/target.js.map +1 -0
- package/dist/modules/mail_transport/template.d.ts +4 -0
- package/dist/modules/mail_transport/template.d.ts.map +1 -0
- package/dist/modules/mail_transport/template.js +52 -0
- package/dist/modules/mail_transport/template.js.map +1 -0
- package/dist/modules/mail_transport/types.d.ts +9 -0
- package/dist/modules/mail_transport/types.d.ts.map +1 -0
- package/dist/modules/mail_transport/types.js +3 -0
- package/dist/modules/mail_transport/types.js.map +1 -0
- package/dist/modules/mail_transport_backend/index.d.ts +5 -0
- package/dist/modules/mail_transport_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/index.js +69 -0
- package/dist/modules/mail_transport_backend/index.js.map +1 -0
- package/dist/modules/mail_transport_backend/routes.d.ts +5 -0
- package/dist/modules/mail_transport_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/routes.js +42 -0
- package/dist/modules/mail_transport_backend/routes.js.map +1 -0
- package/dist/modules/mail_transport_backend/screens.d.ts +5 -0
- package/dist/modules/mail_transport_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/screens.js +35 -0
- package/dist/modules/mail_transport_backend/screens.js.map +1 -0
- package/dist/modules/oauth/functions.d.ts +3 -0
- package/dist/modules/oauth/functions.d.ts.map +1 -0
- package/dist/modules/oauth/functions.js +817 -0
- package/dist/modules/oauth/functions.js.map +1 -0
- package/dist/modules/oauth/index.d.ts +4 -0
- package/dist/modules/oauth/index.d.ts.map +1 -0
- package/dist/modules/oauth/index.js +22 -0
- package/dist/modules/oauth/index.js.map +1 -0
- package/dist/modules/oauth/messages.d.ts +129 -0
- package/dist/modules/oauth/messages.d.ts.map +1 -0
- package/dist/modules/oauth/messages.js +129 -0
- package/dist/modules/oauth/messages.js.map +1 -0
- package/dist/modules/oauth/models.d.ts +4 -0
- package/dist/modules/oauth/models.d.ts.map +1 -0
- package/dist/modules/oauth/models.js +83 -0
- package/dist/modules/oauth/models.js.map +1 -0
- package/dist/modules/oauth/protocol.d.ts +54 -0
- package/dist/modules/oauth/protocol.d.ts.map +1 -0
- package/dist/modules/oauth/protocol.js +309 -0
- package/dist/modules/oauth/protocol.js.map +1 -0
- package/dist/modules/oauth/relations.d.ts +3 -0
- package/dist/modules/oauth/relations.d.ts.map +1 -0
- package/dist/modules/oauth/relations.js +18 -0
- package/dist/modules/oauth/relations.js.map +1 -0
- package/dist/modules/oauth/routes.d.ts +3 -0
- package/dist/modules/oauth/routes.d.ts.map +1 -0
- package/dist/modules/oauth/routes.js +185 -0
- package/dist/modules/oauth/routes.js.map +1 -0
- package/dist/modules/oauth_backend/index.d.ts +4 -0
- package/dist/modules/oauth_backend/index.d.ts.map +1 -0
- package/dist/modules/oauth_backend/index.js +23 -0
- package/dist/modules/oauth_backend/index.js.map +1 -0
- package/dist/modules/oauth_backend/menus.d.ts +3 -0
- package/dist/modules/oauth_backend/menus.d.ts.map +1 -0
- package/dist/modules/oauth_backend/menus.js +17 -0
- package/dist/modules/oauth_backend/menus.js.map +1 -0
- package/dist/modules/oauth_backend/messages.d.ts +169 -0
- package/dist/modules/oauth_backend/messages.d.ts.map +1 -0
- package/dist/modules/oauth_backend/messages.js +169 -0
- package/dist/modules/oauth_backend/messages.js.map +1 -0
- package/dist/modules/oauth_backend/routes.d.ts +3 -0
- package/dist/modules/oauth_backend/routes.d.ts.map +1 -0
- package/dist/modules/oauth_backend/routes.js +231 -0
- package/dist/modules/oauth_backend/routes.js.map +1 -0
- package/dist/modules/oauth_backend/screens.d.ts +66 -0
- package/dist/modules/oauth_backend/screens.d.ts.map +1 -0
- package/dist/modules/oauth_backend/screens.js +323 -0
- package/dist/modules/oauth_backend/screens.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/functions.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/functions.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/functions.js +128 -0
- package/dist/modules/odoo_collaboration_import/functions.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/index.d.ts +6 -0
- package/dist/modules/odoo_collaboration_import/index.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/index.js +31 -0
- package/dist/modules/odoo_collaboration_import/index.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/models.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/models.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/models.js +76 -0
- package/dist/modules/odoo_collaboration_import/models.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/operations.d.ts +14 -0
- package/dist/modules/odoo_collaboration_import/operations.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/operations.js +1139 -0
- package/dist/modules/odoo_collaboration_import/operations.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/relations.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/relations.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/relations.js +19 -0
- package/dist/modules/odoo_collaboration_import/relations.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/types.d.ts +58 -0
- package/dist/modules/odoo_collaboration_import/types.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/types.js +2 -0
- package/dist/modules/odoo_collaboration_import/types.js.map +1 -0
- package/dist/modules/partner/functions.d.ts +5 -0
- package/dist/modules/partner/functions.d.ts.map +1 -0
- package/dist/modules/partner/functions.js +563 -0
- package/dist/modules/partner/functions.js.map +1 -0
- package/dist/modules/partner/index.d.ts +5 -0
- package/dist/modules/partner/index.d.ts.map +1 -0
- package/dist/modules/partner/index.js +23 -0
- package/dist/modules/partner/index.js.map +1 -0
- package/dist/modules/partner/messages.d.ts +55 -0
- package/dist/modules/partner/messages.d.ts.map +1 -0
- package/dist/modules/partner/messages.js +55 -0
- package/dist/modules/partner/messages.js.map +1 -0
- package/dist/modules/partner/models.d.ts +23 -0
- package/dist/modules/partner/models.d.ts.map +1 -0
- package/dist/modules/partner/models.js +124 -0
- package/dist/modules/partner/models.js.map +1 -0
- package/dist/modules/partner/relations.d.ts +4 -0
- package/dist/modules/partner/relations.d.ts.map +1 -0
- package/dist/modules/partner/relations.js +35 -0
- package/dist/modules/partner/relations.js.map +1 -0
- package/dist/modules/partner/types.d.ts +17 -0
- package/dist/modules/partner/types.d.ts.map +1 -0
- package/dist/modules/partner/types.js +14 -0
- package/dist/modules/partner/types.js.map +1 -0
- package/dist/modules/partner/views.d.ts +4 -0
- package/dist/modules/partner/views.d.ts.map +1 -0
- package/dist/modules/partner/views.js +19 -0
- package/dist/modules/partner/views.js.map +1 -0
- package/dist/modules/partner_backend/client/address-view.d.mts +5 -0
- package/dist/modules/partner_backend/client/address-view.d.mts.map +1 -0
- package/dist/modules/partner_backend/client/address-view.mjs +193 -0
- package/dist/modules/partner_backend/client/address-view.mjs.map +1 -0
- package/dist/modules/partner_backend/client/address.css +12 -0
- package/dist/modules/partner_backend/client/address.d.mts +5 -0
- package/dist/modules/partner_backend/client/address.d.mts.map +1 -0
- package/dist/modules/partner_backend/client/address.mjs +7 -0
- package/dist/modules/partner_backend/client/address.mjs.map +1 -0
- package/dist/modules/partner_backend/index.d.ts +5 -0
- package/dist/modules/partner_backend/index.d.ts.map +1 -0
- package/dist/modules/partner_backend/index.js +178 -0
- package/dist/modules/partner_backend/index.js.map +1 -0
- package/dist/modules/partner_backend/islands.d.ts +3 -0
- package/dist/modules/partner_backend/islands.d.ts.map +1 -0
- package/dist/modules/partner_backend/islands.js +23 -0
- package/dist/modules/partner_backend/islands.js.map +1 -0
- package/dist/modules/partner_backend/menus.d.ts +3 -0
- package/dist/modules/partner_backend/menus.d.ts.map +1 -0
- package/dist/modules/partner_backend/menus.js +11 -0
- package/dist/modules/partner_backend/menus.js.map +1 -0
- package/dist/modules/partner_backend/relation-control.d.ts +22 -0
- package/dist/modules/partner_backend/relation-control.d.ts.map +1 -0
- package/dist/modules/partner_backend/relation-control.js +46 -0
- package/dist/modules/partner_backend/relation-control.js.map +1 -0
- package/dist/modules/partner_backend/routes.d.ts +3 -0
- package/dist/modules/partner_backend/routes.d.ts.map +1 -0
- package/dist/modules/partner_backend/routes.js +300 -0
- package/dist/modules/partner_backend/routes.js.map +1 -0
- package/dist/modules/partner_backend/screens.d.ts +53 -0
- package/dist/modules/partner_backend/screens.d.ts.map +1 -0
- package/dist/modules/partner_backend/screens.js +169 -0
- package/dist/modules/partner_backend/screens.js.map +1 -0
- package/dist/modules/pos/functions.d.ts +6 -0
- package/dist/modules/pos/functions.d.ts.map +1 -0
- package/dist/modules/pos/functions.js +953 -0
- package/dist/modules/pos/functions.js.map +1 -0
- package/dist/modules/pos/index.d.ts +4 -0
- package/dist/modules/pos/index.d.ts.map +1 -0
- package/dist/modules/pos/index.js +34 -0
- package/dist/modules/pos/index.js.map +1 -0
- package/dist/modules/pos/models.d.ts +3 -0
- package/dist/modules/pos/models.d.ts.map +1 -0
- package/dist/modules/pos/models.js +107 -0
- package/dist/modules/pos/models.js.map +1 -0
- package/dist/modules/pos/relations.d.ts +3 -0
- package/dist/modules/pos/relations.d.ts.map +1 -0
- package/dist/modules/pos/relations.js +37 -0
- package/dist/modules/pos/relations.js.map +1 -0
- package/dist/modules/pos_backend/index.d.ts +3 -0
- package/dist/modules/pos_backend/index.d.ts.map +1 -0
- package/dist/modules/pos_backend/index.js +654 -0
- package/dist/modules/pos_backend/index.js.map +1 -0
- package/dist/modules/pos_backend/screens.d.ts +15 -0
- package/dist/modules/pos_backend/screens.d.ts.map +1 -0
- package/dist/modules/pos_backend/screens.js +320 -0
- package/dist/modules/pos_backend/screens.js.map +1 -0
- package/dist/modules/pricing/functions.d.ts +6 -0
- package/dist/modules/pricing/functions.d.ts.map +1 -0
- package/dist/modules/pricing/functions.js +318 -0
- package/dist/modules/pricing/functions.js.map +1 -0
- package/dist/modules/pricing/index.d.ts +4 -0
- package/dist/modules/pricing/index.d.ts.map +1 -0
- package/dist/modules/pricing/index.js +30 -0
- package/dist/modules/pricing/index.js.map +1 -0
- package/dist/modules/pricing/models.d.ts +3 -0
- package/dist/modules/pricing/models.d.ts.map +1 -0
- package/dist/modules/pricing/models.js +34 -0
- package/dist/modules/pricing/models.js.map +1 -0
- package/dist/modules/pricing/relations.d.ts +3 -0
- package/dist/modules/pricing/relations.d.ts.map +1 -0
- package/dist/modules/pricing/relations.js +11 -0
- package/dist/modules/pricing/relations.js.map +1 -0
- package/dist/modules/pricing_backend/index.d.ts +3 -0
- package/dist/modules/pricing_backend/index.d.ts.map +1 -0
- package/dist/modules/pricing_backend/index.js +241 -0
- package/dist/modules/pricing_backend/index.js.map +1 -0
- package/dist/modules/pricing_backend/screens.d.ts +13 -0
- package/dist/modules/pricing_backend/screens.d.ts.map +1 -0
- package/dist/modules/pricing_backend/screens.js +182 -0
- package/dist/modules/pricing_backend/screens.js.map +1 -0
- package/dist/modules/product/functions.d.ts +3 -0
- package/dist/modules/product/functions.d.ts.map +1 -0
- package/dist/modules/product/functions.js +627 -0
- package/dist/modules/product/functions.js.map +1 -0
- package/dist/modules/product/index.d.ts +6 -0
- package/dist/modules/product/index.d.ts.map +1 -0
- package/dist/modules/product/index.js +24 -0
- package/dist/modules/product/index.js.map +1 -0
- package/dist/modules/product/messages.d.ts +3 -0
- package/dist/modules/product/messages.d.ts.map +1 -0
- package/dist/modules/product/messages.js +19 -0
- package/dist/modules/product/messages.js.map +1 -0
- package/dist/modules/product/models.d.ts +11 -0
- package/dist/modules/product/models.d.ts.map +1 -0
- package/dist/modules/product/models.js +116 -0
- package/dist/modules/product/models.js.map +1 -0
- package/dist/modules/product/relations.d.ts +8 -0
- package/dist/modules/product/relations.d.ts.map +1 -0
- package/dist/modules/product/relations.js +53 -0
- package/dist/modules/product/relations.js.map +1 -0
- package/dist/modules/product/search.d.ts +73 -0
- package/dist/modules/product/search.d.ts.map +1 -0
- package/dist/modules/product/search.js +66 -0
- package/dist/modules/product/search.js.map +1 -0
- package/dist/modules/product/types.d.ts +14 -0
- package/dist/modules/product/types.d.ts.map +1 -0
- package/dist/modules/product/types.js +2 -0
- package/dist/modules/product/types.js.map +1 -0
- package/dist/modules/product/views.d.ts +4 -0
- package/dist/modules/product/views.d.ts.map +1 -0
- package/dist/modules/product/views.js +7 -0
- package/dist/modules/product/views.js.map +1 -0
- package/dist/modules/product_activity_backend/index.d.ts +5 -0
- package/dist/modules/product_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/product_activity_backend/index.js +29 -0
- package/dist/modules/product_activity_backend/index.js.map +1 -0
- package/dist/modules/product_backend/attributes-screen.d.ts +7 -0
- package/dist/modules/product_backend/attributes-screen.d.ts.map +1 -0
- package/dist/modules/product_backend/attributes-screen.js +76 -0
- package/dist/modules/product_backend/attributes-screen.js.map +1 -0
- package/dist/modules/product_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/product_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/product_backend/client/editor-view.mjs +141 -0
- package/dist/modules/product_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/product_backend/client/product.d.mts +6 -0
- package/dist/modules/product_backend/client/product.d.mts.map +1 -0
- package/dist/modules/product_backend/client/product.mjs +8 -0
- package/dist/modules/product_backend/client/product.mjs.map +1 -0
- package/dist/modules/product_backend/create-screen.d.ts +12 -0
- package/dist/modules/product_backend/create-screen.d.ts.map +1 -0
- package/dist/modules/product_backend/create-screen.js +83 -0
- package/dist/modules/product_backend/create-screen.js.map +1 -0
- package/dist/modules/product_backend/index.d.ts +20 -0
- package/dist/modules/product_backend/index.d.ts.map +1 -0
- package/dist/modules/product_backend/index.js +287 -0
- package/dist/modules/product_backend/index.js.map +1 -0
- package/dist/modules/product_backend/islands.d.ts +3 -0
- package/dist/modules/product_backend/islands.d.ts.map +1 -0
- package/dist/modules/product_backend/islands.js +13 -0
- package/dist/modules/product_backend/islands.js.map +1 -0
- package/dist/modules/product_backend/menus.d.ts +3 -0
- package/dist/modules/product_backend/menus.d.ts.map +1 -0
- package/dist/modules/product_backend/menus.js +25 -0
- package/dist/modules/product_backend/menus.js.map +1 -0
- package/dist/modules/product_backend/routes.d.ts +14 -0
- package/dist/modules/product_backend/routes.d.ts.map +1 -0
- package/dist/modules/product_backend/routes.js +990 -0
- package/dist/modules/product_backend/routes.js.map +1 -0
- package/dist/modules/product_backend/screens.d.ts +68 -0
- package/dist/modules/product_backend/screens.d.ts.map +1 -0
- package/dist/modules/product_backend/screens.js +388 -0
- package/dist/modules/product_backend/screens.js.map +1 -0
- package/dist/modules/product_mail_backend/index.d.ts +5 -0
- package/dist/modules/product_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/product_mail_backend/index.js +30 -0
- package/dist/modules/product_mail_backend/index.js.map +1 -0
- package/dist/modules/product_media/functions.d.ts +3 -0
- package/dist/modules/product_media/functions.d.ts.map +1 -0
- package/dist/modules/product_media/functions.js +183 -0
- package/dist/modules/product_media/functions.js.map +1 -0
- package/dist/modules/product_media/index.d.ts +3 -0
- package/dist/modules/product_media/index.d.ts.map +1 -0
- package/dist/modules/product_media/index.js +29 -0
- package/dist/modules/product_media/index.js.map +1 -0
- package/dist/modules/product_media/models.d.ts +4 -0
- package/dist/modules/product_media/models.d.ts.map +1 -0
- package/dist/modules/product_media/models.js +24 -0
- package/dist/modules/product_media/models.js.map +1 -0
- package/dist/modules/product_media/relations.d.ts +3 -0
- package/dist/modules/product_media/relations.d.ts.map +1 -0
- package/dist/modules/product_media/relations.js +8 -0
- package/dist/modules/product_media/relations.js.map +1 -0
- package/dist/modules/product_variant_activity_backend/index.d.ts +5 -0
- package/dist/modules/product_variant_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/product_variant_activity_backend/index.js +29 -0
- package/dist/modules/product_variant_activity_backend/index.js.map +1 -0
- package/dist/modules/product_variant_mail_backend/index.d.ts +5 -0
- package/dist/modules/product_variant_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/product_variant_mail_backend/index.js +30 -0
- package/dist/modules/product_variant_mail_backend/index.js.map +1 -0
- package/dist/modules/purchase/functions.d.ts +6 -0
- package/dist/modules/purchase/functions.d.ts.map +1 -0
- package/dist/modules/purchase/functions.js +743 -0
- package/dist/modules/purchase/functions.js.map +1 -0
- package/dist/modules/purchase/index.d.ts +4 -0
- package/dist/modules/purchase/index.d.ts.map +1 -0
- package/dist/modules/purchase/index.js +35 -0
- package/dist/modules/purchase/index.js.map +1 -0
- package/dist/modules/purchase/models.d.ts +3 -0
- package/dist/modules/purchase/models.d.ts.map +1 -0
- package/dist/modules/purchase/models.js +68 -0
- package/dist/modules/purchase/models.js.map +1 -0
- package/dist/modules/purchase/relations.d.ts +3 -0
- package/dist/modules/purchase/relations.d.ts.map +1 -0
- package/dist/modules/purchase/relations.js +20 -0
- package/dist/modules/purchase/relations.js.map +1 -0
- package/dist/modules/purchase_backend/index.d.ts +3 -0
- package/dist/modules/purchase_backend/index.d.ts.map +1 -0
- package/dist/modules/purchase_backend/index.js +615 -0
- package/dist/modules/purchase_backend/index.js.map +1 -0
- package/dist/modules/purchase_backend/screens.d.ts +29 -0
- package/dist/modules/purchase_backend/screens.d.ts.map +1 -0
- package/dist/modules/purchase_backend/screens.js +324 -0
- package/dist/modules/purchase_backend/screens.js.map +1 -0
- package/dist/modules/sale/functions.d.ts +6 -0
- package/dist/modules/sale/functions.d.ts.map +1 -0
- package/dist/modules/sale/functions.js +611 -0
- package/dist/modules/sale/functions.js.map +1 -0
- package/dist/modules/sale/index.d.ts +4 -0
- package/dist/modules/sale/index.d.ts.map +1 -0
- package/dist/modules/sale/index.js +35 -0
- package/dist/modules/sale/index.js.map +1 -0
- package/dist/modules/sale/models.d.ts +3 -0
- package/dist/modules/sale/models.d.ts.map +1 -0
- package/dist/modules/sale/models.js +46 -0
- package/dist/modules/sale/models.js.map +1 -0
- package/dist/modules/sale/relations.d.ts +3 -0
- package/dist/modules/sale/relations.d.ts.map +1 -0
- package/dist/modules/sale/relations.js +16 -0
- package/dist/modules/sale/relations.js.map +1 -0
- package/dist/modules/sale_activity_backend/index.d.ts +5 -0
- package/dist/modules/sale_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_activity_backend/index.js +29 -0
- package/dist/modules/sale_activity_backend/index.js.map +1 -0
- package/dist/modules/sale_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/sale_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/sale_backend/client/editor-view.mjs +132 -0
- package/dist/modules/sale_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/sale_backend/client/sale.d.mts +6 -0
- package/dist/modules/sale_backend/client/sale.d.mts.map +1 -0
- package/dist/modules/sale_backend/client/sale.mjs +8 -0
- package/dist/modules/sale_backend/client/sale.mjs.map +1 -0
- package/dist/modules/sale_backend/index.d.ts +3 -0
- package/dist/modules/sale_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_backend/index.js +681 -0
- package/dist/modules/sale_backend/index.js.map +1 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.d.ts +14 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.js +36 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.js.map +1 -0
- package/dist/modules/sale_backend/islands.d.ts +3 -0
- package/dist/modules/sale_backend/islands.d.ts.map +1 -0
- package/dist/modules/sale_backend/islands.js +13 -0
- package/dist/modules/sale_backend/islands.js.map +1 -0
- package/dist/modules/sale_backend/order-detail-screen.d.ts +18 -0
- package/dist/modules/sale_backend/order-detail-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/order-detail-screen.js +217 -0
- package/dist/modules/sale_backend/order-detail-screen.js.map +1 -0
- package/dist/modules/sale_backend/quotations-screen.d.ts +15 -0
- package/dist/modules/sale_backend/quotations-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/quotations-screen.js +64 -0
- package/dist/modules/sale_backend/quotations-screen.js.map +1 -0
- package/dist/modules/sale_backend/sales-orders-screen.d.ts +12 -0
- package/dist/modules/sale_backend/sales-orders-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/sales-orders-screen.js +65 -0
- package/dist/modules/sale_backend/sales-orders-screen.js.map +1 -0
- package/dist/modules/sale_backend/screens.d.ts +23 -0
- package/dist/modules/sale_backend/screens.d.ts.map +1 -0
- package/dist/modules/sale_backend/screens.js +275 -0
- package/dist/modules/sale_backend/screens.js.map +1 -0
- package/dist/modules/sale_mail_backend/index.d.ts +5 -0
- package/dist/modules/sale_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_mail_backend/index.js +30 -0
- package/dist/modules/sale_mail_backend/index.js.map +1 -0
- package/dist/modules/stock/functions.d.ts +10 -0
- package/dist/modules/stock/functions.d.ts.map +1 -0
- package/dist/modules/stock/functions.js +1523 -0
- package/dist/modules/stock/functions.js.map +1 -0
- package/dist/modules/stock/index.d.ts +5 -0
- package/dist/modules/stock/index.d.ts.map +1 -0
- package/dist/modules/stock/index.js +35 -0
- package/dist/modules/stock/index.js.map +1 -0
- package/dist/modules/stock/models.d.ts +3 -0
- package/dist/modules/stock/models.d.ts.map +1 -0
- package/dist/modules/stock/models.js +185 -0
- package/dist/modules/stock/models.js.map +1 -0
- package/dist/modules/stock/relations.d.ts +3 -0
- package/dist/modules/stock/relations.d.ts.map +1 -0
- package/dist/modules/stock/relations.js +40 -0
- package/dist/modules/stock/relations.js.map +1 -0
- package/dist/modules/stock/routing.d.ts +7 -0
- package/dist/modules/stock/routing.d.ts.map +1 -0
- package/dist/modules/stock/routing.js +527 -0
- package/dist/modules/stock/routing.js.map +1 -0
- package/dist/modules/stock_activity_backend/index.d.ts +5 -0
- package/dist/modules/stock_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_activity_backend/index.js +29 -0
- package/dist/modules/stock_activity_backend/index.js.map +1 -0
- package/dist/modules/stock_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/stock_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/stock_backend/client/editor-view.mjs +147 -0
- package/dist/modules/stock_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/stock_backend/client/stock.d.mts +6 -0
- package/dist/modules/stock_backend/client/stock.d.mts.map +1 -0
- package/dist/modules/stock_backend/client/stock.mjs +8 -0
- package/dist/modules/stock_backend/client/stock.mjs.map +1 -0
- package/dist/modules/stock_backend/forecast-screen.d.ts +28 -0
- package/dist/modules/stock_backend/forecast-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/forecast-screen.js +108 -0
- package/dist/modules/stock_backend/forecast-screen.js.map +1 -0
- package/dist/modules/stock_backend/index.d.ts +3 -0
- package/dist/modules/stock_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_backend/index.js +880 -0
- package/dist/modules/stock_backend/index.js.map +1 -0
- package/dist/modules/stock_backend/inventory-screen.d.ts +27 -0
- package/dist/modules/stock_backend/inventory-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/inventory-screen.js +141 -0
- package/dist/modules/stock_backend/inventory-screen.js.map +1 -0
- package/dist/modules/stock_backend/islands.d.ts +3 -0
- package/dist/modules/stock_backend/islands.d.ts.map +1 -0
- package/dist/modules/stock_backend/islands.js +13 -0
- package/dist/modules/stock_backend/islands.js.map +1 -0
- package/dist/modules/stock_backend/locations-screen.d.ts +18 -0
- package/dist/modules/stock_backend/locations-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/locations-screen.js +92 -0
- package/dist/modules/stock_backend/locations-screen.js.map +1 -0
- package/dist/modules/stock_backend/lot-screen.d.ts +30 -0
- package/dist/modules/stock_backend/lot-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/lot-screen.js +86 -0
- package/dist/modules/stock_backend/lot-screen.js.map +1 -0
- package/dist/modules/stock_backend/lots-screen.d.ts +21 -0
- package/dist/modules/stock_backend/lots-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/lots-screen.js +79 -0
- package/dist/modules/stock_backend/lots-screen.js.map +1 -0
- package/dist/modules/stock_backend/picking-types-screen.d.ts +21 -0
- package/dist/modules/stock_backend/picking-types-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/picking-types-screen.js +110 -0
- package/dist/modules/stock_backend/picking-types-screen.js.map +1 -0
- package/dist/modules/stock_backend/replenishment-screen.d.ts +29 -0
- package/dist/modules/stock_backend/replenishment-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/replenishment-screen.js +131 -0
- package/dist/modules/stock_backend/replenishment-screen.js.map +1 -0
- package/dist/modules/stock_backend/routes.d.ts +3 -0
- package/dist/modules/stock_backend/routes.d.ts.map +1 -0
- package/dist/modules/stock_backend/routes.js +950 -0
- package/dist/modules/stock_backend/routes.js.map +1 -0
- package/dist/modules/stock_backend/screens.d.ts +14 -0
- package/dist/modules/stock_backend/screens.d.ts.map +1 -0
- package/dist/modules/stock_backend/screens.js +40 -0
- package/dist/modules/stock_backend/screens.js.map +1 -0
- package/dist/modules/stock_backend/stock-route-screen.d.ts +30 -0
- package/dist/modules/stock_backend/stock-route-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/stock-route-screen.js +129 -0
- package/dist/modules/stock_backend/stock-route-screen.js.map +1 -0
- package/dist/modules/stock_backend/stock-routes-screen.d.ts +17 -0
- package/dist/modules/stock_backend/stock-routes-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/stock-routes-screen.js +60 -0
- package/dist/modules/stock_backend/stock-routes-screen.js.map +1 -0
- package/dist/modules/stock_backend/transfer-screen.d.ts +26 -0
- package/dist/modules/stock_backend/transfer-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/transfer-screen.js +95 -0
- package/dist/modules/stock_backend/transfer-screen.js.map +1 -0
- package/dist/modules/stock_backend/transfers-screen.d.ts +21 -0
- package/dist/modules/stock_backend/transfers-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/transfers-screen.js +88 -0
- package/dist/modules/stock_backend/transfers-screen.js.map +1 -0
- package/dist/modules/stock_backend/warehouses-screen.d.ts +17 -0
- package/dist/modules/stock_backend/warehouses-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/warehouses-screen.js +96 -0
- package/dist/modules/stock_backend/warehouses-screen.js.map +1 -0
- package/dist/modules/stock_lot_activity_backend/index.d.ts +5 -0
- package/dist/modules/stock_lot_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_lot_activity_backend/index.js +29 -0
- package/dist/modules/stock_lot_activity_backend/index.js.map +1 -0
- package/dist/modules/stock_lot_mail_backend/index.d.ts +5 -0
- package/dist/modules/stock_lot_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_lot_mail_backend/index.js +30 -0
- package/dist/modules/stock_lot_mail_backend/index.js.map +1 -0
- package/dist/modules/stock_mail_backend/index.d.ts +5 -0
- package/dist/modules/stock_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_mail_backend/index.js +30 -0
- package/dist/modules/stock_mail_backend/index.js.map +1 -0
- package/dist/modules/stock_mail_inbound/index.d.ts +6 -0
- package/dist/modules/stock_mail_inbound/index.d.ts.map +1 -0
- package/dist/modules/stock_mail_inbound/index.js +104 -0
- package/dist/modules/stock_mail_inbound/index.js.map +1 -0
- package/dist/modules/storage/functions.d.ts +3 -0
- package/dist/modules/storage/functions.d.ts.map +1 -0
- package/dist/modules/storage/functions.js +129 -0
- package/dist/modules/storage/functions.js.map +1 -0
- package/dist/modules/storage/index.d.ts +3 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +31 -0
- package/dist/modules/storage/index.js.map +1 -0
- package/dist/modules/storage/jobs.d.ts +3 -0
- package/dist/modules/storage/jobs.d.ts.map +1 -0
- package/dist/modules/storage/jobs.js +37 -0
- package/dist/modules/storage/jobs.js.map +1 -0
- package/dist/modules/storage/models.d.ts +3 -0
- package/dist/modules/storage/models.d.ts.map +1 -0
- package/dist/modules/storage/models.js +23 -0
- package/dist/modules/storage/models.js.map +1 -0
- package/dist/modules/storage/routes.d.ts +27 -0
- package/dist/modules/storage/routes.d.ts.map +1 -0
- package/dist/modules/storage/routes.js +180 -0
- package/dist/modules/storage/routes.js.map +1 -0
- package/dist/modules/uom/convert.d.ts +52 -0
- package/dist/modules/uom/convert.d.ts.map +1 -0
- package/dist/modules/uom/convert.js +76 -0
- package/dist/modules/uom/convert.js.map +1 -0
- package/dist/modules/uom/functions.d.ts +5 -0
- package/dist/modules/uom/functions.d.ts.map +1 -0
- package/dist/modules/uom/functions.js +235 -0
- package/dist/modules/uom/functions.js.map +1 -0
- package/dist/modules/uom/index.d.ts +5 -0
- package/dist/modules/uom/index.d.ts.map +1 -0
- package/dist/modules/uom/index.js +19 -0
- package/dist/modules/uom/index.js.map +1 -0
- package/dist/modules/uom/messages.d.ts +3 -0
- package/dist/modules/uom/messages.d.ts.map +1 -0
- package/dist/modules/uom/messages.js +19 -0
- package/dist/modules/uom/messages.js.map +1 -0
- package/dist/modules/uom/models.d.ts +4 -0
- package/dist/modules/uom/models.d.ts.map +1 -0
- package/dist/modules/uom/models.js +34 -0
- package/dist/modules/uom/models.js.map +1 -0
- package/dist/modules/uom/relations.d.ts +3 -0
- package/dist/modules/uom/relations.d.ts.map +1 -0
- package/dist/modules/uom/relations.js +7 -0
- package/dist/modules/uom/relations.js.map +1 -0
- package/dist/modules/user/functions.d.ts +8 -0
- package/dist/modules/user/functions.d.ts.map +1 -0
- package/dist/modules/user/functions.js +1094 -0
- package/dist/modules/user/functions.js.map +1 -0
- package/dist/modules/user/index.d.ts +8 -0
- package/dist/modules/user/index.d.ts.map +1 -0
- package/dist/modules/user/index.js +34 -0
- package/dist/modules/user/index.js.map +1 -0
- package/dist/modules/user/login.d.ts +28 -0
- package/dist/modules/user/login.d.ts.map +1 -0
- package/dist/modules/user/login.js +46 -0
- package/dist/modules/user/login.js.map +1 -0
- package/dist/modules/user/messages.d.ts +115 -0
- package/dist/modules/user/messages.d.ts.map +1 -0
- package/dist/modules/user/messages.js +115 -0
- package/dist/modules/user/messages.js.map +1 -0
- package/dist/modules/user/models.d.ts +16 -0
- package/dist/modules/user/models.d.ts.map +1 -0
- package/dist/modules/user/models.js +168 -0
- package/dist/modules/user/models.js.map +1 -0
- package/dist/modules/user/password.d.ts +11 -0
- package/dist/modules/user/password.d.ts.map +1 -0
- package/dist/modules/user/password.js +74 -0
- package/dist/modules/user/password.js.map +1 -0
- package/dist/modules/user/relations.d.ts +3 -0
- package/dist/modules/user/relations.d.ts.map +1 -0
- package/dist/modules/user/relations.js +31 -0
- package/dist/modules/user/relations.js.map +1 -0
- package/dist/modules/user/roles.d.ts +12 -0
- package/dist/modules/user/roles.d.ts.map +1 -0
- package/dist/modules/user/roles.js +254 -0
- package/dist/modules/user/roles.js.map +1 -0
- package/dist/modules/user/routes.d.ts +3 -0
- package/dist/modules/user/routes.d.ts.map +1 -0
- package/dist/modules/user/routes.js +244 -0
- package/dist/modules/user/routes.js.map +1 -0
- package/dist/modules/user/session-context.d.ts +10 -0
- package/dist/modules/user/session-context.d.ts.map +1 -0
- package/dist/modules/user/session-context.js +31 -0
- package/dist/modules/user/session-context.js.map +1 -0
- package/dist/modules/user_backend/index.d.ts +5 -0
- package/dist/modules/user_backend/index.d.ts.map +1 -0
- package/dist/modules/user_backend/index.js +24 -0
- package/dist/modules/user_backend/index.js.map +1 -0
- package/dist/modules/user_backend/menus.d.ts +3 -0
- package/dist/modules/user_backend/menus.d.ts.map +1 -0
- package/dist/modules/user_backend/menus.js +24 -0
- package/dist/modules/user_backend/menus.js.map +1 -0
- package/dist/modules/user_backend/messages.d.ts +189 -0
- package/dist/modules/user_backend/messages.d.ts.map +1 -0
- package/dist/modules/user_backend/messages.js +189 -0
- package/dist/modules/user_backend/messages.js.map +1 -0
- package/dist/modules/user_backend/routes.d.ts +3 -0
- package/dist/modules/user_backend/routes.d.ts.map +1 -0
- package/dist/modules/user_backend/routes.js +474 -0
- package/dist/modules/user_backend/routes.js.map +1 -0
- package/dist/modules/user_backend/screens.d.ts +70 -0
- package/dist/modules/user_backend/screens.d.ts.map +1 -0
- package/dist/modules/user_backend/screens.js +308 -0
- package/dist/modules/user_backend/screens.js.map +1 -0
- package/dist/modules/website/access.d.ts +15 -0
- package/dist/modules/website/access.d.ts.map +1 -0
- package/dist/modules/website/access.js +39 -0
- package/dist/modules/website/access.js.map +1 -0
- package/dist/modules/website/cms.d.ts +3 -0
- package/dist/modules/website/cms.d.ts.map +1 -0
- package/dist/modules/website/cms.js +1142 -0
- package/dist/modules/website/cms.js.map +1 -0
- package/dist/modules/website/content-types.d.ts +4 -0
- package/dist/modules/website/content-types.d.ts.map +1 -0
- package/dist/modules/website/content-types.js +30 -0
- package/dist/modules/website/content-types.js.map +1 -0
- package/dist/modules/website/customer-password.d.ts +4 -0
- package/dist/modules/website/customer-password.d.ts.map +1 -0
- package/dist/modules/website/customer-password.js +51 -0
- package/dist/modules/website/customer-password.js.map +1 -0
- package/dist/modules/website/customer-routes.d.ts +3 -0
- package/dist/modules/website/customer-routes.d.ts.map +1 -0
- package/dist/modules/website/customer-routes.js +322 -0
- package/dist/modules/website/customer-routes.js.map +1 -0
- package/dist/modules/website/customer.d.ts +5 -0
- package/dist/modules/website/customer.d.ts.map +1 -0
- package/dist/modules/website/customer.js +442 -0
- package/dist/modules/website/customer.js.map +1 -0
- package/dist/modules/website/functions.d.ts +3 -0
- package/dist/modules/website/functions.d.ts.map +1 -0
- package/dist/modules/website/functions.js +96 -0
- package/dist/modules/website/functions.js.map +1 -0
- package/dist/modules/website/index.d.ts +4 -0
- package/dist/modules/website/index.d.ts.map +1 -0
- package/dist/modules/website/index.js +152 -0
- package/dist/modules/website/index.js.map +1 -0
- package/dist/modules/website/jobs.d.ts +3 -0
- package/dist/modules/website/jobs.d.ts.map +1 -0
- package/dist/modules/website/jobs.js +25 -0
- package/dist/modules/website/jobs.js.map +1 -0
- package/dist/modules/website/joints.d.ts +4 -0
- package/dist/modules/website/joints.d.ts.map +1 -0
- package/dist/modules/website/joints.js +7 -0
- package/dist/modules/website/joints.js.map +1 -0
- package/dist/modules/website/models.d.ts +8 -0
- package/dist/modules/website/models.d.ts.map +1 -0
- package/dist/modules/website/models.js +260 -0
- package/dist/modules/website/models.js.map +1 -0
- package/dist/modules/website/sections.d.ts +8 -0
- package/dist/modules/website/sections.d.ts.map +1 -0
- package/dist/modules/website/sections.js +16 -0
- package/dist/modules/website/sections.js.map +1 -0
- package/dist/modules/website/tokens.d.ts +2 -0
- package/dist/modules/website/tokens.d.ts.map +1 -0
- package/dist/modules/website/tokens.js +5 -0
- package/dist/modules/website/tokens.js.map +1 -0
- package/dist/modules/website/types.d.ts +6 -0
- package/dist/modules/website/types.d.ts.map +1 -0
- package/dist/modules/website/types.js +2 -0
- package/dist/modules/website/types.js.map +1 -0
- package/dist/modules/website/views.d.ts +4 -0
- package/dist/modules/website/views.d.ts.map +1 -0
- package/dist/modules/website/views.js +5 -0
- package/dist/modules/website/views.js.map +1 -0
- package/dist/modules/website_backend/index.d.ts +3 -0
- package/dist/modules/website_backend/index.d.ts.map +1 -0
- package/dist/modules/website_backend/index.js +290 -0
- package/dist/modules/website_backend/index.js.map +1 -0
- package/dist/modules/website_backend/menus.d.ts +3 -0
- package/dist/modules/website_backend/menus.d.ts.map +1 -0
- package/dist/modules/website_backend/menus.js +54 -0
- package/dist/modules/website_backend/menus.js.map +1 -0
- package/dist/modules/website_backend/routes.d.ts +3 -0
- package/dist/modules/website_backend/routes.d.ts.map +1 -0
- package/dist/modules/website_backend/routes.js +625 -0
- package/dist/modules/website_backend/routes.js.map +1 -0
- package/dist/modules/website_backend/screens.d.ts +114 -0
- package/dist/modules/website_backend/screens.d.ts.map +1 -0
- package/dist/modules/website_backend/screens.js +625 -0
- package/dist/modules/website_backend/screens.js.map +1 -0
- package/dist/modules/website_form/functions.d.ts +3 -0
- package/dist/modules/website_form/functions.d.ts.map +1 -0
- package/dist/modules/website_form/functions.js +305 -0
- package/dist/modules/website_form/functions.js.map +1 -0
- package/dist/modules/website_form/index.d.ts +3 -0
- package/dist/modules/website_form/index.d.ts.map +1 -0
- package/dist/modules/website_form/index.js +72 -0
- package/dist/modules/website_form/index.js.map +1 -0
- package/dist/modules/website_form/models.d.ts +3 -0
- package/dist/modules/website_form/models.d.ts.map +1 -0
- package/dist/modules/website_form/models.js +46 -0
- package/dist/modules/website_form/models.js.map +1 -0
- package/dist/modules/website_form/routes.d.ts +3 -0
- package/dist/modules/website_form/routes.d.ts.map +1 -0
- package/dist/modules/website_form/routes.js +74 -0
- package/dist/modules/website_form/routes.js.map +1 -0
- package/dist/modules/website_form/sections.d.ts +3 -0
- package/dist/modules/website_form/sections.d.ts.map +1 -0
- package/dist/modules/website_form/sections.js +7 -0
- package/dist/modules/website_form/sections.js.map +1 -0
- package/dist/modules/website_hospitality/content-types.d.ts +3 -0
- package/dist/modules/website_hospitality/content-types.d.ts.map +1 -0
- package/dist/modules/website_hospitality/content-types.js +9 -0
- package/dist/modules/website_hospitality/content-types.js.map +1 -0
- package/dist/modules/website_hospitality/functions.d.ts +3 -0
- package/dist/modules/website_hospitality/functions.d.ts.map +1 -0
- package/dist/modules/website_hospitality/functions.js +296 -0
- package/dist/modules/website_hospitality/functions.js.map +1 -0
- package/dist/modules/website_hospitality/index.d.ts +3 -0
- package/dist/modules/website_hospitality/index.d.ts.map +1 -0
- package/dist/modules/website_hospitality/index.js +67 -0
- package/dist/modules/website_hospitality/index.js.map +1 -0
- package/dist/modules/website_hospitality/models.d.ts +3 -0
- package/dist/modules/website_hospitality/models.d.ts.map +1 -0
- package/dist/modules/website_hospitality/models.js +49 -0
- package/dist/modules/website_hospitality/models.js.map +1 -0
- package/dist/modules/website_hospitality/routes.d.ts +3 -0
- package/dist/modules/website_hospitality/routes.d.ts.map +1 -0
- package/dist/modules/website_hospitality/routes.js +78 -0
- package/dist/modules/website_hospitality/routes.js.map +1 -0
- package/dist/modules/website_hospitality/sections.d.ts +3 -0
- package/dist/modules/website_hospitality/sections.d.ts.map +1 -0
- package/dist/modules/website_hospitality/sections.js +11 -0
- package/dist/modules/website_hospitality/sections.js.map +1 -0
- package/dist/modules/website_menu/functions.d.ts +3 -0
- package/dist/modules/website_menu/functions.d.ts.map +1 -0
- package/dist/modules/website_menu/functions.js +79 -0
- package/dist/modules/website_menu/functions.js.map +1 -0
- package/dist/modules/website_menu/index.d.ts +3 -0
- package/dist/modules/website_menu/index.d.ts.map +1 -0
- package/dist/modules/website_menu/index.js +31 -0
- package/dist/modules/website_menu/index.js.map +1 -0
- package/dist/modules/website_menu/models.d.ts +3 -0
- package/dist/modules/website_menu/models.d.ts.map +1 -0
- package/dist/modules/website_menu/models.js +15 -0
- package/dist/modules/website_menu/models.js.map +1 -0
- package/dist/modules/website_menu/sections.d.ts +3 -0
- package/dist/modules/website_menu/sections.d.ts.map +1 -0
- package/dist/modules/website_menu/sections.js +4 -0
- package/dist/modules/website_menu/sections.js.map +1 -0
- package/dist/modules/website_menu/views.d.ts +3 -0
- package/dist/modules/website_menu/views.d.ts.map +1 -0
- package/dist/modules/website_menu/views.js +4 -0
- package/dist/modules/website_menu/views.js.map +1 -0
- package/dist/modules/website_retail/content-types.d.ts +3 -0
- package/dist/modules/website_retail/content-types.d.ts.map +1 -0
- package/dist/modules/website_retail/content-types.js +10 -0
- package/dist/modules/website_retail/content-types.js.map +1 -0
- package/dist/modules/website_retail/functions.d.ts +3 -0
- package/dist/modules/website_retail/functions.d.ts.map +1 -0
- package/dist/modules/website_retail/functions.js +321 -0
- package/dist/modules/website_retail/functions.js.map +1 -0
- package/dist/modules/website_retail/index.d.ts +3 -0
- package/dist/modules/website_retail/index.d.ts.map +1 -0
- package/dist/modules/website_retail/index.js +63 -0
- package/dist/modules/website_retail/index.js.map +1 -0
- package/dist/modules/website_retail/models.d.ts +3 -0
- package/dist/modules/website_retail/models.d.ts.map +1 -0
- package/dist/modules/website_retail/models.js +50 -0
- package/dist/modules/website_retail/models.js.map +1 -0
- package/dist/modules/website_retail/sections.d.ts +3 -0
- package/dist/modules/website_retail/sections.d.ts.map +1 -0
- package/dist/modules/website_retail/sections.js +11 -0
- package/dist/modules/website_retail/sections.js.map +1 -0
- package/dist/modules/website_search/client/search.d.mts +6 -0
- package/dist/modules/website_search/client/search.d.mts.map +1 -0
- package/dist/modules/website_search/client/search.mjs +25 -0
- package/dist/modules/website_search/client/search.mjs.map +1 -0
- package/dist/modules/website_search/fills.d.ts +3 -0
- package/dist/modules/website_search/fills.d.ts.map +1 -0
- package/dist/modules/website_search/fills.js +5 -0
- package/dist/modules/website_search/fills.js.map +1 -0
- package/dist/modules/website_search/index.d.ts +3 -0
- package/dist/modules/website_search/index.d.ts.map +1 -0
- package/dist/modules/website_search/index.js +28 -0
- package/dist/modules/website_search/index.js.map +1 -0
- package/dist/modules/website_search/islands.d.ts +7 -0
- package/dist/modules/website_search/islands.d.ts.map +1 -0
- package/dist/modules/website_search/islands.js +23 -0
- package/dist/modules/website_search/islands.js.map +1 -0
- package/dist/modules/website_seo/extend.d.ts +7 -0
- package/dist/modules/website_seo/extend.d.ts.map +1 -0
- package/dist/modules/website_seo/extend.js +20 -0
- package/dist/modules/website_seo/extend.js.map +1 -0
- package/dist/modules/website_seo/fills.d.ts +3 -0
- package/dist/modules/website_seo/fills.d.ts.map +1 -0
- package/dist/modules/website_seo/fills.js +8 -0
- package/dist/modules/website_seo/fills.js.map +1 -0
- package/dist/modules/website_seo/index.d.ts +3 -0
- package/dist/modules/website_seo/index.d.ts.map +1 -0
- package/dist/modules/website_seo/index.js +30 -0
- package/dist/modules/website_seo/index.js.map +1 -0
- package/dist/modules/website_seo/views.d.ts +3 -0
- package/dist/modules/website_seo/views.d.ts.map +1 -0
- package/dist/modules/website_seo/views.js +5 -0
- package/dist/modules/website_seo/views.js.map +1 -0
- package/dist/themes/default/index.d.ts +3 -0
- package/dist/themes/default/index.d.ts.map +1 -0
- package/dist/themes/default/index.js +16 -0
- package/dist/themes/default/index.js.map +1 -0
- package/dist/themes/default/templates/layout.ktl +7 -0
- package/dist/themes/default/templates/product.detail.ktl +10 -0
- package/dist/themes/default/templates/product.related_row.ktl +1 -0
- package/dist/themes/hospitality/assets/theme.css +109 -0
- package/dist/themes/hospitality/index.d.ts +3 -0
- package/dist/themes/hospitality/index.d.ts.map +1 -0
- package/dist/themes/hospitality/index.js +26 -0
- package/dist/themes/hospitality/index.js.map +1 -0
- package/dist/themes/hospitality/templates/layout.ktl +17 -0
- package/dist/themes/hospitality/templates/menu.item.ktl +1 -0
- package/dist/themes/hospitality/templates/menu.primary.ktl +1 -0
- package/dist/themes/hospitality/templates/website.hero.ktl +6 -0
- package/dist/themes/hospitality/templates/website.page.ktl +1 -0
- package/dist/themes/hospitality/templates/website.rich_text.ktl +3 -0
- package/dist/themes/hospitality/templates/website_form.form.ktl +1 -0
- package/dist/themes/hospitality/templates/website_hospitality.booking.ktl +1 -0
- package/dist/themes/hospitality/templates/website_hospitality.stays.ktl +1 -0
- package/dist/themes/hospitality/tokens.d.ts +2 -0
- package/dist/themes/hospitality/tokens.d.ts.map +1 -0
- package/dist/themes/hospitality/tokens.js +9 -0
- package/dist/themes/hospitality/tokens.js.map +1 -0
- package/dist/themes/paper/index.d.ts +9 -0
- package/dist/themes/paper/index.d.ts.map +1 -0
- package/dist/themes/paper/index.js +30 -0
- package/dist/themes/paper/index.js.map +1 -0
- package/dist/themes/paper/templates/layout.ktl +14 -0
- package/dist/themes/paper/templates/menu.item.ktl +3 -0
- package/dist/themes/paper/templates/menu.primary.ktl +3 -0
- package/dist/themes/paper/templates/website.hero.ktl +6 -0
- package/dist/themes/paper/templates/website.page.ktl +2 -0
- package/dist/themes/paper/templates/website.rich_text.ktl +4 -0
- package/dist/themes/paper/tokens.d.ts +2 -0
- package/dist/themes/paper/tokens.d.ts.map +1 -0
- package/dist/themes/paper/tokens.js +11 -0
- package/dist/themes/paper/tokens.js.map +1 -0
- package/dist/themes/retail/assets/theme.css +114 -0
- package/dist/themes/retail/index.d.ts +3 -0
- package/dist/themes/retail/index.d.ts.map +1 -0
- package/dist/themes/retail/index.js +26 -0
- package/dist/themes/retail/index.js.map +1 -0
- package/dist/themes/retail/templates/layout.ktl +5 -0
- package/dist/themes/retail/templates/menu.item.ktl +1 -0
- package/dist/themes/retail/templates/menu.primary.ktl +1 -0
- package/dist/themes/retail/templates/website.hero.ktl +1 -0
- package/dist/themes/retail/templates/website.page.ktl +1 -0
- package/dist/themes/retail/templates/website.rich_text.ktl +1 -0
- package/dist/themes/retail/templates/website_form.form.ktl +1 -0
- package/dist/themes/retail/templates/website_retail.cart.ktl +1 -0
- package/dist/themes/retail/templates/website_retail.products.ktl +1 -0
- package/dist/themes/retail/tokens.d.ts +2 -0
- package/dist/themes/retail/tokens.d.ts.map +1 -0
- package/dist/themes/retail/tokens.js +9 -0
- package/dist/themes/retail/tokens.js.map +1 -0
- package/dist/ui/actions.d.ts +38 -0
- package/dist/ui/actions.d.ts.map +1 -0
- package/dist/ui/actions.js +20 -0
- package/dist/ui/actions.js.map +1 -0
- package/dist/ui/activity.d.ts +4 -0
- package/dist/ui/activity.d.ts.map +1 -0
- package/dist/ui/activity.js +73 -0
- package/dist/ui/activity.js.map +1 -0
- package/dist/ui/attachments.d.ts +18 -0
- package/dist/ui/attachments.d.ts.map +1 -0
- package/dist/ui/attachments.js +15 -0
- package/dist/ui/attachments.js.map +1 -0
- package/dist/ui/auth.d.ts +9 -0
- package/dist/ui/auth.d.ts.map +1 -0
- package/dist/ui/auth.js +44 -0
- package/dist/ui/auth.js.map +1 -0
- package/dist/ui/calendar.d.ts +4 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +51 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/chrome.d.ts +66 -0
- package/dist/ui/chrome.d.ts.map +1 -0
- package/dist/ui/chrome.js +39 -0
- package/dist/ui/chrome.js.map +1 -0
- package/dist/ui/client/activity-view.d.mts +12 -0
- package/dist/ui/client/activity-view.d.mts.map +1 -0
- package/dist/ui/client/activity-view.mjs +393 -0
- package/dist/ui/client/activity-view.mjs.map +1 -0
- package/dist/ui/client/activity.css +269 -0
- package/dist/ui/client/activity.d.mts +11 -0
- package/dist/ui/client/activity.d.mts.map +1 -0
- package/dist/ui/client/activity.mjs +10 -0
- package/dist/ui/client/activity.mjs.map +1 -0
- package/dist/ui/client/calendar-view.d.mts +5 -0
- package/dist/ui/client/calendar-view.d.mts.map +1 -0
- package/dist/ui/client/calendar-view.mjs +266 -0
- package/dist/ui/client/calendar-view.mjs.map +1 -0
- package/dist/ui/client/calendar.css +170 -0
- package/dist/ui/client/calendar.d.mts +6 -0
- package/dist/ui/client/calendar.d.mts.map +1 -0
- package/dist/ui/client/calendar.mjs +6 -0
- package/dist/ui/client/calendar.mjs.map +1 -0
- package/dist/ui/client/mail-view.d.mts +9 -0
- package/dist/ui/client/mail-view.d.mts.map +1 -0
- package/dist/ui/client/mail-view.mjs +350 -0
- package/dist/ui/client/mail-view.mjs.map +1 -0
- package/dist/ui/client/mail.css +230 -0
- package/dist/ui/client/mail.d.mts +11 -0
- package/dist/ui/client/mail.d.mts.map +1 -0
- package/dist/ui/client/mail.mjs +10 -0
- package/dist/ui/client/mail.mjs.map +1 -0
- package/dist/ui/data.d.ts +25 -0
- package/dist/ui/data.d.ts.map +1 -0
- package/dist/ui/data.js +23 -0
- package/dist/ui/data.js.map +1 -0
- package/dist/ui/date-picker.d.ts +36 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +40 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/form.d.ts +67 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +75 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/format.d.ts +4 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/format.js +33 -0
- package/dist/ui/format.js.map +1 -0
- package/dist/ui/hooks.d.ts +5 -0
- package/dist/ui/hooks.d.ts.map +1 -0
- package/dist/ui/hooks.js +82 -0
- package/dist/ui/hooks.js.map +1 -0
- package/dist/ui/icons.d.ts +12 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/icons.js +76 -0
- package/dist/ui/icons.js.map +1 -0
- package/dist/ui/index.d.ts +39 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +39 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout.d.ts +80 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +86 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/mail.d.ts +5 -0
- package/dist/ui/mail.d.ts.map +1 -0
- package/dist/ui/mail.js +69 -0
- package/dist/ui/mail.js.map +1 -0
- package/dist/ui/media.d.ts +42 -0
- package/dist/ui/media.d.ts.map +1 -0
- package/dist/ui/media.js +48 -0
- package/dist/ui/media.js.map +1 -0
- package/dist/ui/modal.d.ts +9 -0
- package/dist/ui/modal.d.ts.map +1 -0
- package/dist/ui/modal.js +13 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/nav.d.ts +34 -0
- package/dist/ui/nav.d.ts.map +1 -0
- package/dist/ui/nav.js +77 -0
- package/dist/ui/nav.js.map +1 -0
- package/dist/ui/navigation.d.ts +22 -0
- package/dist/ui/navigation.d.ts.map +1 -0
- package/dist/ui/navigation.js +9 -0
- package/dist/ui/navigation.js.map +1 -0
- package/dist/ui/primitives.d.ts +61 -0
- package/dist/ui/primitives.d.ts.map +1 -0
- package/dist/ui/primitives.js +74 -0
- package/dist/ui/primitives.js.map +1 -0
- package/dist/ui/record.d.ts +44 -0
- package/dist/ui/record.d.ts.map +1 -0
- package/dist/ui/record.js +39 -0
- package/dist/ui/record.js.map +1 -0
- package/dist/ui/schedule.d.ts +34 -0
- package/dist/ui/schedule.d.ts.map +1 -0
- package/dist/ui/schedule.js +39 -0
- package/dist/ui/schedule.js.map +1 -0
- package/dist/ui/state.d.ts +19 -0
- package/dist/ui/state.d.ts.map +1 -0
- package/dist/ui/state.js +34 -0
- package/dist/ui/state.js.map +1 -0
- package/dist/ui/surfaces.d.ts +38 -0
- package/dist/ui/surfaces.d.ts.map +1 -0
- package/dist/ui/surfaces.js +36 -0
- package/dist/ui/surfaces.js.map +1 -0
- package/dist/ui/table.d.ts +48 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +53 -0
- package/dist/ui/table.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,1562 @@
|
|
|
1
|
+
import { asc, defineFn, eq, from } from '@ketvietlab/ketjs';
|
|
2
|
+
import { BILLING_MODES, BOOKING_PROVIDERS, BOOKING_TYPES, DOCUMENT_TYPES, GENDERS, OCR_STATES, } from './types.js';
|
|
3
|
+
import { dateKeyIn } from './calendar.js';
|
|
4
|
+
import { defaultRatePlan, InventoryConflict, occupancyDates, quoteAvailability, recordInventoryChange, releaseInventory, replaceReservedInventory, reserveInventory, restrictionIssues, } from './inventory.js';
|
|
5
|
+
import { postCharge } from './services.js';
|
|
6
|
+
import { initializeRecurringRent } from './night-audit.js';
|
|
7
|
+
const issue = (field, code, params) => ({
|
|
8
|
+
field,
|
|
9
|
+
code,
|
|
10
|
+
messageKey: `hospitality_core.validation.${code}`,
|
|
11
|
+
...(params ? { params } : {}),
|
|
12
|
+
});
|
|
13
|
+
const success = (id, extra = {}) => ({
|
|
14
|
+
ok: true,
|
|
15
|
+
id: String(id),
|
|
16
|
+
errors: [],
|
|
17
|
+
...extra,
|
|
18
|
+
});
|
|
19
|
+
const failure = (...errors) => ({ ok: false, errors });
|
|
20
|
+
const oneOf = (values, value) => values.includes(String(value));
|
|
21
|
+
const text = (value) => String(value ?? '').trim();
|
|
22
|
+
const date = (value) => {
|
|
23
|
+
const parsed = new Date(String(value ?? ''));
|
|
24
|
+
return Number.isFinite(parsed.getTime()) ? parsed : null;
|
|
25
|
+
};
|
|
26
|
+
const record = async (ctx, model, id) => {
|
|
27
|
+
const table = ctx.table(model);
|
|
28
|
+
return ctx.db.one(from(table).where(eq(table.id, id)));
|
|
29
|
+
};
|
|
30
|
+
const calendarDays = (start, end, timezone) => {
|
|
31
|
+
const a = Date.parse(`${dateKeyIn(start, timezone)}T00:00:00Z`);
|
|
32
|
+
const b = Date.parse(`${dateKeyIn(end, timezone)}T00:00:00Z`);
|
|
33
|
+
return Math.round((b - a) / 86_400_000);
|
|
34
|
+
};
|
|
35
|
+
const scheduleOf = (bookingType, checkInValue, checkOutValue, rateValue, timezone) => {
|
|
36
|
+
const errors = [];
|
|
37
|
+
if (!oneOf(BOOKING_TYPES, bookingType))
|
|
38
|
+
errors.push(issue('bookingType', 'booking_type'));
|
|
39
|
+
const checkIn = date(checkInValue);
|
|
40
|
+
const checkOut = date(checkOutValue);
|
|
41
|
+
if (!checkIn)
|
|
42
|
+
errors.push(issue('checkIn', 'datetime'));
|
|
43
|
+
if (!checkOut)
|
|
44
|
+
errors.push(issue('checkOut', 'datetime'));
|
|
45
|
+
if (checkIn && checkOut && checkOut <= checkIn)
|
|
46
|
+
errors.push(issue('checkOut', 'schedule_order'));
|
|
47
|
+
const rate = Number(rateValue ?? 0);
|
|
48
|
+
if (!Number.isFinite(rate) || rate < 0)
|
|
49
|
+
errors.push(issue('rate', 'non_negative'));
|
|
50
|
+
if (errors.length || !checkIn || !checkOut)
|
|
51
|
+
return { errors };
|
|
52
|
+
const hours = (checkOut.getTime() - checkIn.getTime()) / 3_600_000;
|
|
53
|
+
const nights = calendarDays(checkIn, checkOut, timezone);
|
|
54
|
+
let quantity = nights;
|
|
55
|
+
if (bookingType === 'hourly')
|
|
56
|
+
quantity = Math.ceil(hours);
|
|
57
|
+
if (bookingType === 'weekly') {
|
|
58
|
+
if (nights < 7)
|
|
59
|
+
errors.push(issue('checkOut', 'weekly_minimum'));
|
|
60
|
+
quantity = Math.ceil(nights / 7);
|
|
61
|
+
}
|
|
62
|
+
if (bookingType === 'monthly') {
|
|
63
|
+
if (nights < 30)
|
|
64
|
+
errors.push(issue('checkOut', 'monthly_minimum'));
|
|
65
|
+
quantity = Math.ceil(nights / 30);
|
|
66
|
+
}
|
|
67
|
+
if (bookingType === 'nightly' && nights < 1)
|
|
68
|
+
errors.push(issue('checkOut', 'nightly_minimum'));
|
|
69
|
+
if (bookingType === 'hourly' && hours < 1)
|
|
70
|
+
errors.push(issue('checkOut', 'hourly_minimum'));
|
|
71
|
+
if (errors.length)
|
|
72
|
+
return { errors };
|
|
73
|
+
return {
|
|
74
|
+
errors: [],
|
|
75
|
+
schedule: {
|
|
76
|
+
checkIn: checkIn.toISOString(),
|
|
77
|
+
checkOut: checkOut.toISOString(),
|
|
78
|
+
quantity: String(quantity),
|
|
79
|
+
amountTotal: String(quantity * rate),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const overlaps = (startA, endA, startB, endB) => {
|
|
84
|
+
const a = date(startA);
|
|
85
|
+
const b = date(endA);
|
|
86
|
+
return !!a && !!b && a < endB && b > startB;
|
|
87
|
+
};
|
|
88
|
+
class TransitionConflict extends Error {
|
|
89
|
+
problem;
|
|
90
|
+
constructor(problem) {
|
|
91
|
+
super(problem.code);
|
|
92
|
+
this.problem = problem;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const transition = async (run) => {
|
|
96
|
+
try {
|
|
97
|
+
return await run();
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error instanceof TransitionConflict)
|
|
101
|
+
return failure(error.problem);
|
|
102
|
+
if (error instanceof InventoryConflict)
|
|
103
|
+
return failure(error.problem);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const planReservation = async (ctx, args) => {
|
|
108
|
+
const property = await record(ctx, 'hospitality_core.Property', args.propertyId);
|
|
109
|
+
const roomType = await record(ctx, 'hospitality_core.RoomType', args.roomTypeId);
|
|
110
|
+
const bookingType = String(args.bookingType ?? 'nightly');
|
|
111
|
+
const billingMode = String(args.billingMode ?? (bookingType === 'weekly' || bookingType === 'monthly' ? 'recurring' : 'upfront'));
|
|
112
|
+
const ratePlan = roomType ? await defaultRatePlan(ctx, args.roomTypeId, bookingType) : null;
|
|
113
|
+
const rate = String(args.rate ?? ratePlan?.amount ?? roomType?.baseRate ?? '0');
|
|
114
|
+
const calculated = scheduleOf(bookingType, args.checkIn, args.checkOut, rate, String(property?.timezone ?? 'UTC'));
|
|
115
|
+
const errors = [...calculated.errors];
|
|
116
|
+
if (!property)
|
|
117
|
+
errors.push(issue('propertyId', 'property_missing'));
|
|
118
|
+
if (!roomType)
|
|
119
|
+
errors.push(issue('roomTypeId', 'room_type_missing'));
|
|
120
|
+
else if (roomType.propertyId !== args.propertyId)
|
|
121
|
+
errors.push(issue('roomTypeId', 'property_mismatch'));
|
|
122
|
+
if (!oneOf(BILLING_MODES, billingMode))
|
|
123
|
+
errors.push(issue('billingMode', 'billing_mode'));
|
|
124
|
+
if (Number(args.adults ?? 1) < 1)
|
|
125
|
+
errors.push(issue('adults', 'positive'));
|
|
126
|
+
if (Number(args.children ?? 0) < 0)
|
|
127
|
+
errors.push(issue('children', 'non_negative'));
|
|
128
|
+
if (calculated.schedule && ratePlan) {
|
|
129
|
+
const quantity = Number(calculated.schedule.quantity);
|
|
130
|
+
if (Number(ratePlan.minStay) > 0 && quantity < Number(ratePlan.minStay))
|
|
131
|
+
errors.push(issue('checkOut', 'rate_plan_min_stay', {
|
|
132
|
+
count: ratePlan.minStay,
|
|
133
|
+
actual: quantity,
|
|
134
|
+
}));
|
|
135
|
+
if (Number(ratePlan.maxStay) > 0 && quantity > Number(ratePlan.maxStay))
|
|
136
|
+
errors.push(issue('checkOut', 'rate_plan_max_stay', {
|
|
137
|
+
count: ratePlan.maxStay,
|
|
138
|
+
actual: quantity,
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
const inventoryDates = calculated.schedule && bookingType !== 'hourly'
|
|
142
|
+
? occupancyDates(calculated.schedule.checkIn, calculated.schedule.checkOut, String(property?.timezone ?? 'UTC'))
|
|
143
|
+
: [];
|
|
144
|
+
if (inventoryDates.length > 366)
|
|
145
|
+
errors.push(issue('checkOut', 'inventory_horizon', { count: 366 }));
|
|
146
|
+
let minimumAvailable;
|
|
147
|
+
if (property && roomType && roomType.propertyId === args.propertyId && calculated.schedule) {
|
|
148
|
+
if (inventoryDates.length) {
|
|
149
|
+
errors.push(...(await restrictionIssues(ctx, args.propertyId, args.roomTypeId, inventoryDates, dateKeyIn(new Date(calculated.schedule.checkOut), String(property.timezone ?? 'UTC')))));
|
|
150
|
+
const availability = await quoteAvailability(ctx, args.propertyId, args.roomTypeId, inventoryDates);
|
|
151
|
+
minimumAvailable = availability.minimumAvailable;
|
|
152
|
+
errors.push(...availability.errors);
|
|
153
|
+
}
|
|
154
|
+
else if (bookingType === 'hourly') {
|
|
155
|
+
minimumAvailable = (await quoteAvailability(ctx, args.propertyId, args.roomTypeId, [])).minimumAvailable;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
property,
|
|
160
|
+
roomType,
|
|
161
|
+
bookingType,
|
|
162
|
+
billingMode,
|
|
163
|
+
ratePlan,
|
|
164
|
+
rate,
|
|
165
|
+
schedule: calculated.schedule,
|
|
166
|
+
inventoryDates,
|
|
167
|
+
minimumAvailable,
|
|
168
|
+
errors,
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
const reservationOutput = {
|
|
172
|
+
id: 'id',
|
|
173
|
+
code: 'text',
|
|
174
|
+
propertyId: 'id',
|
|
175
|
+
roomTypeId: 'id',
|
|
176
|
+
folioId: 'id',
|
|
177
|
+
stayId: 'id?',
|
|
178
|
+
partnerId: 'id',
|
|
179
|
+
provider: 'text',
|
|
180
|
+
externalId: 'text?',
|
|
181
|
+
channelRef: 'text?',
|
|
182
|
+
bookingType: 'text',
|
|
183
|
+
checkIn: 'datetime',
|
|
184
|
+
checkOut: 'datetime',
|
|
185
|
+
adults: 'int',
|
|
186
|
+
children: 'int',
|
|
187
|
+
rate: 'decimal',
|
|
188
|
+
quantity: 'decimal',
|
|
189
|
+
billingMode: 'text',
|
|
190
|
+
amountTotal: 'decimal',
|
|
191
|
+
state: 'text',
|
|
192
|
+
cancelReason: 'text?',
|
|
193
|
+
noShowAt: 'datetime?',
|
|
194
|
+
noShowReason: 'text?',
|
|
195
|
+
createdAt: 'datetime',
|
|
196
|
+
updatedAt: 'datetime',
|
|
197
|
+
partner: 'json?',
|
|
198
|
+
roomType: 'json?',
|
|
199
|
+
stay: 'json?',
|
|
200
|
+
folio: 'json?',
|
|
201
|
+
};
|
|
202
|
+
const stayOutput = {
|
|
203
|
+
id: 'id',
|
|
204
|
+
code: 'text',
|
|
205
|
+
folioId: 'id',
|
|
206
|
+
reservationId: 'id?',
|
|
207
|
+
partnerId: 'id',
|
|
208
|
+
propertyId: 'id',
|
|
209
|
+
roomTypeId: 'id',
|
|
210
|
+
currentRoomId: 'id?',
|
|
211
|
+
bookingType: 'text',
|
|
212
|
+
checkIn: 'datetime',
|
|
213
|
+
checkOut: 'datetime',
|
|
214
|
+
adults: 'int',
|
|
215
|
+
children: 'int',
|
|
216
|
+
billingMode: 'text',
|
|
217
|
+
rate: 'decimal',
|
|
218
|
+
nextBillDate: 'date?',
|
|
219
|
+
state: 'text',
|
|
220
|
+
checkedInAt: 'datetime?',
|
|
221
|
+
checkedOutAt: 'datetime?',
|
|
222
|
+
noShowAt: 'datetime?',
|
|
223
|
+
partner: 'json?',
|
|
224
|
+
roomType: 'json?',
|
|
225
|
+
currentRoom: 'json?',
|
|
226
|
+
reservation: 'json?',
|
|
227
|
+
assignments: 'json?',
|
|
228
|
+
guests: 'json?',
|
|
229
|
+
};
|
|
230
|
+
const reservationQuoteEffects = [
|
|
231
|
+
'read:hospitality_core.Property',
|
|
232
|
+
'read:hospitality_core.RoomType',
|
|
233
|
+
'read:hospitality_core.Room',
|
|
234
|
+
'read:hospitality_core.RatePlan',
|
|
235
|
+
'read:hospitality_core.Restriction',
|
|
236
|
+
'read:hospitality_core.AvailabilityLedger',
|
|
237
|
+
];
|
|
238
|
+
const bookingEffects = [
|
|
239
|
+
...reservationQuoteEffects,
|
|
240
|
+
'read:partner.Partner',
|
|
241
|
+
'read:hospitality_core.Reservation',
|
|
242
|
+
'write:hospitality_core.Folio',
|
|
243
|
+
'write:hospitality_core.Reservation',
|
|
244
|
+
'write:hospitality_core.Stay',
|
|
245
|
+
'write:hospitality_core.Charge',
|
|
246
|
+
'write:hospitality_core.StayGuest',
|
|
247
|
+
'write:hospitality_core.AvailabilityLedger',
|
|
248
|
+
'write:hospitality_core.InventoryChange',
|
|
249
|
+
];
|
|
250
|
+
const voidPostedCharge = async (ctx, args) => {
|
|
251
|
+
const reason = text(args.reason);
|
|
252
|
+
if (!reason)
|
|
253
|
+
return failure(issue('reason', 'required'));
|
|
254
|
+
const voidedAt = date(args.voidedAt)?.toISOString() ?? new Date().toISOString();
|
|
255
|
+
for (let attempt = 0; attempt < 5; attempt++) {
|
|
256
|
+
try {
|
|
257
|
+
return await ctx.tx(async (tx) => {
|
|
258
|
+
const charge = await record(tx, 'hospitality_core.Charge', args.id);
|
|
259
|
+
if (!charge)
|
|
260
|
+
return failure(issue('id', 'charge_missing'));
|
|
261
|
+
if (charge.folioId !== args.folioId)
|
|
262
|
+
return failure(issue('folioId', 'folio_mismatch'));
|
|
263
|
+
if (charge.state === 'void')
|
|
264
|
+
return success(charge.id, { amount: charge.amount, existing: true });
|
|
265
|
+
if (charge.state !== 'active')
|
|
266
|
+
return failure(issue('id', 'charge_not_active'));
|
|
267
|
+
const folio = await record(tx, 'hospitality_core.Folio', charge.folioId);
|
|
268
|
+
if (!folio)
|
|
269
|
+
return failure(issue('folioId', 'folio_missing'));
|
|
270
|
+
if (folio.state !== 'open')
|
|
271
|
+
return failure(issue('folioId', 'folio_not_open'));
|
|
272
|
+
const nextTotal = String(Number(folio.amountTotal) - Number(charge.amount));
|
|
273
|
+
const changedFolio = await tx.db.compareAndSet('hospitality_core.Folio', { id: folio.id }, { state: 'open', version: folio.version }, { amountTotal: nextTotal, version: Number(folio.version) + 1 });
|
|
274
|
+
if (!('dryRun' in changedFolio) && !changedFolio.matched)
|
|
275
|
+
throw new TransitionConflict(issue('folioId', 'transition_conflict'));
|
|
276
|
+
const changedCharge = await tx.db.compareAndSet('hospitality_core.Charge', { id: charge.id }, { state: 'active' }, { state: 'void', voidedAt, voidReason: reason });
|
|
277
|
+
if (!('dryRun' in changedCharge) && !changedCharge.matched)
|
|
278
|
+
throw new TransitionConflict(issue('id', 'transition_conflict'));
|
|
279
|
+
return success(charge.id, { amount: charge.amount, amountTotal: nextTotal, existing: false });
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
if (!(error instanceof TransitionConflict))
|
|
284
|
+
throw error;
|
|
285
|
+
if (attempt === 4)
|
|
286
|
+
return failure(error.problem);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return failure(issue('id', 'transition_conflict'));
|
|
290
|
+
};
|
|
291
|
+
export const operations = {
|
|
292
|
+
quoteReservation: defineFn({
|
|
293
|
+
input: {
|
|
294
|
+
propertyId: 'id',
|
|
295
|
+
roomTypeId: 'id',
|
|
296
|
+
bookingType: 'text?',
|
|
297
|
+
checkIn: 'datetime',
|
|
298
|
+
checkOut: 'datetime',
|
|
299
|
+
adults: 'int?',
|
|
300
|
+
children: 'int?',
|
|
301
|
+
rate: 'decimal?',
|
|
302
|
+
billingMode: 'text?',
|
|
303
|
+
},
|
|
304
|
+
output: {
|
|
305
|
+
ok: 'bool',
|
|
306
|
+
propertyId: 'id?',
|
|
307
|
+
roomTypeId: 'id?',
|
|
308
|
+
ratePlanId: 'id?',
|
|
309
|
+
bookingType: 'text?',
|
|
310
|
+
billingMode: 'text?',
|
|
311
|
+
checkIn: 'datetime?',
|
|
312
|
+
checkOut: 'datetime?',
|
|
313
|
+
rate: 'decimal?',
|
|
314
|
+
quantity: 'decimal?',
|
|
315
|
+
amountTotal: 'decimal?',
|
|
316
|
+
minimumAvailable: 'int?',
|
|
317
|
+
errors: 'json?',
|
|
318
|
+
},
|
|
319
|
+
effects: reservationQuoteEffects,
|
|
320
|
+
agent: true,
|
|
321
|
+
handler: async (ctx, args) => {
|
|
322
|
+
const plan = await planReservation(ctx, args);
|
|
323
|
+
if (plan.errors.length || !plan.schedule)
|
|
324
|
+
return failure(...plan.errors);
|
|
325
|
+
return {
|
|
326
|
+
ok: true,
|
|
327
|
+
propertyId: String(args.propertyId),
|
|
328
|
+
roomTypeId: String(args.roomTypeId),
|
|
329
|
+
ratePlanId: plan.ratePlan?.id,
|
|
330
|
+
bookingType: plan.bookingType,
|
|
331
|
+
billingMode: plan.billingMode,
|
|
332
|
+
checkIn: plan.schedule.checkIn,
|
|
333
|
+
checkOut: plan.schedule.checkOut,
|
|
334
|
+
rate: plan.rate,
|
|
335
|
+
quantity: plan.schedule.quantity,
|
|
336
|
+
amountTotal: plan.schedule.amountTotal,
|
|
337
|
+
minimumAvailable: plan.minimumAvailable,
|
|
338
|
+
errors: [],
|
|
339
|
+
};
|
|
340
|
+
},
|
|
341
|
+
}),
|
|
342
|
+
createReservation: defineFn({
|
|
343
|
+
input: {
|
|
344
|
+
id: 'id',
|
|
345
|
+
code: 'text?',
|
|
346
|
+
propertyId: 'id',
|
|
347
|
+
roomTypeId: 'id',
|
|
348
|
+
partnerId: 'id',
|
|
349
|
+
provider: 'text?',
|
|
350
|
+
externalId: 'text?',
|
|
351
|
+
channelRef: 'text?',
|
|
352
|
+
bookingType: 'text?',
|
|
353
|
+
checkIn: 'datetime',
|
|
354
|
+
checkOut: 'datetime',
|
|
355
|
+
adults: 'int?',
|
|
356
|
+
children: 'int?',
|
|
357
|
+
rate: 'decimal?',
|
|
358
|
+
billingMode: 'text?',
|
|
359
|
+
createdAt: 'datetime?',
|
|
360
|
+
},
|
|
361
|
+
output: { ok: 'bool', id: 'id?', folioId: 'id?', stayId: 'id?', existing: 'bool?', errors: 'json?' },
|
|
362
|
+
effects: bookingEffects,
|
|
363
|
+
idempotent: true,
|
|
364
|
+
agent: true,
|
|
365
|
+
handler: async (ctx, args) => {
|
|
366
|
+
const existing = await record(ctx, 'hospitality_core.Reservation', args.id);
|
|
367
|
+
if (existing)
|
|
368
|
+
return success(existing.id, {
|
|
369
|
+
folioId: existing.folioId,
|
|
370
|
+
stayId: existing.stayId,
|
|
371
|
+
existing: true,
|
|
372
|
+
});
|
|
373
|
+
const partner = await record(ctx, 'partner.Partner', args.partnerId);
|
|
374
|
+
const provider = String(args.provider ?? 'direct');
|
|
375
|
+
const plan = await planReservation(ctx, args);
|
|
376
|
+
const errors = [...plan.errors];
|
|
377
|
+
if (!partner)
|
|
378
|
+
errors.push(issue('partnerId', 'partner_missing'));
|
|
379
|
+
if (!oneOf(BOOKING_PROVIDERS, provider))
|
|
380
|
+
errors.push(issue('provider', 'booking_provider'));
|
|
381
|
+
if (args.externalId) {
|
|
382
|
+
const R = ctx.table('hospitality_core.Reservation');
|
|
383
|
+
const duplicate = await ctx.db.one(from(R).where(eq(R.propertyId, args.propertyId), eq(R.provider, provider), eq(R.externalId, args.externalId)));
|
|
384
|
+
if (duplicate)
|
|
385
|
+
errors.push(issue('externalId', 'provider_external_unique'));
|
|
386
|
+
}
|
|
387
|
+
if (errors.length || !plan.schedule)
|
|
388
|
+
return failure(...errors);
|
|
389
|
+
const schedule = plan.schedule;
|
|
390
|
+
const now = date(args.createdAt)?.toISOString() ?? new Date().toISOString();
|
|
391
|
+
const folioId = `${String(args.id)}:folio`;
|
|
392
|
+
const stayId = `${String(args.id)}:stay`;
|
|
393
|
+
const chargeId = `${String(args.id)}:room`;
|
|
394
|
+
const guestId = `${String(args.id)}:guest`;
|
|
395
|
+
const code = text(args.code) || String(args.id).toUpperCase();
|
|
396
|
+
const state = 'confirmed';
|
|
397
|
+
const initialFolioTotal = plan.billingMode === 'upfront' ? schedule.amountTotal : '0';
|
|
398
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
399
|
+
if (plan.inventoryDates.length)
|
|
400
|
+
await reserveInventory(tx, args.propertyId, args.roomTypeId, plan.inventoryDates);
|
|
401
|
+
if (plan.inventoryDates.length)
|
|
402
|
+
await recordInventoryChange(tx, {
|
|
403
|
+
propertyId: args.propertyId,
|
|
404
|
+
roomTypeId: args.roomTypeId,
|
|
405
|
+
kind: 'availability',
|
|
406
|
+
dateFrom: plan.inventoryDates[0],
|
|
407
|
+
dateTo: plan.inventoryDates.at(-1),
|
|
408
|
+
aggregateId: args.id,
|
|
409
|
+
});
|
|
410
|
+
await tx.db.insert('hospitality_core.Folio', {
|
|
411
|
+
id: folioId,
|
|
412
|
+
code: `F-${code}`,
|
|
413
|
+
propertyId: args.propertyId,
|
|
414
|
+
partnerId: args.partnerId,
|
|
415
|
+
state: 'open',
|
|
416
|
+
amountTotal: initialFolioTotal,
|
|
417
|
+
version: 0,
|
|
418
|
+
openedAt: now,
|
|
419
|
+
});
|
|
420
|
+
await tx.db.insert('hospitality_core.Reservation', {
|
|
421
|
+
id: args.id,
|
|
422
|
+
code,
|
|
423
|
+
propertyId: args.propertyId,
|
|
424
|
+
roomTypeId: args.roomTypeId,
|
|
425
|
+
folioId,
|
|
426
|
+
partnerId: args.partnerId,
|
|
427
|
+
provider,
|
|
428
|
+
externalId: args.externalId,
|
|
429
|
+
channelRef: args.channelRef,
|
|
430
|
+
bookingType: plan.bookingType,
|
|
431
|
+
checkIn: schedule.checkIn,
|
|
432
|
+
checkOut: schedule.checkOut,
|
|
433
|
+
adults: Number(args.adults ?? 1),
|
|
434
|
+
children: Number(args.children ?? 0),
|
|
435
|
+
rate: plan.rate,
|
|
436
|
+
quantity: schedule.quantity,
|
|
437
|
+
billingMode: plan.billingMode,
|
|
438
|
+
amountTotal: schedule.amountTotal,
|
|
439
|
+
state,
|
|
440
|
+
createdAt: now,
|
|
441
|
+
updatedAt: now,
|
|
442
|
+
});
|
|
443
|
+
await tx.db.insert('hospitality_core.Stay', {
|
|
444
|
+
id: stayId,
|
|
445
|
+
code: `S-${code}`,
|
|
446
|
+
folioId,
|
|
447
|
+
reservationId: args.id,
|
|
448
|
+
partnerId: args.partnerId,
|
|
449
|
+
propertyId: args.propertyId,
|
|
450
|
+
roomTypeId: args.roomTypeId,
|
|
451
|
+
bookingType: plan.bookingType,
|
|
452
|
+
checkIn: schedule.checkIn,
|
|
453
|
+
checkOut: schedule.checkOut,
|
|
454
|
+
adults: Number(args.adults ?? 1),
|
|
455
|
+
children: Number(args.children ?? 0),
|
|
456
|
+
billingMode: plan.billingMode,
|
|
457
|
+
rate: plan.rate,
|
|
458
|
+
state: 'draft',
|
|
459
|
+
});
|
|
460
|
+
await tx.db.update('hospitality_core.Reservation', { id: args.id }, { stayId });
|
|
461
|
+
await tx.db.insert('hospitality_core.StayGuest', {
|
|
462
|
+
id: guestId,
|
|
463
|
+
stayId,
|
|
464
|
+
propertyId: args.propertyId,
|
|
465
|
+
partnerId: args.partnerId,
|
|
466
|
+
displayName: partner.name,
|
|
467
|
+
primary: true,
|
|
468
|
+
primaryKey: 'primary',
|
|
469
|
+
});
|
|
470
|
+
if (plan.billingMode === 'upfront')
|
|
471
|
+
await tx.db.insert('hospitality_core.Charge', {
|
|
472
|
+
id: chargeId,
|
|
473
|
+
folioId,
|
|
474
|
+
stayId,
|
|
475
|
+
description: `room:${String(args.roomTypeId)}`,
|
|
476
|
+
type: 'room',
|
|
477
|
+
quantity: schedule.quantity,
|
|
478
|
+
unitPrice: plan.rate,
|
|
479
|
+
amount: schedule.amountTotal,
|
|
480
|
+
occurredAt: now,
|
|
481
|
+
sourceKey: `reservation:${String(args.id)}:room`,
|
|
482
|
+
state: 'active',
|
|
483
|
+
});
|
|
484
|
+
return success(args.id, { folioId, stayId, existing: false });
|
|
485
|
+
}));
|
|
486
|
+
},
|
|
487
|
+
}),
|
|
488
|
+
amendReservation: defineFn({
|
|
489
|
+
input: {
|
|
490
|
+
id: 'id',
|
|
491
|
+
roomTypeId: 'id',
|
|
492
|
+
partnerId: 'id',
|
|
493
|
+
checkIn: 'datetime',
|
|
494
|
+
checkOut: 'datetime',
|
|
495
|
+
adults: 'int',
|
|
496
|
+
children: 'int',
|
|
497
|
+
rate: 'decimal',
|
|
498
|
+
at: 'datetime?',
|
|
499
|
+
},
|
|
500
|
+
output: { ok: 'bool', id: 'id?', amountTotal: 'decimal?', errors: 'json?' },
|
|
501
|
+
effects: [
|
|
502
|
+
...reservationQuoteEffects,
|
|
503
|
+
'read:partner.Partner',
|
|
504
|
+
'read:hospitality_core.Reservation',
|
|
505
|
+
'read:hospitality_core.Stay',
|
|
506
|
+
'read:hospitality_core.StayGuest',
|
|
507
|
+
'read:hospitality_core.Folio',
|
|
508
|
+
'read:hospitality_core.Charge',
|
|
509
|
+
'write:hospitality_core.Reservation',
|
|
510
|
+
'write:hospitality_core.Stay',
|
|
511
|
+
'write:hospitality_core.StayGuest',
|
|
512
|
+
'write:hospitality_core.Folio',
|
|
513
|
+
'write:hospitality_core.Charge',
|
|
514
|
+
'write:hospitality_core.AvailabilityLedger',
|
|
515
|
+
'write:hospitality_core.InventoryChange',
|
|
516
|
+
],
|
|
517
|
+
idempotent: true,
|
|
518
|
+
agent: true,
|
|
519
|
+
handler: async (ctx, args) => {
|
|
520
|
+
const reservation = await record(ctx, 'hospitality_core.Reservation', args.id);
|
|
521
|
+
if (!reservation)
|
|
522
|
+
return failure(issue('id', 'reservation_missing'));
|
|
523
|
+
if (reservation.provider !== 'direct')
|
|
524
|
+
return failure(issue('provider', 'reservation_external_readonly'));
|
|
525
|
+
if (reservation.state !== 'confirmed')
|
|
526
|
+
return failure(issue('state', 'reservation_cannot_amend'));
|
|
527
|
+
const stay = reservation.stayId ? await record(ctx, 'hospitality_core.Stay', reservation.stayId) : null;
|
|
528
|
+
if (stay?.state !== 'draft')
|
|
529
|
+
return failure(issue('state', 'reservation_cannot_amend'));
|
|
530
|
+
const partner = await record(ctx, 'partner.Partner', args.partnerId);
|
|
531
|
+
const plan = await planReservation(ctx, {
|
|
532
|
+
...args,
|
|
533
|
+
propertyId: reservation.propertyId,
|
|
534
|
+
bookingType: reservation.bookingType,
|
|
535
|
+
billingMode: reservation.billingMode,
|
|
536
|
+
});
|
|
537
|
+
const errors = plan.errors.filter((problem) => problem.code !== 'no_availability');
|
|
538
|
+
if (!partner)
|
|
539
|
+
errors.push(issue('partnerId', 'partner_missing'));
|
|
540
|
+
if (errors.length || !plan.schedule)
|
|
541
|
+
return failure(...errors);
|
|
542
|
+
const property = plan.property;
|
|
543
|
+
const previousDates = reservation.bookingType === 'hourly'
|
|
544
|
+
? []
|
|
545
|
+
: occupancyDates(reservation.checkIn, reservation.checkOut, String(property.timezone ?? 'UTC'));
|
|
546
|
+
const at = date(args.at)?.toISOString() ?? new Date().toISOString();
|
|
547
|
+
const schedule = plan.schedule;
|
|
548
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
549
|
+
const claimed = await tx.db.compareAndSet('hospitality_core.Reservation', { id: reservation.id }, { state: 'confirmed', updatedAt: reservation.updatedAt }, { updatedAt: at });
|
|
550
|
+
if (!('matched' in claimed) || !claimed.matched)
|
|
551
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
552
|
+
await replaceReservedInventory(tx, reservation.propertyId, reservation.roomTypeId, previousDates, args.roomTypeId, plan.inventoryDates);
|
|
553
|
+
const inventoryChanged = reservation.roomTypeId !== args.roomTypeId ||
|
|
554
|
+
previousDates.join(',') !== plan.inventoryDates.join(',');
|
|
555
|
+
if (inventoryChanged && previousDates.length)
|
|
556
|
+
await recordInventoryChange(tx, {
|
|
557
|
+
propertyId: reservation.propertyId,
|
|
558
|
+
roomTypeId: reservation.roomTypeId,
|
|
559
|
+
kind: 'availability',
|
|
560
|
+
dateFrom: previousDates[0],
|
|
561
|
+
dateTo: previousDates.at(-1),
|
|
562
|
+
aggregateId: reservation.id,
|
|
563
|
+
});
|
|
564
|
+
if (inventoryChanged && plan.inventoryDates.length)
|
|
565
|
+
await recordInventoryChange(tx, {
|
|
566
|
+
propertyId: reservation.propertyId,
|
|
567
|
+
roomTypeId: args.roomTypeId,
|
|
568
|
+
kind: 'availability',
|
|
569
|
+
dateFrom: plan.inventoryDates[0],
|
|
570
|
+
dateTo: plan.inventoryDates.at(-1),
|
|
571
|
+
aggregateId: reservation.id,
|
|
572
|
+
});
|
|
573
|
+
const changedStay = await tx.db.compareAndSet('hospitality_core.Stay', { id: stay.id }, { state: 'draft' }, {
|
|
574
|
+
partnerId: args.partnerId,
|
|
575
|
+
roomTypeId: args.roomTypeId,
|
|
576
|
+
checkIn: schedule.checkIn,
|
|
577
|
+
checkOut: schedule.checkOut,
|
|
578
|
+
adults: Number(args.adults),
|
|
579
|
+
children: Number(args.children),
|
|
580
|
+
rate: plan.rate,
|
|
581
|
+
});
|
|
582
|
+
if (!('matched' in changedStay) || !changedStay.matched)
|
|
583
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
584
|
+
await tx.db.update('hospitality_core.Reservation', { id: reservation.id }, {
|
|
585
|
+
partnerId: args.partnerId,
|
|
586
|
+
roomTypeId: args.roomTypeId,
|
|
587
|
+
checkIn: schedule.checkIn,
|
|
588
|
+
checkOut: schedule.checkOut,
|
|
589
|
+
adults: Number(args.adults),
|
|
590
|
+
children: Number(args.children),
|
|
591
|
+
rate: plan.rate,
|
|
592
|
+
quantity: schedule.quantity,
|
|
593
|
+
amountTotal: schedule.amountTotal,
|
|
594
|
+
updatedAt: at,
|
|
595
|
+
});
|
|
596
|
+
const Guest = tx.table('hospitality_core.StayGuest');
|
|
597
|
+
const primaryGuest = await tx.db.one(from(Guest).where(eq(Guest.stayId, stay.id), eq(Guest.primary, true)));
|
|
598
|
+
if (primaryGuest)
|
|
599
|
+
await tx.db.update('hospitality_core.StayGuest', { id: primaryGuest.id }, { partnerId: args.partnerId, displayName: partner.name });
|
|
600
|
+
if (reservation.billingMode === 'upfront') {
|
|
601
|
+
const charge = await record(tx, 'hospitality_core.Charge', `${String(reservation.id)}:room`);
|
|
602
|
+
const folio = await record(tx, 'hospitality_core.Folio', reservation.folioId);
|
|
603
|
+
if (charge?.state !== 'active')
|
|
604
|
+
throw new TransitionConflict(issue('folioId', 'room_charge_missing'));
|
|
605
|
+
if (folio?.state !== 'open')
|
|
606
|
+
throw new TransitionConflict(issue('folioId', 'folio_not_open'));
|
|
607
|
+
const nextFolioTotal = String(Number(folio.amountTotal) - Number(charge.amount) + Number(schedule.amountTotal));
|
|
608
|
+
await tx.db.update('hospitality_core.Charge', { id: charge.id }, {
|
|
609
|
+
description: `room:${String(args.roomTypeId)}`,
|
|
610
|
+
quantity: schedule.quantity,
|
|
611
|
+
unitPrice: plan.rate,
|
|
612
|
+
amount: schedule.amountTotal,
|
|
613
|
+
});
|
|
614
|
+
await tx.db.update('hospitality_core.Folio', { id: folio.id }, {
|
|
615
|
+
partnerId: args.partnerId,
|
|
616
|
+
amountTotal: nextFolioTotal,
|
|
617
|
+
version: Number(folio.version) + 1,
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
else {
|
|
621
|
+
await tx.db.update('hospitality_core.Folio', { id: reservation.folioId }, { partnerId: args.partnerId });
|
|
622
|
+
}
|
|
623
|
+
return success(reservation.id, { amountTotal: schedule.amountTotal });
|
|
624
|
+
}));
|
|
625
|
+
},
|
|
626
|
+
}),
|
|
627
|
+
listReservations: defineFn({
|
|
628
|
+
input: { propertyId: 'id?', state: 'text?', from: 'datetime?', to: 'datetime?' },
|
|
629
|
+
output: reservationOutput,
|
|
630
|
+
effects: [
|
|
631
|
+
'read:hospitality_core.Reservation',
|
|
632
|
+
'read:partner.Partner',
|
|
633
|
+
'read:hospitality_core.RoomType',
|
|
634
|
+
'read:hospitality_core.Stay',
|
|
635
|
+
],
|
|
636
|
+
agent: true,
|
|
637
|
+
handler: async (ctx, args) => {
|
|
638
|
+
const R = ctx.table('hospitality_core.Reservation');
|
|
639
|
+
let query = from(R).orderBy(asc(R.checkIn)).preload('partner', 'roomType', 'stay');
|
|
640
|
+
if (args.propertyId)
|
|
641
|
+
query = query.where(eq(R.propertyId, args.propertyId));
|
|
642
|
+
if (args.state)
|
|
643
|
+
query = query.where(eq(R.state, args.state));
|
|
644
|
+
const start = args.from ? date(args.from) : null;
|
|
645
|
+
const end = args.to ? date(args.to) : null;
|
|
646
|
+
return (await ctx.db.all(query)).filter((row) => (!start || date(row.checkOut) > start) && (!end || date(row.checkIn) < end));
|
|
647
|
+
},
|
|
648
|
+
}),
|
|
649
|
+
getReservation: defineFn({
|
|
650
|
+
input: { id: 'id' },
|
|
651
|
+
output: reservationOutput,
|
|
652
|
+
effects: [
|
|
653
|
+
'read:hospitality_core.Reservation',
|
|
654
|
+
'read:partner.Partner',
|
|
655
|
+
'read:hospitality_core.RoomType',
|
|
656
|
+
'read:hospitality_core.Stay',
|
|
657
|
+
'read:hospitality_core.Folio',
|
|
658
|
+
],
|
|
659
|
+
agent: true,
|
|
660
|
+
handler: async (ctx, args) => {
|
|
661
|
+
const R = ctx.table('hospitality_core.Reservation');
|
|
662
|
+
return ctx.db.one(from(R).where(eq(R.id, args.id)).preload('partner', 'roomType', 'stay', 'folio'));
|
|
663
|
+
},
|
|
664
|
+
}),
|
|
665
|
+
cancelReservation: defineFn({
|
|
666
|
+
input: { id: 'id', reason: 'text?', at: 'datetime?' },
|
|
667
|
+
output: { ok: 'bool', id: 'id?', state: 'text?', errors: 'json?' },
|
|
668
|
+
effects: [
|
|
669
|
+
'read:hospitality_core.Reservation',
|
|
670
|
+
'read:hospitality_core.Charge',
|
|
671
|
+
'read:hospitality_core.Folio',
|
|
672
|
+
'read:hospitality_core.Property',
|
|
673
|
+
'read:hospitality_core.Room',
|
|
674
|
+
'read:hospitality_core.AvailabilityLedger',
|
|
675
|
+
'write:hospitality_core.Reservation',
|
|
676
|
+
'write:hospitality_core.Stay',
|
|
677
|
+
'write:hospitality_core.Folio',
|
|
678
|
+
'write:hospitality_core.Charge',
|
|
679
|
+
'write:hospitality_core.AvailabilityLedger',
|
|
680
|
+
'write:hospitality_core.InventoryChange',
|
|
681
|
+
],
|
|
682
|
+
idempotent: true,
|
|
683
|
+
agent: true,
|
|
684
|
+
handler: async (ctx, args) => {
|
|
685
|
+
const reservation = await record(ctx, 'hospitality_core.Reservation', args.id);
|
|
686
|
+
if (!reservation)
|
|
687
|
+
return failure(issue('id', 'reservation_missing'));
|
|
688
|
+
if (reservation.state === 'cancelled')
|
|
689
|
+
return success(args.id, { state: 'cancelled' });
|
|
690
|
+
if (reservation.state === 'no_show')
|
|
691
|
+
return success(args.id, { state: 'no_show' });
|
|
692
|
+
if (reservation.state === 'checked_in' || reservation.state === 'checked_out')
|
|
693
|
+
return failure(issue('state', 'reservation_cannot_cancel'));
|
|
694
|
+
const at = date(args.at)?.toISOString() ?? new Date().toISOString();
|
|
695
|
+
const property = await record(ctx, 'hospitality_core.Property', reservation.propertyId);
|
|
696
|
+
const inventoryDates = reservation.bookingType === 'hourly'
|
|
697
|
+
? []
|
|
698
|
+
: occupancyDates(reservation.checkIn, reservation.checkOut, String(property?.timezone ?? 'UTC'));
|
|
699
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
700
|
+
const reservationClaim = await tx.db.compareAndSet('hospitality_core.Reservation', { id: args.id }, { state: reservation.state, updatedAt: reservation.updatedAt }, { state: 'cancelled', cancelReason: args.reason, updatedAt: at });
|
|
701
|
+
if (!('matched' in reservationClaim) || !reservationClaim.matched)
|
|
702
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
703
|
+
if (reservation.stayId) {
|
|
704
|
+
const stayClaim = await tx.db.compareAndSet('hospitality_core.Stay', { id: reservation.stayId }, { state: 'draft' }, { state: 'cancelled' });
|
|
705
|
+
if (!('matched' in stayClaim) || !stayClaim.matched)
|
|
706
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
707
|
+
}
|
|
708
|
+
const folio = await record(tx, 'hospitality_core.Folio', reservation.folioId);
|
|
709
|
+
await tx.db.update('hospitality_core.Folio', { id: reservation.folioId }, { state: 'cancelled', amountTotal: '0', closedAt: at, version: Number(folio?.version ?? 0) + 1 });
|
|
710
|
+
const C = tx.table('hospitality_core.Charge');
|
|
711
|
+
const charges = await tx.db.all(from(C).where(eq(C.folioId, reservation.folioId), eq(C.state, 'active')));
|
|
712
|
+
for (const charge of charges)
|
|
713
|
+
await tx.db.update('hospitality_core.Charge', { id: charge.id }, { state: 'void' });
|
|
714
|
+
if (inventoryDates.length)
|
|
715
|
+
await releaseInventory(tx, reservation.propertyId, reservation.roomTypeId, inventoryDates);
|
|
716
|
+
if (inventoryDates.length)
|
|
717
|
+
await recordInventoryChange(tx, {
|
|
718
|
+
propertyId: reservation.propertyId,
|
|
719
|
+
roomTypeId: reservation.roomTypeId,
|
|
720
|
+
kind: 'availability',
|
|
721
|
+
dateFrom: inventoryDates[0],
|
|
722
|
+
dateTo: inventoryDates.at(-1),
|
|
723
|
+
aggregateId: reservation.id,
|
|
724
|
+
});
|
|
725
|
+
return success(args.id, { state: 'cancelled' });
|
|
726
|
+
}));
|
|
727
|
+
},
|
|
728
|
+
}),
|
|
729
|
+
markNoShow: defineFn({
|
|
730
|
+
input: { id: 'id', reason: 'text', at: 'datetime?' },
|
|
731
|
+
output: { ok: 'bool', id: 'id?', state: 'text?', errors: 'json?' },
|
|
732
|
+
effects: [
|
|
733
|
+
'read:hospitality_core.Reservation',
|
|
734
|
+
'read:hospitality_core.Folio',
|
|
735
|
+
'read:hospitality_core.Property',
|
|
736
|
+
'read:hospitality_core.Room',
|
|
737
|
+
'read:hospitality_core.AvailabilityLedger',
|
|
738
|
+
'write:hospitality_core.Reservation',
|
|
739
|
+
'write:hospitality_core.Stay',
|
|
740
|
+
'write:hospitality_core.Folio',
|
|
741
|
+
'write:hospitality_core.AvailabilityLedger',
|
|
742
|
+
'write:hospitality_core.InventoryChange',
|
|
743
|
+
],
|
|
744
|
+
idempotent: true,
|
|
745
|
+
agent: true,
|
|
746
|
+
handler: async (ctx, args) => {
|
|
747
|
+
const reservation = await record(ctx, 'hospitality_core.Reservation', args.id);
|
|
748
|
+
if (!reservation)
|
|
749
|
+
return failure(issue('id', 'reservation_missing'));
|
|
750
|
+
if (reservation.state === 'no_show')
|
|
751
|
+
return success(args.id, { state: 'no_show' });
|
|
752
|
+
if (reservation.state !== 'confirmed')
|
|
753
|
+
return failure(issue('state', 'reservation_cannot_no_show'));
|
|
754
|
+
const reason = text(args.reason);
|
|
755
|
+
if (!reason)
|
|
756
|
+
return failure(issue('reason', 'required'));
|
|
757
|
+
const at = date(args.at) ?? new Date();
|
|
758
|
+
if (at < date(reservation.checkIn))
|
|
759
|
+
return failure(issue('at', 'reservation_no_show_too_early'));
|
|
760
|
+
const timestamp = at.toISOString();
|
|
761
|
+
const property = await record(ctx, 'hospitality_core.Property', reservation.propertyId);
|
|
762
|
+
const inventoryDates = reservation.bookingType === 'hourly'
|
|
763
|
+
? []
|
|
764
|
+
: occupancyDates(reservation.checkIn, reservation.checkOut, String(property?.timezone ?? 'UTC'));
|
|
765
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
766
|
+
const reservationClaim = await tx.db.compareAndSet('hospitality_core.Reservation', { id: reservation.id }, { state: 'confirmed', updatedAt: reservation.updatedAt }, {
|
|
767
|
+
state: 'no_show',
|
|
768
|
+
noShowAt: timestamp,
|
|
769
|
+
noShowReason: reason,
|
|
770
|
+
updatedAt: timestamp,
|
|
771
|
+
});
|
|
772
|
+
if (!('matched' in reservationClaim) || !reservationClaim.matched)
|
|
773
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
774
|
+
if (reservation.stayId) {
|
|
775
|
+
const stayClaim = await tx.db.compareAndSet('hospitality_core.Stay', { id: reservation.stayId }, { state: 'draft' }, { state: 'no_show', noShowAt: timestamp });
|
|
776
|
+
if (!('matched' in stayClaim) || !stayClaim.matched)
|
|
777
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
778
|
+
}
|
|
779
|
+
const folio = await record(tx, 'hospitality_core.Folio', reservation.folioId);
|
|
780
|
+
if (folio?.state !== 'open')
|
|
781
|
+
throw new TransitionConflict(issue('folioId', 'folio_not_open'));
|
|
782
|
+
const folioClaim = await tx.db.compareAndSet('hospitality_core.Folio', { id: folio.id }, { state: 'open', version: folio.version }, { state: 'closed', closedAt: timestamp, version: Number(folio.version) + 1 });
|
|
783
|
+
if (!('matched' in folioClaim) || !folioClaim.matched)
|
|
784
|
+
throw new TransitionConflict(issue('folioId', 'transition_conflict'));
|
|
785
|
+
if (inventoryDates.length)
|
|
786
|
+
await releaseInventory(tx, reservation.propertyId, reservation.roomTypeId, inventoryDates);
|
|
787
|
+
if (inventoryDates.length)
|
|
788
|
+
await recordInventoryChange(tx, {
|
|
789
|
+
propertyId: reservation.propertyId,
|
|
790
|
+
roomTypeId: reservation.roomTypeId,
|
|
791
|
+
kind: 'availability',
|
|
792
|
+
dateFrom: inventoryDates[0],
|
|
793
|
+
dateTo: inventoryDates.at(-1),
|
|
794
|
+
aggregateId: reservation.id,
|
|
795
|
+
});
|
|
796
|
+
return success(reservation.id, { state: 'no_show' });
|
|
797
|
+
}));
|
|
798
|
+
},
|
|
799
|
+
}),
|
|
800
|
+
listStays: defineFn({
|
|
801
|
+
input: { propertyId: 'id?', state: 'text?', from: 'datetime?', to: 'datetime?' },
|
|
802
|
+
output: stayOutput,
|
|
803
|
+
effects: [
|
|
804
|
+
'read:hospitality_core.Stay',
|
|
805
|
+
'read:partner.Partner',
|
|
806
|
+
'read:hospitality_core.RoomType',
|
|
807
|
+
'read:hospitality_core.Room',
|
|
808
|
+
'read:hospitality_core.Reservation',
|
|
809
|
+
],
|
|
810
|
+
agent: true,
|
|
811
|
+
handler: async (ctx, args) => {
|
|
812
|
+
const S = ctx.table('hospitality_core.Stay');
|
|
813
|
+
let query = from(S).orderBy(asc(S.checkIn)).preload('partner', 'roomType', 'currentRoom', 'reservation');
|
|
814
|
+
if (args.propertyId)
|
|
815
|
+
query = query.where(eq(S.propertyId, args.propertyId));
|
|
816
|
+
if (args.state)
|
|
817
|
+
query = query.where(eq(S.state, args.state));
|
|
818
|
+
const start = args.from ? date(args.from) : null;
|
|
819
|
+
const end = args.to ? date(args.to) : null;
|
|
820
|
+
return (await ctx.db.all(query)).filter((row) => (!start || date(row.checkOut) > start) && (!end || date(row.checkIn) < end));
|
|
821
|
+
},
|
|
822
|
+
}),
|
|
823
|
+
getStay: defineFn({
|
|
824
|
+
input: { id: 'id' },
|
|
825
|
+
output: stayOutput,
|
|
826
|
+
effects: [
|
|
827
|
+
'read:hospitality_core.Stay',
|
|
828
|
+
'read:partner.Partner',
|
|
829
|
+
'read:hospitality_core.RoomType',
|
|
830
|
+
'read:hospitality_core.Room',
|
|
831
|
+
'read:hospitality_core.Reservation',
|
|
832
|
+
'read:hospitality_core.RoomAssignment',
|
|
833
|
+
'read:hospitality_core.StayGuest',
|
|
834
|
+
],
|
|
835
|
+
agent: true,
|
|
836
|
+
handler: async (ctx, args) => {
|
|
837
|
+
const S = ctx.table('hospitality_core.Stay');
|
|
838
|
+
return ctx.db.one(from(S)
|
|
839
|
+
.where(eq(S.id, args.id))
|
|
840
|
+
.preload('partner', 'roomType', 'currentRoom', 'reservation', 'assignments', 'guests'));
|
|
841
|
+
},
|
|
842
|
+
}),
|
|
843
|
+
checkIn: defineFn({
|
|
844
|
+
input: { stayId: 'id', roomId: 'id?', assignmentId: 'id?', at: 'datetime?' },
|
|
845
|
+
output: { ok: 'bool', id: 'id?', roomId: 'id?', state: 'text?', errors: 'json?' },
|
|
846
|
+
effects: [
|
|
847
|
+
'read:hospitality_core.Stay',
|
|
848
|
+
'read:hospitality_core.Reservation',
|
|
849
|
+
'read:hospitality_core.Property',
|
|
850
|
+
'read:hospitality_core.Room',
|
|
851
|
+
'read:hospitality_core.Folio',
|
|
852
|
+
'read:hospitality_core.Charge',
|
|
853
|
+
'write:hospitality_core.Charge',
|
|
854
|
+
'write:hospitality_core.Room',
|
|
855
|
+
'write:hospitality_core.Stay',
|
|
856
|
+
'write:hospitality_core.Reservation',
|
|
857
|
+
'write:hospitality_core.Folio',
|
|
858
|
+
'write:hospitality_core.RoomAssignment',
|
|
859
|
+
'enqueue:hospitality_core.prepareStayNotices',
|
|
860
|
+
],
|
|
861
|
+
idempotent: true,
|
|
862
|
+
agent: true,
|
|
863
|
+
handler: async (ctx, args) => {
|
|
864
|
+
const stay = await record(ctx, 'hospitality_core.Stay', args.stayId);
|
|
865
|
+
if (!stay)
|
|
866
|
+
return failure(issue('stayId', 'stay_missing'));
|
|
867
|
+
if (stay.state === 'checked_in') {
|
|
868
|
+
const property = await record(ctx, 'hospitality_core.Property', stay.propertyId);
|
|
869
|
+
if (property) {
|
|
870
|
+
const rent = await initializeRecurringRent(ctx, stay, property);
|
|
871
|
+
if (rent.ok !== true)
|
|
872
|
+
return rent;
|
|
873
|
+
}
|
|
874
|
+
await ctx.jobs.enqueue('hospitality_core.prepareStayNotices', { stayId: stay.id }, { uniqueKey: `stay-notices:${String(stay.id)}` });
|
|
875
|
+
return success(stay.id, { roomId: stay.currentRoomId, state: stay.state });
|
|
876
|
+
}
|
|
877
|
+
if (stay.state !== 'draft')
|
|
878
|
+
return failure(issue('state', 'stay_cannot_check_in'));
|
|
879
|
+
const reservation = stay.reservationId
|
|
880
|
+
? await record(ctx, 'hospitality_core.Reservation', stay.reservationId)
|
|
881
|
+
: null;
|
|
882
|
+
if (stay.reservationId && !reservation)
|
|
883
|
+
return failure(issue('state', 'transition_conflict'));
|
|
884
|
+
const at = date(args.at) ?? new Date();
|
|
885
|
+
const property = await record(ctx, 'hospitality_core.Property', stay.propertyId);
|
|
886
|
+
if (property?.enforceTimes && at < date(stay.checkIn))
|
|
887
|
+
return failure(issue('at', 'early_check_in'));
|
|
888
|
+
const R = ctx.table('hospitality_core.Room');
|
|
889
|
+
let room = null;
|
|
890
|
+
if (args.roomId)
|
|
891
|
+
room = await record(ctx, 'hospitality_core.Room', args.roomId);
|
|
892
|
+
else {
|
|
893
|
+
const candidates = await ctx.db.all(from(R).where(eq(R.propertyId, stay.propertyId), eq(R.roomTypeId, stay.roomTypeId), eq(R.status, 'available'), eq(R.active, true)));
|
|
894
|
+
room = candidates[0] ?? null;
|
|
895
|
+
}
|
|
896
|
+
if (!room)
|
|
897
|
+
return failure(issue('roomId', 'no_available_room'));
|
|
898
|
+
if (room.propertyId !== stay.propertyId)
|
|
899
|
+
return failure(issue('roomId', 'property_mismatch'));
|
|
900
|
+
if (room.roomTypeId !== stay.roomTypeId)
|
|
901
|
+
return failure(issue('roomId', 'room_type_mismatch'));
|
|
902
|
+
if (room.status !== 'available' || room.active !== true)
|
|
903
|
+
return failure(issue('roomId', 'room_not_available'));
|
|
904
|
+
const assignmentId = args.assignmentId ?? `${String(stay.id)}:assignment:1`;
|
|
905
|
+
const transitioned = await transition(() => ctx.tx(async (tx) => {
|
|
906
|
+
if (stay.reservationId) {
|
|
907
|
+
const reservationClaim = await tx.db.compareAndSet('hospitality_core.Reservation', { id: stay.reservationId }, { state: 'confirmed', updatedAt: reservation.updatedAt }, { state: 'checked_in', updatedAt: at.toISOString() });
|
|
908
|
+
if (!('matched' in reservationClaim) || !reservationClaim.matched)
|
|
909
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
910
|
+
}
|
|
911
|
+
const stayClaim = await tx.db.compareAndSet('hospitality_core.Stay', { id: stay.id }, { state: 'draft' }, { state: 'checked_in', currentRoomId: room.id, checkedInAt: at.toISOString() });
|
|
912
|
+
if (!('matched' in stayClaim) || !stayClaim.matched)
|
|
913
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
914
|
+
const roomClaim = await tx.db.compareAndSet('hospitality_core.Room', { id: room.id }, { status: 'available', active: true }, { status: 'occupied' });
|
|
915
|
+
if (!('matched' in roomClaim) || !roomClaim.matched)
|
|
916
|
+
throw new TransitionConflict(issue('roomId', 'room_not_available'));
|
|
917
|
+
await tx.db.insert('hospitality_core.RoomAssignment', {
|
|
918
|
+
id: assignmentId,
|
|
919
|
+
stayId: stay.id,
|
|
920
|
+
propertyId: stay.propertyId,
|
|
921
|
+
roomId: room.id,
|
|
922
|
+
roomTypeId: room.roomTypeId,
|
|
923
|
+
startAt: at.toISOString(),
|
|
924
|
+
state: 'active',
|
|
925
|
+
});
|
|
926
|
+
await tx.db.update('hospitality_core.Folio', { id: stay.folioId }, { state: 'open' });
|
|
927
|
+
await tx.jobs.enqueue('hospitality_core.prepareStayNotices', { stayId: stay.id }, { uniqueKey: `stay-notices:${String(stay.id)}` });
|
|
928
|
+
return success(stay.id, { roomId: room.id, state: 'checked_in' });
|
|
929
|
+
}));
|
|
930
|
+
if (transitioned.ok !== true)
|
|
931
|
+
return transitioned;
|
|
932
|
+
const checkedIn = await record(ctx, 'hospitality_core.Stay', stay.id);
|
|
933
|
+
if (checkedIn && property) {
|
|
934
|
+
const rent = await initializeRecurringRent(ctx, checkedIn, property);
|
|
935
|
+
if (rent.ok !== true)
|
|
936
|
+
return rent;
|
|
937
|
+
}
|
|
938
|
+
return transitioned;
|
|
939
|
+
},
|
|
940
|
+
}),
|
|
941
|
+
adjustStayDeparture: defineFn({
|
|
942
|
+
input: { stayId: 'id', checkOut: 'datetime', at: 'datetime?' },
|
|
943
|
+
output: { ok: 'bool', id: 'id?', checkOut: 'datetime?', amountTotal: 'decimal?', errors: 'json?' },
|
|
944
|
+
effects: [
|
|
945
|
+
'read:hospitality_core.Stay',
|
|
946
|
+
'read:hospitality_core.Reservation',
|
|
947
|
+
'read:hospitality_core.Property',
|
|
948
|
+
'read:hospitality_core.Room',
|
|
949
|
+
'read:hospitality_core.Folio',
|
|
950
|
+
'read:hospitality_core.Charge',
|
|
951
|
+
'read:hospitality_core.AvailabilityLedger',
|
|
952
|
+
'write:hospitality_core.Stay',
|
|
953
|
+
'write:hospitality_core.Reservation',
|
|
954
|
+
'write:hospitality_core.Folio',
|
|
955
|
+
'write:hospitality_core.Charge',
|
|
956
|
+
'write:hospitality_core.AvailabilityLedger',
|
|
957
|
+
'write:hospitality_core.InventoryChange',
|
|
958
|
+
],
|
|
959
|
+
idempotent: true,
|
|
960
|
+
agent: true,
|
|
961
|
+
handler: async (ctx, args) => {
|
|
962
|
+
const stay = await record(ctx, 'hospitality_core.Stay', args.stayId);
|
|
963
|
+
if (!stay)
|
|
964
|
+
return failure(issue('stayId', 'stay_missing'));
|
|
965
|
+
if (stay.state !== 'checked_in')
|
|
966
|
+
return failure(issue('state', 'stay_cannot_adjust_departure'));
|
|
967
|
+
const reservation = stay.reservationId
|
|
968
|
+
? await record(ctx, 'hospitality_core.Reservation', stay.reservationId)
|
|
969
|
+
: null;
|
|
970
|
+
if (reservation?.state !== 'checked_in')
|
|
971
|
+
return failure(issue('state', 'transition_conflict'));
|
|
972
|
+
const property = await record(ctx, 'hospitality_core.Property', stay.propertyId);
|
|
973
|
+
if (!property)
|
|
974
|
+
return failure(issue('propertyId', 'property_missing'));
|
|
975
|
+
const calculated = scheduleOf(stay.bookingType, stay.checkIn, args.checkOut, stay.rate, String(property.timezone ?? 'UTC'));
|
|
976
|
+
if (calculated.errors.length || !calculated.schedule)
|
|
977
|
+
return failure(...calculated.errors);
|
|
978
|
+
const schedule = calculated.schedule;
|
|
979
|
+
if (schedule.checkOut === new Date(String(stay.checkOut)).toISOString())
|
|
980
|
+
return success(stay.id, { checkOut: schedule.checkOut, amountTotal: schedule.amountTotal });
|
|
981
|
+
const at = date(args.at) ?? new Date();
|
|
982
|
+
if (date(schedule.checkOut) <= at)
|
|
983
|
+
return failure(issue('checkOut', 'departure_not_future'));
|
|
984
|
+
const previousDates = stay.bookingType === 'hourly'
|
|
985
|
+
? []
|
|
986
|
+
: occupancyDates(stay.checkIn, stay.checkOut, String(property.timezone ?? 'UTC'));
|
|
987
|
+
const nextDates = stay.bookingType === 'hourly'
|
|
988
|
+
? []
|
|
989
|
+
: occupancyDates(stay.checkIn, schedule.checkOut, String(property.timezone ?? 'UTC'));
|
|
990
|
+
const timestamp = at.toISOString();
|
|
991
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
992
|
+
const reservationClaim = await tx.db.compareAndSet('hospitality_core.Reservation', { id: reservation.id }, { state: 'checked_in', updatedAt: reservation.updatedAt }, {
|
|
993
|
+
checkOut: schedule.checkOut,
|
|
994
|
+
quantity: schedule.quantity,
|
|
995
|
+
amountTotal: schedule.amountTotal,
|
|
996
|
+
updatedAt: timestamp,
|
|
997
|
+
});
|
|
998
|
+
if (!('matched' in reservationClaim) || !reservationClaim.matched)
|
|
999
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
1000
|
+
const stayClaim = await tx.db.compareAndSet('hospitality_core.Stay', { id: stay.id }, { state: 'checked_in', checkOut: stay.checkOut }, { checkOut: schedule.checkOut });
|
|
1001
|
+
if (!('matched' in stayClaim) || !stayClaim.matched)
|
|
1002
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
1003
|
+
await replaceReservedInventory(tx, stay.propertyId, stay.roomTypeId, previousDates, stay.roomTypeId, nextDates);
|
|
1004
|
+
if (previousDates.join(',') !== nextDates.join(',')) {
|
|
1005
|
+
const changedDates = [...previousDates, ...nextDates].sort();
|
|
1006
|
+
if (changedDates.length)
|
|
1007
|
+
await recordInventoryChange(tx, {
|
|
1008
|
+
propertyId: stay.propertyId,
|
|
1009
|
+
roomTypeId: stay.roomTypeId,
|
|
1010
|
+
kind: 'availability',
|
|
1011
|
+
dateFrom: changedDates[0],
|
|
1012
|
+
dateTo: changedDates.at(-1),
|
|
1013
|
+
aggregateId: reservation.id,
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
if (stay.billingMode === 'upfront') {
|
|
1017
|
+
const charge = await record(tx, 'hospitality_core.Charge', `${String(reservation.id)}:room`);
|
|
1018
|
+
const folio = await record(tx, 'hospitality_core.Folio', stay.folioId);
|
|
1019
|
+
if (charge?.state !== 'active')
|
|
1020
|
+
throw new TransitionConflict(issue('folioId', 'room_charge_missing'));
|
|
1021
|
+
if (folio?.state !== 'open')
|
|
1022
|
+
throw new TransitionConflict(issue('folioId', 'folio_not_open'));
|
|
1023
|
+
const nextFolioTotal = String(Number(folio.amountTotal) - Number(charge.amount) + Number(schedule.amountTotal));
|
|
1024
|
+
await tx.db.update('hospitality_core.Charge', { id: charge.id }, { quantity: schedule.quantity, amount: schedule.amountTotal });
|
|
1025
|
+
const folioClaim = await tx.db.compareAndSet('hospitality_core.Folio', { id: folio.id }, { state: 'open', version: folio.version }, { amountTotal: nextFolioTotal, version: Number(folio.version) + 1 });
|
|
1026
|
+
if (!('matched' in folioClaim) || !folioClaim.matched)
|
|
1027
|
+
throw new TransitionConflict(issue('folioId', 'transition_conflict'));
|
|
1028
|
+
}
|
|
1029
|
+
return success(stay.id, { checkOut: schedule.checkOut, amountTotal: schedule.amountTotal });
|
|
1030
|
+
}));
|
|
1031
|
+
},
|
|
1032
|
+
}),
|
|
1033
|
+
moveRoom: defineFn({
|
|
1034
|
+
input: { stayId: 'id', roomId: 'id', assignmentId: 'id', reason: 'text?', at: 'datetime?' },
|
|
1035
|
+
output: { ok: 'bool', id: 'id?', roomId: 'id?', state: 'text?', errors: 'json?' },
|
|
1036
|
+
effects: [
|
|
1037
|
+
'read:hospitality_core.Stay',
|
|
1038
|
+
'read:hospitality_core.Room',
|
|
1039
|
+
'read:hospitality_core.RoomAssignment',
|
|
1040
|
+
'write:hospitality_core.Room',
|
|
1041
|
+
'write:hospitality_core.Stay',
|
|
1042
|
+
'write:hospitality_core.RoomAssignment',
|
|
1043
|
+
'write:hospitality_core.CleaningTask',
|
|
1044
|
+
],
|
|
1045
|
+
idempotent: true,
|
|
1046
|
+
agent: true,
|
|
1047
|
+
handler: async (ctx, args) => {
|
|
1048
|
+
const stay = await record(ctx, 'hospitality_core.Stay', args.stayId);
|
|
1049
|
+
const room = await record(ctx, 'hospitality_core.Room', args.roomId);
|
|
1050
|
+
if (!stay)
|
|
1051
|
+
return failure(issue('stayId', 'stay_missing'));
|
|
1052
|
+
if (stay.state !== 'checked_in' || !stay.currentRoomId)
|
|
1053
|
+
return failure(issue('state', 'stay_cannot_move'));
|
|
1054
|
+
if (!room)
|
|
1055
|
+
return failure(issue('roomId', 'room_missing'));
|
|
1056
|
+
if (room.propertyId !== stay.propertyId)
|
|
1057
|
+
return failure(issue('roomId', 'property_mismatch'));
|
|
1058
|
+
if (room.status !== 'available' || room.active !== true)
|
|
1059
|
+
return failure(issue('roomId', 'room_not_available'));
|
|
1060
|
+
if (room.id === stay.currentRoomId)
|
|
1061
|
+
return success(stay.id, { roomId: room.id, state: 'checked_in' });
|
|
1062
|
+
const A = ctx.table('hospitality_core.RoomAssignment');
|
|
1063
|
+
const current = await ctx.db.one(from(A).where(eq(A.stayId, stay.id), eq(A.roomId, stay.currentRoomId), eq(A.state, 'active')));
|
|
1064
|
+
if (!current)
|
|
1065
|
+
return failure(issue('stayId', 'active_assignment_missing'));
|
|
1066
|
+
const at = date(args.at) ?? new Date();
|
|
1067
|
+
if (at <= date(current.startAt))
|
|
1068
|
+
return failure(issue('at', 'assignment_order'));
|
|
1069
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
1070
|
+
const roomClaim = await tx.db.compareAndSet('hospitality_core.Room', { id: room.id }, { status: 'available', active: true }, { status: 'occupied' });
|
|
1071
|
+
if (!('matched' in roomClaim) || !roomClaim.matched)
|
|
1072
|
+
throw new TransitionConflict(issue('roomId', 'room_not_available'));
|
|
1073
|
+
const stayClaim = await tx.db.compareAndSet('hospitality_core.Stay', { id: stay.id }, { state: 'checked_in', currentRoomId: stay.currentRoomId }, { currentRoomId: room.id, roomTypeId: room.roomTypeId });
|
|
1074
|
+
if (!('matched' in stayClaim) || !stayClaim.matched)
|
|
1075
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
1076
|
+
await tx.db.update('hospitality_core.RoomAssignment', { id: current.id }, { state: 'closed', endAt: at.toISOString() });
|
|
1077
|
+
await tx.db.update('hospitality_core.Room', { id: stay.currentRoomId }, { status: 'dirty' });
|
|
1078
|
+
await tx.db.insert('hospitality_core.CleaningTask', {
|
|
1079
|
+
id: `move:${String(current.id)}:clean`,
|
|
1080
|
+
code: `HK-${String(stay.code)}-MOVE`,
|
|
1081
|
+
propertyId: stay.propertyId,
|
|
1082
|
+
roomId: stay.currentRoomId,
|
|
1083
|
+
stayId: stay.id,
|
|
1084
|
+
taskType: 'daily_clean',
|
|
1085
|
+
priority: 'normal',
|
|
1086
|
+
state: 'todo',
|
|
1087
|
+
requestedAt: at.toISOString(),
|
|
1088
|
+
notes: args.reason,
|
|
1089
|
+
});
|
|
1090
|
+
await tx.db.insert('hospitality_core.RoomAssignment', {
|
|
1091
|
+
id: args.assignmentId,
|
|
1092
|
+
stayId: stay.id,
|
|
1093
|
+
propertyId: stay.propertyId,
|
|
1094
|
+
roomId: room.id,
|
|
1095
|
+
roomTypeId: room.roomTypeId,
|
|
1096
|
+
startAt: at.toISOString(),
|
|
1097
|
+
state: 'active',
|
|
1098
|
+
reason: args.reason,
|
|
1099
|
+
});
|
|
1100
|
+
return success(stay.id, { roomId: room.id, state: 'checked_in' });
|
|
1101
|
+
}));
|
|
1102
|
+
},
|
|
1103
|
+
}),
|
|
1104
|
+
checkOut: defineFn({
|
|
1105
|
+
input: { stayId: 'id', at: 'datetime?' },
|
|
1106
|
+
output: {
|
|
1107
|
+
ok: 'bool',
|
|
1108
|
+
id: 'id?',
|
|
1109
|
+
roomId: 'id?',
|
|
1110
|
+
state: 'text?',
|
|
1111
|
+
inventoryReleased: 'int?',
|
|
1112
|
+
errors: 'json?',
|
|
1113
|
+
},
|
|
1114
|
+
effects: [
|
|
1115
|
+
'read:hospitality_core.Stay',
|
|
1116
|
+
'read:hospitality_core.Property',
|
|
1117
|
+
'read:hospitality_core.Room',
|
|
1118
|
+
'read:hospitality_core.RoomAssignment',
|
|
1119
|
+
'read:hospitality_core.AvailabilityLedger',
|
|
1120
|
+
'write:hospitality_core.Room',
|
|
1121
|
+
'write:hospitality_core.Stay',
|
|
1122
|
+
'write:hospitality_core.Reservation',
|
|
1123
|
+
'write:hospitality_core.Folio',
|
|
1124
|
+
'write:hospitality_core.RoomAssignment',
|
|
1125
|
+
'write:hospitality_core.CleaningTask',
|
|
1126
|
+
'write:hospitality_core.AvailabilityLedger',
|
|
1127
|
+
'write:hospitality_core.InventoryChange',
|
|
1128
|
+
],
|
|
1129
|
+
idempotent: true,
|
|
1130
|
+
agent: true,
|
|
1131
|
+
handler: async (ctx, args) => {
|
|
1132
|
+
const stay = await record(ctx, 'hospitality_core.Stay', args.stayId);
|
|
1133
|
+
if (!stay)
|
|
1134
|
+
return failure(issue('stayId', 'stay_missing'));
|
|
1135
|
+
if (stay.state === 'checked_out')
|
|
1136
|
+
return success(stay.id, { roomId: stay.currentRoomId, state: stay.state });
|
|
1137
|
+
if (stay.state !== 'checked_in' || !stay.currentRoomId)
|
|
1138
|
+
return failure(issue('state', 'stay_cannot_check_out'));
|
|
1139
|
+
const at = date(args.at) ?? new Date();
|
|
1140
|
+
const property = await record(ctx, 'hospitality_core.Property', stay.propertyId);
|
|
1141
|
+
if (!property)
|
|
1142
|
+
return failure(issue('propertyId', 'property_missing'));
|
|
1143
|
+
const remainingInventoryDates = stay.bookingType === 'hourly'
|
|
1144
|
+
? []
|
|
1145
|
+
: occupancyDates(stay.checkIn, stay.checkOut, String(property.timezone ?? 'UTC')).filter((value) => value >= dateKeyIn(at, String(property.timezone ?? 'UTC')));
|
|
1146
|
+
const A = ctx.table('hospitality_core.RoomAssignment');
|
|
1147
|
+
const current = await ctx.db.one(from(A).where(eq(A.stayId, stay.id), eq(A.state, 'active')));
|
|
1148
|
+
if (!current)
|
|
1149
|
+
return failure(issue('stayId', 'active_assignment_missing'));
|
|
1150
|
+
if (at <= date(current.startAt))
|
|
1151
|
+
return failure(issue('at', 'assignment_order'));
|
|
1152
|
+
return transition(() => ctx.tx(async (tx) => {
|
|
1153
|
+
if (stay.reservationId) {
|
|
1154
|
+
const reservationClaim = await tx.db.compareAndSet('hospitality_core.Reservation', { id: stay.reservationId }, { state: 'checked_in' }, { state: 'checked_out', updatedAt: at.toISOString() });
|
|
1155
|
+
if (!('matched' in reservationClaim) || !reservationClaim.matched)
|
|
1156
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
1157
|
+
}
|
|
1158
|
+
const stayClaim = await tx.db.compareAndSet('hospitality_core.Stay', { id: stay.id }, { state: 'checked_in', currentRoomId: stay.currentRoomId }, { state: 'checked_out', currentRoomId: null, checkedOutAt: at.toISOString() });
|
|
1159
|
+
if (!('matched' in stayClaim) || !stayClaim.matched)
|
|
1160
|
+
throw new TransitionConflict(issue('state', 'transition_conflict'));
|
|
1161
|
+
await tx.db.update('hospitality_core.RoomAssignment', { id: current.id }, { state: 'closed', endAt: at.toISOString() });
|
|
1162
|
+
await tx.db.update('hospitality_core.Room', { id: stay.currentRoomId }, { status: 'dirty' });
|
|
1163
|
+
await tx.db.insert('hospitality_core.CleaningTask', {
|
|
1164
|
+
id: `checkout:${stay.id}`,
|
|
1165
|
+
code: `HK-${stay.code}`,
|
|
1166
|
+
propertyId: stay.propertyId,
|
|
1167
|
+
roomId: stay.currentRoomId,
|
|
1168
|
+
stayId: stay.id,
|
|
1169
|
+
taskType: 'checkout_clean',
|
|
1170
|
+
priority: 'urgent',
|
|
1171
|
+
state: 'todo',
|
|
1172
|
+
requestedAt: at.toISOString(),
|
|
1173
|
+
});
|
|
1174
|
+
await tx.db.update('hospitality_core.Folio', { id: stay.folioId }, { state: 'closed', closedAt: at.toISOString() });
|
|
1175
|
+
if (remainingInventoryDates.length) {
|
|
1176
|
+
await releaseInventory(tx, stay.propertyId, stay.roomTypeId, remainingInventoryDates);
|
|
1177
|
+
await recordInventoryChange(tx, {
|
|
1178
|
+
propertyId: stay.propertyId,
|
|
1179
|
+
roomTypeId: stay.roomTypeId,
|
|
1180
|
+
kind: 'availability',
|
|
1181
|
+
dateFrom: remainingInventoryDates[0],
|
|
1182
|
+
dateTo: remainingInventoryDates.at(-1),
|
|
1183
|
+
aggregateId: stay.reservationId ?? stay.id,
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
return success(stay.id, {
|
|
1187
|
+
roomId: stay.currentRoomId,
|
|
1188
|
+
state: 'checked_out',
|
|
1189
|
+
inventoryReleased: remainingInventoryDates.length,
|
|
1190
|
+
});
|
|
1191
|
+
}));
|
|
1192
|
+
},
|
|
1193
|
+
}),
|
|
1194
|
+
addStayGuest: defineFn({
|
|
1195
|
+
input: { id: 'id', stayId: 'id', partnerId: 'id?', displayName: 'text', primary: 'bool?' },
|
|
1196
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1197
|
+
effects: [
|
|
1198
|
+
'read:hospitality_core.Stay',
|
|
1199
|
+
'read:hospitality_core.StayGuest',
|
|
1200
|
+
'read:partner.Partner',
|
|
1201
|
+
'write:hospitality_core.StayGuest',
|
|
1202
|
+
'enqueue:hospitality_core.prepareStayNotices',
|
|
1203
|
+
],
|
|
1204
|
+
idempotent: true,
|
|
1205
|
+
agent: true,
|
|
1206
|
+
handler: async (ctx, args) => {
|
|
1207
|
+
const stay = await record(ctx, 'hospitality_core.Stay', args.stayId);
|
|
1208
|
+
const existing = await record(ctx, 'hospitality_core.StayGuest', args.id);
|
|
1209
|
+
if (existing) {
|
|
1210
|
+
if (stay?.state === 'checked_in')
|
|
1211
|
+
await ctx.jobs.enqueue('hospitality_core.prepareStayNotices', { stayId: stay.id }, { uniqueKey: `stay-notices:${String(stay.id)}` });
|
|
1212
|
+
return success(existing.id);
|
|
1213
|
+
}
|
|
1214
|
+
const errors = [];
|
|
1215
|
+
if (!stay)
|
|
1216
|
+
errors.push(issue('stayId', 'stay_missing'));
|
|
1217
|
+
if (!text(args.displayName))
|
|
1218
|
+
errors.push(issue('displayName', 'required'));
|
|
1219
|
+
if (args.partnerId && !(await record(ctx, 'partner.Partner', args.partnerId)))
|
|
1220
|
+
errors.push(issue('partnerId', 'partner_missing'));
|
|
1221
|
+
if (args.primary === true && args.partnerId !== stay?.partnerId)
|
|
1222
|
+
errors.push(issue('partnerId', 'primary_guest_mismatch'));
|
|
1223
|
+
const G = ctx.table('hospitality_core.StayGuest');
|
|
1224
|
+
if (args.primary === true) {
|
|
1225
|
+
const primary = await ctx.db.one(from(G).where(eq(G.stayId, args.stayId), eq(G.primary, true)));
|
|
1226
|
+
if (primary)
|
|
1227
|
+
errors.push(issue('primary', 'primary_guest_unique'));
|
|
1228
|
+
}
|
|
1229
|
+
if (args.partnerId) {
|
|
1230
|
+
const duplicate = await ctx.db.one(from(G).where(eq(G.stayId, args.stayId), eq(G.partnerId, args.partnerId)));
|
|
1231
|
+
if (duplicate)
|
|
1232
|
+
return success(duplicate.id);
|
|
1233
|
+
}
|
|
1234
|
+
if (errors.length || !stay)
|
|
1235
|
+
return failure(...errors);
|
|
1236
|
+
await ctx.tx(async (tx) => {
|
|
1237
|
+
await tx.db.insert('hospitality_core.StayGuest', {
|
|
1238
|
+
id: args.id,
|
|
1239
|
+
stayId: args.stayId,
|
|
1240
|
+
propertyId: stay.propertyId,
|
|
1241
|
+
partnerId: args.partnerId,
|
|
1242
|
+
displayName: text(args.displayName),
|
|
1243
|
+
primary: args.primary === true,
|
|
1244
|
+
primaryKey: args.primary === true ? 'primary' : null,
|
|
1245
|
+
});
|
|
1246
|
+
if (stay.state === 'checked_in')
|
|
1247
|
+
await tx.jobs.enqueue('hospitality_core.prepareStayNotices', { stayId: stay.id }, { uniqueKey: `stay-notices:${String(stay.id)}` });
|
|
1248
|
+
});
|
|
1249
|
+
return success(args.id);
|
|
1250
|
+
},
|
|
1251
|
+
}),
|
|
1252
|
+
listStayGuests: defineFn({
|
|
1253
|
+
input: { stayId: 'id' },
|
|
1254
|
+
output: { id: 'id', stayId: 'id', displayName: 'text', primary: 'bool' },
|
|
1255
|
+
effects: ['read:hospitality_core.StayGuest'],
|
|
1256
|
+
agent: true,
|
|
1257
|
+
handler: async (ctx, args) => {
|
|
1258
|
+
const G = ctx.table('hospitality_core.StayGuest');
|
|
1259
|
+
return ctx.db.all(from(G).where(eq(G.stayId, args.stayId)).orderBy(asc(G.id)));
|
|
1260
|
+
},
|
|
1261
|
+
}),
|
|
1262
|
+
addCharge: defineFn({
|
|
1263
|
+
input: {
|
|
1264
|
+
id: 'id',
|
|
1265
|
+
folioId: 'id',
|
|
1266
|
+
stayId: 'id?',
|
|
1267
|
+
description: 'text',
|
|
1268
|
+
type: 'text?',
|
|
1269
|
+
quantity: 'decimal?',
|
|
1270
|
+
unitPrice: 'decimal',
|
|
1271
|
+
occurredAt: 'datetime?',
|
|
1272
|
+
sourceKey: 'text?',
|
|
1273
|
+
},
|
|
1274
|
+
output: { ok: 'bool', id: 'id?', amount: 'decimal?', existing: 'bool?', errors: 'json?' },
|
|
1275
|
+
effects: [
|
|
1276
|
+
'read:hospitality_core.Folio',
|
|
1277
|
+
'read:hospitality_core.Stay',
|
|
1278
|
+
'read:hospitality_core.Charge',
|
|
1279
|
+
'write:hospitality_core.Folio',
|
|
1280
|
+
'write:hospitality_core.Charge',
|
|
1281
|
+
],
|
|
1282
|
+
idempotent: true,
|
|
1283
|
+
agent: true,
|
|
1284
|
+
handler: postCharge,
|
|
1285
|
+
}),
|
|
1286
|
+
voidCharge: defineFn({
|
|
1287
|
+
input: { id: 'id', folioId: 'id', reason: 'text', voidedAt: 'datetime?' },
|
|
1288
|
+
output: {
|
|
1289
|
+
ok: 'bool',
|
|
1290
|
+
id: 'id?',
|
|
1291
|
+
amount: 'decimal?',
|
|
1292
|
+
amountTotal: 'decimal?',
|
|
1293
|
+
existing: 'bool?',
|
|
1294
|
+
errors: 'json?',
|
|
1295
|
+
},
|
|
1296
|
+
effects: [
|
|
1297
|
+
'read:hospitality_core.Folio',
|
|
1298
|
+
'read:hospitality_core.Charge',
|
|
1299
|
+
'write:hospitality_core.Folio',
|
|
1300
|
+
'write:hospitality_core.Charge',
|
|
1301
|
+
],
|
|
1302
|
+
idempotent: true,
|
|
1303
|
+
agent: true,
|
|
1304
|
+
handler: voidPostedCharge,
|
|
1305
|
+
}),
|
|
1306
|
+
listFolios: defineFn({
|
|
1307
|
+
input: { propertyId: 'id?', state: 'text?' },
|
|
1308
|
+
output: {
|
|
1309
|
+
id: 'id',
|
|
1310
|
+
code: 'text',
|
|
1311
|
+
propertyId: 'id',
|
|
1312
|
+
partnerId: 'id',
|
|
1313
|
+
state: 'text',
|
|
1314
|
+
amountTotal: 'decimal',
|
|
1315
|
+
version: 'int',
|
|
1316
|
+
openedAt: 'datetime',
|
|
1317
|
+
closedAt: 'datetime?',
|
|
1318
|
+
partner: 'json?',
|
|
1319
|
+
stays: 'json?',
|
|
1320
|
+
},
|
|
1321
|
+
effects: ['read:hospitality_core.Folio', 'read:partner.Partner', 'read:hospitality_core.Stay'],
|
|
1322
|
+
agent: true,
|
|
1323
|
+
handler: async (ctx, args) => {
|
|
1324
|
+
const F = ctx.table('hospitality_core.Folio');
|
|
1325
|
+
let query = from(F).orderBy(asc(F.openedAt)).preload('partner', 'stays');
|
|
1326
|
+
if (args.propertyId)
|
|
1327
|
+
query = query.where(eq(F.propertyId, args.propertyId));
|
|
1328
|
+
if (args.state)
|
|
1329
|
+
query = query.where(eq(F.state, args.state));
|
|
1330
|
+
return ctx.db.all(query);
|
|
1331
|
+
},
|
|
1332
|
+
}),
|
|
1333
|
+
getFolio: defineFn({
|
|
1334
|
+
input: { id: 'id' },
|
|
1335
|
+
output: {
|
|
1336
|
+
id: 'id',
|
|
1337
|
+
code: 'text',
|
|
1338
|
+
propertyId: 'id',
|
|
1339
|
+
partnerId: 'id',
|
|
1340
|
+
state: 'text',
|
|
1341
|
+
amountTotal: 'decimal',
|
|
1342
|
+
version: 'int',
|
|
1343
|
+
openedAt: 'datetime',
|
|
1344
|
+
closedAt: 'datetime?',
|
|
1345
|
+
partner: 'json?',
|
|
1346
|
+
charges: 'json?',
|
|
1347
|
+
stays: 'json?',
|
|
1348
|
+
},
|
|
1349
|
+
effects: [
|
|
1350
|
+
'read:hospitality_core.Folio',
|
|
1351
|
+
'read:partner.Partner',
|
|
1352
|
+
'read:hospitality_core.Charge',
|
|
1353
|
+
'read:hospitality_core.Stay',
|
|
1354
|
+
],
|
|
1355
|
+
agent: true,
|
|
1356
|
+
handler: async (ctx, args) => {
|
|
1357
|
+
const F = ctx.table('hospitality_core.Folio');
|
|
1358
|
+
return ctx.db.one(from(F).where(eq(F.id, args.id)).preload('partner', 'charges', 'stays'));
|
|
1359
|
+
},
|
|
1360
|
+
}),
|
|
1361
|
+
saveGuestDocument: defineFn({
|
|
1362
|
+
input: {
|
|
1363
|
+
id: 'id',
|
|
1364
|
+
stayId: 'id?',
|
|
1365
|
+
partnerId: 'id',
|
|
1366
|
+
type: 'text',
|
|
1367
|
+
number: 'text?',
|
|
1368
|
+
fullName: 'text',
|
|
1369
|
+
dateOfBirth: 'datetime?',
|
|
1370
|
+
gender: 'text?',
|
|
1371
|
+
nationality: 'text?',
|
|
1372
|
+
permanentAddress: 'text?',
|
|
1373
|
+
issueDate: 'datetime?',
|
|
1374
|
+
issuePlace: 'text?',
|
|
1375
|
+
frontAttachmentId: 'id?',
|
|
1376
|
+
backAttachmentId: 'id?',
|
|
1377
|
+
ocrState: 'text?',
|
|
1378
|
+
ocrRaw: 'json?',
|
|
1379
|
+
},
|
|
1380
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1381
|
+
effects: [
|
|
1382
|
+
'read:partner.Partner',
|
|
1383
|
+
'read:hospitality_core.Stay',
|
|
1384
|
+
'read:hospitality_core.StayGuest',
|
|
1385
|
+
'read:hospitality_core.GuestDocument',
|
|
1386
|
+
'read:storage.Attachment',
|
|
1387
|
+
'write:hospitality_core.GuestDocument',
|
|
1388
|
+
'enqueue:hospitality_core.prepareStayNotices',
|
|
1389
|
+
],
|
|
1390
|
+
idempotent: true,
|
|
1391
|
+
agent: true,
|
|
1392
|
+
handler: async (ctx, args) => {
|
|
1393
|
+
const partner = await record(ctx, 'partner.Partner', args.partnerId);
|
|
1394
|
+
const stay = args.stayId ? await record(ctx, 'hospitality_core.Stay', args.stayId) : null;
|
|
1395
|
+
const existing = await record(ctx, 'hospitality_core.GuestDocument', args.id);
|
|
1396
|
+
const errors = [];
|
|
1397
|
+
if (!partner)
|
|
1398
|
+
errors.push(issue('partnerId', 'partner_missing'));
|
|
1399
|
+
if (args.stayId && !stay)
|
|
1400
|
+
errors.push(issue('stayId', 'stay_missing'));
|
|
1401
|
+
if (stay) {
|
|
1402
|
+
const G = ctx.table('hospitality_core.StayGuest');
|
|
1403
|
+
const registered = await ctx.db.one(from(G).where(eq(G.stayId, stay.id), eq(G.partnerId, args.partnerId)));
|
|
1404
|
+
if (!registered)
|
|
1405
|
+
errors.push(issue('partnerId', 'guest_not_registered'));
|
|
1406
|
+
}
|
|
1407
|
+
if (existing &&
|
|
1408
|
+
(existing.partnerId !== args.partnerId || String(existing.stayId ?? '') !== String(args.stayId ?? '')))
|
|
1409
|
+
errors.push(issue('id', 'document_owner_immutable'));
|
|
1410
|
+
if (!oneOf(DOCUMENT_TYPES, args.type))
|
|
1411
|
+
errors.push(issue('type', 'document_type'));
|
|
1412
|
+
if (!text(args.fullName))
|
|
1413
|
+
errors.push(issue('fullName', 'required'));
|
|
1414
|
+
if (args.gender && !oneOf(GENDERS, args.gender))
|
|
1415
|
+
errors.push(issue('gender', 'gender'));
|
|
1416
|
+
const ocrState = String(args.ocrState ?? 'pending');
|
|
1417
|
+
if (!oneOf(OCR_STATES, ocrState))
|
|
1418
|
+
errors.push(issue('ocrState', 'ocr_state'));
|
|
1419
|
+
for (const field of ['frontAttachmentId', 'backAttachmentId'])
|
|
1420
|
+
if (args[field] && !(await record(ctx, 'storage.Attachment', args[field])))
|
|
1421
|
+
errors.push(issue(field, 'attachment_missing'));
|
|
1422
|
+
if (errors.length)
|
|
1423
|
+
return failure(...errors);
|
|
1424
|
+
const values = {
|
|
1425
|
+
stayId: args.stayId,
|
|
1426
|
+
partnerId: args.partnerId,
|
|
1427
|
+
type: args.type,
|
|
1428
|
+
number: text(args.number) || undefined,
|
|
1429
|
+
fullName: text(args.fullName),
|
|
1430
|
+
dateOfBirth: args.dateOfBirth,
|
|
1431
|
+
gender: args.gender,
|
|
1432
|
+
nationality: args.nationality,
|
|
1433
|
+
permanentAddress: args.permanentAddress,
|
|
1434
|
+
issueDate: args.issueDate,
|
|
1435
|
+
issuePlace: args.issuePlace,
|
|
1436
|
+
frontAttachmentId: args.frontAttachmentId,
|
|
1437
|
+
backAttachmentId: args.backAttachmentId,
|
|
1438
|
+
ocrState,
|
|
1439
|
+
ocrRaw: args.ocrRaw,
|
|
1440
|
+
};
|
|
1441
|
+
await ctx.tx(async (tx) => {
|
|
1442
|
+
if (existing)
|
|
1443
|
+
await tx.db.update('hospitality_core.GuestDocument', { id: args.id }, values);
|
|
1444
|
+
else
|
|
1445
|
+
await tx.db.insert('hospitality_core.GuestDocument', { id: args.id, ...values });
|
|
1446
|
+
if (stay?.state === 'checked_in')
|
|
1447
|
+
await tx.jobs.enqueue('hospitality_core.prepareStayNotices', { stayId: stay.id }, { uniqueKey: `stay-notices:${String(stay.id)}` });
|
|
1448
|
+
});
|
|
1449
|
+
return success(args.id);
|
|
1450
|
+
},
|
|
1451
|
+
}),
|
|
1452
|
+
listGuestDocuments: defineFn({
|
|
1453
|
+
input: { stayId: 'id?', partnerId: 'id?' },
|
|
1454
|
+
output: {
|
|
1455
|
+
id: 'id',
|
|
1456
|
+
stayId: 'id?',
|
|
1457
|
+
partnerId: 'id',
|
|
1458
|
+
type: 'text',
|
|
1459
|
+
numberLast4: 'text?',
|
|
1460
|
+
fullName: 'text',
|
|
1461
|
+
nationality: 'text?',
|
|
1462
|
+
ocrState: 'text',
|
|
1463
|
+
dateOfBirthPresent: 'bool',
|
|
1464
|
+
},
|
|
1465
|
+
effects: ['read:hospitality_core.GuestDocument'],
|
|
1466
|
+
agent: true,
|
|
1467
|
+
handler: async (ctx, args) => {
|
|
1468
|
+
const D = ctx.table('hospitality_core.GuestDocument');
|
|
1469
|
+
let query = from(D).orderBy(asc(D.fullName));
|
|
1470
|
+
if (args.stayId)
|
|
1471
|
+
query = query.where(eq(D.stayId, args.stayId));
|
|
1472
|
+
if (args.partnerId)
|
|
1473
|
+
query = query.where(eq(D.partnerId, args.partnerId));
|
|
1474
|
+
return (await ctx.db.all(query)).map((row) => ({
|
|
1475
|
+
...row,
|
|
1476
|
+
numberLast4: text(row.number).slice(-4) || undefined,
|
|
1477
|
+
dateOfBirthPresent: date(row.dateOfBirth) !== null,
|
|
1478
|
+
}));
|
|
1479
|
+
},
|
|
1480
|
+
}),
|
|
1481
|
+
getTapeChart: defineFn({
|
|
1482
|
+
input: { propertyId: 'id', from: 'datetime', to: 'datetime' },
|
|
1483
|
+
output: {
|
|
1484
|
+
propertyId: 'id',
|
|
1485
|
+
timezone: 'text',
|
|
1486
|
+
from: 'datetime',
|
|
1487
|
+
to: 'datetime',
|
|
1488
|
+
rooms: 'json',
|
|
1489
|
+
events: 'json',
|
|
1490
|
+
},
|
|
1491
|
+
effects: [
|
|
1492
|
+
'read:hospitality_core.Property',
|
|
1493
|
+
'read:hospitality_core.Room',
|
|
1494
|
+
'read:hospitality_core.RoomType',
|
|
1495
|
+
'read:hospitality_core.Stay',
|
|
1496
|
+
'read:hospitality_core.RoomAssignment',
|
|
1497
|
+
'read:partner.Partner',
|
|
1498
|
+
'read:hospitality_core.Reservation',
|
|
1499
|
+
],
|
|
1500
|
+
agent: true,
|
|
1501
|
+
handler: async (ctx, args) => {
|
|
1502
|
+
const start = date(args.from);
|
|
1503
|
+
const end = date(args.to);
|
|
1504
|
+
const property = await record(ctx, 'hospitality_core.Property', args.propertyId);
|
|
1505
|
+
const timezone = String(property?.timezone ?? 'UTC');
|
|
1506
|
+
if (!start || !end || end <= start)
|
|
1507
|
+
return { propertyId: args.propertyId, timezone, from: args.from, to: args.to, rooms: [], events: [] };
|
|
1508
|
+
const R = ctx.table('hospitality_core.Room');
|
|
1509
|
+
const S = ctx.table('hospitality_core.Stay');
|
|
1510
|
+
const A = ctx.table('hospitality_core.RoomAssignment');
|
|
1511
|
+
const rooms = await ctx.db.all(from(R)
|
|
1512
|
+
.where(eq(R.propertyId, args.propertyId), eq(R.active, true))
|
|
1513
|
+
.orderBy(asc(R.name))
|
|
1514
|
+
.preload('roomType'));
|
|
1515
|
+
const stays = (await ctx.db.all(from(S).where(eq(S.propertyId, args.propertyId)).preload('partner', 'reservation'))).filter((stay) => stay.state !== 'cancelled' &&
|
|
1516
|
+
stay.state !== 'no_show' &&
|
|
1517
|
+
overlaps(stay.checkIn, stay.checkOut, start, end));
|
|
1518
|
+
const stayIds = new Set(stays.map((stay) => stay.id));
|
|
1519
|
+
const assignments = (await ctx.db.all(from(A).where(eq(A.propertyId, args.propertyId)))).filter((assignment) => stayIds.has(assignment.stayId) &&
|
|
1520
|
+
overlaps(assignment.startAt, assignment.endAt ?? end.toISOString(), start, end));
|
|
1521
|
+
const assigned = new Set(assignments.map((assignment) => assignment.stayId));
|
|
1522
|
+
const events = assignments.map((assignment) => {
|
|
1523
|
+
const stay = stays.find((row) => row.id === assignment.stayId);
|
|
1524
|
+
return {
|
|
1525
|
+
id: String(assignment.id),
|
|
1526
|
+
stayId: String(stay.id),
|
|
1527
|
+
reservationId: stay.reservationId ? String(stay.reservationId) : null,
|
|
1528
|
+
roomId: assignment.roomId ? String(assignment.roomId) : null,
|
|
1529
|
+
roomTypeId: String(assignment.roomTypeId),
|
|
1530
|
+
guest: String(stay.partner?.name ?? ''),
|
|
1531
|
+
provider: String(stay.reservation?.provider ?? 'direct'),
|
|
1532
|
+
state: String(stay.state),
|
|
1533
|
+
start: String(assignment.startAt),
|
|
1534
|
+
end: String(assignment.endAt ?? stay.checkOut),
|
|
1535
|
+
};
|
|
1536
|
+
});
|
|
1537
|
+
for (const stay of stays)
|
|
1538
|
+
if (!assigned.has(stay.id))
|
|
1539
|
+
events.push({
|
|
1540
|
+
id: `${String(stay.id)}:unassigned`,
|
|
1541
|
+
stayId: String(stay.id),
|
|
1542
|
+
reservationId: stay.reservationId ? String(stay.reservationId) : null,
|
|
1543
|
+
roomId: null,
|
|
1544
|
+
roomTypeId: String(stay.roomTypeId),
|
|
1545
|
+
guest: String(stay.partner?.name ?? ''),
|
|
1546
|
+
provider: String(stay.reservation?.provider ?? 'direct'),
|
|
1547
|
+
state: String(stay.state),
|
|
1548
|
+
start: String(stay.checkIn),
|
|
1549
|
+
end: String(stay.checkOut),
|
|
1550
|
+
});
|
|
1551
|
+
return {
|
|
1552
|
+
propertyId: args.propertyId,
|
|
1553
|
+
timezone,
|
|
1554
|
+
from: start.toISOString(),
|
|
1555
|
+
to: end.toISOString(),
|
|
1556
|
+
rooms,
|
|
1557
|
+
events,
|
|
1558
|
+
};
|
|
1559
|
+
},
|
|
1560
|
+
}),
|
|
1561
|
+
};
|
|
1562
|
+
//# sourceMappingURL=operations.js.map
|