@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,1556 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { text } from '@ketvietlab/ketjs';
|
|
3
|
+
import { viewerOf } from '../backend/routes.js';
|
|
4
|
+
import { backendPage } from '../../ui/index.js';
|
|
5
|
+
import { readForm, seeOther } from '../backend/forms.js';
|
|
6
|
+
import { receiveAttachment } from '../storage/routes.js';
|
|
7
|
+
import { amenitiesScreen, buildingDetailScreen, cleaningTaskDetailScreen, cleaningTasksScreen, folioDetailScreen, foliosScreen, floorDetailScreen, frontDeskScreen, housekeepingRoomDetailScreen, housekeepingRoomsScreen, newPropertyScreen, newRoomScreen, newRoomTypeScreen, policiesScreen, propertiesScreen, propertyDetailScreen, ratePlansScreen, reservationDetailScreen, reservationsScreen, inventoryScreen, roomsScreen, roomDetailScreen, roomTypeDetailScreen, roomTypesScreen, stayDetailScreen, staysScreen, tapeChartScreen, contentScreen, servicesScreen, nightAuditScreen, stayNoticesScreen, } from './screens.js';
|
|
8
|
+
import { addCalendarDays, calendarRange, dateKeyIn, zonedDateTime } from './calendar.js';
|
|
9
|
+
import { CLEANING_TASK_STATES, ROOM_STATUSES, STAY_NOTICE_STATES } from './types.js';
|
|
10
|
+
const frame = async (ctx, url, req) => ({
|
|
11
|
+
navigation: req.headers['x-ket-navigation'] === 'fragment-v1',
|
|
12
|
+
viewer: await viewerOf(ctx, url, req),
|
|
13
|
+
menu: await ctx.menu(url, req),
|
|
14
|
+
menuFilter: url.searchParams.get('menu')?.trim() || null,
|
|
15
|
+
extras: {
|
|
16
|
+
'nav.items': await ctx.joint(url, req, 'backend:nav.items', { active: url.pathname }),
|
|
17
|
+
'topbar.end': await ctx.joint(url, req, 'backend:topbar.end'),
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const document = async (ctx, url, req, title, body) => {
|
|
21
|
+
const lang = ctx.localeOf(url, req);
|
|
22
|
+
return backendPage(ctx, req, { lang, title, body });
|
|
23
|
+
};
|
|
24
|
+
const operationErrors = (ctx, url, req, result) => {
|
|
25
|
+
const _ = ctx.translate(ctx.localeOf(url, req));
|
|
26
|
+
const errors = result.errors ?? [];
|
|
27
|
+
return errors.length
|
|
28
|
+
? errors.map((error) => error.messageKey ? _(error.messageKey, error.params) : _('hospitality_core.feedback.invalidHint'))
|
|
29
|
+
: [_('hospitality_core.feedback.invalidHint')];
|
|
30
|
+
};
|
|
31
|
+
const propertyTimezone = async (ctx, propertyId, url, req) => {
|
|
32
|
+
if (!propertyId)
|
|
33
|
+
return 'UTC';
|
|
34
|
+
const property = (await ctx.call('hospitality_core.getProperty', { id: propertyId }, url, req));
|
|
35
|
+
return property?.timezone || 'UTC';
|
|
36
|
+
};
|
|
37
|
+
const renderReservationDetail = async (ctx, url, req, id, errors = [], attempted, attemptedDeparture) => {
|
|
38
|
+
const reservation = (await ctx.call('hospitality_core.getReservation', { id }, url, req));
|
|
39
|
+
if (!reservation)
|
|
40
|
+
return text('Not found', { status: 404 });
|
|
41
|
+
if (reservation.stayId) {
|
|
42
|
+
reservation.stay = (await ctx.call('hospitality_core.getStay', { id: reservation.stayId }, url, req));
|
|
43
|
+
}
|
|
44
|
+
const timezone = await propertyTimezone(ctx, reservation.propertyId, url, req);
|
|
45
|
+
const [allRooms, roomTypes, partners] = (await Promise.all([
|
|
46
|
+
reservation.state === 'confirmed'
|
|
47
|
+
? ctx.call('hospitality_core.listRooms', { propertyId: reservation.propertyId, status: 'available' }, url, req)
|
|
48
|
+
: Promise.resolve([]),
|
|
49
|
+
ctx.call('hospitality_core.listRoomTypes', { propertyId: reservation.propertyId }, url, req),
|
|
50
|
+
ctx.call('partner.listPartners', { kind: 'person', limit: 500 }, url, req),
|
|
51
|
+
]));
|
|
52
|
+
const rooms = allRooms.filter((room) => room.roomTypeId === reservation.roomTypeId);
|
|
53
|
+
const lang = ctx.localeOf(url, req);
|
|
54
|
+
const _ = ctx.translate(lang);
|
|
55
|
+
const amendment = {
|
|
56
|
+
partnerId: attempted?.partnerId ?? reservation.partnerId,
|
|
57
|
+
roomTypeId: attempted?.roomTypeId ?? reservation.roomTypeId,
|
|
58
|
+
checkIn: attempted?.checkIn ?? localDateTime(new Date(reservation.checkIn), timezone),
|
|
59
|
+
checkOut: attempted?.checkOut ?? localDateTime(new Date(reservation.checkOut), timezone),
|
|
60
|
+
adults: attempted?.adults ?? reservation.adults,
|
|
61
|
+
children: attempted?.children ?? reservation.children,
|
|
62
|
+
rate: attempted?.rate ?? String(reservation.rate),
|
|
63
|
+
};
|
|
64
|
+
return document(ctx, url, req, _('hospitality_core.reservation.detail.title', { code: reservation.code }), reservationDetailScreen(_, reservation, rooms, roomTypes, partners, amendment, attemptedDeparture ?? localDateTime(new Date(reservation.checkOut), timezone), lang, timezone, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
65
|
+
};
|
|
66
|
+
const renderStayDetail = async (ctx, url, req, id, errors = []) => {
|
|
67
|
+
const stay = (await ctx.call('hospitality_core.getStay', { id }, url, req));
|
|
68
|
+
if (!stay)
|
|
69
|
+
return text('Not found', { status: 404 });
|
|
70
|
+
const [rooms, partners, documents] = (await Promise.all([
|
|
71
|
+
ctx.call('hospitality_core.listRooms', { propertyId: stay.propertyId, includeArchived: true }, url, req),
|
|
72
|
+
ctx.call('partner.listPartners', { kind: 'person', limit: 500 }, url, req),
|
|
73
|
+
ctx.call('hospitality_core.listGuestDocuments', { stayId: stay.id }, url, req),
|
|
74
|
+
]));
|
|
75
|
+
const timezone = await propertyTimezone(ctx, stay.propertyId, url, req);
|
|
76
|
+
const lang = ctx.localeOf(url, req);
|
|
77
|
+
const _ = ctx.translate(lang);
|
|
78
|
+
return document(ctx, url, req, _('hospitality_core.stay.detail.title', { code: stay.code }), stayDetailScreen(_, stay, rooms, partners, documents, randomUUID(), lang, timezone, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
79
|
+
};
|
|
80
|
+
const renderFolioDetail = async (ctx, url, req, id, errors = []) => {
|
|
81
|
+
const folio = (await ctx.call('hospitality_core.getFolio', { id }, url, req));
|
|
82
|
+
if (!folio)
|
|
83
|
+
return text('Not found', { status: 404 });
|
|
84
|
+
const timezone = await propertyTimezone(ctx, folio.propertyId, url, req);
|
|
85
|
+
const lang = ctx.localeOf(url, req);
|
|
86
|
+
const _ = ctx.translate(lang);
|
|
87
|
+
return document(ctx, url, req, _('hospitality_core.folio.detail.title', { code: folio.code }), folioDetailScreen(_, folio, lang, timezone, await frame(ctx, url, req), randomUUID(), url.searchParams.get('status'), errors));
|
|
88
|
+
};
|
|
89
|
+
const renderCleaningTaskDetail = async (ctx, url, req, id, errors = []) => {
|
|
90
|
+
const task = (await ctx.call('hospitality_core.getCleaningTask', { id }, url, req));
|
|
91
|
+
if (!task)
|
|
92
|
+
return text('Not found', { status: 404 });
|
|
93
|
+
const timezone = await propertyTimezone(ctx, task.propertyId, url, req);
|
|
94
|
+
const lang = ctx.localeOf(url, req);
|
|
95
|
+
const _ = ctx.translate(lang);
|
|
96
|
+
return document(ctx, url, req, _('hospitality_core.housekeeping.detail.title', { code: task.code }), cleaningTaskDetailScreen(_, task, lang, timezone, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
97
|
+
};
|
|
98
|
+
const renderHousekeepingRoomDetail = async (ctx, url, req, id, errors = []) => {
|
|
99
|
+
const room = (await ctx.call('hospitality_core.getHousekeepingRoom', { id }, url, req));
|
|
100
|
+
if (room?.active !== true)
|
|
101
|
+
return text('Not found', { status: 404 });
|
|
102
|
+
const tasks = (await ctx.call('hospitality_core.listCleaningTasks', { roomId: id, limit: 20 }, url, req));
|
|
103
|
+
const timezone = await propertyTimezone(ctx, room.propertyId, url, req);
|
|
104
|
+
const lang = ctx.localeOf(url, req);
|
|
105
|
+
const _ = ctx.translate(lang);
|
|
106
|
+
return document(ctx, url, req, _('hospitality_core.housekeeping.rooms.detail.title', { code: room.code }), housekeepingRoomDetailScreen(_, room, tasks, lang, timezone, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
107
|
+
};
|
|
108
|
+
const selectedProperty = async (ctx, url, req) => {
|
|
109
|
+
const selected = url.searchParams.get('property')?.trim();
|
|
110
|
+
if (selected)
|
|
111
|
+
return selected;
|
|
112
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
113
|
+
return properties[0]?.id;
|
|
114
|
+
};
|
|
115
|
+
const redirected = (url, state, values = {}) => {
|
|
116
|
+
const params = new URLSearchParams(url.searchParams);
|
|
117
|
+
params.set('status', state);
|
|
118
|
+
for (const [key, value] of Object.entries(values)) {
|
|
119
|
+
if (value)
|
|
120
|
+
params.set(key, value);
|
|
121
|
+
else
|
|
122
|
+
params.delete(key);
|
|
123
|
+
}
|
|
124
|
+
return seeOther(`${url.pathname}?${params.toString()}`);
|
|
125
|
+
};
|
|
126
|
+
const integer = (value, fallback = 0) => {
|
|
127
|
+
const parsed = Number(value ?? fallback);
|
|
128
|
+
return Number.isInteger(parsed) ? parsed : -1;
|
|
129
|
+
};
|
|
130
|
+
const optionalInteger = (value) => value ? integer(value) : undefined;
|
|
131
|
+
const localDateTime = (value, timezone) => {
|
|
132
|
+
const parts = Object.fromEntries(new Intl.DateTimeFormat('en', {
|
|
133
|
+
timeZone: timezone,
|
|
134
|
+
hourCycle: 'h23',
|
|
135
|
+
hour: '2-digit',
|
|
136
|
+
minute: '2-digit',
|
|
137
|
+
})
|
|
138
|
+
.formatToParts(value)
|
|
139
|
+
.filter((part) => part.type !== 'literal')
|
|
140
|
+
.map((part) => [part.type, part.value]));
|
|
141
|
+
return `${dateKeyIn(value, timezone)}T${parts.hour}:${parts.minute}`;
|
|
142
|
+
};
|
|
143
|
+
const instantFromLocal = (value, timezone) => {
|
|
144
|
+
const matched = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})$/.exec(String(value ?? ''));
|
|
145
|
+
if (!matched)
|
|
146
|
+
return null;
|
|
147
|
+
const hour = Number(matched[2]);
|
|
148
|
+
const minute = Number(matched[3]);
|
|
149
|
+
if (hour > 23 || minute > 59)
|
|
150
|
+
return null;
|
|
151
|
+
const instant = zonedDateTime(matched[1], hour, minute, timezone);
|
|
152
|
+
if (!Number.isFinite(instant.getTime()) || localDateTime(instant, timezone) !== value)
|
|
153
|
+
return null;
|
|
154
|
+
return instant.toISOString();
|
|
155
|
+
};
|
|
156
|
+
const contentSelection = async (ctx, url, req) => {
|
|
157
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
158
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
159
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
160
|
+
? requestedProperty
|
|
161
|
+
: properties[0]?.id;
|
|
162
|
+
const roomTypes = propertyId
|
|
163
|
+
? (await ctx.call('hospitality_core.listRoomTypes', { propertyId }, url, req))
|
|
164
|
+
: [];
|
|
165
|
+
const requestedTarget = url.searchParams.get('target')?.trim() || 'property';
|
|
166
|
+
const requestedRoomType = requestedTarget.startsWith('room_type:')
|
|
167
|
+
? requestedTarget.slice('room_type:'.length)
|
|
168
|
+
: null;
|
|
169
|
+
const roomTypeId = roomTypes.some((row) => row.id === requestedRoomType) ? requestedRoomType : null;
|
|
170
|
+
return {
|
|
171
|
+
properties,
|
|
172
|
+
roomTypes,
|
|
173
|
+
propertyId,
|
|
174
|
+
roomTypeId,
|
|
175
|
+
target: roomTypeId ? `room_type:${roomTypeId}` : 'property',
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
const contentQuery = (url, selection) => {
|
|
179
|
+
const query = new URLSearchParams();
|
|
180
|
+
if (selection.propertyId)
|
|
181
|
+
query.set('property', selection.propertyId);
|
|
182
|
+
query.set('target', selection.target);
|
|
183
|
+
const lang = url.searchParams.get('lang')?.trim();
|
|
184
|
+
if (lang)
|
|
185
|
+
query.set('lang', lang);
|
|
186
|
+
return query.toString();
|
|
187
|
+
};
|
|
188
|
+
const contentRedirect = (url, selection, status) => {
|
|
189
|
+
const query = new URLSearchParams(contentQuery(url, selection));
|
|
190
|
+
query.set('status', status);
|
|
191
|
+
return seeOther(`/admin/hospitality/content?${query.toString()}`);
|
|
192
|
+
};
|
|
193
|
+
const contentImages = async (ctx, url, req, selection) => {
|
|
194
|
+
if (!selection.propertyId)
|
|
195
|
+
return [];
|
|
196
|
+
return (await ctx.call('hospitality_core.listContentImages', selection.roomTypeId ? { roomTypeId: selection.roomTypeId } : { propertyId: selection.propertyId }, url, req));
|
|
197
|
+
};
|
|
198
|
+
const defaultPropertyValues = (id) => ({
|
|
199
|
+
id,
|
|
200
|
+
code: '',
|
|
201
|
+
name: '',
|
|
202
|
+
publicName: null,
|
|
203
|
+
accommodationType: 'hotel',
|
|
204
|
+
timezone: 'Asia/Ho_Chi_Minh',
|
|
205
|
+
defaultCheckIn: '14:00',
|
|
206
|
+
defaultCheckOut: '12:00',
|
|
207
|
+
enforceTimes: true,
|
|
208
|
+
longStayBillOnCheckIn: true,
|
|
209
|
+
starRating: 0,
|
|
210
|
+
description: null,
|
|
211
|
+
houseRules: null,
|
|
212
|
+
childrenStayFree: false,
|
|
213
|
+
minimumGuestAge: null,
|
|
214
|
+
defaultCancellationPolicyId: null,
|
|
215
|
+
});
|
|
216
|
+
const propertyFormValues = (id, form, current = null) => ({
|
|
217
|
+
id,
|
|
218
|
+
code: form.code?.trim() ?? current?.code ?? '',
|
|
219
|
+
name: form.name?.trim() ?? current?.name ?? '',
|
|
220
|
+
publicName: form.publicName?.trim() || null,
|
|
221
|
+
accommodationType: form.accommodationType?.trim() ?? current?.accommodationType ?? 'hotel',
|
|
222
|
+
timezone: form.timezone?.trim() ?? current?.timezone ?? 'Asia/Ho_Chi_Minh',
|
|
223
|
+
defaultCheckIn: form.defaultCheckIn?.trim() ?? current?.defaultCheckIn ?? '14:00',
|
|
224
|
+
defaultCheckOut: form.defaultCheckOut?.trim() ?? current?.defaultCheckOut ?? '12:00',
|
|
225
|
+
enforceTimes: form.enforceTimes === '1',
|
|
226
|
+
longStayBillOnCheckIn: form.longStayBillOnCheckIn === '1',
|
|
227
|
+
starRating: integer(form.starRating, current?.starRating ?? 0),
|
|
228
|
+
description: form.description?.trim() || null,
|
|
229
|
+
houseRules: form.houseRules?.trim() || null,
|
|
230
|
+
childrenStayFree: form.childrenStayFree === '1',
|
|
231
|
+
minimumGuestAge: form.minimumGuestAge ? integer(form.minimumGuestAge) : null,
|
|
232
|
+
defaultCancellationPolicyId: form.defaultCancellationPolicyId?.trim() || null,
|
|
233
|
+
});
|
|
234
|
+
const propertySaveInput = (values, current = null) => ({
|
|
235
|
+
...values,
|
|
236
|
+
street1: current?.street1 ?? null,
|
|
237
|
+
street2: current?.street2 ?? null,
|
|
238
|
+
locality: current?.locality ?? null,
|
|
239
|
+
postalCode: current?.postalCode ?? null,
|
|
240
|
+
countryCode: current?.countryCode ?? null,
|
|
241
|
+
divisionId: current?.divisionId ?? null,
|
|
242
|
+
divisionText: current?.divisionText ?? null,
|
|
243
|
+
latitude: current?.latitude ?? null,
|
|
244
|
+
longitude: current?.longitude ?? null,
|
|
245
|
+
});
|
|
246
|
+
const renderPropertyDetail = async (ctx, url, req, id, errors = [], attempted) => {
|
|
247
|
+
const [property, policies] = (await Promise.all([
|
|
248
|
+
ctx.call('hospitality_core.getProperty', { id }, url, req),
|
|
249
|
+
ctx.call('hospitality_core.listCancellationPolicies', {}, url, req),
|
|
250
|
+
]));
|
|
251
|
+
if (!property)
|
|
252
|
+
return text('Not found', { status: 404 });
|
|
253
|
+
const lang = ctx.localeOf(url, req);
|
|
254
|
+
return document(ctx, url, req, property.name, propertyDetailScreen(ctx.translate(lang), property, policies, lang, await frame(ctx, url, req), url.searchParams.get('status'), errors, attempted));
|
|
255
|
+
};
|
|
256
|
+
const defaultRoomTypeValues = (id, propertyId) => ({
|
|
257
|
+
id,
|
|
258
|
+
propertyId,
|
|
259
|
+
code: '',
|
|
260
|
+
name: '',
|
|
261
|
+
publicName: null,
|
|
262
|
+
description: null,
|
|
263
|
+
defaultCapacity: 2,
|
|
264
|
+
maxAdults: 2,
|
|
265
|
+
maxChildren: 0,
|
|
266
|
+
maxInfants: 0,
|
|
267
|
+
maxExtraBeds: 0,
|
|
268
|
+
sizeSqm: null,
|
|
269
|
+
viewType: null,
|
|
270
|
+
sharedBathroom: false,
|
|
271
|
+
baseRate: '0',
|
|
272
|
+
color: '#2563eb',
|
|
273
|
+
cancellationPolicyId: null,
|
|
274
|
+
published: false,
|
|
275
|
+
});
|
|
276
|
+
const roomTypeFormValues = (id, form, current = null) => ({
|
|
277
|
+
id,
|
|
278
|
+
propertyId: form.propertyId?.trim() ?? current?.propertyId ?? '',
|
|
279
|
+
code: form.code?.trim() ?? current?.code ?? '',
|
|
280
|
+
name: form.name?.trim() ?? current?.name ?? '',
|
|
281
|
+
publicName: form.publicName?.trim() || null,
|
|
282
|
+
description: form.description?.trim() || null,
|
|
283
|
+
defaultCapacity: integer(form.defaultCapacity, current?.defaultCapacity ?? 2),
|
|
284
|
+
maxAdults: integer(form.maxAdults, current?.maxAdults ?? 2),
|
|
285
|
+
maxChildren: integer(form.maxChildren, current?.maxChildren ?? 0),
|
|
286
|
+
maxInfants: integer(form.maxInfants, current?.maxInfants ?? 0),
|
|
287
|
+
maxExtraBeds: integer(form.maxExtraBeds, current?.maxExtraBeds ?? 0),
|
|
288
|
+
sizeSqm: form.sizeSqm?.trim() || null,
|
|
289
|
+
viewType: form.viewType?.trim() || null,
|
|
290
|
+
sharedBathroom: form.sharedBathroom === '1',
|
|
291
|
+
baseRate: form.baseRate?.trim() ?? String(current?.baseRate ?? '0'),
|
|
292
|
+
color: form.color?.trim() || null,
|
|
293
|
+
cancellationPolicyId: form.cancellationPolicyId?.trim() || null,
|
|
294
|
+
published: form.published === '1',
|
|
295
|
+
});
|
|
296
|
+
const roomTypeInputErrors = (ctx, url, req, values) => {
|
|
297
|
+
const decimal = (value) => /^-?(?:\d+(?:\.\d*)?|\.\d+)$/.test(String(value ?? '').trim()) && Number.isFinite(Number(value));
|
|
298
|
+
if (decimal(values.baseRate) && (values.sizeSqm == null || decimal(values.sizeSqm)))
|
|
299
|
+
return [];
|
|
300
|
+
return [ctx.translate(ctx.localeOf(url, req))('hospitality_core.validation.decimal')];
|
|
301
|
+
};
|
|
302
|
+
const renderRoomTypeDetail = async (ctx, url, req, id, errors = [], attempted) => {
|
|
303
|
+
const [roomType, properties, policies] = (await Promise.all([
|
|
304
|
+
ctx.call('hospitality_core.getRoomType', { id }, url, req),
|
|
305
|
+
ctx.call('hospitality_core.listProperties', { includeArchived: true }, url, req),
|
|
306
|
+
ctx.call('hospitality_core.listCancellationPolicies', { includeArchived: true }, url, req),
|
|
307
|
+
]));
|
|
308
|
+
if (!roomType)
|
|
309
|
+
return text('Not found', { status: 404 });
|
|
310
|
+
const lang = ctx.localeOf(url, req);
|
|
311
|
+
const _ = ctx.translate(lang);
|
|
312
|
+
return document(ctx, url, req, roomType.name, roomTypeDetailScreen(_, roomType, properties, policies, lang, await frame(ctx, url, req), url.searchParams.get('status'), errors, attempted));
|
|
313
|
+
};
|
|
314
|
+
const buildingFormValues = (id, form, current = null) => ({
|
|
315
|
+
id,
|
|
316
|
+
propertyId: form.propertyId?.trim() ?? current?.propertyId ?? '',
|
|
317
|
+
code: form.code?.trim() ?? current?.code ?? '',
|
|
318
|
+
name: form.name?.trim() ?? current?.name ?? '',
|
|
319
|
+
sequence: integer(form.sequence, current?.sequence ?? 10),
|
|
320
|
+
});
|
|
321
|
+
const renderBuildingDetail = async (ctx, url, req, id, errors = [], attempted) => {
|
|
322
|
+
const building = (await ctx.call('hospitality_core.getBuilding', { id }, url, req));
|
|
323
|
+
if (!building)
|
|
324
|
+
return text('Not found', { status: 404 });
|
|
325
|
+
const lang = ctx.localeOf(url, req);
|
|
326
|
+
return document(ctx, url, req, building.name, buildingDetailScreen(ctx.translate(lang), building, attempted ?? building, lang, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
327
|
+
};
|
|
328
|
+
const floorFormValues = (id, form, current = null) => ({
|
|
329
|
+
id,
|
|
330
|
+
propertyId: form.propertyId?.trim() ?? current?.propertyId ?? '',
|
|
331
|
+
buildingId: form.buildingId?.trim() ?? current?.buildingId ?? '',
|
|
332
|
+
code: form.code?.trim() ?? current?.code ?? '',
|
|
333
|
+
name: form.name?.trim() ?? current?.name ?? '',
|
|
334
|
+
sequence: integer(form.sequence, current?.sequence ?? 10),
|
|
335
|
+
});
|
|
336
|
+
const renderFloorDetail = async (ctx, url, req, id, errors = [], attempted) => {
|
|
337
|
+
const floor = (await ctx.call('hospitality_core.getFloor', { id }, url, req));
|
|
338
|
+
if (!floor)
|
|
339
|
+
return text('Not found', { status: 404 });
|
|
340
|
+
const lang = ctx.localeOf(url, req);
|
|
341
|
+
return document(ctx, url, req, floor.name, floorDetailScreen(ctx.translate(lang), floor, attempted ?? floor, lang, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
342
|
+
};
|
|
343
|
+
const roomFormValues = (id, form, current = null) => ({
|
|
344
|
+
id,
|
|
345
|
+
propertyId: form.propertyId?.trim() ?? current?.propertyId ?? '',
|
|
346
|
+
roomTypeId: form.roomTypeId?.trim() ?? current?.roomTypeId ?? '',
|
|
347
|
+
buildingId: form.buildingId?.trim() || null,
|
|
348
|
+
floorId: form.floorId?.trim() || null,
|
|
349
|
+
code: form.code?.trim() ?? current?.code ?? '',
|
|
350
|
+
name: form.name?.trim() ?? current?.name ?? '',
|
|
351
|
+
capacity: integer(form.capacity, current?.capacity ?? 1),
|
|
352
|
+
});
|
|
353
|
+
const defaultRoomValues = (id, propertyId, roomTypeId) => ({
|
|
354
|
+
id,
|
|
355
|
+
propertyId,
|
|
356
|
+
roomTypeId,
|
|
357
|
+
buildingId: null,
|
|
358
|
+
floorId: null,
|
|
359
|
+
code: '',
|
|
360
|
+
name: '',
|
|
361
|
+
capacity: 2,
|
|
362
|
+
});
|
|
363
|
+
const roomOptions = async (ctx, url, req, propertyId, includeArchived = false) => {
|
|
364
|
+
const properties = (await ctx.call('hospitality_core.listProperties', includeArchived ? { includeArchived: true } : {}, url, req));
|
|
365
|
+
const selected = properties.some((row) => row.id === propertyId) ? propertyId : properties[0]?.id;
|
|
366
|
+
if (!selected)
|
|
367
|
+
return { properties, propertyId: undefined, roomTypes: [], buildings: [], floors: [] };
|
|
368
|
+
const [roomTypes, buildings, floors] = (await Promise.all([
|
|
369
|
+
ctx.call('hospitality_core.listRoomTypes', { propertyId: selected, includeArchived: includeArchived || undefined }, url, req),
|
|
370
|
+
ctx.call('hospitality_core.listBuildings', { propertyId: selected, includeArchived: includeArchived || undefined }, url, req),
|
|
371
|
+
ctx.call('hospitality_core.listFloors', { propertyId: selected, includeArchived: includeArchived || undefined }, url, req),
|
|
372
|
+
]));
|
|
373
|
+
return { properties, propertyId: selected, roomTypes, buildings, floors };
|
|
374
|
+
};
|
|
375
|
+
const renderRooms = async (ctx, url, req, errors = []) => {
|
|
376
|
+
const requestedProperty = url.searchParams.get('property')?.trim() || undefined;
|
|
377
|
+
const options = await roomOptions(ctx, url, req, requestedProperty);
|
|
378
|
+
const [rows, buildings, floors] = options.propertyId
|
|
379
|
+
? (await Promise.all([
|
|
380
|
+
ctx.call('hospitality_core.listRooms', { propertyId: options.propertyId }, url, req),
|
|
381
|
+
ctx.call('hospitality_core.listBuildings', { propertyId: options.propertyId, includeArchived: true }, url, req),
|
|
382
|
+
ctx.call('hospitality_core.listFloors', { propertyId: options.propertyId, includeArchived: true }, url, req),
|
|
383
|
+
]))
|
|
384
|
+
: [[], [], []];
|
|
385
|
+
const lang = ctx.localeOf(url, req);
|
|
386
|
+
const _ = ctx.translate(lang);
|
|
387
|
+
return document(ctx, url, req, _('hospitality_core.screen.rooms.title'), roomsScreen(_, { rows, ...options, buildings, floors }, lang, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
388
|
+
};
|
|
389
|
+
const renderRoomDetail = async (ctx, url, req, id, errors = [], attempted) => {
|
|
390
|
+
const room = (await ctx.call('hospitality_core.getRoom', { id }, url, req));
|
|
391
|
+
if (!room)
|
|
392
|
+
return text('Not found', { status: 404 });
|
|
393
|
+
const options = await roomOptions(ctx, url, req, room.propertyId, true);
|
|
394
|
+
const lang = ctx.localeOf(url, req);
|
|
395
|
+
return document(ctx, url, req, room.name, roomDetailScreen(ctx.translate(lang), room, attempted ?? room, options.properties, options.roomTypes, options.buildings, options.floors, lang, await frame(ctx, url, req), url.searchParams.get('status'), errors));
|
|
396
|
+
};
|
|
397
|
+
export const routes = {
|
|
398
|
+
'/admin/hospitality/front-desk': (ctx) => async (url, req) => {
|
|
399
|
+
const lang = ctx.localeOf(url, req);
|
|
400
|
+
const _ = ctx.translate(lang);
|
|
401
|
+
const propertyId = await selectedProperty(ctx, url, req);
|
|
402
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
403
|
+
const range = calendarRange(url.searchParams.get('date'), 1, timezone);
|
|
404
|
+
const [stays, inHouseStays, openFolios] = (await Promise.all([
|
|
405
|
+
ctx.call('hospitality_core.listStays', { propertyId, from: range.from, to: range.to }, url, req),
|
|
406
|
+
ctx.call('hospitality_core.listStays', { propertyId, state: 'checked_in' }, url, req),
|
|
407
|
+
ctx.call('hospitality_core.listFolios', { propertyId, state: 'open' }, url, req),
|
|
408
|
+
]));
|
|
409
|
+
const inRange = (value) => value >= range.from && value < range.to;
|
|
410
|
+
const now = new Date().toISOString();
|
|
411
|
+
const overdue = inHouseStays
|
|
412
|
+
.filter((stay) => stay.checkOut < now)
|
|
413
|
+
.sort((left, right) => left.checkOut.localeCompare(right.checkOut));
|
|
414
|
+
const overdueIds = new Set(overdue.map((stay) => stay.id));
|
|
415
|
+
return document(ctx, url, req, _('hospitality_core.screen.frontDesk.title'), frontDeskScreen(_, stays.filter((stay) => !overdueIds.has(stay.id)), overdue, {
|
|
416
|
+
arrivals: stays.filter((stay) => stay.state === 'draft' && inRange(stay.checkIn)).length,
|
|
417
|
+
inHouse: inHouseStays.length,
|
|
418
|
+
departures: stays.filter((stay) => stay.state === 'checked_in' && inRange(stay.checkOut)).length,
|
|
419
|
+
overdue: overdue.length,
|
|
420
|
+
openFolios: openFolios.length,
|
|
421
|
+
}, lang, timezone, await frame(ctx, url, req)));
|
|
422
|
+
},
|
|
423
|
+
'/admin/hospitality/reservations': (ctx) => async (url, req) => {
|
|
424
|
+
if (req.method === 'POST') {
|
|
425
|
+
const form = await readForm(req);
|
|
426
|
+
if (form.operation !== 'quote' && form.operation !== 'create')
|
|
427
|
+
return text('unknown action', { status: 400 });
|
|
428
|
+
const propertyId = form.property?.trim() || '';
|
|
429
|
+
const property = propertyId
|
|
430
|
+
? (await ctx.call('hospitality_core.getProperty', { id: propertyId }, url, req))
|
|
431
|
+
: null;
|
|
432
|
+
const timezone = property?.timezone || 'UTC';
|
|
433
|
+
const checkIn = instantFromLocal(form.checkIn, timezone);
|
|
434
|
+
const checkOut = instantFromLocal(form.checkOut, timezone);
|
|
435
|
+
const values = {
|
|
436
|
+
lang: form.lang,
|
|
437
|
+
property: propertyId,
|
|
438
|
+
preview: '1',
|
|
439
|
+
id: form.id,
|
|
440
|
+
code: form.code,
|
|
441
|
+
partnerId: form.partnerId,
|
|
442
|
+
roomTypeId: form.roomTypeId,
|
|
443
|
+
bookingType: form.bookingType,
|
|
444
|
+
checkIn: form.checkIn,
|
|
445
|
+
checkOut: form.checkOut,
|
|
446
|
+
adults: form.adults,
|
|
447
|
+
children: form.children,
|
|
448
|
+
rate: form.rate,
|
|
449
|
+
};
|
|
450
|
+
if (!property || !checkIn || !checkOut || !form.partnerId)
|
|
451
|
+
return redirected(url, 'invalid', values);
|
|
452
|
+
if (form.operation === 'quote') {
|
|
453
|
+
const result = (await ctx.call('hospitality_core.quoteReservation', {
|
|
454
|
+
propertyId,
|
|
455
|
+
roomTypeId: form.roomTypeId ?? '',
|
|
456
|
+
bookingType: form.bookingType ?? 'nightly',
|
|
457
|
+
checkIn,
|
|
458
|
+
checkOut,
|
|
459
|
+
adults: integer(form.adults, 1),
|
|
460
|
+
children: integer(form.children),
|
|
461
|
+
rate: form.rate || undefined,
|
|
462
|
+
}, url, req));
|
|
463
|
+
return redirected(url, result.ok ? 'quoted' : 'invalid', values);
|
|
464
|
+
}
|
|
465
|
+
const result = (await ctx.call('hospitality_core.createReservation', {
|
|
466
|
+
id: form.id ?? '',
|
|
467
|
+
code: form.code || undefined,
|
|
468
|
+
propertyId,
|
|
469
|
+
partnerId: form.partnerId,
|
|
470
|
+
roomTypeId: form.roomTypeId ?? '',
|
|
471
|
+
provider: 'direct',
|
|
472
|
+
bookingType: form.bookingType ?? 'nightly',
|
|
473
|
+
checkIn,
|
|
474
|
+
checkOut,
|
|
475
|
+
adults: integer(form.adults, 1),
|
|
476
|
+
children: integer(form.children),
|
|
477
|
+
rate: form.rate || undefined,
|
|
478
|
+
}, url, req));
|
|
479
|
+
return result.ok
|
|
480
|
+
? redirected(url, 'saved', { lang: form.lang, property: propertyId })
|
|
481
|
+
: redirected(url, 'invalid', values);
|
|
482
|
+
}
|
|
483
|
+
if (req.method !== 'GET')
|
|
484
|
+
return text('GET or POST', { status: 405 });
|
|
485
|
+
const lang = ctx.localeOf(url, req);
|
|
486
|
+
const _ = ctx.translate(lang);
|
|
487
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
488
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
489
|
+
const propertyId = properties.find((row) => row.id === requestedProperty)?.id ?? properties[0]?.id ?? '';
|
|
490
|
+
const property = propertyId
|
|
491
|
+
? (await ctx.call('hospitality_core.getProperty', { id: propertyId }, url, req))
|
|
492
|
+
: null;
|
|
493
|
+
const timezone = property?.timezone || 'UTC';
|
|
494
|
+
const today = dateKeyIn(new Date(), timezone);
|
|
495
|
+
const checkInClock = /^(\d{2}):(\d{2})$/.exec(property?.defaultCheckIn ?? '');
|
|
496
|
+
const checkOutClock = /^(\d{2}):(\d{2})$/.exec(property?.defaultCheckOut ?? '');
|
|
497
|
+
const defaultCheckIn = zonedDateTime(today, Number(checkInClock?.[1] ?? 14), Number(checkInClock?.[2] ?? 0), timezone);
|
|
498
|
+
const defaultCheckOut = zonedDateTime(addCalendarDays(today, 1), Number(checkOutClock?.[1] ?? 12), Number(checkOutClock?.[2] ?? 0), timezone);
|
|
499
|
+
const [rows, roomTypes, partners] = (await Promise.all([
|
|
500
|
+
ctx.call('hospitality_core.listReservations', { propertyId: propertyId || undefined, state: url.searchParams.get('state') || undefined }, url, req),
|
|
501
|
+
propertyId
|
|
502
|
+
? ctx.call('hospitality_core.listRoomTypes', { propertyId }, url, req)
|
|
503
|
+
: Promise.resolve([]),
|
|
504
|
+
ctx.call('partner.listPartners', { kind: 'person', limit: 500 }, url, req),
|
|
505
|
+
]));
|
|
506
|
+
const reservationId = url.searchParams.get('id')?.trim() || randomUUID();
|
|
507
|
+
const values = {
|
|
508
|
+
id: reservationId,
|
|
509
|
+
code: url.searchParams.get('code')?.trim() || `R-${reservationId.slice(0, 8).toUpperCase()}`,
|
|
510
|
+
propertyId,
|
|
511
|
+
roomTypeId: roomTypes.find((row) => row.id === url.searchParams.get('roomTypeId'))?.id ??
|
|
512
|
+
roomTypes[0]?.id ??
|
|
513
|
+
'',
|
|
514
|
+
partnerId: partners.find((row) => row.id === url.searchParams.get('partnerId'))?.id ?? partners[0]?.id ?? '',
|
|
515
|
+
bookingType: ['nightly', 'weekly', 'monthly'].includes(url.searchParams.get('bookingType') ?? '')
|
|
516
|
+
? url.searchParams.get('bookingType')
|
|
517
|
+
: 'nightly',
|
|
518
|
+
checkIn: url.searchParams.get('checkIn') || localDateTime(defaultCheckIn, timezone),
|
|
519
|
+
checkOut: url.searchParams.get('checkOut') || localDateTime(defaultCheckOut, timezone),
|
|
520
|
+
adults: Math.max(1, integer(url.searchParams.get('adults') ?? undefined, 1)),
|
|
521
|
+
children: Math.max(0, integer(url.searchParams.get('children') ?? undefined)),
|
|
522
|
+
rate: url.searchParams.get('rate')?.trim() || '',
|
|
523
|
+
};
|
|
524
|
+
let quote = null;
|
|
525
|
+
if (url.searchParams.get('preview') === '1') {
|
|
526
|
+
const checkIn = instantFromLocal(values.checkIn, timezone);
|
|
527
|
+
const checkOut = instantFromLocal(values.checkOut, timezone);
|
|
528
|
+
quote =
|
|
529
|
+
checkIn && checkOut
|
|
530
|
+
? (await ctx.call('hospitality_core.quoteReservation', {
|
|
531
|
+
propertyId,
|
|
532
|
+
roomTypeId: values.roomTypeId,
|
|
533
|
+
bookingType: values.bookingType,
|
|
534
|
+
checkIn,
|
|
535
|
+
checkOut,
|
|
536
|
+
adults: values.adults,
|
|
537
|
+
children: values.children,
|
|
538
|
+
rate: values.rate || undefined,
|
|
539
|
+
}, url, req))
|
|
540
|
+
: {
|
|
541
|
+
ok: false,
|
|
542
|
+
errors: [{ messageKey: 'hospitality_core.validation.datetime' }],
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
return document(ctx, url, req, _('hospitality_core.screen.reservations.title'), reservationsScreen(_, { rows, properties, roomTypes, partners, values, quote }, lang, timezone, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
546
|
+
},
|
|
547
|
+
'/admin/hospitality/reservations/{id}': (ctx) => async (url, req, params) => {
|
|
548
|
+
if (req.method === 'GET')
|
|
549
|
+
return renderReservationDetail(ctx, url, req, params.id);
|
|
550
|
+
if (req.method !== 'POST')
|
|
551
|
+
return text('GET or POST', { status: 405 });
|
|
552
|
+
const form = await readForm(req);
|
|
553
|
+
const reservation = (await ctx.call('hospitality_core.getReservation', { id: params.id }, url, req));
|
|
554
|
+
if (!reservation)
|
|
555
|
+
return text('Not found', { status: 404 });
|
|
556
|
+
let result;
|
|
557
|
+
let status;
|
|
558
|
+
if (form.operation === 'amend') {
|
|
559
|
+
const timezone = await propertyTimezone(ctx, reservation.propertyId, url, req);
|
|
560
|
+
const checkIn = instantFromLocal(form.checkIn, timezone);
|
|
561
|
+
const checkOut = instantFromLocal(form.checkOut, timezone);
|
|
562
|
+
const attempted = {
|
|
563
|
+
partnerId: form.partnerId?.trim() || '',
|
|
564
|
+
roomTypeId: form.roomTypeId?.trim() || '',
|
|
565
|
+
checkIn: form.checkIn?.trim() || '',
|
|
566
|
+
checkOut: form.checkOut?.trim() || '',
|
|
567
|
+
adults: integer(form.adults, 1),
|
|
568
|
+
children: integer(form.children),
|
|
569
|
+
rate: form.rate?.trim() || '',
|
|
570
|
+
};
|
|
571
|
+
if (!checkIn || !checkOut)
|
|
572
|
+
return renderReservationDetail(ctx, url, req, params.id, [ctx.translate(ctx.localeOf(url, req))('hospitality_core.validation.datetime')], attempted);
|
|
573
|
+
result = (await ctx.call('hospitality_core.amendReservation', {
|
|
574
|
+
id: reservation.id,
|
|
575
|
+
partnerId: attempted.partnerId,
|
|
576
|
+
roomTypeId: attempted.roomTypeId,
|
|
577
|
+
checkIn,
|
|
578
|
+
checkOut,
|
|
579
|
+
adults: attempted.adults,
|
|
580
|
+
children: attempted.children,
|
|
581
|
+
rate: attempted.rate,
|
|
582
|
+
}, url, req));
|
|
583
|
+
if (!result.ok)
|
|
584
|
+
return renderReservationDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), attempted);
|
|
585
|
+
status = 'amended';
|
|
586
|
+
}
|
|
587
|
+
else if (form.operation === 'check-in') {
|
|
588
|
+
if (!reservation.stayId || !form.roomId)
|
|
589
|
+
return renderReservationDetail(ctx, url, req, params.id, [
|
|
590
|
+
ctx.translate(ctx.localeOf(url, req))('hospitality_core.validation.no_available_room'),
|
|
591
|
+
]);
|
|
592
|
+
result = (await ctx.call('hospitality_core.checkIn', { stayId: reservation.stayId, roomId: form.roomId }, url, req));
|
|
593
|
+
status = 'checked-in';
|
|
594
|
+
}
|
|
595
|
+
else if (form.operation === 'adjust-departure') {
|
|
596
|
+
if (!reservation.stayId)
|
|
597
|
+
return renderReservationDetail(ctx, url, req, params.id, [
|
|
598
|
+
ctx.translate(ctx.localeOf(url, req))('hospitality_core.validation.stay_missing'),
|
|
599
|
+
]);
|
|
600
|
+
const timezone = await propertyTimezone(ctx, reservation.propertyId, url, req);
|
|
601
|
+
const attemptedDeparture = form.checkOut?.trim() || '';
|
|
602
|
+
const checkOut = instantFromLocal(attemptedDeparture, timezone);
|
|
603
|
+
if (!checkOut)
|
|
604
|
+
return renderReservationDetail(ctx, url, req, params.id, [ctx.translate(ctx.localeOf(url, req))('hospitality_core.validation.datetime')], undefined, attemptedDeparture);
|
|
605
|
+
result = (await ctx.call('hospitality_core.adjustStayDeparture', { stayId: reservation.stayId, checkOut }, url, req));
|
|
606
|
+
if (!result.ok)
|
|
607
|
+
return renderReservationDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), undefined, attemptedDeparture);
|
|
608
|
+
status = 'departure-adjusted';
|
|
609
|
+
}
|
|
610
|
+
else if (form.operation === 'check-out') {
|
|
611
|
+
if (!reservation.stayId)
|
|
612
|
+
return renderReservationDetail(ctx, url, req, params.id, [
|
|
613
|
+
ctx.translate(ctx.localeOf(url, req))('hospitality_core.validation.stay_missing'),
|
|
614
|
+
]);
|
|
615
|
+
result = (await ctx.call('hospitality_core.checkOut', { stayId: reservation.stayId }, url, req));
|
|
616
|
+
status = Number(result.inventoryReleased ?? 0) > 0 ? 'checked-out-early' : 'checked-out';
|
|
617
|
+
}
|
|
618
|
+
else if (form.operation === 'cancel') {
|
|
619
|
+
result = (await ctx.call('hospitality_core.cancelReservation', { id: reservation.id, reason: form.reason?.trim() || undefined }, url, req));
|
|
620
|
+
status = 'cancelled';
|
|
621
|
+
}
|
|
622
|
+
else if (form.operation === 'no-show') {
|
|
623
|
+
result = (await ctx.call('hospitality_core.markNoShow', { id: reservation.id, reason: form.reason?.trim() || '' }, url, req));
|
|
624
|
+
status = 'no-show';
|
|
625
|
+
}
|
|
626
|
+
else
|
|
627
|
+
return text('unknown action', { status: 400 });
|
|
628
|
+
if (!result.ok)
|
|
629
|
+
return renderReservationDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
630
|
+
const query = new URLSearchParams();
|
|
631
|
+
query.set('status', status);
|
|
632
|
+
const lang = url.searchParams.get('lang')?.trim() || form.lang?.trim();
|
|
633
|
+
if (lang)
|
|
634
|
+
query.set('lang', lang);
|
|
635
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
636
|
+
},
|
|
637
|
+
'/admin/hospitality/stays': (ctx) => async (url, req) => {
|
|
638
|
+
const lang = ctx.localeOf(url, req);
|
|
639
|
+
const _ = ctx.translate(lang);
|
|
640
|
+
const propertyId = await selectedProperty(ctx, url, req);
|
|
641
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
642
|
+
const rows = (await ctx.call('hospitality_core.listStays', { propertyId, state: url.searchParams.get('state') || undefined }, url, req));
|
|
643
|
+
return document(ctx, url, req, _('hospitality_core.screen.stays.title'), staysScreen(_, rows, lang, timezone, await frame(ctx, url, req)));
|
|
644
|
+
},
|
|
645
|
+
'/admin/hospitality/stays/{id}': (ctx) => async (url, req, params) => {
|
|
646
|
+
if (req.method === 'GET')
|
|
647
|
+
return renderStayDetail(ctx, url, req, params.id);
|
|
648
|
+
if (req.method !== 'POST')
|
|
649
|
+
return text('GET or POST', { status: 405 });
|
|
650
|
+
const form = await readForm(req);
|
|
651
|
+
const stay = (await ctx.call('hospitality_core.getStay', { id: params.id }, url, req));
|
|
652
|
+
if (!stay)
|
|
653
|
+
return text('Not found', { status: 404 });
|
|
654
|
+
let result;
|
|
655
|
+
let status;
|
|
656
|
+
if (form.operation === 'add-guest') {
|
|
657
|
+
result = (await ctx.call('hospitality_core.addStayGuest', {
|
|
658
|
+
id: randomUUID(),
|
|
659
|
+
stayId: stay.id,
|
|
660
|
+
partnerId: form.partnerId?.trim() || undefined,
|
|
661
|
+
displayName: form.displayName?.trim() || '',
|
|
662
|
+
}, url, req));
|
|
663
|
+
status = 'guest-added';
|
|
664
|
+
}
|
|
665
|
+
else if (form.operation === 'move-room') {
|
|
666
|
+
if (!form.roomId?.trim() || !form.reason?.trim())
|
|
667
|
+
return renderStayDetail(ctx, url, req, params.id, [
|
|
668
|
+
ctx.translate(ctx.localeOf(url, req))('hospitality_core.stay.validation.moveRequired'),
|
|
669
|
+
]);
|
|
670
|
+
result = (await ctx.call('hospitality_core.moveRoom', {
|
|
671
|
+
stayId: stay.id,
|
|
672
|
+
roomId: form.roomId,
|
|
673
|
+
assignmentId: randomUUID(),
|
|
674
|
+
reason: form.reason.trim(),
|
|
675
|
+
}, url, req));
|
|
676
|
+
status = 'room-moved';
|
|
677
|
+
}
|
|
678
|
+
else if (form.operation === 'save-document') {
|
|
679
|
+
result = (await ctx.call('hospitality_core.saveGuestDocument', {
|
|
680
|
+
id: form.documentId?.trim() || randomUUID(),
|
|
681
|
+
stayId: stay.id,
|
|
682
|
+
partnerId: form.partnerId?.trim() || '',
|
|
683
|
+
type: form.type?.trim() || 'cccd',
|
|
684
|
+
number: form.number?.trim() || undefined,
|
|
685
|
+
fullName: form.fullName?.trim() || '',
|
|
686
|
+
dateOfBirth: form.dateOfBirth?.trim() || undefined,
|
|
687
|
+
gender: form.gender?.trim() || undefined,
|
|
688
|
+
nationality: form.nationality?.trim() || undefined,
|
|
689
|
+
permanentAddress: form.permanentAddress?.trim() || undefined,
|
|
690
|
+
issueDate: form.issueDate?.trim() || undefined,
|
|
691
|
+
issuePlace: form.issuePlace?.trim() || undefined,
|
|
692
|
+
ocrState: 'pending',
|
|
693
|
+
}, url, req));
|
|
694
|
+
status = 'document-saved';
|
|
695
|
+
}
|
|
696
|
+
else
|
|
697
|
+
return text('unknown action', { status: 400 });
|
|
698
|
+
if (!result.ok)
|
|
699
|
+
return renderStayDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
700
|
+
const query = new URLSearchParams();
|
|
701
|
+
query.set('status', status);
|
|
702
|
+
const lang = url.searchParams.get('lang')?.trim() || form.lang?.trim();
|
|
703
|
+
if (lang)
|
|
704
|
+
query.set('lang', lang);
|
|
705
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
706
|
+
},
|
|
707
|
+
'/admin/hospitality/folios': (ctx) => async (url, req) => {
|
|
708
|
+
const lang = ctx.localeOf(url, req);
|
|
709
|
+
const _ = ctx.translate(lang);
|
|
710
|
+
const propertyId = await selectedProperty(ctx, url, req);
|
|
711
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
712
|
+
const rows = (await ctx.call('hospitality_core.listFolios', { propertyId, state: url.searchParams.get('state') || undefined }, url, req));
|
|
713
|
+
return document(ctx, url, req, _('hospitality_core.screen.folios.title'), foliosScreen(_, rows, lang, timezone, await frame(ctx, url, req)));
|
|
714
|
+
},
|
|
715
|
+
'/admin/hospitality/folios/{id}': (ctx) => async (url, req, params) => {
|
|
716
|
+
if (req.method === 'GET')
|
|
717
|
+
return renderFolioDetail(ctx, url, req, params.id);
|
|
718
|
+
if (req.method !== 'POST')
|
|
719
|
+
return text('GET or POST', { status: 405 });
|
|
720
|
+
const form = await readForm(req);
|
|
721
|
+
let result;
|
|
722
|
+
let status;
|
|
723
|
+
if (form.operation === 'post-charge') {
|
|
724
|
+
const id = form.id?.trim() || randomUUID();
|
|
725
|
+
result = (await ctx.call('hospitality_core.addCharge', {
|
|
726
|
+
id,
|
|
727
|
+
folioId: params.id,
|
|
728
|
+
stayId: form.stayId?.trim() || undefined,
|
|
729
|
+
description: form.description?.trim() || '',
|
|
730
|
+
type: form.type?.trim() || 'service',
|
|
731
|
+
quantity: form.quantity?.trim() || '1',
|
|
732
|
+
unitPrice: form.unitPrice?.trim() || '',
|
|
733
|
+
sourceKey: `manual-charge:${id}`,
|
|
734
|
+
}, url, req));
|
|
735
|
+
status = 'charge-posted';
|
|
736
|
+
}
|
|
737
|
+
else if (form.operation === 'void-charge') {
|
|
738
|
+
result = (await ctx.call('hospitality_core.voidCharge', {
|
|
739
|
+
id: form.chargeId?.trim() || '',
|
|
740
|
+
folioId: params.id,
|
|
741
|
+
reason: form.reason?.trim() || '',
|
|
742
|
+
}, url, req));
|
|
743
|
+
status = 'charge-voided';
|
|
744
|
+
}
|
|
745
|
+
else
|
|
746
|
+
return text('unknown action', { status: 400 });
|
|
747
|
+
if (!result.ok)
|
|
748
|
+
return renderFolioDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
749
|
+
const query = new URLSearchParams();
|
|
750
|
+
query.set('status', status);
|
|
751
|
+
const lang = url.searchParams.get('lang')?.trim() || form.lang?.trim();
|
|
752
|
+
if (lang)
|
|
753
|
+
query.set('lang', lang);
|
|
754
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
755
|
+
},
|
|
756
|
+
'/admin/hospitality/tape-chart': (ctx) => async (url, req) => {
|
|
757
|
+
const lang = ctx.localeOf(url, req);
|
|
758
|
+
const _ = ctx.translate(lang);
|
|
759
|
+
const propertyId = await selectedProperty(ctx, url, req);
|
|
760
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
761
|
+
const range = calendarRange(url.searchParams.get('from'), 7, timezone);
|
|
762
|
+
const chart = (await ctx.call('hospitality_core.getTapeChart', { propertyId: propertyId ?? '__none__', from: range.from, to: range.to }, url, req));
|
|
763
|
+
return document(ctx, url, req, _('hospitality_core.screen.tapeChart.title'), tapeChartScreen(_, chart, lang, await frame(ctx, url, req)));
|
|
764
|
+
},
|
|
765
|
+
'/admin/hospitality/properties': (ctx) => async (url, req) => {
|
|
766
|
+
if (req.method !== 'GET')
|
|
767
|
+
return text('GET', { status: 405 });
|
|
768
|
+
const lang = ctx.localeOf(url, req);
|
|
769
|
+
const _ = ctx.translate(lang);
|
|
770
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
771
|
+
return document(ctx, url, req, _('hospitality_core.screen.properties.title'), propertiesScreen(_, properties, {
|
|
772
|
+
rooms: properties.reduce((sum, property) => sum + property.rooms, 0),
|
|
773
|
+
available: properties.reduce((sum, property) => sum + property.availableRooms, 0),
|
|
774
|
+
attention: properties.reduce((sum, property) => sum + property.attentionRooms, 0),
|
|
775
|
+
}, lang, await frame(ctx, url, req)));
|
|
776
|
+
},
|
|
777
|
+
'/admin/hospitality/properties/new': (ctx) => async (url, req) => {
|
|
778
|
+
const lang = ctx.localeOf(url, req);
|
|
779
|
+
const _ = ctx.translate(lang);
|
|
780
|
+
const policies = (await ctx.call('hospitality_core.listCancellationPolicies', {}, url, req));
|
|
781
|
+
if (req.method === 'GET') {
|
|
782
|
+
const values = defaultPropertyValues(randomUUID());
|
|
783
|
+
return document(ctx, url, req, _('hospitality_core.property.create.title'), newPropertyScreen(_, values, policies, lang, await frame(ctx, url, req)));
|
|
784
|
+
}
|
|
785
|
+
if (req.method !== 'POST')
|
|
786
|
+
return text('GET or POST', { status: 405 });
|
|
787
|
+
const form = await readForm(req);
|
|
788
|
+
const values = propertyFormValues(randomUUID(), form);
|
|
789
|
+
const result = (await ctx.call('hospitality_core.saveProperty', propertySaveInput(values), url, req));
|
|
790
|
+
if (!result.ok)
|
|
791
|
+
return document(ctx, url, req, _('hospitality_core.property.create.title'), newPropertyScreen(_, values, policies, lang, await frame(ctx, url, req), operationErrors(ctx, url, req, result)));
|
|
792
|
+
const query = new URLSearchParams({ status: 'created', lang });
|
|
793
|
+
return seeOther(`/admin/hospitality/properties/${encodeURIComponent(values.id)}?${query.toString()}`);
|
|
794
|
+
},
|
|
795
|
+
'/admin/hospitality/properties/{id}': (ctx) => async (url, req, params) => {
|
|
796
|
+
if (req.method === 'GET')
|
|
797
|
+
return renderPropertyDetail(ctx, url, req, params.id);
|
|
798
|
+
if (req.method !== 'POST')
|
|
799
|
+
return text('GET or POST', { status: 405 });
|
|
800
|
+
const current = (await ctx.call('hospitality_core.getProperty', { id: params.id }, url, req));
|
|
801
|
+
if (!current)
|
|
802
|
+
return text('Not found', { status: 404 });
|
|
803
|
+
const form = await readForm(req);
|
|
804
|
+
const values = propertyFormValues(params.id, form, current);
|
|
805
|
+
const result = (await ctx.call('hospitality_core.saveProperty', propertySaveInput(values, current), url, req));
|
|
806
|
+
if (!result.ok)
|
|
807
|
+
return renderPropertyDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), values);
|
|
808
|
+
const query = new URLSearchParams({ status: 'saved', lang: ctx.localeOf(url, req) });
|
|
809
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
810
|
+
},
|
|
811
|
+
'/admin/hospitality/buildings/{id}': (ctx) => async (url, req, params) => {
|
|
812
|
+
if (req.method === 'GET')
|
|
813
|
+
return renderBuildingDetail(ctx, url, req, params.id);
|
|
814
|
+
if (req.method !== 'POST')
|
|
815
|
+
return text('GET or POST', { status: 405 });
|
|
816
|
+
const current = (await ctx.call('hospitality_core.getBuilding', { id: params.id }, url, req));
|
|
817
|
+
if (!current)
|
|
818
|
+
return text('Not found', { status: 404 });
|
|
819
|
+
const values = buildingFormValues(params.id, await readForm(req), current);
|
|
820
|
+
const result = (await ctx.call('hospitality_core.saveBuilding', values, url, req));
|
|
821
|
+
if (!result.ok)
|
|
822
|
+
return renderBuildingDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), values);
|
|
823
|
+
const query = new URLSearchParams({ status: 'saved', lang: ctx.localeOf(url, req) });
|
|
824
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
825
|
+
},
|
|
826
|
+
'/admin/hospitality/buildings/{id}/archive': (ctx) => async (url, req, params) => {
|
|
827
|
+
if (req.method !== 'POST')
|
|
828
|
+
return text('POST', { status: 405 });
|
|
829
|
+
const form = await readForm(req);
|
|
830
|
+
const active = form.action === 'restore';
|
|
831
|
+
const result = (await ctx.call('hospitality_core.archiveBuilding', { id: params.id, active }, url, req));
|
|
832
|
+
if (!result.ok)
|
|
833
|
+
return renderBuildingDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
834
|
+
const query = new URLSearchParams({
|
|
835
|
+
status: active ? 'restored' : 'archived',
|
|
836
|
+
lang: ctx.localeOf(url, req),
|
|
837
|
+
});
|
|
838
|
+
return seeOther(`/admin/hospitality/buildings/${encodeURIComponent(params.id)}?${query.toString()}`);
|
|
839
|
+
},
|
|
840
|
+
'/admin/hospitality/levels/{id}': (ctx) => async (url, req, params) => {
|
|
841
|
+
if (req.method === 'GET')
|
|
842
|
+
return renderFloorDetail(ctx, url, req, params.id);
|
|
843
|
+
if (req.method !== 'POST')
|
|
844
|
+
return text('GET or POST', { status: 405 });
|
|
845
|
+
const current = (await ctx.call('hospitality_core.getFloor', { id: params.id }, url, req));
|
|
846
|
+
if (!current)
|
|
847
|
+
return text('Not found', { status: 404 });
|
|
848
|
+
const values = floorFormValues(params.id, await readForm(req), current);
|
|
849
|
+
const result = (await ctx.call('hospitality_core.saveFloor', values, url, req));
|
|
850
|
+
if (!result.ok)
|
|
851
|
+
return renderFloorDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), values);
|
|
852
|
+
const query = new URLSearchParams({ status: 'saved', lang: ctx.localeOf(url, req) });
|
|
853
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
854
|
+
},
|
|
855
|
+
'/admin/hospitality/levels/{id}/archive': (ctx) => async (url, req, params) => {
|
|
856
|
+
if (req.method !== 'POST')
|
|
857
|
+
return text('POST', { status: 405 });
|
|
858
|
+
const form = await readForm(req);
|
|
859
|
+
const active = form.action === 'restore';
|
|
860
|
+
const result = (await ctx.call('hospitality_core.archiveFloor', { id: params.id, active }, url, req));
|
|
861
|
+
if (!result.ok)
|
|
862
|
+
return renderFloorDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
863
|
+
const query = new URLSearchParams({
|
|
864
|
+
status: active ? 'restored' : 'archived',
|
|
865
|
+
lang: ctx.localeOf(url, req),
|
|
866
|
+
});
|
|
867
|
+
return seeOther(`/admin/hospitality/levels/${encodeURIComponent(params.id)}?${query.toString()}`);
|
|
868
|
+
},
|
|
869
|
+
'/admin/hospitality/rooms': (ctx) => async (url, req) => {
|
|
870
|
+
if (req.method === 'GET')
|
|
871
|
+
return renderRooms(ctx, url, req);
|
|
872
|
+
if (req.method !== 'POST')
|
|
873
|
+
return text('GET or POST', { status: 405 });
|
|
874
|
+
const form = await readForm(req);
|
|
875
|
+
const operation = form.operation?.trim();
|
|
876
|
+
const propertyId = form.propertyId?.trim() || '';
|
|
877
|
+
let result;
|
|
878
|
+
let status;
|
|
879
|
+
if (operation === 'save-building') {
|
|
880
|
+
result = (await ctx.call('hospitality_core.saveBuilding', {
|
|
881
|
+
id: randomUUID(),
|
|
882
|
+
propertyId,
|
|
883
|
+
code: form.code?.trim() || '',
|
|
884
|
+
name: form.name?.trim() || '',
|
|
885
|
+
sequence: integer(form.sequence, 10),
|
|
886
|
+
}, url, req));
|
|
887
|
+
status = 'building-created';
|
|
888
|
+
}
|
|
889
|
+
else if (operation === 'save-floor') {
|
|
890
|
+
result = (await ctx.call('hospitality_core.saveFloor', {
|
|
891
|
+
id: randomUUID(),
|
|
892
|
+
propertyId,
|
|
893
|
+
buildingId: form.buildingId?.trim() || '',
|
|
894
|
+
code: form.code?.trim() || '',
|
|
895
|
+
name: form.name?.trim() || '',
|
|
896
|
+
sequence: integer(form.sequence, 10),
|
|
897
|
+
}, url, req));
|
|
898
|
+
status = 'floor-created';
|
|
899
|
+
}
|
|
900
|
+
else
|
|
901
|
+
return text('unknown action', { status: 400 });
|
|
902
|
+
if (!result.ok)
|
|
903
|
+
return renderRooms(ctx, url, req, operationErrors(ctx, url, req, result));
|
|
904
|
+
const query = new URLSearchParams({ property: propertyId, status, lang: ctx.localeOf(url, req) });
|
|
905
|
+
return seeOther(`/admin/hospitality/rooms?${query.toString()}`);
|
|
906
|
+
},
|
|
907
|
+
'/admin/hospitality/rooms/new': (ctx) => async (url, req) => {
|
|
908
|
+
const requestedProperty = url.searchParams.get('property')?.trim() || undefined;
|
|
909
|
+
const initial = await roomOptions(ctx, url, req, requestedProperty);
|
|
910
|
+
const lang = ctx.localeOf(url, req);
|
|
911
|
+
const _ = ctx.translate(lang);
|
|
912
|
+
if (!initial.propertyId || !initial.roomTypes.length)
|
|
913
|
+
return seeOther(`/admin/hospitality/rooms?lang=${encodeURIComponent(lang)}`);
|
|
914
|
+
if (req.method === 'GET') {
|
|
915
|
+
const values = defaultRoomValues(randomUUID(), initial.propertyId, initial.roomTypes[0].id);
|
|
916
|
+
return document(ctx, url, req, _('hospitality_core.room.create.title'), newRoomScreen(_, values, initial.properties, initial.roomTypes, initial.buildings, initial.floors, lang, await frame(ctx, url, req)));
|
|
917
|
+
}
|
|
918
|
+
if (req.method !== 'POST')
|
|
919
|
+
return text('GET or POST', { status: 405 });
|
|
920
|
+
const form = await readForm(req);
|
|
921
|
+
const values = roomFormValues(randomUUID(), form);
|
|
922
|
+
const options = await roomOptions(ctx, url, req, values.propertyId);
|
|
923
|
+
const result = (await ctx.call('hospitality_core.saveRoom', values, url, req));
|
|
924
|
+
if (!result.ok)
|
|
925
|
+
return document(ctx, url, req, _('hospitality_core.room.create.title'), newRoomScreen(_, values, options.properties, options.roomTypes, options.buildings, options.floors, lang, await frame(ctx, url, req), operationErrors(ctx, url, req, result)));
|
|
926
|
+
const query = new URLSearchParams({ status: 'created', lang });
|
|
927
|
+
return seeOther(`/admin/hospitality/rooms/${encodeURIComponent(values.id)}?${query.toString()}`);
|
|
928
|
+
},
|
|
929
|
+
'/admin/hospitality/rooms/{id}': (ctx) => async (url, req, params) => {
|
|
930
|
+
if (req.method === 'GET')
|
|
931
|
+
return renderRoomDetail(ctx, url, req, params.id);
|
|
932
|
+
if (req.method !== 'POST')
|
|
933
|
+
return text('GET or POST', { status: 405 });
|
|
934
|
+
const current = (await ctx.call('hospitality_core.getRoom', { id: params.id }, url, req));
|
|
935
|
+
if (!current)
|
|
936
|
+
return text('Not found', { status: 404 });
|
|
937
|
+
const form = await readForm(req);
|
|
938
|
+
const values = roomFormValues(params.id, form, current);
|
|
939
|
+
const result = (await ctx.call('hospitality_core.saveRoom', values, url, req));
|
|
940
|
+
if (!result.ok)
|
|
941
|
+
return renderRoomDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), values);
|
|
942
|
+
const query = new URLSearchParams({ status: 'saved', lang: ctx.localeOf(url, req) });
|
|
943
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
944
|
+
},
|
|
945
|
+
'/admin/hospitality/rooms/{id}/archive': (ctx) => async (url, req, params) => {
|
|
946
|
+
if (req.method !== 'POST')
|
|
947
|
+
return text('POST', { status: 405 });
|
|
948
|
+
const form = await readForm(req);
|
|
949
|
+
const active = form.action === 'restore';
|
|
950
|
+
const result = (await ctx.call('hospitality_core.archiveRoom', { id: params.id, active }, url, req));
|
|
951
|
+
if (!result.ok)
|
|
952
|
+
return renderRoomDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
953
|
+
const query = new URLSearchParams({
|
|
954
|
+
status: active ? 'restored' : 'archived',
|
|
955
|
+
lang: ctx.localeOf(url, req),
|
|
956
|
+
});
|
|
957
|
+
return seeOther(`/admin/hospitality/rooms/${encodeURIComponent(params.id)}?${query.toString()}`);
|
|
958
|
+
},
|
|
959
|
+
'/admin/hospitality/room-types': (ctx) => async (url, req) => {
|
|
960
|
+
if (req.method !== 'GET')
|
|
961
|
+
return text('GET', { status: 405 });
|
|
962
|
+
const lang = ctx.localeOf(url, req);
|
|
963
|
+
const _ = ctx.translate(lang);
|
|
964
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
965
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
966
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
967
|
+
? requestedProperty
|
|
968
|
+
: properties[0]?.id;
|
|
969
|
+
const rows = (await ctx.call('hospitality_core.listRoomTypes', { propertyId }, url, req));
|
|
970
|
+
return document(ctx, url, req, _('hospitality_core.screen.roomTypes.title'), roomTypesScreen(_, rows, properties, propertyId, lang, await frame(ctx, url, req)));
|
|
971
|
+
},
|
|
972
|
+
'/admin/hospitality/room-types/new': (ctx) => async (url, req) => {
|
|
973
|
+
const lang = ctx.localeOf(url, req);
|
|
974
|
+
const _ = ctx.translate(lang);
|
|
975
|
+
const [properties, policies] = (await Promise.all([
|
|
976
|
+
ctx.call('hospitality_core.listProperties', {}, url, req),
|
|
977
|
+
ctx.call('hospitality_core.listCancellationPolicies', {}, url, req),
|
|
978
|
+
]));
|
|
979
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
980
|
+
const propertyId = properties.find((row) => row.id === requestedProperty)?.id ?? properties[0]?.id ?? '';
|
|
981
|
+
if (req.method === 'GET') {
|
|
982
|
+
const values = defaultRoomTypeValues(randomUUID(), propertyId);
|
|
983
|
+
return document(ctx, url, req, _('hospitality_core.roomType.create.title'), newRoomTypeScreen(_, values, properties, policies, lang, await frame(ctx, url, req)));
|
|
984
|
+
}
|
|
985
|
+
if (req.method !== 'POST')
|
|
986
|
+
return text('GET or POST', { status: 405 });
|
|
987
|
+
const form = await readForm(req);
|
|
988
|
+
const values = roomTypeFormValues(randomUUID(), form);
|
|
989
|
+
const inputErrors = roomTypeInputErrors(ctx, url, req, values);
|
|
990
|
+
if (inputErrors.length)
|
|
991
|
+
return document(ctx, url, req, _('hospitality_core.roomType.create.title'), newRoomTypeScreen(_, values, properties, policies, lang, await frame(ctx, url, req), inputErrors));
|
|
992
|
+
const result = (await ctx.call('hospitality_core.saveRoomType', values, url, req));
|
|
993
|
+
if (!result.ok)
|
|
994
|
+
return document(ctx, url, req, _('hospitality_core.roomType.create.title'), newRoomTypeScreen(_, values, properties, policies, lang, await frame(ctx, url, req), operationErrors(ctx, url, req, result)));
|
|
995
|
+
const query = new URLSearchParams({ status: 'created', lang });
|
|
996
|
+
return seeOther(`/admin/hospitality/room-types/${encodeURIComponent(values.id)}?${query.toString()}`);
|
|
997
|
+
},
|
|
998
|
+
'/admin/hospitality/room-types/{id}': (ctx) => async (url, req, params) => {
|
|
999
|
+
if (req.method === 'GET')
|
|
1000
|
+
return renderRoomTypeDetail(ctx, url, req, params.id);
|
|
1001
|
+
if (req.method !== 'POST')
|
|
1002
|
+
return text('GET or POST', { status: 405 });
|
|
1003
|
+
const current = (await ctx.call('hospitality_core.getRoomType', { id: params.id }, url, req));
|
|
1004
|
+
if (!current)
|
|
1005
|
+
return text('Not found', { status: 404 });
|
|
1006
|
+
const form = await readForm(req);
|
|
1007
|
+
const values = roomTypeFormValues(params.id, form, current);
|
|
1008
|
+
const inputErrors = roomTypeInputErrors(ctx, url, req, values);
|
|
1009
|
+
if (inputErrors.length)
|
|
1010
|
+
return renderRoomTypeDetail(ctx, url, req, params.id, inputErrors, values);
|
|
1011
|
+
const result = (await ctx.call('hospitality_core.saveRoomType', values, url, req));
|
|
1012
|
+
if (!result.ok)
|
|
1013
|
+
return renderRoomTypeDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result), values);
|
|
1014
|
+
const query = new URLSearchParams({ status: 'saved', lang: ctx.localeOf(url, req) });
|
|
1015
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
1016
|
+
},
|
|
1017
|
+
'/admin/hospitality/rate-plans': (ctx) => async (url, req) => {
|
|
1018
|
+
if (req.method === 'POST') {
|
|
1019
|
+
const form = await readForm(req);
|
|
1020
|
+
if (form.operation !== 'save-rate-plan')
|
|
1021
|
+
return text('unknown action', { status: 400 });
|
|
1022
|
+
const result = (await ctx.call('hospitality_core.saveRatePlan', {
|
|
1023
|
+
id: randomUUID(),
|
|
1024
|
+
propertyId: form.propertyId ?? '',
|
|
1025
|
+
roomTypeId: form.roomTypeId ?? '',
|
|
1026
|
+
code: form.code ?? '',
|
|
1027
|
+
name: form.name ?? '',
|
|
1028
|
+
rateType: form.rateType ?? 'nightly',
|
|
1029
|
+
amount: form.amount ?? '',
|
|
1030
|
+
mealPlan: form.mealPlan || undefined,
|
|
1031
|
+
minStay: integer(form.minStay),
|
|
1032
|
+
maxStay: integer(form.maxStay),
|
|
1033
|
+
isDefault: form.isDefault === '1',
|
|
1034
|
+
active: form.active === '1',
|
|
1035
|
+
}, url, req));
|
|
1036
|
+
return redirected(url, result.ok ? 'saved' : 'invalid', { property: form.propertyId });
|
|
1037
|
+
}
|
|
1038
|
+
if (req.method !== 'GET')
|
|
1039
|
+
return text('GET or POST', { status: 405 });
|
|
1040
|
+
const lang = ctx.localeOf(url, req);
|
|
1041
|
+
const _ = ctx.translate(lang);
|
|
1042
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1043
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1044
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1045
|
+
? requestedProperty
|
|
1046
|
+
: properties[0]?.id;
|
|
1047
|
+
const [rows, roomTypes] = (await Promise.all([
|
|
1048
|
+
ctx.call('hospitality_core.listRatePlans', { propertyId }, url, req),
|
|
1049
|
+
ctx.call('hospitality_core.listRoomTypes', { propertyId }, url, req),
|
|
1050
|
+
]));
|
|
1051
|
+
return document(ctx, url, req, _('hospitality_core.screen.ratePlans.title'), ratePlansScreen(_, rows, properties, roomTypes, propertyId, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1052
|
+
},
|
|
1053
|
+
'/admin/hospitality/inventory': (ctx) => async (url, req) => {
|
|
1054
|
+
if (req.method === 'POST') {
|
|
1055
|
+
const form = await readForm(req);
|
|
1056
|
+
let result;
|
|
1057
|
+
if (form.operation === 'set-inventory')
|
|
1058
|
+
result = (await ctx.call('hospitality_core.setInventoryRange', {
|
|
1059
|
+
propertyId: form.propertyId ?? '',
|
|
1060
|
+
roomTypeId: form.roomTypeId ?? '',
|
|
1061
|
+
from: form.from ?? '',
|
|
1062
|
+
to: form.to ?? '',
|
|
1063
|
+
total: optionalInteger(form.total),
|
|
1064
|
+
blocked: optionalInteger(form.blocked),
|
|
1065
|
+
}, url, req));
|
|
1066
|
+
else if (form.operation === 'set-restrictions')
|
|
1067
|
+
result = (await ctx.call('hospitality_core.setRestrictionRange', {
|
|
1068
|
+
propertyId: form.propertyId ?? '',
|
|
1069
|
+
roomTypeId: form.roomTypeId ?? '',
|
|
1070
|
+
from: form.from ?? '',
|
|
1071
|
+
to: form.to ?? '',
|
|
1072
|
+
minLos: integer(form.minLos),
|
|
1073
|
+
maxLos: integer(form.maxLos),
|
|
1074
|
+
stopSell: form.stopSell === '1',
|
|
1075
|
+
closedToArrival: form.closedToArrival === '1',
|
|
1076
|
+
closedToDeparture: form.closedToDeparture === '1',
|
|
1077
|
+
}, url, req));
|
|
1078
|
+
else
|
|
1079
|
+
return text('unknown action', { status: 400 });
|
|
1080
|
+
return redirected(url, result.ok ? 'saved' : 'invalid', {
|
|
1081
|
+
property: form.propertyId,
|
|
1082
|
+
roomType: form.roomTypeId,
|
|
1083
|
+
from: form.from,
|
|
1084
|
+
to: form.to,
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
if (req.method !== 'GET')
|
|
1088
|
+
return text('GET or POST', { status: 405 });
|
|
1089
|
+
const lang = ctx.localeOf(url, req);
|
|
1090
|
+
const _ = ctx.translate(lang);
|
|
1091
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1092
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1093
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1094
|
+
? requestedProperty
|
|
1095
|
+
: properties[0]?.id;
|
|
1096
|
+
const roomTypes = (await ctx.call('hospitality_core.listRoomTypes', { propertyId }, url, req));
|
|
1097
|
+
const requestedRoomType = url.searchParams.get('roomType')?.trim();
|
|
1098
|
+
const roomTypeId = roomTypes.some((row) => row.id === requestedRoomType)
|
|
1099
|
+
? requestedRoomType
|
|
1100
|
+
: roomTypes[0]?.id;
|
|
1101
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
1102
|
+
const today = dateKeyIn(new Date(), timezone);
|
|
1103
|
+
const from = /^\d{4}-\d{2}-\d{2}$/.test(url.searchParams.get('from') ?? '')
|
|
1104
|
+
? url.searchParams.get('from')
|
|
1105
|
+
: today;
|
|
1106
|
+
const to = /^\d{4}-\d{2}-\d{2}$/.test(url.searchParams.get('to') ?? '')
|
|
1107
|
+
? url.searchParams.get('to')
|
|
1108
|
+
: addCalendarDays(from, 13);
|
|
1109
|
+
const rows = roomTypeId
|
|
1110
|
+
? (await ctx.call('hospitality_core.listInventory', { propertyId, roomTypeId, from, to }, url, req))
|
|
1111
|
+
: [];
|
|
1112
|
+
return document(ctx, url, req, _('hospitality_core.screen.inventory.title'), inventoryScreen(_, rows, properties, roomTypes, { propertyId, roomTypeId, from, to }, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1113
|
+
},
|
|
1114
|
+
'/admin/hospitality/services': (ctx) => async (url, req) => {
|
|
1115
|
+
if (req.method === 'POST') {
|
|
1116
|
+
const form = await readForm(req);
|
|
1117
|
+
let result;
|
|
1118
|
+
if (form.operation === 'save-property-charge')
|
|
1119
|
+
result = (await ctx.call('hospitality_core.savePropertyCharge', {
|
|
1120
|
+
id: form.id ?? '',
|
|
1121
|
+
propertyId: form.propertyId ?? '',
|
|
1122
|
+
chargeType: form.chargeType ?? '',
|
|
1123
|
+
name: form.name ?? '',
|
|
1124
|
+
amount: form.amount ?? '',
|
|
1125
|
+
description: form.description || undefined,
|
|
1126
|
+
active: form.active === '1',
|
|
1127
|
+
}, url, req));
|
|
1128
|
+
else if (form.operation === 'save-extra-line') {
|
|
1129
|
+
const target = form.target ?? '';
|
|
1130
|
+
const separator = target.indexOf(':');
|
|
1131
|
+
const targetType = separator > 0 ? target.slice(0, separator) : '';
|
|
1132
|
+
const targetId = separator > 0 ? target.slice(separator + 1) : '';
|
|
1133
|
+
result = (await ctx.call('hospitality_core.saveExtraLine', {
|
|
1134
|
+
id: form.id ?? '',
|
|
1135
|
+
...(targetType === 'reservation' ? { reservationId: targetId } : {}),
|
|
1136
|
+
...(targetType === 'stay' ? { stayId: targetId } : {}),
|
|
1137
|
+
productId: form.productId ?? '',
|
|
1138
|
+
description: form.description || undefined,
|
|
1139
|
+
quantity: form.quantity || undefined,
|
|
1140
|
+
unitPrice: form.unitPrice || undefined,
|
|
1141
|
+
recurrence: form.recurrence || undefined,
|
|
1142
|
+
active: form.active === '1',
|
|
1143
|
+
}, url, req));
|
|
1144
|
+
}
|
|
1145
|
+
else if (form.operation === 'materialize-extra')
|
|
1146
|
+
result = (await ctx.call('hospitality_core.materializeExtraLine', {
|
|
1147
|
+
id: form.id ?? '',
|
|
1148
|
+
serviceDate: form.serviceDate || undefined,
|
|
1149
|
+
quantity: form.quantity || undefined,
|
|
1150
|
+
requestKey: form.requestKey || undefined,
|
|
1151
|
+
}, url, req));
|
|
1152
|
+
else
|
|
1153
|
+
return text('unknown action', { status: 400 });
|
|
1154
|
+
return redirected(url, result.ok ? 'saved' : 'invalid', {
|
|
1155
|
+
property: form.propertyId || url.searchParams.get('property') || undefined,
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
if (req.method !== 'GET')
|
|
1159
|
+
return text('GET or POST', { status: 405 });
|
|
1160
|
+
const lang = ctx.localeOf(url, req);
|
|
1161
|
+
const _ = ctx.translate(lang);
|
|
1162
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1163
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1164
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1165
|
+
? requestedProperty
|
|
1166
|
+
: properties[0]?.id;
|
|
1167
|
+
const [propertyCharges, extraLines, charges, products, reservations, stays] = (await Promise.all([
|
|
1168
|
+
ctx.call('hospitality_core.listPropertyCharges', { propertyId }, url, req),
|
|
1169
|
+
ctx.call('hospitality_core.listExtraLines', { propertyId }, url, req),
|
|
1170
|
+
ctx.call('hospitality_core.listServiceCharges', { propertyId }, url, req),
|
|
1171
|
+
ctx.call('hospitality_core.listServiceProducts', {}, url, req),
|
|
1172
|
+
ctx.call('hospitality_core.listReservations', { propertyId }, url, req),
|
|
1173
|
+
ctx.call('hospitality_core.listStays', { propertyId }, url, req),
|
|
1174
|
+
]));
|
|
1175
|
+
const targets = [
|
|
1176
|
+
...reservations
|
|
1177
|
+
.filter((row) => row.state === 'draft' || row.state === 'confirmed')
|
|
1178
|
+
.map((row) => ({
|
|
1179
|
+
id: row.id,
|
|
1180
|
+
code: row.code,
|
|
1181
|
+
name: row.partner?.name ?? row.partnerId,
|
|
1182
|
+
type: 'reservation',
|
|
1183
|
+
})),
|
|
1184
|
+
...stays
|
|
1185
|
+
.filter((row) => row.state === 'checked_in')
|
|
1186
|
+
.map((row) => ({
|
|
1187
|
+
id: row.id,
|
|
1188
|
+
code: row.code,
|
|
1189
|
+
name: row.partner?.name ?? row.partnerId,
|
|
1190
|
+
type: 'stay',
|
|
1191
|
+
})),
|
|
1192
|
+
];
|
|
1193
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
1194
|
+
return document(ctx, url, req, _('hospitality_core.screen.services.title'), servicesScreen(_, {
|
|
1195
|
+
properties,
|
|
1196
|
+
propertyId,
|
|
1197
|
+
products,
|
|
1198
|
+
targets,
|
|
1199
|
+
propertyCharges,
|
|
1200
|
+
extraLines,
|
|
1201
|
+
charges,
|
|
1202
|
+
ids: { propertyCharge: randomUUID(), extraLine: randomUUID(), requestKey: randomUUID() },
|
|
1203
|
+
}, lang, timezone, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1204
|
+
},
|
|
1205
|
+
'/admin/hospitality/night-audit': (ctx) => async (url, req) => {
|
|
1206
|
+
if (req.method === 'POST') {
|
|
1207
|
+
const form = await readForm(req);
|
|
1208
|
+
if (form.operation !== 'request-night-audit')
|
|
1209
|
+
return text('unknown action', { status: 400 });
|
|
1210
|
+
const result = (await ctx.call('hospitality_core.requestNightAudit', { propertyId: form.propertyId ?? '', auditDate: form.auditDate ?? '' }, url, req));
|
|
1211
|
+
return redirected(url, result.ok ? 'queued' : 'invalid', {
|
|
1212
|
+
property: form.propertyId,
|
|
1213
|
+
auditDate: form.auditDate,
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
if (req.method !== 'GET')
|
|
1217
|
+
return text('GET or POST', { status: 405 });
|
|
1218
|
+
const lang = ctx.localeOf(url, req);
|
|
1219
|
+
const _ = ctx.translate(lang);
|
|
1220
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1221
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1222
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1223
|
+
? requestedProperty
|
|
1224
|
+
: properties[0]?.id;
|
|
1225
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
1226
|
+
const today = dateKeyIn(new Date(), timezone);
|
|
1227
|
+
const requestedDate = url.searchParams.get('auditDate')?.trim();
|
|
1228
|
+
const auditDate = /^\d{4}-\d{2}-\d{2}$/u.test(requestedDate ?? '') && requestedDate <= today ? requestedDate : today;
|
|
1229
|
+
const [preview, runs] = propertyId
|
|
1230
|
+
? (await Promise.all([
|
|
1231
|
+
ctx.call('hospitality_core.previewNightAudit', { propertyId, auditDate }, url, req),
|
|
1232
|
+
ctx.call('hospitality_core.listNightAudits', { propertyId, limit: 30 }, url, req),
|
|
1233
|
+
]))
|
|
1234
|
+
: [undefined, []];
|
|
1235
|
+
return document(ctx, url, req, _('hospitality_core.screen.nightAudit.title'), nightAuditScreen(_, { properties, propertyId, auditDate, today, preview, runs }, lang, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1236
|
+
},
|
|
1237
|
+
'/admin/hospitality/stay-notices': (ctx) => async (url, req) => {
|
|
1238
|
+
if (req.method === 'POST') {
|
|
1239
|
+
const form = await readForm(req);
|
|
1240
|
+
let result = { ok: false };
|
|
1241
|
+
let state = 'refreshed';
|
|
1242
|
+
if (form.operation === 'refresh') {
|
|
1243
|
+
result = (await ctx.call('hospitality_core.requestStayNoticeRefresh', { stayId: form.stayId ?? '' }, url, req));
|
|
1244
|
+
}
|
|
1245
|
+
else if (form.operation === 'record-submission') {
|
|
1246
|
+
state = 'submitted';
|
|
1247
|
+
result = (await ctx.call('hospitality_core.recordStayNoticeSubmission', {
|
|
1248
|
+
id: form.id ?? '',
|
|
1249
|
+
reason: form.reason ?? '',
|
|
1250
|
+
channel: form.channel ?? '',
|
|
1251
|
+
evidenceRef: form.evidenceRef ?? '',
|
|
1252
|
+
}, url, req));
|
|
1253
|
+
}
|
|
1254
|
+
else if (form.operation === 'confirm') {
|
|
1255
|
+
state = 'confirmed';
|
|
1256
|
+
result = (await ctx.call('hospitality_core.confirmStayNotice', { id: form.id ?? '', receiptRef: form.receiptRef ?? '' }, url, req));
|
|
1257
|
+
}
|
|
1258
|
+
else
|
|
1259
|
+
return text('unknown action', { status: 400 });
|
|
1260
|
+
return redirected(url, result.ok ? state : 'invalid', {
|
|
1261
|
+
property: form.property,
|
|
1262
|
+
state: form.state === 'all' ? undefined : form.state,
|
|
1263
|
+
notice: form.id,
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
if (req.method !== 'GET')
|
|
1267
|
+
return text('GET or POST', { status: 405 });
|
|
1268
|
+
const lang = ctx.localeOf(url, req);
|
|
1269
|
+
const _ = ctx.translate(lang);
|
|
1270
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1271
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1272
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1273
|
+
? requestedProperty
|
|
1274
|
+
: properties[0]?.id;
|
|
1275
|
+
const requestedState = url.searchParams.get('state')?.trim();
|
|
1276
|
+
const state = STAY_NOTICE_STATES.includes(requestedState)
|
|
1277
|
+
? requestedState
|
|
1278
|
+
: 'all';
|
|
1279
|
+
const rows = propertyId
|
|
1280
|
+
? (await ctx.call('hospitality_core.listStayNotices', { propertyId, limit: 500 }, url, req))
|
|
1281
|
+
: [];
|
|
1282
|
+
const selectedId = url.searchParams.get('notice')?.trim();
|
|
1283
|
+
const selected = rows.find((row) => row.id === selectedId);
|
|
1284
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
1285
|
+
return document(ctx, url, req, _('hospitality_core.screen.stayNotices.title'), stayNoticesScreen(_, { properties, propertyId, state, rows, selected }, lang, timezone, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1286
|
+
},
|
|
1287
|
+
'/admin/hospitality/housekeeping': (ctx) => async (url, req) => {
|
|
1288
|
+
if (req.method === 'POST') {
|
|
1289
|
+
const form = await readForm(req);
|
|
1290
|
+
if (form.operation !== 'create')
|
|
1291
|
+
return text('unknown action', { status: 400 });
|
|
1292
|
+
const id = form.id?.trim() || randomUUID();
|
|
1293
|
+
const result = (await ctx.call('hospitality_core.createCleaningTask', {
|
|
1294
|
+
id,
|
|
1295
|
+
code: form.code?.trim() || `HK-${id.slice(0, 12).toUpperCase()}`,
|
|
1296
|
+
roomId: form.roomId?.trim() || '',
|
|
1297
|
+
taskType: form.taskType?.trim() || 'daily_clean',
|
|
1298
|
+
priority: form.priority?.trim() || 'normal',
|
|
1299
|
+
assigneeId: form.assigneeId?.trim() || undefined,
|
|
1300
|
+
notes: form.notes?.trim() || undefined,
|
|
1301
|
+
}, url, req));
|
|
1302
|
+
return redirected(url, result.ok ? 'created' : 'invalid', {
|
|
1303
|
+
property: form.propertyId,
|
|
1304
|
+
state: form.state === 'all' ? undefined : form.state,
|
|
1305
|
+
lang: form.lang,
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
if (req.method !== 'GET')
|
|
1309
|
+
return text('GET or POST', { status: 405 });
|
|
1310
|
+
const lang = ctx.localeOf(url, req);
|
|
1311
|
+
const _ = ctx.translate(lang);
|
|
1312
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1313
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1314
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1315
|
+
? requestedProperty
|
|
1316
|
+
: properties[0]?.id;
|
|
1317
|
+
const requestedState = url.searchParams.get('state')?.trim();
|
|
1318
|
+
const state = CLEANING_TASK_STATES.includes(requestedState)
|
|
1319
|
+
? requestedState
|
|
1320
|
+
: 'all';
|
|
1321
|
+
const [rows, rooms, summary] = propertyId
|
|
1322
|
+
? (await Promise.all([
|
|
1323
|
+
ctx.call('hospitality_core.listCleaningTasks', { propertyId, state: state === 'all' ? undefined : state, limit: 500 }, url, req),
|
|
1324
|
+
ctx.call('hospitality_core.listRooms', { propertyId }, url, req),
|
|
1325
|
+
ctx.call('hospitality_core.cleaningTaskSummary', { propertyId }, url, req),
|
|
1326
|
+
]))
|
|
1327
|
+
: [[], [], { todo: 0, inProgress: 0, done: 0, cancelled: 0 }];
|
|
1328
|
+
const timezone = await propertyTimezone(ctx, propertyId, url, req);
|
|
1329
|
+
const taskId = randomUUID();
|
|
1330
|
+
return document(ctx, url, req, _('hospitality_core.screen.cleaningTasks.title'), cleaningTasksScreen(_, {
|
|
1331
|
+
rows,
|
|
1332
|
+
properties,
|
|
1333
|
+
propertyId,
|
|
1334
|
+
state,
|
|
1335
|
+
rooms,
|
|
1336
|
+
summary,
|
|
1337
|
+
id: taskId,
|
|
1338
|
+
code: `HK-${taskId.slice(0, 12).toUpperCase()}`,
|
|
1339
|
+
selectedRoomId: rooms.some((room) => room.id === url.searchParams.get('room'))
|
|
1340
|
+
? url.searchParams.get('room')
|
|
1341
|
+
: undefined,
|
|
1342
|
+
}, lang, timezone, await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1343
|
+
},
|
|
1344
|
+
'/admin/hospitality/housekeeping/tasks/{id}': (ctx) => async (url, req, params) => {
|
|
1345
|
+
if (req.method === 'GET')
|
|
1346
|
+
return renderCleaningTaskDetail(ctx, url, req, params.id);
|
|
1347
|
+
if (req.method !== 'POST')
|
|
1348
|
+
return text('GET or POST', { status: 405 });
|
|
1349
|
+
const form = await readForm(req);
|
|
1350
|
+
let result;
|
|
1351
|
+
let status;
|
|
1352
|
+
if (form.operation === 'start') {
|
|
1353
|
+
result = (await ctx.call('hospitality_core.startCleaningTask', { id: params.id, assigneeId: form.assigneeId?.trim() || undefined }, url, req));
|
|
1354
|
+
status = 'started';
|
|
1355
|
+
}
|
|
1356
|
+
else if (form.operation === 'complete') {
|
|
1357
|
+
result = (await ctx.call('hospitality_core.completeCleaningTask', { id: params.id }, url, req));
|
|
1358
|
+
status = 'completed';
|
|
1359
|
+
}
|
|
1360
|
+
else if (form.operation === 'cancel') {
|
|
1361
|
+
result = (await ctx.call('hospitality_core.cancelCleaningTask', { id: params.id }, url, req));
|
|
1362
|
+
status = 'cancelled';
|
|
1363
|
+
}
|
|
1364
|
+
else
|
|
1365
|
+
return text('unknown action', { status: 400 });
|
|
1366
|
+
if (!result.ok)
|
|
1367
|
+
return renderCleaningTaskDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
1368
|
+
const query = new URLSearchParams({ status });
|
|
1369
|
+
const lang = url.searchParams.get('lang')?.trim() || form.lang?.trim();
|
|
1370
|
+
if (lang)
|
|
1371
|
+
query.set('lang', lang);
|
|
1372
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
1373
|
+
},
|
|
1374
|
+
'/admin/hospitality/housekeeping/rooms': (ctx) => async (url, req) => {
|
|
1375
|
+
if (req.method !== 'GET')
|
|
1376
|
+
return text('GET', { status: 405 });
|
|
1377
|
+
const lang = ctx.localeOf(url, req);
|
|
1378
|
+
const _ = ctx.translate(lang);
|
|
1379
|
+
const properties = (await ctx.call('hospitality_core.listProperties', {}, url, req));
|
|
1380
|
+
const requestedProperty = url.searchParams.get('property')?.trim();
|
|
1381
|
+
const propertyId = properties.some((row) => row.id === requestedProperty)
|
|
1382
|
+
? requestedProperty
|
|
1383
|
+
: properties[0]?.id;
|
|
1384
|
+
const requestedState = url.searchParams.get('state')?.trim();
|
|
1385
|
+
const state = ROOM_STATUSES.includes(requestedState)
|
|
1386
|
+
? requestedState
|
|
1387
|
+
: 'all';
|
|
1388
|
+
const [rows, summary] = propertyId
|
|
1389
|
+
? (await Promise.all([
|
|
1390
|
+
ctx.call('hospitality_core.listRooms', { propertyId, status: state === 'all' ? undefined : state, limit: 500 }, url, req),
|
|
1391
|
+
ctx.call('hospitality_core.roomStatusSummary', { propertyId }, url, req),
|
|
1392
|
+
]))
|
|
1393
|
+
: [[], { available: 0, occupied: 0, dirty: 0, cleaning: 0, maintenance: 0, outOfOrder: 0 }];
|
|
1394
|
+
return document(ctx, url, req, _('hospitality_core.screen.housekeepingRooms.title'), housekeepingRoomsScreen(_, { rows, properties, propertyId, state, summary }, lang, await frame(ctx, url, req)));
|
|
1395
|
+
},
|
|
1396
|
+
'/admin/hospitality/housekeeping/rooms/{id}': (ctx) => async (url, req, params) => {
|
|
1397
|
+
if (req.method === 'GET')
|
|
1398
|
+
return renderHousekeepingRoomDetail(ctx, url, req, params.id);
|
|
1399
|
+
if (req.method !== 'POST')
|
|
1400
|
+
return text('GET or POST', { status: 405 });
|
|
1401
|
+
const form = await readForm(req);
|
|
1402
|
+
if (form.operation !== 'set-status')
|
|
1403
|
+
return text('unknown action', { status: 400 });
|
|
1404
|
+
const result = (await ctx.call('hospitality_core.setRoomStatus', {
|
|
1405
|
+
id: params.id,
|
|
1406
|
+
expectedStatus: form.expectedStatus?.trim() || undefined,
|
|
1407
|
+
status: form.status?.trim() || '',
|
|
1408
|
+
note: form.note?.trim() || undefined,
|
|
1409
|
+
}, url, req));
|
|
1410
|
+
if (!result.ok)
|
|
1411
|
+
return renderHousekeepingRoomDetail(ctx, url, req, params.id, operationErrors(ctx, url, req, result));
|
|
1412
|
+
const query = new URLSearchParams({ status: 'updated' });
|
|
1413
|
+
const lang = url.searchParams.get('lang')?.trim() || form.lang?.trim();
|
|
1414
|
+
if (lang)
|
|
1415
|
+
query.set('lang', lang);
|
|
1416
|
+
return seeOther(`${url.pathname}?${query.toString()}`);
|
|
1417
|
+
},
|
|
1418
|
+
'/admin/hospitality/content': (ctx) => async (url, req) => {
|
|
1419
|
+
if (req.method !== 'GET')
|
|
1420
|
+
return text('GET', { status: 405 });
|
|
1421
|
+
const lang = ctx.localeOf(url, req);
|
|
1422
|
+
const _ = ctx.translate(lang);
|
|
1423
|
+
const selection = await contentSelection(ctx, url, req);
|
|
1424
|
+
const images = await contentImages(ctx, url, req, selection);
|
|
1425
|
+
const property = selection.propertyId
|
|
1426
|
+
? (await ctx.call('hospitality_core.getProperty', { id: selection.propertyId }, url, req))
|
|
1427
|
+
: null;
|
|
1428
|
+
const roomType = selection.roomTypes.find((row) => row.id === selection.roomTypeId);
|
|
1429
|
+
const checks = selection.roomTypeId
|
|
1430
|
+
? [
|
|
1431
|
+
Boolean(roomType?.publicName || roomType?.name),
|
|
1432
|
+
Boolean(roomType?.description),
|
|
1433
|
+
Number(roomType?.defaultCapacity ?? 0) > 0,
|
|
1434
|
+
Number(roomType?.maxAdults ?? 0) > 0,
|
|
1435
|
+
images.length > 0,
|
|
1436
|
+
]
|
|
1437
|
+
: [
|
|
1438
|
+
Boolean(property?.publicName || property?.name),
|
|
1439
|
+
Boolean(property?.addressLine),
|
|
1440
|
+
Boolean(property?.description),
|
|
1441
|
+
Number(property?.starRating ?? 0) > 0,
|
|
1442
|
+
images.length > 0,
|
|
1443
|
+
];
|
|
1444
|
+
const completed = checks.filter(Boolean).length;
|
|
1445
|
+
return document(ctx, url, req, _('hospitality_core.screen.content.title'), contentScreen(_, selection.properties, selection.roomTypes, selection.propertyId, selection.target, images, {
|
|
1446
|
+
completed,
|
|
1447
|
+
total: checks.length,
|
|
1448
|
+
percent: checks.length ? Math.round((completed / checks.length) * 100) : 0,
|
|
1449
|
+
}, lang, contentQuery(url, selection), await frame(ctx, url, req), url.searchParams.get('status')));
|
|
1450
|
+
},
|
|
1451
|
+
'/admin/hospitality/content/upload': (ctx) => async (url, req) => {
|
|
1452
|
+
if (req.method !== 'POST')
|
|
1453
|
+
return text('POST multipart/form-data', { status: 405 });
|
|
1454
|
+
const selection = await contentSelection(ctx, url, req);
|
|
1455
|
+
if (!selection.propertyId)
|
|
1456
|
+
return text('Property not found', { status: 404 });
|
|
1457
|
+
const resourceId = selection.roomTypeId ?? selection.propertyId;
|
|
1458
|
+
const attachment = await receiveAttachment(ctx, url, req, {
|
|
1459
|
+
resModel: selection.roomTypeId ? 'hospitality_core.RoomType' : 'hospitality_core.Property',
|
|
1460
|
+
resId: resourceId,
|
|
1461
|
+
resField: 'contentImages',
|
|
1462
|
+
public: true,
|
|
1463
|
+
});
|
|
1464
|
+
try {
|
|
1465
|
+
await ctx.call('hospitality_core.attachContentImage', {
|
|
1466
|
+
id: attachment.id,
|
|
1467
|
+
attachmentId: attachment.id,
|
|
1468
|
+
...(selection.roomTypeId
|
|
1469
|
+
? { roomTypeId: selection.roomTypeId }
|
|
1470
|
+
: { propertyId: selection.propertyId }),
|
|
1471
|
+
category: selection.roomTypeId ? 'room' : 'exterior',
|
|
1472
|
+
caption: attachment.name,
|
|
1473
|
+
}, url, req);
|
|
1474
|
+
}
|
|
1475
|
+
catch (error) {
|
|
1476
|
+
await ctx.call('storage.removeAttachment', { id: attachment.id }, url, req).catch(() => undefined);
|
|
1477
|
+
await ctx.call('storage.requestSweep', { minAgeMs: 0 }, url, req).catch(() => undefined);
|
|
1478
|
+
throw error;
|
|
1479
|
+
}
|
|
1480
|
+
return contentRedirect(url, selection, 'saved');
|
|
1481
|
+
},
|
|
1482
|
+
'/admin/hospitality/content/images/{id}/metadata': (ctx) => async (url, req, params) => {
|
|
1483
|
+
if (req.method !== 'POST')
|
|
1484
|
+
return text('POST', { status: 405 });
|
|
1485
|
+
const selection = await contentSelection(ctx, url, req);
|
|
1486
|
+
const images = await contentImages(ctx, url, req, selection);
|
|
1487
|
+
if (!images.some((image) => image.id === params.id))
|
|
1488
|
+
return text('Image not found', { status: 404 });
|
|
1489
|
+
const form = await readForm(req);
|
|
1490
|
+
try {
|
|
1491
|
+
await ctx.call('hospitality_core.updateContentImage', { id: params.id, category: form.category ?? '', caption: form.caption || undefined }, url, req);
|
|
1492
|
+
return contentRedirect(url, selection, 'saved');
|
|
1493
|
+
}
|
|
1494
|
+
catch (error) {
|
|
1495
|
+
if (error.code === 'E_HOSPITALITY_CONTENT_INVALID')
|
|
1496
|
+
return contentRedirect(url, selection, 'invalid');
|
|
1497
|
+
throw error;
|
|
1498
|
+
}
|
|
1499
|
+
},
|
|
1500
|
+
'/admin/hospitality/content/images/{id}/primary': (ctx) => async (url, req, params) => {
|
|
1501
|
+
if (req.method !== 'POST')
|
|
1502
|
+
return text('POST', { status: 405 });
|
|
1503
|
+
const selection = await contentSelection(ctx, url, req);
|
|
1504
|
+
const images = await contentImages(ctx, url, req, selection);
|
|
1505
|
+
if (!images.some((image) => image.id === params.id))
|
|
1506
|
+
return text('Image not found', { status: 404 });
|
|
1507
|
+
await ctx.call('hospitality_core.setPrimaryContentImage', { id: params.id }, url, req);
|
|
1508
|
+
return contentRedirect(url, selection, 'saved');
|
|
1509
|
+
},
|
|
1510
|
+
'/admin/hospitality/content/images/{id}/remove': (ctx) => async (url, req, params) => {
|
|
1511
|
+
if (req.method !== 'POST')
|
|
1512
|
+
return text('POST', { status: 405 });
|
|
1513
|
+
const selection = await contentSelection(ctx, url, req);
|
|
1514
|
+
const images = await contentImages(ctx, url, req, selection);
|
|
1515
|
+
if (!images.some((image) => image.id === params.id))
|
|
1516
|
+
return text('Image not found', { status: 404 });
|
|
1517
|
+
await ctx.call('hospitality_core.removeContentImage', { id: params.id }, url, req);
|
|
1518
|
+
return contentRedirect(url, selection, 'saved');
|
|
1519
|
+
},
|
|
1520
|
+
'/admin/hospitality/content/images/{id}/move-up': (ctx) => async (url, req, params) => moveContentImage(ctx, url, req, params.id, -1),
|
|
1521
|
+
'/admin/hospitality/content/images/{id}/move-down': (ctx) => async (url, req, params) => moveContentImage(ctx, url, req, params.id, 1),
|
|
1522
|
+
'/admin/hospitality/amenities': (ctx) => async (url, req) => {
|
|
1523
|
+
const lang = ctx.localeOf(url, req);
|
|
1524
|
+
const _ = ctx.translate(lang);
|
|
1525
|
+
const rows = (await ctx.call('hospitality_core.listAmenities', {}, url, req));
|
|
1526
|
+
return document(ctx, url, req, _('hospitality_core.screen.amenities.title'), amenitiesScreen(_, rows, await frame(ctx, url, req)));
|
|
1527
|
+
},
|
|
1528
|
+
'/admin/hospitality/policies': (ctx) => async (url, req) => {
|
|
1529
|
+
const lang = ctx.localeOf(url, req);
|
|
1530
|
+
const _ = ctx.translate(lang);
|
|
1531
|
+
const rows = (await ctx.call('hospitality_core.listCancellationPolicies', {}, url, req));
|
|
1532
|
+
return document(ctx, url, req, _('hospitality_core.screen.policies.title'), policiesScreen(_, rows, await frame(ctx, url, req)));
|
|
1533
|
+
},
|
|
1534
|
+
};
|
|
1535
|
+
const moveContentImage = async (ctx, url, req, imageId, delta) => {
|
|
1536
|
+
if (req.method !== 'POST')
|
|
1537
|
+
return text('POST', { status: 405 });
|
|
1538
|
+
const selection = await contentSelection(ctx, url, req);
|
|
1539
|
+
const images = await contentImages(ctx, url, req, selection);
|
|
1540
|
+
const index = images.findIndex((image) => image.id === imageId);
|
|
1541
|
+
if (index < 0)
|
|
1542
|
+
return text('Image not found', { status: 404 });
|
|
1543
|
+
const destination = index + delta;
|
|
1544
|
+
if (destination >= 0 && destination < images.length) {
|
|
1545
|
+
const ids = images.map((image) => image.id);
|
|
1546
|
+
[ids[index], ids[destination]] = [ids[destination], ids[index]];
|
|
1547
|
+
await ctx.call('hospitality_core.reorderContentImages', {
|
|
1548
|
+
...(selection.roomTypeId
|
|
1549
|
+
? { roomTypeId: selection.roomTypeId }
|
|
1550
|
+
: { propertyId: selection.propertyId }),
|
|
1551
|
+
ids,
|
|
1552
|
+
}, url, req);
|
|
1553
|
+
}
|
|
1554
|
+
return contentRedirect(url, selection, 'saved');
|
|
1555
|
+
};
|
|
1556
|
+
//# sourceMappingURL=routes.js.map
|