@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,1558 @@
|
|
|
1
|
+
import { asc, defineFn, eq, from, inArray } from '@ketvietlab/ketjs';
|
|
2
|
+
import { resolveAddress, validateAddress } from '../address/format.js';
|
|
3
|
+
import { appendContentChange } from './content.js';
|
|
4
|
+
import { ACCOMMODATION_TYPES, AMENITY_SCOPES, BED_TYPES, CANCELLATION_POLICY_TYPES, CONTACT_TYPES, ROOM_STATUSES, ROOM_VIEW_TYPES, } from './types.js';
|
|
5
|
+
const issue = (field, code, params) => ({
|
|
6
|
+
field,
|
|
7
|
+
code,
|
|
8
|
+
messageKey: `hospitality_core.validation.${code}`,
|
|
9
|
+
...(params ? { params } : {}),
|
|
10
|
+
});
|
|
11
|
+
const success = (id) => ({ ok: true, id: String(id), errors: [] });
|
|
12
|
+
const failure = (...errors) => ({ ok: false, errors });
|
|
13
|
+
const cleanCode = (value) => String(value ?? '')
|
|
14
|
+
.trim()
|
|
15
|
+
.toUpperCase();
|
|
16
|
+
const cleanText = (value) => String(value ?? '').trim();
|
|
17
|
+
const normalized = (raw, values) => ({ ...raw, ...values });
|
|
18
|
+
const isClock = (value) => /^(?:[01]\d|2[0-3]):[0-5]\d$/.test(String(value));
|
|
19
|
+
const isTimezone = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
new Intl.DateTimeFormat('en', { timeZone: String(value) }).format();
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const countryCodeOf = (value) => {
|
|
29
|
+
const country = cleanText(value);
|
|
30
|
+
if (/^vi(?:ệ|e)t\s*nam$/iu.test(country))
|
|
31
|
+
return 'VN';
|
|
32
|
+
return country.toUpperCase();
|
|
33
|
+
};
|
|
34
|
+
const propertyPresentation = async (ctx, row) => {
|
|
35
|
+
let oneLine = [row.street1, row.street2, row.divisionText, row.locality, row.postalCode, row.countryCode]
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
.join(', ');
|
|
38
|
+
let divisions = [];
|
|
39
|
+
if (row.countryId) {
|
|
40
|
+
const resolved = await resolveAddress(ctx, {
|
|
41
|
+
street1: row.street1,
|
|
42
|
+
street2: row.street2,
|
|
43
|
+
locality: row.locality,
|
|
44
|
+
postalCode: row.postalCode,
|
|
45
|
+
countryId: row.countryId,
|
|
46
|
+
divisionId: row.divisionId,
|
|
47
|
+
});
|
|
48
|
+
if (resolved.value) {
|
|
49
|
+
oneLine = resolved.value.oneLine;
|
|
50
|
+
divisions = resolved.value.divisions;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
...row,
|
|
55
|
+
addressLine: oneLine,
|
|
56
|
+
city: divisions.at(-1)?.officialName ?? row.locality ?? row.divisionText ?? null,
|
|
57
|
+
country: row.countryCode ?? null,
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const isOneOf = (values, value) => values.includes(String(value));
|
|
61
|
+
const record = async (ctx, model, id) => {
|
|
62
|
+
const table = ctx.table(model);
|
|
63
|
+
return ctx.db.one(from(table).where(eq(table.id, id)));
|
|
64
|
+
};
|
|
65
|
+
class RoomStatusGuard extends Error {
|
|
66
|
+
problem;
|
|
67
|
+
constructor(problem) {
|
|
68
|
+
super(problem.code);
|
|
69
|
+
this.problem = problem;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
class LocationLifecycleGuard extends Error {
|
|
73
|
+
problem;
|
|
74
|
+
constructor(problem) {
|
|
75
|
+
super(problem.code);
|
|
76
|
+
this.problem = problem;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
class RoomLifecycleGuard extends Error {
|
|
80
|
+
problem;
|
|
81
|
+
constructor(problem) {
|
|
82
|
+
super(problem.code);
|
|
83
|
+
this.problem = problem;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const lockActiveFlag = async (ctx, model, row) => {
|
|
87
|
+
const active = row.active === true;
|
|
88
|
+
const locked = await ctx.db.compareAndSet(model, { id: row.id }, { active }, { active });
|
|
89
|
+
return 'matched' in locked && locked.matched;
|
|
90
|
+
};
|
|
91
|
+
const duplicate = async (ctx, model, field, value, exceptId, parent) => {
|
|
92
|
+
const table = ctx.table(model);
|
|
93
|
+
let query = from(table).where(eq(table[field], value));
|
|
94
|
+
if (parent)
|
|
95
|
+
query = query.where(eq(table[parent[0]], parent[1]));
|
|
96
|
+
const rows = await ctx.db.all(query);
|
|
97
|
+
return rows.some((row) => row.id !== exceptId);
|
|
98
|
+
};
|
|
99
|
+
const save = async (ctx, model, args, fields, defaults = {}) => {
|
|
100
|
+
const existing = await record(ctx, model, args.id);
|
|
101
|
+
let changes = ctx.change(model, args, existing).cast(fields);
|
|
102
|
+
if (!existing)
|
|
103
|
+
for (const [key, value] of Object.entries(defaults))
|
|
104
|
+
if (!(key in args) || args[key] == null)
|
|
105
|
+
changes = changes.put(key, value);
|
|
106
|
+
if (!changes.valid)
|
|
107
|
+
return { ok: false, errors: changes.errors };
|
|
108
|
+
await ctx.db.commit(changes, existing ? { id: args.id } : undefined);
|
|
109
|
+
return success(args.id);
|
|
110
|
+
};
|
|
111
|
+
const signalAmenityUsers = async (ctx, amenityId) => {
|
|
112
|
+
const PropertyAmenity = ctx.table('hospitality_core.PropertyAmenity');
|
|
113
|
+
const RoomTypeAmenity = ctx.table('hospitality_core.RoomTypeAmenity');
|
|
114
|
+
const propertyAssignments = await ctx.db.all(from(PropertyAmenity).where(eq(PropertyAmenity.amenityId, amenityId)));
|
|
115
|
+
const roomAssignments = await ctx.db.all(from(RoomTypeAmenity).where(eq(RoomTypeAmenity.amenityId, amenityId)));
|
|
116
|
+
for (const assignment of propertyAssignments)
|
|
117
|
+
await appendContentChange(ctx, {
|
|
118
|
+
propertyId: assignment.propertyId,
|
|
119
|
+
resourceType: 'property',
|
|
120
|
+
resourceId: assignment.propertyId,
|
|
121
|
+
});
|
|
122
|
+
for (const assignment of roomAssignments) {
|
|
123
|
+
const roomType = await record(ctx, 'hospitality_core.RoomType', assignment.roomTypeId);
|
|
124
|
+
if (roomType)
|
|
125
|
+
await appendContentChange(ctx, {
|
|
126
|
+
propertyId: roomType.propertyId,
|
|
127
|
+
resourceType: 'room_type',
|
|
128
|
+
resourceId: roomType.id,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const signalPolicyUsers = async (ctx, policyId) => {
|
|
133
|
+
const Property = ctx.table('hospitality_core.Property');
|
|
134
|
+
const RoomType = ctx.table('hospitality_core.RoomType');
|
|
135
|
+
const properties = await ctx.db.all(from(Property).where(eq(Property.defaultCancellationPolicyId, policyId)));
|
|
136
|
+
const roomTypes = await ctx.db.all(from(RoomType).where(eq(RoomType.cancellationPolicyId, policyId)));
|
|
137
|
+
for (const property of properties)
|
|
138
|
+
await appendContentChange(ctx, {
|
|
139
|
+
propertyId: property.id,
|
|
140
|
+
resourceType: 'property',
|
|
141
|
+
resourceId: property.id,
|
|
142
|
+
});
|
|
143
|
+
for (const roomType of roomTypes)
|
|
144
|
+
await appendContentChange(ctx, {
|
|
145
|
+
propertyId: roomType.propertyId,
|
|
146
|
+
resourceType: 'room_type',
|
|
147
|
+
resourceId: roomType.id,
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
const writable = (name) => ({
|
|
151
|
+
Property: [
|
|
152
|
+
'id',
|
|
153
|
+
'code',
|
|
154
|
+
'name',
|
|
155
|
+
'publicName',
|
|
156
|
+
'accommodationType',
|
|
157
|
+
'timezone',
|
|
158
|
+
'defaultCheckIn',
|
|
159
|
+
'defaultCheckOut',
|
|
160
|
+
'enforceTimes',
|
|
161
|
+
'longStayBillOnCheckIn',
|
|
162
|
+
'starRating',
|
|
163
|
+
'street1',
|
|
164
|
+
'street2',
|
|
165
|
+
'locality',
|
|
166
|
+
'postalCode',
|
|
167
|
+
'countryCode',
|
|
168
|
+
'countryId',
|
|
169
|
+
'divisionId',
|
|
170
|
+
'divisionText',
|
|
171
|
+
'latitude',
|
|
172
|
+
'longitude',
|
|
173
|
+
'description',
|
|
174
|
+
'houseRules',
|
|
175
|
+
'childrenStayFree',
|
|
176
|
+
'minimumGuestAge',
|
|
177
|
+
'defaultCancellationPolicyId',
|
|
178
|
+
],
|
|
179
|
+
Building: ['id', 'propertyId', 'code', 'name', 'sequence'],
|
|
180
|
+
Floor: ['id', 'propertyId', 'buildingId', 'code', 'name', 'sequence'],
|
|
181
|
+
RoomType: [
|
|
182
|
+
'id',
|
|
183
|
+
'propertyId',
|
|
184
|
+
'code',
|
|
185
|
+
'name',
|
|
186
|
+
'publicName',
|
|
187
|
+
'description',
|
|
188
|
+
'defaultCapacity',
|
|
189
|
+
'maxAdults',
|
|
190
|
+
'maxChildren',
|
|
191
|
+
'maxInfants',
|
|
192
|
+
'maxExtraBeds',
|
|
193
|
+
'sizeSqm',
|
|
194
|
+
'viewType',
|
|
195
|
+
'sharedBathroom',
|
|
196
|
+
'baseRate',
|
|
197
|
+
'color',
|
|
198
|
+
'cancellationPolicyId',
|
|
199
|
+
'published',
|
|
200
|
+
],
|
|
201
|
+
Room: ['id', 'propertyId', 'roomTypeId', 'buildingId', 'floorId', 'code', 'name', 'capacity'],
|
|
202
|
+
})[name] ?? [];
|
|
203
|
+
const result = { ok: 'bool', id: 'id?', errors: 'json?' };
|
|
204
|
+
export const functions = {
|
|
205
|
+
listProperties: defineFn({
|
|
206
|
+
input: { includeArchived: 'bool?' },
|
|
207
|
+
output: {
|
|
208
|
+
id: 'id',
|
|
209
|
+
code: 'text',
|
|
210
|
+
name: 'text',
|
|
211
|
+
publicName: 'text?',
|
|
212
|
+
accommodationType: 'text',
|
|
213
|
+
timezone: 'text',
|
|
214
|
+
starRating: 'int',
|
|
215
|
+
city: 'text?',
|
|
216
|
+
country: 'text?',
|
|
217
|
+
addressLine: 'text?',
|
|
218
|
+
active: 'bool',
|
|
219
|
+
rooms: 'int',
|
|
220
|
+
availableRooms: 'int',
|
|
221
|
+
attentionRooms: 'int',
|
|
222
|
+
},
|
|
223
|
+
effects: [
|
|
224
|
+
'read:hospitality_core.Property',
|
|
225
|
+
'read:hospitality_core.Room',
|
|
226
|
+
'read:address.Country',
|
|
227
|
+
'read:address.CurrentCatalog',
|
|
228
|
+
'read:address.Division',
|
|
229
|
+
],
|
|
230
|
+
agent: true,
|
|
231
|
+
handler: async (ctx, args) => {
|
|
232
|
+
const P = ctx.table('hospitality_core.Property');
|
|
233
|
+
let query = from(P).orderBy(asc(P.name));
|
|
234
|
+
if (args.includeArchived !== true)
|
|
235
|
+
query = query.where(eq(P.active, true));
|
|
236
|
+
const properties = await ctx.db.all(query);
|
|
237
|
+
const R = ctx.table('hospitality_core.Room');
|
|
238
|
+
const rooms = await ctx.db.all(from(R).where(eq(R.active, true)));
|
|
239
|
+
const attention = new Set(['dirty', 'cleaning', 'maintenance', 'out_of_order']);
|
|
240
|
+
const counts = new Map();
|
|
241
|
+
for (const room of rooms) {
|
|
242
|
+
const key = String(room.propertyId);
|
|
243
|
+
const count = counts.get(key) ?? { rooms: 0, availableRooms: 0, attentionRooms: 0 };
|
|
244
|
+
count.rooms++;
|
|
245
|
+
if (room.status === 'available')
|
|
246
|
+
count.availableRooms++;
|
|
247
|
+
if (attention.has(String(room.status)))
|
|
248
|
+
count.attentionRooms++;
|
|
249
|
+
counts.set(key, count);
|
|
250
|
+
}
|
|
251
|
+
return Promise.all(properties.map(async (property) => {
|
|
252
|
+
const count = counts.get(String(property.id)) ?? {
|
|
253
|
+
rooms: 0,
|
|
254
|
+
availableRooms: 0,
|
|
255
|
+
attentionRooms: 0,
|
|
256
|
+
};
|
|
257
|
+
return {
|
|
258
|
+
...(await propertyPresentation(ctx, property)),
|
|
259
|
+
...count,
|
|
260
|
+
};
|
|
261
|
+
}));
|
|
262
|
+
},
|
|
263
|
+
}),
|
|
264
|
+
getProperty: defineFn({
|
|
265
|
+
input: { id: 'id' },
|
|
266
|
+
output: {
|
|
267
|
+
id: 'id',
|
|
268
|
+
code: 'text',
|
|
269
|
+
name: 'text',
|
|
270
|
+
publicName: 'text?',
|
|
271
|
+
accommodationType: 'text',
|
|
272
|
+
timezone: 'text',
|
|
273
|
+
defaultCheckIn: 'text',
|
|
274
|
+
defaultCheckOut: 'text',
|
|
275
|
+
enforceTimes: 'bool',
|
|
276
|
+
longStayBillOnCheckIn: 'bool?',
|
|
277
|
+
starRating: 'int',
|
|
278
|
+
street1: 'text?',
|
|
279
|
+
street2: 'text?',
|
|
280
|
+
locality: 'text?',
|
|
281
|
+
postalCode: 'text?',
|
|
282
|
+
countryCode: 'text?',
|
|
283
|
+
countryId: 'id?',
|
|
284
|
+
divisionId: 'id?',
|
|
285
|
+
divisionText: 'text?',
|
|
286
|
+
street: 'text?',
|
|
287
|
+
city: 'text?',
|
|
288
|
+
state: 'text?',
|
|
289
|
+
country: 'text?',
|
|
290
|
+
addressLine: 'text?',
|
|
291
|
+
latitude: 'decimal?',
|
|
292
|
+
longitude: 'decimal?',
|
|
293
|
+
description: 'text?',
|
|
294
|
+
houseRules: 'text?',
|
|
295
|
+
childrenStayFree: 'bool',
|
|
296
|
+
minimumGuestAge: 'int?',
|
|
297
|
+
defaultCancellationPolicyId: 'id?',
|
|
298
|
+
defaultCancellationPolicy: 'json?',
|
|
299
|
+
active: 'bool',
|
|
300
|
+
buildings: 'json?',
|
|
301
|
+
floors: 'json?',
|
|
302
|
+
roomTypes: 'json?',
|
|
303
|
+
rooms: 'json?',
|
|
304
|
+
contacts: 'json?',
|
|
305
|
+
},
|
|
306
|
+
effects: [
|
|
307
|
+
'read:hospitality_core.Property',
|
|
308
|
+
'read:hospitality_core.Building',
|
|
309
|
+
'read:hospitality_core.Floor',
|
|
310
|
+
'read:hospitality_core.RoomType',
|
|
311
|
+
'read:hospitality_core.Room',
|
|
312
|
+
'read:hospitality_core.PropertyContact',
|
|
313
|
+
'read:hospitality_core.CancellationPolicy',
|
|
314
|
+
'read:address.Country',
|
|
315
|
+
'read:address.CurrentCatalog',
|
|
316
|
+
'read:address.Division',
|
|
317
|
+
],
|
|
318
|
+
agent: true,
|
|
319
|
+
handler: async (ctx, args) => {
|
|
320
|
+
const P = ctx.table('hospitality_core.Property');
|
|
321
|
+
const row = await ctx.db.one(from(P)
|
|
322
|
+
.where(eq(P.id, args.id))
|
|
323
|
+
.preload('buildings', 'floors', 'roomTypes', 'rooms', 'contacts', 'cancellationPolicy'));
|
|
324
|
+
if (!row)
|
|
325
|
+
return null;
|
|
326
|
+
return {
|
|
327
|
+
...(await propertyPresentation(ctx, row)),
|
|
328
|
+
defaultCancellationPolicy: row.cancellationPolicy ?? null,
|
|
329
|
+
};
|
|
330
|
+
},
|
|
331
|
+
}),
|
|
332
|
+
saveProperty: defineFn({
|
|
333
|
+
input: {
|
|
334
|
+
id: 'id',
|
|
335
|
+
code: 'text',
|
|
336
|
+
name: 'text',
|
|
337
|
+
publicName: 'text?',
|
|
338
|
+
accommodationType: 'text',
|
|
339
|
+
timezone: 'text?',
|
|
340
|
+
defaultCheckIn: 'text?',
|
|
341
|
+
defaultCheckOut: 'text?',
|
|
342
|
+
enforceTimes: 'bool?',
|
|
343
|
+
longStayBillOnCheckIn: 'bool?',
|
|
344
|
+
starRating: 'int?',
|
|
345
|
+
street: 'text?',
|
|
346
|
+
street1: 'text?',
|
|
347
|
+
street2: 'text?',
|
|
348
|
+
city: 'text?',
|
|
349
|
+
locality: 'text?',
|
|
350
|
+
zip: 'text?',
|
|
351
|
+
postalCode: 'text?',
|
|
352
|
+
state: 'text?',
|
|
353
|
+
country: 'text?',
|
|
354
|
+
countryCode: 'text?',
|
|
355
|
+
countryId: 'id?',
|
|
356
|
+
divisionId: 'id?',
|
|
357
|
+
divisionText: 'text?',
|
|
358
|
+
latitude: 'decimal?',
|
|
359
|
+
longitude: 'decimal?',
|
|
360
|
+
description: 'text?',
|
|
361
|
+
houseRules: 'text?',
|
|
362
|
+
childrenStayFree: 'bool?',
|
|
363
|
+
minimumGuestAge: 'int?',
|
|
364
|
+
defaultCancellationPolicyId: 'id?',
|
|
365
|
+
},
|
|
366
|
+
output: result,
|
|
367
|
+
effects: [
|
|
368
|
+
'read:hospitality_core.Property',
|
|
369
|
+
'write:hospitality_core.Property',
|
|
370
|
+
'write:hospitality_core.ContentChange',
|
|
371
|
+
'read:hospitality_core.CancellationPolicy',
|
|
372
|
+
'read:address.Country',
|
|
373
|
+
'read:address.CurrentCatalog',
|
|
374
|
+
'read:address.Division',
|
|
375
|
+
],
|
|
376
|
+
idempotent: true,
|
|
377
|
+
agent: true,
|
|
378
|
+
handler: async (ctx, raw) => {
|
|
379
|
+
const args = normalized(raw, {
|
|
380
|
+
code: cleanCode(raw.code),
|
|
381
|
+
name: cleanText(raw.name),
|
|
382
|
+
timezone: cleanText(raw.timezone) || 'Asia/Ho_Chi_Minh',
|
|
383
|
+
defaultCheckIn: cleanText(raw.defaultCheckIn) || '14:00',
|
|
384
|
+
defaultCheckOut: cleanText(raw.defaultCheckOut) || '12:00',
|
|
385
|
+
starRating: Number(raw.starRating ?? 0),
|
|
386
|
+
street1: cleanText(raw.street1 ?? raw.street) || null,
|
|
387
|
+
locality: cleanText(raw.locality ?? raw.city) || null,
|
|
388
|
+
postalCode: cleanText(raw.postalCode ?? raw.zip) || null,
|
|
389
|
+
divisionText: cleanText(raw.divisionText ?? raw.state) || null,
|
|
390
|
+
countryCode: countryCodeOf(raw.countryId ?? raw.countryCode ?? raw.country) || null,
|
|
391
|
+
countryId: null,
|
|
392
|
+
divisionId: raw.divisionId ? String(raw.divisionId) : null,
|
|
393
|
+
});
|
|
394
|
+
const errors = [];
|
|
395
|
+
if (!args.code)
|
|
396
|
+
errors.push(issue('code', 'required'));
|
|
397
|
+
if (!args.name)
|
|
398
|
+
errors.push(issue('name', 'required'));
|
|
399
|
+
if (!isOneOf(ACCOMMODATION_TYPES, args.accommodationType))
|
|
400
|
+
errors.push(issue('accommodationType', 'accommodation_type'));
|
|
401
|
+
if (!isClock(args.defaultCheckIn))
|
|
402
|
+
errors.push(issue('defaultCheckIn', 'clock'));
|
|
403
|
+
if (!isClock(args.defaultCheckOut))
|
|
404
|
+
errors.push(issue('defaultCheckOut', 'clock'));
|
|
405
|
+
if (!isTimezone(args.timezone))
|
|
406
|
+
errors.push(issue('timezone', 'timezone'));
|
|
407
|
+
if (!Number.isInteger(args.starRating) || args.starRating < 0 || args.starRating > 5)
|
|
408
|
+
errors.push(issue('starRating', 'star_rating'));
|
|
409
|
+
if (raw.minimumGuestAge != null && Number(raw.minimumGuestAge) < 0)
|
|
410
|
+
errors.push(issue('minimumGuestAge', 'non_negative'));
|
|
411
|
+
if (await duplicate(ctx, 'hospitality_core.Property', 'code', args.code, args.id))
|
|
412
|
+
errors.push(issue('code', 'unique'));
|
|
413
|
+
if (args.defaultCancellationPolicyId &&
|
|
414
|
+
!(await record(ctx, 'hospitality_core.CancellationPolicy', args.defaultCancellationPolicyId)))
|
|
415
|
+
errors.push(issue('defaultCancellationPolicyId', 'policy_missing'));
|
|
416
|
+
if (args.countryCode && !/^[A-Z]{2}$/.test(args.countryCode))
|
|
417
|
+
errors.push(issue('countryId', 'address.error.countryCode'));
|
|
418
|
+
if (args.countryCode) {
|
|
419
|
+
const C = ctx.table('address.Country');
|
|
420
|
+
const installed = await ctx.db.one(from(C).where(eq(C.id, args.countryCode)));
|
|
421
|
+
if (installed) {
|
|
422
|
+
const checked = await validateAddress(ctx, {
|
|
423
|
+
street1: args.street1,
|
|
424
|
+
street2: args.street2,
|
|
425
|
+
locality: args.locality,
|
|
426
|
+
postalCode: args.postalCode,
|
|
427
|
+
countryId: args.countryCode,
|
|
428
|
+
divisionId: args.divisionId,
|
|
429
|
+
});
|
|
430
|
+
if (checked.issues.length)
|
|
431
|
+
return { ok: false, errors: checked.issues };
|
|
432
|
+
args.countryId = args.countryCode;
|
|
433
|
+
}
|
|
434
|
+
else if (args.divisionId) {
|
|
435
|
+
return { ok: false, errors: [{ field: 'divisionId', code: 'address.error.catalogNotInstalled' }] };
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (errors.length)
|
|
439
|
+
return failure(...errors);
|
|
440
|
+
return ctx.tx(async (tx) => {
|
|
441
|
+
const result = await save(tx, 'hospitality_core.Property', args, writable('Property'), {
|
|
442
|
+
enforceTimes: true,
|
|
443
|
+
longStayBillOnCheckIn: true,
|
|
444
|
+
childrenStayFree: false,
|
|
445
|
+
active: true,
|
|
446
|
+
});
|
|
447
|
+
if (result.ok)
|
|
448
|
+
await appendContentChange(tx, {
|
|
449
|
+
propertyId: args.id,
|
|
450
|
+
resourceType: 'property',
|
|
451
|
+
resourceId: args.id,
|
|
452
|
+
});
|
|
453
|
+
return result;
|
|
454
|
+
});
|
|
455
|
+
},
|
|
456
|
+
}),
|
|
457
|
+
archiveProperty: defineFn({
|
|
458
|
+
input: { id: 'id', active: 'bool' },
|
|
459
|
+
output: { id: 'id', active: 'bool' },
|
|
460
|
+
effects: [
|
|
461
|
+
'read:hospitality_core.Property',
|
|
462
|
+
'write:hospitality_core.Property',
|
|
463
|
+
'write:hospitality_core.ContentChange',
|
|
464
|
+
],
|
|
465
|
+
idempotent: true,
|
|
466
|
+
agent: true,
|
|
467
|
+
handler: async (ctx, args) => {
|
|
468
|
+
const property = await record(ctx, 'hospitality_core.Property', args.id);
|
|
469
|
+
if (!property)
|
|
470
|
+
return args;
|
|
471
|
+
await ctx.tx(async (tx) => {
|
|
472
|
+
await tx.db.update('hospitality_core.Property', { id: args.id }, { active: args.active });
|
|
473
|
+
await appendContentChange(tx, {
|
|
474
|
+
propertyId: args.id,
|
|
475
|
+
resourceType: 'property',
|
|
476
|
+
resourceId: args.id,
|
|
477
|
+
kind: args.active ? 'upsert' : 'archive',
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
return args;
|
|
481
|
+
},
|
|
482
|
+
}),
|
|
483
|
+
listBuildings: defineFn({
|
|
484
|
+
input: { propertyId: 'id', includeArchived: 'bool?' },
|
|
485
|
+
output: {
|
|
486
|
+
id: 'id',
|
|
487
|
+
propertyId: 'id',
|
|
488
|
+
code: 'text',
|
|
489
|
+
name: 'text',
|
|
490
|
+
sequence: 'int',
|
|
491
|
+
active: 'bool',
|
|
492
|
+
floors: 'json?',
|
|
493
|
+
rooms: 'json?',
|
|
494
|
+
},
|
|
495
|
+
effects: ['read:hospitality_core.Building', 'read:hospitality_core.Floor', 'read:hospitality_core.Room'],
|
|
496
|
+
agent: true,
|
|
497
|
+
handler: async (ctx, args) => {
|
|
498
|
+
const B = ctx.table('hospitality_core.Building');
|
|
499
|
+
let query = from(B).where(eq(B.propertyId, args.propertyId));
|
|
500
|
+
if (args.includeArchived !== true)
|
|
501
|
+
query = query.where(eq(B.active, true));
|
|
502
|
+
return ctx.db.all(query.orderBy(asc(B.sequence), asc(B.name)).preload('floors', 'rooms'));
|
|
503
|
+
},
|
|
504
|
+
}),
|
|
505
|
+
getBuilding: defineFn({
|
|
506
|
+
input: { id: 'id' },
|
|
507
|
+
output: {
|
|
508
|
+
id: 'id',
|
|
509
|
+
propertyId: 'id',
|
|
510
|
+
code: 'text',
|
|
511
|
+
name: 'text',
|
|
512
|
+
sequence: 'int',
|
|
513
|
+
active: 'bool',
|
|
514
|
+
property: 'json?',
|
|
515
|
+
floors: 'json?',
|
|
516
|
+
rooms: 'json?',
|
|
517
|
+
},
|
|
518
|
+
effects: [
|
|
519
|
+
'read:hospitality_core.Building',
|
|
520
|
+
'read:hospitality_core.Property',
|
|
521
|
+
'read:hospitality_core.Floor',
|
|
522
|
+
'read:hospitality_core.Room',
|
|
523
|
+
],
|
|
524
|
+
agent: true,
|
|
525
|
+
handler: async (ctx, args) => {
|
|
526
|
+
const B = ctx.table('hospitality_core.Building');
|
|
527
|
+
const building = await ctx.db.one(from(B).where(eq(B.id, args.id)).preload('property', 'rooms'));
|
|
528
|
+
if (!building)
|
|
529
|
+
return null;
|
|
530
|
+
const F = ctx.table('hospitality_core.Floor');
|
|
531
|
+
const floors = await ctx.db.all(from(F)
|
|
532
|
+
.where(eq(F.buildingId, building.id))
|
|
533
|
+
.orderBy(asc(F.sequence), asc(F.name))
|
|
534
|
+
.preload('building', 'rooms'));
|
|
535
|
+
return { ...building, floors };
|
|
536
|
+
},
|
|
537
|
+
}),
|
|
538
|
+
saveBuilding: defineFn({
|
|
539
|
+
input: { id: 'id', propertyId: 'id', code: 'text', name: 'text', sequence: 'int?' },
|
|
540
|
+
output: result,
|
|
541
|
+
effects: [
|
|
542
|
+
'read:hospitality_core.Property',
|
|
543
|
+
'read:hospitality_core.Building',
|
|
544
|
+
'write:hospitality_core.Building',
|
|
545
|
+
],
|
|
546
|
+
idempotent: true,
|
|
547
|
+
agent: true,
|
|
548
|
+
handler: async (ctx, raw) => {
|
|
549
|
+
const current = await record(ctx, 'hospitality_core.Building', raw.id);
|
|
550
|
+
const args = normalized(raw, {
|
|
551
|
+
code: cleanCode(raw.code),
|
|
552
|
+
name: cleanText(raw.name),
|
|
553
|
+
sequence: Number(raw.sequence ?? 10),
|
|
554
|
+
});
|
|
555
|
+
const errors = [];
|
|
556
|
+
if (!(await record(ctx, 'hospitality_core.Property', args.propertyId)))
|
|
557
|
+
errors.push(issue('propertyId', 'property_missing'));
|
|
558
|
+
if (current && current.propertyId !== args.propertyId)
|
|
559
|
+
errors.push(issue('propertyId', 'property_mismatch'));
|
|
560
|
+
if (!args.code)
|
|
561
|
+
errors.push(issue('code', 'required'));
|
|
562
|
+
if (!args.name)
|
|
563
|
+
errors.push(issue('name', 'required'));
|
|
564
|
+
if (await duplicate(ctx, 'hospitality_core.Building', 'code', args.code, args.id, [
|
|
565
|
+
'propertyId',
|
|
566
|
+
args.propertyId,
|
|
567
|
+
]))
|
|
568
|
+
errors.push(issue('code', 'unique'));
|
|
569
|
+
if (errors.length)
|
|
570
|
+
return failure(...errors);
|
|
571
|
+
return save(ctx, 'hospitality_core.Building', args, writable('Building'), { active: true });
|
|
572
|
+
},
|
|
573
|
+
}),
|
|
574
|
+
archiveBuilding: defineFn({
|
|
575
|
+
input: { id: 'id', active: 'bool' },
|
|
576
|
+
output: result,
|
|
577
|
+
effects: [
|
|
578
|
+
'read:hospitality_core.Property',
|
|
579
|
+
'read:hospitality_core.Building',
|
|
580
|
+
'read:hospitality_core.Floor',
|
|
581
|
+
'read:hospitality_core.Room',
|
|
582
|
+
'write:hospitality_core.Building',
|
|
583
|
+
],
|
|
584
|
+
idempotent: true,
|
|
585
|
+
agent: true,
|
|
586
|
+
handler: async (ctx, args) => {
|
|
587
|
+
try {
|
|
588
|
+
return await ctx.tx(async (tx) => {
|
|
589
|
+
const building = await record(tx, 'hospitality_core.Building', args.id);
|
|
590
|
+
if (!building)
|
|
591
|
+
return failure(issue('id', 'building_missing'));
|
|
592
|
+
if (building.active === args.active)
|
|
593
|
+
return success(args.id);
|
|
594
|
+
if (args.active) {
|
|
595
|
+
const property = await record(tx, 'hospitality_core.Property', building.propertyId);
|
|
596
|
+
if (!property)
|
|
597
|
+
return failure(issue('propertyId', 'property_missing'));
|
|
598
|
+
if (property.active !== true)
|
|
599
|
+
return failure(issue('propertyId', 'property_archived'));
|
|
600
|
+
}
|
|
601
|
+
const changed = await tx.db.compareAndSet('hospitality_core.Building', { id: args.id }, { active: building.active }, { active: args.active });
|
|
602
|
+
if (!('matched' in changed) || !changed.matched)
|
|
603
|
+
return failure(issue('id', 'transition_conflict'));
|
|
604
|
+
if (!args.active) {
|
|
605
|
+
const F = tx.table('hospitality_core.Floor');
|
|
606
|
+
const activeFloor = await tx.db.one(from(F).where(eq(F.buildingId, args.id), eq(F.active, true)).limit(1));
|
|
607
|
+
if (activeFloor)
|
|
608
|
+
throw new LocationLifecycleGuard(issue('id', 'location_has_active_floors'));
|
|
609
|
+
const R = tx.table('hospitality_core.Room');
|
|
610
|
+
const activeRoom = await tx.db.one(from(R).where(eq(R.buildingId, args.id), eq(R.active, true)).limit(1));
|
|
611
|
+
if (activeRoom)
|
|
612
|
+
throw new LocationLifecycleGuard(issue('id', 'location_has_active_rooms'));
|
|
613
|
+
}
|
|
614
|
+
return success(args.id);
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
catch (error) {
|
|
618
|
+
if (error instanceof LocationLifecycleGuard)
|
|
619
|
+
return failure(error.problem);
|
|
620
|
+
throw error;
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
}),
|
|
624
|
+
listFloors: defineFn({
|
|
625
|
+
input: { propertyId: 'id', buildingId: 'id?', includeArchived: 'bool?' },
|
|
626
|
+
output: {
|
|
627
|
+
id: 'id',
|
|
628
|
+
propertyId: 'id',
|
|
629
|
+
buildingId: 'id',
|
|
630
|
+
code: 'text',
|
|
631
|
+
name: 'text',
|
|
632
|
+
sequence: 'int',
|
|
633
|
+
active: 'bool',
|
|
634
|
+
building: 'json?',
|
|
635
|
+
rooms: 'json?',
|
|
636
|
+
},
|
|
637
|
+
effects: ['read:hospitality_core.Floor', 'read:hospitality_core.Building', 'read:hospitality_core.Room'],
|
|
638
|
+
agent: true,
|
|
639
|
+
handler: async (ctx, args) => {
|
|
640
|
+
const F = ctx.table('hospitality_core.Floor');
|
|
641
|
+
let query = from(F).where(eq(F.propertyId, args.propertyId));
|
|
642
|
+
if (args.includeArchived !== true)
|
|
643
|
+
query = query.where(eq(F.active, true));
|
|
644
|
+
if (args.buildingId)
|
|
645
|
+
query = query.where(eq(F.buildingId, args.buildingId));
|
|
646
|
+
return ctx.db.all(query.orderBy(asc(F.sequence), asc(F.name)).preload('building', 'rooms'));
|
|
647
|
+
},
|
|
648
|
+
}),
|
|
649
|
+
getFloor: defineFn({
|
|
650
|
+
input: { id: 'id' },
|
|
651
|
+
output: {
|
|
652
|
+
id: 'id',
|
|
653
|
+
propertyId: 'id',
|
|
654
|
+
buildingId: 'id',
|
|
655
|
+
code: 'text',
|
|
656
|
+
name: 'text',
|
|
657
|
+
sequence: 'int',
|
|
658
|
+
active: 'bool',
|
|
659
|
+
property: 'json?',
|
|
660
|
+
building: 'json?',
|
|
661
|
+
rooms: 'json?',
|
|
662
|
+
},
|
|
663
|
+
effects: [
|
|
664
|
+
'read:hospitality_core.Floor',
|
|
665
|
+
'read:hospitality_core.Property',
|
|
666
|
+
'read:hospitality_core.Building',
|
|
667
|
+
'read:hospitality_core.Room',
|
|
668
|
+
'read:hospitality_core.RoomType',
|
|
669
|
+
],
|
|
670
|
+
agent: true,
|
|
671
|
+
handler: async (ctx, args) => {
|
|
672
|
+
const F = ctx.table('hospitality_core.Floor');
|
|
673
|
+
const floor = await ctx.db.one(from(F).where(eq(F.id, args.id)).preload('property', 'building'));
|
|
674
|
+
if (!floor)
|
|
675
|
+
return null;
|
|
676
|
+
const R = ctx.table('hospitality_core.Room');
|
|
677
|
+
const rooms = await ctx.db.all(from(R).where(eq(R.floorId, floor.id)).orderBy(asc(R.name)).preload('roomType', 'building', 'floor'));
|
|
678
|
+
return { ...floor, rooms };
|
|
679
|
+
},
|
|
680
|
+
}),
|
|
681
|
+
saveFloor: defineFn({
|
|
682
|
+
input: { id: 'id', propertyId: 'id', buildingId: 'id', code: 'text', name: 'text', sequence: 'int?' },
|
|
683
|
+
output: result,
|
|
684
|
+
effects: [
|
|
685
|
+
'read:hospitality_core.Building',
|
|
686
|
+
'read:hospitality_core.Floor',
|
|
687
|
+
'write:hospitality_core.Building',
|
|
688
|
+
'write:hospitality_core.Floor',
|
|
689
|
+
],
|
|
690
|
+
idempotent: true,
|
|
691
|
+
agent: true,
|
|
692
|
+
handler: (ctx, raw) => ctx.tx(async (tx) => {
|
|
693
|
+
const current = await record(tx, 'hospitality_core.Floor', raw.id);
|
|
694
|
+
const args = normalized(raw, {
|
|
695
|
+
code: cleanCode(raw.code),
|
|
696
|
+
name: cleanText(raw.name),
|
|
697
|
+
sequence: Number(raw.sequence ?? 10),
|
|
698
|
+
});
|
|
699
|
+
const building = await record(tx, 'hospitality_core.Building', args.buildingId);
|
|
700
|
+
const errors = [];
|
|
701
|
+
if (!building)
|
|
702
|
+
errors.push(issue('buildingId', 'building_missing'));
|
|
703
|
+
else if (building.propertyId !== args.propertyId)
|
|
704
|
+
errors.push(issue('buildingId', 'property_mismatch'));
|
|
705
|
+
else if (!current && building.active !== true)
|
|
706
|
+
errors.push(issue('buildingId', 'location_archived'));
|
|
707
|
+
if (current && current.propertyId !== args.propertyId)
|
|
708
|
+
errors.push(issue('propertyId', 'property_mismatch'));
|
|
709
|
+
if (current && current.buildingId !== args.buildingId)
|
|
710
|
+
errors.push(issue('buildingId', 'location_immutable'));
|
|
711
|
+
if (!args.code)
|
|
712
|
+
errors.push(issue('code', 'required'));
|
|
713
|
+
if (!args.name)
|
|
714
|
+
errors.push(issue('name', 'required'));
|
|
715
|
+
if (await duplicate(tx, 'hospitality_core.Floor', 'code', args.code, args.id, [
|
|
716
|
+
'buildingId',
|
|
717
|
+
args.buildingId,
|
|
718
|
+
]))
|
|
719
|
+
errors.push(issue('code', 'unique'));
|
|
720
|
+
if (errors.length)
|
|
721
|
+
return failure(...errors);
|
|
722
|
+
if (!(await lockActiveFlag(tx, 'hospitality_core.Building', building)))
|
|
723
|
+
return failure(issue('buildingId', 'transition_conflict'));
|
|
724
|
+
return save(tx, 'hospitality_core.Floor', args, writable('Floor'), { active: true });
|
|
725
|
+
}),
|
|
726
|
+
}),
|
|
727
|
+
archiveFloor: defineFn({
|
|
728
|
+
input: { id: 'id', active: 'bool' },
|
|
729
|
+
output: result,
|
|
730
|
+
effects: [
|
|
731
|
+
'read:hospitality_core.Building',
|
|
732
|
+
'read:hospitality_core.Floor',
|
|
733
|
+
'read:hospitality_core.Room',
|
|
734
|
+
'write:hospitality_core.Building',
|
|
735
|
+
'write:hospitality_core.Floor',
|
|
736
|
+
],
|
|
737
|
+
idempotent: true,
|
|
738
|
+
agent: true,
|
|
739
|
+
handler: async (ctx, args) => {
|
|
740
|
+
try {
|
|
741
|
+
return await ctx.tx(async (tx) => {
|
|
742
|
+
const floor = await record(tx, 'hospitality_core.Floor', args.id);
|
|
743
|
+
if (!floor)
|
|
744
|
+
return failure(issue('id', 'floor_missing'));
|
|
745
|
+
if (floor.active === args.active)
|
|
746
|
+
return success(args.id);
|
|
747
|
+
const building = await record(tx, 'hospitality_core.Building', floor.buildingId);
|
|
748
|
+
if (!building)
|
|
749
|
+
return failure(issue('buildingId', 'building_missing'));
|
|
750
|
+
if (!(await lockActiveFlag(tx, 'hospitality_core.Building', building)))
|
|
751
|
+
return failure(issue('buildingId', 'transition_conflict'));
|
|
752
|
+
if (args.active && building.active !== true)
|
|
753
|
+
return failure(issue('buildingId', 'location_archived'));
|
|
754
|
+
const changed = await tx.db.compareAndSet('hospitality_core.Floor', { id: args.id }, { active: floor.active }, { active: args.active });
|
|
755
|
+
if (!('matched' in changed) || !changed.matched)
|
|
756
|
+
return failure(issue('id', 'transition_conflict'));
|
|
757
|
+
if (!args.active) {
|
|
758
|
+
const R = tx.table('hospitality_core.Room');
|
|
759
|
+
const activeRoom = await tx.db.one(from(R).where(eq(R.floorId, args.id), eq(R.active, true)).limit(1));
|
|
760
|
+
if (activeRoom)
|
|
761
|
+
throw new LocationLifecycleGuard(issue('id', 'location_has_active_rooms'));
|
|
762
|
+
}
|
|
763
|
+
return success(args.id);
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
catch (error) {
|
|
767
|
+
if (error instanceof LocationLifecycleGuard)
|
|
768
|
+
return failure(error.problem);
|
|
769
|
+
throw error;
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
}),
|
|
773
|
+
listRoomTypes: defineFn({
|
|
774
|
+
input: { propertyId: 'id?', includeArchived: 'bool?' },
|
|
775
|
+
output: {
|
|
776
|
+
id: 'id',
|
|
777
|
+
propertyId: 'id',
|
|
778
|
+
code: 'text',
|
|
779
|
+
name: 'text',
|
|
780
|
+
publicName: 'text?',
|
|
781
|
+
description: 'text?',
|
|
782
|
+
defaultCapacity: 'int',
|
|
783
|
+
maxAdults: 'int',
|
|
784
|
+
maxChildren: 'int',
|
|
785
|
+
maxInfants: 'int',
|
|
786
|
+
maxExtraBeds: 'int',
|
|
787
|
+
sizeSqm: 'decimal?',
|
|
788
|
+
viewType: 'text?',
|
|
789
|
+
sharedBathroom: 'bool',
|
|
790
|
+
baseRate: 'decimal',
|
|
791
|
+
published: 'bool',
|
|
792
|
+
active: 'bool',
|
|
793
|
+
rooms: 'json?',
|
|
794
|
+
beds: 'json?',
|
|
795
|
+
},
|
|
796
|
+
effects: ['read:hospitality_core.RoomType', 'read:hospitality_core.Room', 'read:hospitality_core.Bed'],
|
|
797
|
+
agent: true,
|
|
798
|
+
handler: async (ctx, args) => {
|
|
799
|
+
const T = ctx.table('hospitality_core.RoomType');
|
|
800
|
+
let query = from(T).orderBy(asc(T.name)).preload('rooms', 'beds');
|
|
801
|
+
if (args.propertyId)
|
|
802
|
+
query = query.where(eq(T.propertyId, args.propertyId));
|
|
803
|
+
if (args.includeArchived !== true)
|
|
804
|
+
query = query.where(eq(T.active, true));
|
|
805
|
+
return ctx.db.all(query);
|
|
806
|
+
},
|
|
807
|
+
}),
|
|
808
|
+
getRoomType: defineFn({
|
|
809
|
+
input: { id: 'id' },
|
|
810
|
+
output: {
|
|
811
|
+
id: 'id',
|
|
812
|
+
propertyId: 'id',
|
|
813
|
+
code: 'text',
|
|
814
|
+
name: 'text',
|
|
815
|
+
publicName: 'text?',
|
|
816
|
+
description: 'text?',
|
|
817
|
+
defaultCapacity: 'int',
|
|
818
|
+
maxAdults: 'int',
|
|
819
|
+
maxChildren: 'int',
|
|
820
|
+
maxInfants: 'int',
|
|
821
|
+
maxExtraBeds: 'int',
|
|
822
|
+
sizeSqm: 'decimal?',
|
|
823
|
+
viewType: 'text?',
|
|
824
|
+
sharedBathroom: 'bool',
|
|
825
|
+
baseRate: 'decimal',
|
|
826
|
+
color: 'text?',
|
|
827
|
+
cancellationPolicyId: 'id?',
|
|
828
|
+
published: 'bool',
|
|
829
|
+
active: 'bool',
|
|
830
|
+
property: 'json?',
|
|
831
|
+
rooms: 'json?',
|
|
832
|
+
beds: 'json?',
|
|
833
|
+
ratePlans: 'json?',
|
|
834
|
+
cancellationPolicy: 'json?',
|
|
835
|
+
},
|
|
836
|
+
effects: [
|
|
837
|
+
'read:hospitality_core.RoomType',
|
|
838
|
+
'read:hospitality_core.Property',
|
|
839
|
+
'read:hospitality_core.Room',
|
|
840
|
+
'read:hospitality_core.Bed',
|
|
841
|
+
'read:hospitality_core.RatePlan',
|
|
842
|
+
'read:hospitality_core.CancellationPolicy',
|
|
843
|
+
],
|
|
844
|
+
agent: true,
|
|
845
|
+
handler: async (ctx, args) => {
|
|
846
|
+
const T = ctx.table('hospitality_core.RoomType');
|
|
847
|
+
return ctx.db.one(from(T)
|
|
848
|
+
.where(eq(T.id, args.id))
|
|
849
|
+
.preload('property', 'rooms', 'beds', 'ratePlans', 'cancellationPolicy'));
|
|
850
|
+
},
|
|
851
|
+
}),
|
|
852
|
+
saveRoomType: defineFn({
|
|
853
|
+
input: {
|
|
854
|
+
id: 'id',
|
|
855
|
+
propertyId: 'id',
|
|
856
|
+
code: 'text',
|
|
857
|
+
name: 'text',
|
|
858
|
+
publicName: 'text?',
|
|
859
|
+
description: 'text?',
|
|
860
|
+
defaultCapacity: 'int?',
|
|
861
|
+
maxAdults: 'int?',
|
|
862
|
+
maxChildren: 'int?',
|
|
863
|
+
maxInfants: 'int?',
|
|
864
|
+
maxExtraBeds: 'int?',
|
|
865
|
+
sizeSqm: 'decimal?',
|
|
866
|
+
viewType: 'text?',
|
|
867
|
+
sharedBathroom: 'bool?',
|
|
868
|
+
baseRate: 'decimal?',
|
|
869
|
+
color: 'text?',
|
|
870
|
+
cancellationPolicyId: 'id?',
|
|
871
|
+
published: 'bool?',
|
|
872
|
+
},
|
|
873
|
+
output: result,
|
|
874
|
+
effects: [
|
|
875
|
+
'read:hospitality_core.Property',
|
|
876
|
+
'read:hospitality_core.RoomType',
|
|
877
|
+
'read:hospitality_core.CancellationPolicy',
|
|
878
|
+
'write:hospitality_core.RoomType',
|
|
879
|
+
'write:hospitality_core.ContentChange',
|
|
880
|
+
],
|
|
881
|
+
idempotent: true,
|
|
882
|
+
agent: true,
|
|
883
|
+
handler: async (ctx, raw) => {
|
|
884
|
+
const current = await record(ctx, 'hospitality_core.RoomType', raw.id);
|
|
885
|
+
const args = normalized(raw, {
|
|
886
|
+
code: cleanCode(raw.code),
|
|
887
|
+
name: cleanText(raw.name),
|
|
888
|
+
defaultCapacity: Number(raw.defaultCapacity ?? 2),
|
|
889
|
+
maxAdults: Number(raw.maxAdults ?? raw.defaultCapacity ?? 2),
|
|
890
|
+
maxChildren: Number(raw.maxChildren ?? 0),
|
|
891
|
+
maxInfants: Number(raw.maxInfants ?? 0),
|
|
892
|
+
maxExtraBeds: Number(raw.maxExtraBeds ?? 0),
|
|
893
|
+
baseRate: String(raw.baseRate ?? '0'),
|
|
894
|
+
});
|
|
895
|
+
const errors = [];
|
|
896
|
+
if (!(await record(ctx, 'hospitality_core.Property', args.propertyId)))
|
|
897
|
+
errors.push(issue('propertyId', 'property_missing'));
|
|
898
|
+
if (current && current.propertyId !== args.propertyId)
|
|
899
|
+
errors.push(issue('propertyId', 'property_mismatch'));
|
|
900
|
+
if (args.cancellationPolicyId &&
|
|
901
|
+
!(await record(ctx, 'hospitality_core.CancellationPolicy', args.cancellationPolicyId)))
|
|
902
|
+
errors.push(issue('cancellationPolicyId', 'policy_missing'));
|
|
903
|
+
if (!args.code)
|
|
904
|
+
errors.push(issue('code', 'required'));
|
|
905
|
+
if (!args.name)
|
|
906
|
+
errors.push(issue('name', 'required'));
|
|
907
|
+
for (const field of [
|
|
908
|
+
'defaultCapacity',
|
|
909
|
+
'maxAdults',
|
|
910
|
+
'maxChildren',
|
|
911
|
+
'maxInfants',
|
|
912
|
+
'maxExtraBeds',
|
|
913
|
+
])
|
|
914
|
+
if (!Number.isInteger(args[field]) || args[field] < 0)
|
|
915
|
+
errors.push(issue(field, 'non_negative'));
|
|
916
|
+
if (args.defaultCapacity < 1)
|
|
917
|
+
errors.push(issue('defaultCapacity', 'capacity'));
|
|
918
|
+
if (args.maxAdults < 1)
|
|
919
|
+
errors.push(issue('maxAdults', 'capacity'));
|
|
920
|
+
if (args.defaultCapacity > args.maxAdults + args.maxChildren)
|
|
921
|
+
errors.push(issue('defaultCapacity', 'capacity_total'));
|
|
922
|
+
if (Number(args.baseRate) < 0)
|
|
923
|
+
errors.push(issue('baseRate', 'non_negative'));
|
|
924
|
+
if (args.sizeSqm != null && Number(args.sizeSqm) <= 0)
|
|
925
|
+
errors.push(issue('sizeSqm', 'positive'));
|
|
926
|
+
if (args.viewType && !isOneOf(ROOM_VIEW_TYPES, args.viewType))
|
|
927
|
+
errors.push(issue('viewType', 'view_type'));
|
|
928
|
+
if (args.color && !/^#[0-9a-f]{6}$/i.test(String(args.color)))
|
|
929
|
+
errors.push(issue('color', 'color'));
|
|
930
|
+
if (await duplicate(ctx, 'hospitality_core.RoomType', 'code', args.code, args.id, [
|
|
931
|
+
'propertyId',
|
|
932
|
+
args.propertyId,
|
|
933
|
+
]))
|
|
934
|
+
errors.push(issue('code', 'unique'));
|
|
935
|
+
if (errors.length)
|
|
936
|
+
return failure(...errors);
|
|
937
|
+
return ctx.tx(async (tx) => {
|
|
938
|
+
const result = await save(tx, 'hospitality_core.RoomType', args, writable('RoomType'), {
|
|
939
|
+
sharedBathroom: false,
|
|
940
|
+
published: false,
|
|
941
|
+
active: true,
|
|
942
|
+
});
|
|
943
|
+
if (result.ok)
|
|
944
|
+
await appendContentChange(tx, {
|
|
945
|
+
propertyId: args.propertyId,
|
|
946
|
+
resourceType: 'room_type',
|
|
947
|
+
resourceId: args.id,
|
|
948
|
+
});
|
|
949
|
+
return result;
|
|
950
|
+
});
|
|
951
|
+
},
|
|
952
|
+
}),
|
|
953
|
+
listRooms: defineFn({
|
|
954
|
+
input: { propertyId: 'id?', status: 'text?', includeArchived: 'bool?', limit: 'int?' },
|
|
955
|
+
output: {
|
|
956
|
+
id: 'id',
|
|
957
|
+
propertyId: 'id',
|
|
958
|
+
roomTypeId: 'id',
|
|
959
|
+
buildingId: 'id?',
|
|
960
|
+
floorId: 'id?',
|
|
961
|
+
code: 'text',
|
|
962
|
+
name: 'text',
|
|
963
|
+
capacity: 'int',
|
|
964
|
+
status: 'text',
|
|
965
|
+
note: 'text?',
|
|
966
|
+
active: 'bool',
|
|
967
|
+
roomType: 'json?',
|
|
968
|
+
building: 'json?',
|
|
969
|
+
floor: 'json?',
|
|
970
|
+
},
|
|
971
|
+
effects: [
|
|
972
|
+
'read:hospitality_core.Room',
|
|
973
|
+
'read:hospitality_core.RoomType',
|
|
974
|
+
'read:hospitality_core.Building',
|
|
975
|
+
'read:hospitality_core.Floor',
|
|
976
|
+
],
|
|
977
|
+
agent: true,
|
|
978
|
+
handler: async (ctx, args) => {
|
|
979
|
+
const R = ctx.table('hospitality_core.Room');
|
|
980
|
+
let query = from(R).orderBy(asc(R.name)).preload('roomType', 'building', 'floor');
|
|
981
|
+
if (args.propertyId)
|
|
982
|
+
query = query.where(eq(R.propertyId, args.propertyId));
|
|
983
|
+
if (args.status)
|
|
984
|
+
query = query.where(eq(R.status, args.status));
|
|
985
|
+
if (args.includeArchived !== true)
|
|
986
|
+
query = query.where(eq(R.active, true));
|
|
987
|
+
if (args.limit != null)
|
|
988
|
+
query = query.limit(Math.max(1, Math.min(500, Number(args.limit))));
|
|
989
|
+
return ctx.db.all(query);
|
|
990
|
+
},
|
|
991
|
+
}),
|
|
992
|
+
getRoom: defineFn({
|
|
993
|
+
input: { id: 'id' },
|
|
994
|
+
output: {
|
|
995
|
+
id: 'id',
|
|
996
|
+
propertyId: 'id',
|
|
997
|
+
roomTypeId: 'id',
|
|
998
|
+
buildingId: 'id?',
|
|
999
|
+
floorId: 'id?',
|
|
1000
|
+
code: 'text',
|
|
1001
|
+
name: 'text',
|
|
1002
|
+
capacity: 'int',
|
|
1003
|
+
status: 'text',
|
|
1004
|
+
note: 'text?',
|
|
1005
|
+
active: 'bool',
|
|
1006
|
+
property: 'json?',
|
|
1007
|
+
roomType: 'json?',
|
|
1008
|
+
building: 'json?',
|
|
1009
|
+
floor: 'json?',
|
|
1010
|
+
},
|
|
1011
|
+
effects: [
|
|
1012
|
+
'read:hospitality_core.Room',
|
|
1013
|
+
'read:hospitality_core.Property',
|
|
1014
|
+
'read:hospitality_core.RoomType',
|
|
1015
|
+
'read:hospitality_core.Building',
|
|
1016
|
+
'read:hospitality_core.Floor',
|
|
1017
|
+
],
|
|
1018
|
+
agent: true,
|
|
1019
|
+
handler: async (ctx, args) => {
|
|
1020
|
+
const R = ctx.table('hospitality_core.Room');
|
|
1021
|
+
return ctx.db.one(from(R).where(eq(R.id, args.id)).preload('property', 'roomType', 'building', 'floor'));
|
|
1022
|
+
},
|
|
1023
|
+
}),
|
|
1024
|
+
saveRoom: defineFn({
|
|
1025
|
+
input: {
|
|
1026
|
+
id: 'id',
|
|
1027
|
+
propertyId: 'id',
|
|
1028
|
+
roomTypeId: 'id',
|
|
1029
|
+
buildingId: 'id?',
|
|
1030
|
+
floorId: 'id?',
|
|
1031
|
+
code: 'text',
|
|
1032
|
+
name: 'text',
|
|
1033
|
+
capacity: 'int?',
|
|
1034
|
+
status: 'text?',
|
|
1035
|
+
note: 'text?',
|
|
1036
|
+
},
|
|
1037
|
+
output: result,
|
|
1038
|
+
effects: [
|
|
1039
|
+
'read:hospitality_core.Room',
|
|
1040
|
+
'read:hospitality_core.RoomType',
|
|
1041
|
+
'read:hospitality_core.Building',
|
|
1042
|
+
'read:hospitality_core.Floor',
|
|
1043
|
+
'write:hospitality_core.Building',
|
|
1044
|
+
'write:hospitality_core.Floor',
|
|
1045
|
+
'write:hospitality_core.Room',
|
|
1046
|
+
],
|
|
1047
|
+
idempotent: true,
|
|
1048
|
+
agent: true,
|
|
1049
|
+
handler: (ctx, raw) => ctx.tx(async (tx) => {
|
|
1050
|
+
const current = await record(tx, 'hospitality_core.Room', raw.id);
|
|
1051
|
+
const type = await record(tx, 'hospitality_core.RoomType', raw.roomTypeId);
|
|
1052
|
+
const floor = raw.floorId ? await record(tx, 'hospitality_core.Floor', raw.floorId) : null;
|
|
1053
|
+
const buildingId = raw.buildingId || floor?.buildingId || null;
|
|
1054
|
+
const building = buildingId ? await record(tx, 'hospitality_core.Building', buildingId) : null;
|
|
1055
|
+
const args = normalized(raw, {
|
|
1056
|
+
buildingId,
|
|
1057
|
+
floorId: raw.floorId || null,
|
|
1058
|
+
code: cleanCode(raw.code),
|
|
1059
|
+
name: cleanText(raw.name),
|
|
1060
|
+
capacity: Number(raw.capacity ?? type?.defaultCapacity ?? 1),
|
|
1061
|
+
});
|
|
1062
|
+
const errors = [];
|
|
1063
|
+
if (!type)
|
|
1064
|
+
errors.push(issue('roomTypeId', 'room_type_missing'));
|
|
1065
|
+
else if (type.propertyId !== args.propertyId)
|
|
1066
|
+
errors.push(issue('roomTypeId', 'property_mismatch'));
|
|
1067
|
+
if (buildingId && !building)
|
|
1068
|
+
errors.push(issue('buildingId', 'building_missing'));
|
|
1069
|
+
else if (building && building.propertyId !== args.propertyId)
|
|
1070
|
+
errors.push(issue('buildingId', 'property_mismatch'));
|
|
1071
|
+
else if (building && building.active !== true && current?.buildingId !== building.id)
|
|
1072
|
+
errors.push(issue('buildingId', 'location_archived'));
|
|
1073
|
+
if (raw.floorId && !floor)
|
|
1074
|
+
errors.push(issue('floorId', 'floor_missing'));
|
|
1075
|
+
else if (floor && floor.propertyId !== args.propertyId)
|
|
1076
|
+
errors.push(issue('floorId', 'property_mismatch'));
|
|
1077
|
+
else if (floor && buildingId && floor.buildingId !== buildingId)
|
|
1078
|
+
errors.push(issue('floorId', 'building_mismatch'));
|
|
1079
|
+
else if (floor && floor.active !== true && current?.floorId !== floor.id)
|
|
1080
|
+
errors.push(issue('floorId', 'location_archived'));
|
|
1081
|
+
if (current && current.propertyId !== args.propertyId)
|
|
1082
|
+
errors.push(issue('propertyId', 'property_mismatch'));
|
|
1083
|
+
if (!args.code)
|
|
1084
|
+
errors.push(issue('code', 'required'));
|
|
1085
|
+
if (!args.name)
|
|
1086
|
+
errors.push(issue('name', 'required'));
|
|
1087
|
+
if (!Number.isInteger(args.capacity) || args.capacity < 1)
|
|
1088
|
+
errors.push(issue('capacity', 'capacity'));
|
|
1089
|
+
if (raw.status != null) {
|
|
1090
|
+
const requestedStatus = String(raw.status);
|
|
1091
|
+
if (!isOneOf(ROOM_STATUSES, requestedStatus))
|
|
1092
|
+
errors.push(issue('status', 'room_status'));
|
|
1093
|
+
else if (requestedStatus !== String(current?.status ?? 'available'))
|
|
1094
|
+
errors.push(issue('status', 'room_status_configuration_managed'));
|
|
1095
|
+
}
|
|
1096
|
+
if (await duplicate(tx, 'hospitality_core.Room', 'code', args.code, args.id, [
|
|
1097
|
+
'propertyId',
|
|
1098
|
+
args.propertyId,
|
|
1099
|
+
]))
|
|
1100
|
+
errors.push(issue('code', 'unique'));
|
|
1101
|
+
if (errors.length)
|
|
1102
|
+
return failure(...errors);
|
|
1103
|
+
if (building && !(await lockActiveFlag(tx, 'hospitality_core.Building', building)))
|
|
1104
|
+
return failure(issue('buildingId', 'transition_conflict'));
|
|
1105
|
+
if (floor && !(await lockActiveFlag(tx, 'hospitality_core.Floor', floor)))
|
|
1106
|
+
return failure(issue('floorId', 'transition_conflict'));
|
|
1107
|
+
const configuration = { ...args };
|
|
1108
|
+
delete configuration.status;
|
|
1109
|
+
delete configuration.note;
|
|
1110
|
+
return save(tx, 'hospitality_core.Room', configuration, writable('Room'), {
|
|
1111
|
+
status: 'available',
|
|
1112
|
+
note: null,
|
|
1113
|
+
active: true,
|
|
1114
|
+
});
|
|
1115
|
+
}),
|
|
1116
|
+
}),
|
|
1117
|
+
archiveRoom: defineFn({
|
|
1118
|
+
input: { id: 'id', active: 'bool' },
|
|
1119
|
+
output: result,
|
|
1120
|
+
effects: [
|
|
1121
|
+
'read:hospitality_core.Property',
|
|
1122
|
+
'read:hospitality_core.RoomType',
|
|
1123
|
+
'read:hospitality_core.Building',
|
|
1124
|
+
'read:hospitality_core.Floor',
|
|
1125
|
+
'read:hospitality_core.Room',
|
|
1126
|
+
'read:hospitality_core.Stay',
|
|
1127
|
+
'read:hospitality_core.CleaningTask',
|
|
1128
|
+
'write:hospitality_core.Building',
|
|
1129
|
+
'write:hospitality_core.Floor',
|
|
1130
|
+
'write:hospitality_core.Room',
|
|
1131
|
+
],
|
|
1132
|
+
idempotent: true,
|
|
1133
|
+
agent: true,
|
|
1134
|
+
handler: async (ctx, args) => {
|
|
1135
|
+
try {
|
|
1136
|
+
return await ctx.tx(async (tx) => {
|
|
1137
|
+
const room = await record(tx, 'hospitality_core.Room', args.id);
|
|
1138
|
+
if (!room)
|
|
1139
|
+
return failure(issue('id', 'room_missing'));
|
|
1140
|
+
if (room.active === args.active)
|
|
1141
|
+
return success(args.id);
|
|
1142
|
+
if (args.active) {
|
|
1143
|
+
const property = await record(tx, 'hospitality_core.Property', room.propertyId);
|
|
1144
|
+
if (!property)
|
|
1145
|
+
return failure(issue('propertyId', 'property_missing'));
|
|
1146
|
+
if (property.active !== true)
|
|
1147
|
+
return failure(issue('propertyId', 'property_archived'));
|
|
1148
|
+
const roomType = await record(tx, 'hospitality_core.RoomType', room.roomTypeId);
|
|
1149
|
+
if (!roomType)
|
|
1150
|
+
return failure(issue('roomTypeId', 'room_type_missing'));
|
|
1151
|
+
if (roomType.active !== true)
|
|
1152
|
+
return failure(issue('roomTypeId', 'room_type_archived'));
|
|
1153
|
+
const building = room.buildingId
|
|
1154
|
+
? await record(tx, 'hospitality_core.Building', room.buildingId)
|
|
1155
|
+
: null;
|
|
1156
|
+
if (room.buildingId && !building)
|
|
1157
|
+
return failure(issue('buildingId', 'building_missing'));
|
|
1158
|
+
if (building && building.active !== true)
|
|
1159
|
+
return failure(issue('buildingId', 'location_archived'));
|
|
1160
|
+
if (building && !(await lockActiveFlag(tx, 'hospitality_core.Building', building)))
|
|
1161
|
+
return failure(issue('buildingId', 'transition_conflict'));
|
|
1162
|
+
const floor = room.floorId ? await record(tx, 'hospitality_core.Floor', room.floorId) : null;
|
|
1163
|
+
if (room.floorId && !floor)
|
|
1164
|
+
return failure(issue('floorId', 'floor_missing'));
|
|
1165
|
+
if (floor && floor.active !== true)
|
|
1166
|
+
return failure(issue('floorId', 'location_archived'));
|
|
1167
|
+
if (floor && !(await lockActiveFlag(tx, 'hospitality_core.Floor', floor)))
|
|
1168
|
+
return failure(issue('floorId', 'transition_conflict'));
|
|
1169
|
+
const restored = await tx.db.compareAndSet('hospitality_core.Room', { id: args.id }, { active: false, status: 'available' }, { active: true });
|
|
1170
|
+
if (!('matched' in restored) || !restored.matched)
|
|
1171
|
+
return failure(issue('id', 'transition_conflict'));
|
|
1172
|
+
return success(args.id);
|
|
1173
|
+
}
|
|
1174
|
+
if (room.status !== 'available')
|
|
1175
|
+
return failure(issue('id', 'room_archive_status'));
|
|
1176
|
+
const archived = await tx.db.compareAndSet('hospitality_core.Room', { id: args.id }, { active: true, status: 'available' }, { active: false });
|
|
1177
|
+
if (!('matched' in archived) || !archived.matched)
|
|
1178
|
+
return failure(issue('id', 'transition_conflict'));
|
|
1179
|
+
const S = tx.table('hospitality_core.Stay');
|
|
1180
|
+
const activeStay = await tx.db.one(from(S).where(eq(S.currentRoomId, args.id), eq(S.state, 'checked_in')).limit(1));
|
|
1181
|
+
if (activeStay)
|
|
1182
|
+
throw new RoomLifecycleGuard(issue('id', 'room_has_active_stay'));
|
|
1183
|
+
const T = tx.table('hospitality_core.CleaningTask');
|
|
1184
|
+
const activeTask = await tx.db.one(from(T)
|
|
1185
|
+
.where(eq(T.roomId, args.id), inArray(T.state, ['todo', 'in_progress']))
|
|
1186
|
+
.limit(1));
|
|
1187
|
+
if (activeTask)
|
|
1188
|
+
throw new RoomLifecycleGuard(issue('id', 'room_has_open_task'));
|
|
1189
|
+
return success(args.id);
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
catch (error) {
|
|
1193
|
+
if (error instanceof RoomLifecycleGuard)
|
|
1194
|
+
return failure(error.problem);
|
|
1195
|
+
throw error;
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
}),
|
|
1199
|
+
setRoomStatus: defineFn({
|
|
1200
|
+
input: { id: 'id', expectedStatus: 'text?', status: 'text', note: 'text?' },
|
|
1201
|
+
output: { ok: 'bool', id: 'id?', status: 'text?', errors: 'json?' },
|
|
1202
|
+
effects: [
|
|
1203
|
+
'read:hospitality_core.Room',
|
|
1204
|
+
'read:hospitality_core.Stay',
|
|
1205
|
+
'read:hospitality_core.CleaningTask',
|
|
1206
|
+
'write:hospitality_core.Room',
|
|
1207
|
+
],
|
|
1208
|
+
idempotent: true,
|
|
1209
|
+
agent: true,
|
|
1210
|
+
handler: async (ctx, args) => {
|
|
1211
|
+
if (!isOneOf(ROOM_STATUSES, args.status))
|
|
1212
|
+
return failure(issue('status', 'room_status'));
|
|
1213
|
+
if (args.expectedStatus && !isOneOf(ROOM_STATUSES, args.expectedStatus))
|
|
1214
|
+
return failure(issue('expectedStatus', 'room_status'));
|
|
1215
|
+
if (args.status === 'occupied' || args.status === 'cleaning')
|
|
1216
|
+
return failure(issue('status', 'room_status_managed'));
|
|
1217
|
+
if (args.status === 'available')
|
|
1218
|
+
return failure(issue('status', 'room_status_available_managed'));
|
|
1219
|
+
const note = args.note === undefined ? undefined : cleanText(args.note);
|
|
1220
|
+
try {
|
|
1221
|
+
return await ctx.tx(async (tx) => {
|
|
1222
|
+
const room = await record(tx, 'hospitality_core.Room', args.id);
|
|
1223
|
+
if (!room)
|
|
1224
|
+
return failure(issue('id', 'room_missing'));
|
|
1225
|
+
if (room.active !== true)
|
|
1226
|
+
return failure(issue('id', 'room_archived'));
|
|
1227
|
+
if (args.expectedStatus && room.status !== args.expectedStatus)
|
|
1228
|
+
return failure(issue('status', 'transition_conflict'));
|
|
1229
|
+
if (room.status === args.status)
|
|
1230
|
+
return { ok: true, id: args.id, status: args.status, errors: [] };
|
|
1231
|
+
if ((args.status === 'maintenance' || args.status === 'out_of_order') && !note)
|
|
1232
|
+
return failure(issue('note', 'room_status_note_required'));
|
|
1233
|
+
if (room.status === 'occupied')
|
|
1234
|
+
return failure(issue('status', 'room_occupied'));
|
|
1235
|
+
if (room.status === 'cleaning')
|
|
1236
|
+
return failure(issue('status', 'room_cleaning'));
|
|
1237
|
+
const S = tx.table('hospitality_core.Stay');
|
|
1238
|
+
const currentStay = await tx.db.one(from(S).where(eq(S.currentRoomId, args.id), eq(S.state, 'checked_in')).limit(1));
|
|
1239
|
+
if (currentStay)
|
|
1240
|
+
return failure(issue('status', 'room_occupied'));
|
|
1241
|
+
const changed = await tx.db.compareAndSet('hospitality_core.Room', { id: args.id }, { status: room.status, active: true }, {
|
|
1242
|
+
status: args.status,
|
|
1243
|
+
...(note !== undefined ? { note: note || null } : {}),
|
|
1244
|
+
});
|
|
1245
|
+
if (!('matched' in changed) || !changed.matched)
|
|
1246
|
+
return failure(issue('status', 'transition_conflict'));
|
|
1247
|
+
const T = tx.table('hospitality_core.CleaningTask');
|
|
1248
|
+
const activeTask = await tx.db.one(from(T)
|
|
1249
|
+
.where(eq(T.roomId, args.id), inArray(T.state, ['todo', 'in_progress']))
|
|
1250
|
+
.limit(1));
|
|
1251
|
+
if (activeTask)
|
|
1252
|
+
throw new RoomStatusGuard(issue('status', 'room_task_open'));
|
|
1253
|
+
return { ok: true, id: args.id, status: args.status, errors: [] };
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
catch (error) {
|
|
1257
|
+
if (error instanceof RoomStatusGuard)
|
|
1258
|
+
return failure(error.problem);
|
|
1259
|
+
throw error;
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
}),
|
|
1263
|
+
listAmenityCategories: defineFn({
|
|
1264
|
+
output: { id: 'id', name: 'text', sequence: 'int', active: 'bool' },
|
|
1265
|
+
effects: ['read:hospitality_core.AmenityCategory'],
|
|
1266
|
+
agent: true,
|
|
1267
|
+
handler: async (ctx) => {
|
|
1268
|
+
const C = ctx.table('hospitality_core.AmenityCategory');
|
|
1269
|
+
return ctx.db.all(from(C).where(eq(C.active, true)).orderBy(asc(C.sequence)));
|
|
1270
|
+
},
|
|
1271
|
+
}),
|
|
1272
|
+
saveAmenityCategory: defineFn({
|
|
1273
|
+
input: { id: 'id', name: 'text', sequence: 'int?' },
|
|
1274
|
+
output: result,
|
|
1275
|
+
effects: ['read:hospitality_core.AmenityCategory', 'write:hospitality_core.AmenityCategory'],
|
|
1276
|
+
idempotent: true,
|
|
1277
|
+
agent: true,
|
|
1278
|
+
handler: async (ctx, raw) => {
|
|
1279
|
+
const args = normalized(raw, { name: cleanText(raw.name), sequence: Number(raw.sequence ?? 10) });
|
|
1280
|
+
if (!args.name)
|
|
1281
|
+
return failure(issue('name', 'required'));
|
|
1282
|
+
return save(ctx, 'hospitality_core.AmenityCategory', args, ['id', 'name', 'sequence'], { active: true });
|
|
1283
|
+
},
|
|
1284
|
+
}),
|
|
1285
|
+
listAmenities: defineFn({
|
|
1286
|
+
input: { scope: 'text?' },
|
|
1287
|
+
output: {
|
|
1288
|
+
id: 'id',
|
|
1289
|
+
categoryId: 'id?',
|
|
1290
|
+
code: 'text',
|
|
1291
|
+
name: 'text',
|
|
1292
|
+
scope: 'text',
|
|
1293
|
+
sequence: 'int',
|
|
1294
|
+
active: 'bool',
|
|
1295
|
+
},
|
|
1296
|
+
effects: ['read:hospitality_core.Amenity'],
|
|
1297
|
+
agent: true,
|
|
1298
|
+
handler: async (ctx, args) => {
|
|
1299
|
+
const A = ctx.table('hospitality_core.Amenity');
|
|
1300
|
+
let query = from(A).where(eq(A.active, true)).orderBy(asc(A.sequence), asc(A.name));
|
|
1301
|
+
if (args.scope)
|
|
1302
|
+
query = query.where(eq(A.scope, args.scope));
|
|
1303
|
+
return ctx.db.all(query);
|
|
1304
|
+
},
|
|
1305
|
+
}),
|
|
1306
|
+
saveAmenity: defineFn({
|
|
1307
|
+
input: { id: 'id', categoryId: 'id?', code: 'text', name: 'text', scope: 'text', sequence: 'int?' },
|
|
1308
|
+
output: result,
|
|
1309
|
+
effects: [
|
|
1310
|
+
'read:hospitality_core.AmenityCategory',
|
|
1311
|
+
'read:hospitality_core.Amenity',
|
|
1312
|
+
'read:hospitality_core.PropertyAmenity',
|
|
1313
|
+
'read:hospitality_core.RoomTypeAmenity',
|
|
1314
|
+
'read:hospitality_core.RoomType',
|
|
1315
|
+
'write:hospitality_core.Amenity',
|
|
1316
|
+
'write:hospitality_core.ContentChange',
|
|
1317
|
+
],
|
|
1318
|
+
idempotent: true,
|
|
1319
|
+
agent: true,
|
|
1320
|
+
handler: async (ctx, raw) => {
|
|
1321
|
+
const args = normalized(raw, {
|
|
1322
|
+
code: cleanCode(raw.code),
|
|
1323
|
+
name: cleanText(raw.name),
|
|
1324
|
+
sequence: Number(raw.sequence ?? 10),
|
|
1325
|
+
});
|
|
1326
|
+
const errors = [];
|
|
1327
|
+
if (args.categoryId && !(await record(ctx, 'hospitality_core.AmenityCategory', args.categoryId)))
|
|
1328
|
+
errors.push(issue('categoryId', 'amenity_category_missing'));
|
|
1329
|
+
if (!args.code)
|
|
1330
|
+
errors.push(issue('code', 'required'));
|
|
1331
|
+
if (!args.name)
|
|
1332
|
+
errors.push(issue('name', 'required'));
|
|
1333
|
+
if (!isOneOf(AMENITY_SCOPES, args.scope))
|
|
1334
|
+
errors.push(issue('scope', 'amenity_scope'));
|
|
1335
|
+
if (await duplicate(ctx, 'hospitality_core.Amenity', 'code', args.code, args.id))
|
|
1336
|
+
errors.push(issue('code', 'unique'));
|
|
1337
|
+
if (errors.length)
|
|
1338
|
+
return failure(...errors);
|
|
1339
|
+
return ctx.tx(async (tx) => {
|
|
1340
|
+
const result = await save(tx, 'hospitality_core.Amenity', args, ['id', 'categoryId', 'code', 'name', 'scope', 'sequence'], { active: true });
|
|
1341
|
+
if (result.ok)
|
|
1342
|
+
await signalAmenityUsers(tx, args.id);
|
|
1343
|
+
return result;
|
|
1344
|
+
});
|
|
1345
|
+
},
|
|
1346
|
+
}),
|
|
1347
|
+
assignAmenity: defineFn({
|
|
1348
|
+
input: { id: 'id', target: 'text', targetId: 'id', amenityId: 'id' },
|
|
1349
|
+
output: result,
|
|
1350
|
+
effects: [
|
|
1351
|
+
'read:hospitality_core.Amenity',
|
|
1352
|
+
'read:hospitality_core.Property',
|
|
1353
|
+
'read:hospitality_core.RoomType',
|
|
1354
|
+
'read:hospitality_core.PropertyAmenity',
|
|
1355
|
+
'read:hospitality_core.RoomTypeAmenity',
|
|
1356
|
+
'write:hospitality_core.PropertyAmenity',
|
|
1357
|
+
'write:hospitality_core.RoomTypeAmenity',
|
|
1358
|
+
'write:hospitality_core.ContentChange',
|
|
1359
|
+
],
|
|
1360
|
+
idempotent: true,
|
|
1361
|
+
agent: true,
|
|
1362
|
+
handler: async (ctx, args) => {
|
|
1363
|
+
const amenity = await record(ctx, 'hospitality_core.Amenity', args.amenityId);
|
|
1364
|
+
if (!amenity)
|
|
1365
|
+
return failure(issue('amenityId', 'amenity_missing'));
|
|
1366
|
+
const property = args.target === 'property';
|
|
1367
|
+
const roomType = args.target === 'room_type';
|
|
1368
|
+
if (!property && !roomType)
|
|
1369
|
+
return failure(issue('target', 'amenity_target'));
|
|
1370
|
+
if (property && amenity.scope !== 'property')
|
|
1371
|
+
return failure(issue('amenityId', 'amenity_scope_mismatch'));
|
|
1372
|
+
if (roomType && amenity.scope !== 'room')
|
|
1373
|
+
return failure(issue('amenityId', 'amenity_scope_mismatch'));
|
|
1374
|
+
const targetModel = property ? 'hospitality_core.Property' : 'hospitality_core.RoomType';
|
|
1375
|
+
const targetRecord = await record(ctx, targetModel, args.targetId);
|
|
1376
|
+
if (!targetRecord)
|
|
1377
|
+
return failure(issue('targetId', 'target_missing'));
|
|
1378
|
+
const model = property ? 'hospitality_core.PropertyAmenity' : 'hospitality_core.RoomTypeAmenity';
|
|
1379
|
+
const targetField = property ? 'propertyId' : 'roomTypeId';
|
|
1380
|
+
const table = ctx.table(model);
|
|
1381
|
+
const existing = await ctx.db.one(from(table).where(eq(table[targetField], args.targetId), eq(table.amenityId, args.amenityId)));
|
|
1382
|
+
if (existing)
|
|
1383
|
+
return success(existing.id);
|
|
1384
|
+
return ctx.tx(async (tx) => {
|
|
1385
|
+
await tx.db.insert(model, {
|
|
1386
|
+
id: args.id,
|
|
1387
|
+
[targetField]: args.targetId,
|
|
1388
|
+
amenityId: args.amenityId,
|
|
1389
|
+
});
|
|
1390
|
+
await appendContentChange(tx, {
|
|
1391
|
+
propertyId: property ? args.targetId : targetRecord.propertyId,
|
|
1392
|
+
resourceType: property ? 'property' : 'room_type',
|
|
1393
|
+
resourceId: args.targetId,
|
|
1394
|
+
});
|
|
1395
|
+
return success(args.id);
|
|
1396
|
+
});
|
|
1397
|
+
},
|
|
1398
|
+
}),
|
|
1399
|
+
saveBed: defineFn({
|
|
1400
|
+
input: { id: 'id', roomTypeId: 'id', type: 'text', quantity: 'int', roomName: 'text?' },
|
|
1401
|
+
output: result,
|
|
1402
|
+
effects: [
|
|
1403
|
+
'read:hospitality_core.RoomType',
|
|
1404
|
+
'read:hospitality_core.Bed',
|
|
1405
|
+
'write:hospitality_core.Bed',
|
|
1406
|
+
'write:hospitality_core.ContentChange',
|
|
1407
|
+
],
|
|
1408
|
+
idempotent: true,
|
|
1409
|
+
agent: true,
|
|
1410
|
+
handler: async (ctx, args) => {
|
|
1411
|
+
const errors = [];
|
|
1412
|
+
const roomType = await record(ctx, 'hospitality_core.RoomType', args.roomTypeId);
|
|
1413
|
+
if (!roomType)
|
|
1414
|
+
errors.push(issue('roomTypeId', 'room_type_missing'));
|
|
1415
|
+
if (!isOneOf(BED_TYPES, args.type))
|
|
1416
|
+
errors.push(issue('type', 'bed_type'));
|
|
1417
|
+
if (!Number.isInteger(Number(args.quantity)) || Number(args.quantity) < 1)
|
|
1418
|
+
errors.push(issue('quantity', 'positive'));
|
|
1419
|
+
if (errors.length)
|
|
1420
|
+
return failure(...errors);
|
|
1421
|
+
return ctx.tx(async (tx) => {
|
|
1422
|
+
const result = await save(tx, 'hospitality_core.Bed', args, [
|
|
1423
|
+
'id',
|
|
1424
|
+
'roomTypeId',
|
|
1425
|
+
'type',
|
|
1426
|
+
'quantity',
|
|
1427
|
+
'roomName',
|
|
1428
|
+
]);
|
|
1429
|
+
if (result.ok && roomType)
|
|
1430
|
+
await appendContentChange(tx, {
|
|
1431
|
+
propertyId: roomType.propertyId,
|
|
1432
|
+
resourceType: 'room_type',
|
|
1433
|
+
resourceId: args.roomTypeId,
|
|
1434
|
+
});
|
|
1435
|
+
return result;
|
|
1436
|
+
});
|
|
1437
|
+
},
|
|
1438
|
+
}),
|
|
1439
|
+
listCancellationPolicies: defineFn({
|
|
1440
|
+
input: { includeArchived: 'bool?' },
|
|
1441
|
+
output: {
|
|
1442
|
+
id: 'id',
|
|
1443
|
+
code: 'text',
|
|
1444
|
+
name: 'text',
|
|
1445
|
+
type: 'text',
|
|
1446
|
+
description: 'text?',
|
|
1447
|
+
freeCancellationHours: 'int',
|
|
1448
|
+
penaltyPercent: 'decimal',
|
|
1449
|
+
active: 'bool',
|
|
1450
|
+
},
|
|
1451
|
+
effects: ['read:hospitality_core.CancellationPolicy'],
|
|
1452
|
+
agent: true,
|
|
1453
|
+
handler: async (ctx, args) => {
|
|
1454
|
+
const P = ctx.table('hospitality_core.CancellationPolicy');
|
|
1455
|
+
let query = from(P).orderBy(asc(P.name));
|
|
1456
|
+
if (args.includeArchived !== true)
|
|
1457
|
+
query = query.where(eq(P.active, true));
|
|
1458
|
+
return ctx.db.all(query);
|
|
1459
|
+
},
|
|
1460
|
+
}),
|
|
1461
|
+
saveCancellationPolicy: defineFn({
|
|
1462
|
+
input: {
|
|
1463
|
+
id: 'id',
|
|
1464
|
+
code: 'text',
|
|
1465
|
+
name: 'text',
|
|
1466
|
+
type: 'text',
|
|
1467
|
+
description: 'text?',
|
|
1468
|
+
freeCancellationHours: 'int?',
|
|
1469
|
+
penaltyPercent: 'decimal?',
|
|
1470
|
+
},
|
|
1471
|
+
output: result,
|
|
1472
|
+
effects: [
|
|
1473
|
+
'read:hospitality_core.CancellationPolicy',
|
|
1474
|
+
'read:hospitality_core.Property',
|
|
1475
|
+
'read:hospitality_core.RoomType',
|
|
1476
|
+
'write:hospitality_core.CancellationPolicy',
|
|
1477
|
+
'write:hospitality_core.ContentChange',
|
|
1478
|
+
],
|
|
1479
|
+
idempotent: true,
|
|
1480
|
+
agent: true,
|
|
1481
|
+
handler: async (ctx, raw) => {
|
|
1482
|
+
const args = normalized(raw, {
|
|
1483
|
+
code: cleanCode(raw.code),
|
|
1484
|
+
name: cleanText(raw.name),
|
|
1485
|
+
freeCancellationHours: Number(raw.freeCancellationHours ?? 0),
|
|
1486
|
+
penaltyPercent: String(raw.penaltyPercent ?? '0'),
|
|
1487
|
+
});
|
|
1488
|
+
const errors = [];
|
|
1489
|
+
if (!args.code)
|
|
1490
|
+
errors.push(issue('code', 'required'));
|
|
1491
|
+
if (!args.name)
|
|
1492
|
+
errors.push(issue('name', 'required'));
|
|
1493
|
+
if (!isOneOf(CANCELLATION_POLICY_TYPES, args.type))
|
|
1494
|
+
errors.push(issue('type', 'cancellation_policy_type'));
|
|
1495
|
+
if (args.freeCancellationHours < 0)
|
|
1496
|
+
errors.push(issue('freeCancellationHours', 'non_negative'));
|
|
1497
|
+
if (Number(args.penaltyPercent) < 0 || Number(args.penaltyPercent) > 100)
|
|
1498
|
+
errors.push(issue('penaltyPercent', 'percentage'));
|
|
1499
|
+
if (await duplicate(ctx, 'hospitality_core.CancellationPolicy', 'code', args.code, args.id))
|
|
1500
|
+
errors.push(issue('code', 'unique'));
|
|
1501
|
+
if (errors.length)
|
|
1502
|
+
return failure(...errors);
|
|
1503
|
+
return ctx.tx(async (tx) => {
|
|
1504
|
+
const result = await save(tx, 'hospitality_core.CancellationPolicy', args, ['id', 'code', 'name', 'type', 'description', 'freeCancellationHours', 'penaltyPercent'], { active: true });
|
|
1505
|
+
if (result.ok)
|
|
1506
|
+
await signalPolicyUsers(tx, args.id);
|
|
1507
|
+
return result;
|
|
1508
|
+
});
|
|
1509
|
+
},
|
|
1510
|
+
}),
|
|
1511
|
+
savePropertyContact: defineFn({
|
|
1512
|
+
input: { id: 'id', propertyId: 'id', type: 'text', name: 'text', email: 'text?', phone: 'text?' },
|
|
1513
|
+
output: result,
|
|
1514
|
+
effects: [
|
|
1515
|
+
'read:hospitality_core.Property',
|
|
1516
|
+
'read:hospitality_core.PropertyContact',
|
|
1517
|
+
'write:hospitality_core.PropertyContact',
|
|
1518
|
+
'write:hospitality_core.ContentChange',
|
|
1519
|
+
],
|
|
1520
|
+
idempotent: true,
|
|
1521
|
+
agent: true,
|
|
1522
|
+
handler: async (ctx, raw) => {
|
|
1523
|
+
const args = normalized(raw, { name: cleanText(raw.name) });
|
|
1524
|
+
const errors = [];
|
|
1525
|
+
if (!(await record(ctx, 'hospitality_core.Property', args.propertyId)))
|
|
1526
|
+
errors.push(issue('propertyId', 'property_missing'));
|
|
1527
|
+
if (!args.name)
|
|
1528
|
+
errors.push(issue('name', 'required'));
|
|
1529
|
+
if (!isOneOf(CONTACT_TYPES, args.type))
|
|
1530
|
+
errors.push(issue('type', 'contact_type'));
|
|
1531
|
+
if (await duplicate(ctx, 'hospitality_core.PropertyContact', 'type', args.type, args.id, [
|
|
1532
|
+
'propertyId',
|
|
1533
|
+
args.propertyId,
|
|
1534
|
+
]))
|
|
1535
|
+
errors.push(issue('type', 'unique'));
|
|
1536
|
+
if (errors.length)
|
|
1537
|
+
return failure(...errors);
|
|
1538
|
+
return ctx.tx(async (tx) => {
|
|
1539
|
+
const result = await save(tx, 'hospitality_core.PropertyContact', args, [
|
|
1540
|
+
'id',
|
|
1541
|
+
'propertyId',
|
|
1542
|
+
'type',
|
|
1543
|
+
'name',
|
|
1544
|
+
'email',
|
|
1545
|
+
'phone',
|
|
1546
|
+
]);
|
|
1547
|
+
if (result.ok)
|
|
1548
|
+
await appendContentChange(tx, {
|
|
1549
|
+
propertyId: args.propertyId,
|
|
1550
|
+
resourceType: 'property',
|
|
1551
|
+
resourceId: args.propertyId,
|
|
1552
|
+
});
|
|
1553
|
+
return result;
|
|
1554
|
+
});
|
|
1555
|
+
},
|
|
1556
|
+
}),
|
|
1557
|
+
};
|
|
1558
|
+
//# sourceMappingURL=functions.js.map
|