@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,4138 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@ketvietlab/ketjs-view/jsx-runtime";
|
|
2
|
+
import { badge, cardGrid, code, dataTable, datePicker, definitionList, emptyState, formCluster as FormCluster, formatMoney, framedPage as Framed, icon, linkButton, metric, mediaPanel, notice, recordActions, person, recordForm as RecordForm, recordWorkspace as RecordWorkspace, scheduleBoard, section as Section, stack, surface as Surface, } from '../../ui/index.js';
|
|
3
|
+
import { addCalendarDays, dateKeyIn, zonedMidnight } from './calendar.js';
|
|
4
|
+
import { ACCOMMODATION_TYPES, BOOKING_PROVIDERS, CHARGE_TYPES, DOCUMENT_TYPES, GENDERS, ROOM_STATUSES, ROOM_VIEW_TYPES, } from './types.js';
|
|
5
|
+
const providerName = (_, provider) => BOOKING_PROVIDERS.includes(provider)
|
|
6
|
+
? _(`hospitality_core.provider.${provider}`)
|
|
7
|
+
: provider.replace(/[_-]+/g, ' ').replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
8
|
+
const statusTone = (status) => {
|
|
9
|
+
if (status === 'available')
|
|
10
|
+
return 'positive';
|
|
11
|
+
if (status === 'dirty' || status === 'cleaning')
|
|
12
|
+
return 'warning';
|
|
13
|
+
if (status === 'maintenance' || status === 'out_of_order')
|
|
14
|
+
return 'danger';
|
|
15
|
+
if (status === 'occupied')
|
|
16
|
+
return 'info';
|
|
17
|
+
return 'neutral';
|
|
18
|
+
};
|
|
19
|
+
const workflowTone = (status) => {
|
|
20
|
+
if (status === 'confirmed' || status === 'checked_in' || status === 'open')
|
|
21
|
+
return 'positive';
|
|
22
|
+
if (status === 'draft')
|
|
23
|
+
return 'warning';
|
|
24
|
+
if (status === 'cancelled' || status === 'no_show')
|
|
25
|
+
return 'danger';
|
|
26
|
+
if (status === 'checked_out' || status === 'closed')
|
|
27
|
+
return 'neutral';
|
|
28
|
+
return 'info';
|
|
29
|
+
};
|
|
30
|
+
const cleaningTone = (state) => {
|
|
31
|
+
if (state === 'todo')
|
|
32
|
+
return 'warning';
|
|
33
|
+
if (state === 'in_progress')
|
|
34
|
+
return 'info';
|
|
35
|
+
if (state === 'done')
|
|
36
|
+
return 'positive';
|
|
37
|
+
return 'neutral';
|
|
38
|
+
};
|
|
39
|
+
const dateTime = (value, locale, timezone) => new Intl.DateTimeFormat(locale, {
|
|
40
|
+
timeZone: timezone,
|
|
41
|
+
day: '2-digit',
|
|
42
|
+
month: '2-digit',
|
|
43
|
+
hour: '2-digit',
|
|
44
|
+
minute: '2-digit',
|
|
45
|
+
hour12: false,
|
|
46
|
+
}).format(new Date(value));
|
|
47
|
+
const guestName = (row) => row.partner?.name ?? row.partnerId;
|
|
48
|
+
const propertyColumns = (_) => [
|
|
49
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
50
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
51
|
+
{
|
|
52
|
+
key: 'type',
|
|
53
|
+
label: _('hospitality_core.col.type'),
|
|
54
|
+
cell: (row) => badge(_(`hospitality_core.accommodation.${row.accommodationType}`)),
|
|
55
|
+
kind: 'status',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: 'location',
|
|
59
|
+
label: _('hospitality_core.col.location'),
|
|
60
|
+
cell: (row) => row.addressLine || [row.city, row.country].filter(Boolean).join(', ') || '—',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
key: 'rooms',
|
|
64
|
+
label: _('hospitality_core.col.rooms'),
|
|
65
|
+
cell: (row) => String(row.rooms),
|
|
66
|
+
align: 'end',
|
|
67
|
+
kind: 'number',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'stars',
|
|
71
|
+
label: _('hospitality_core.col.stars'),
|
|
72
|
+
cell: (row) => String(row.starRating),
|
|
73
|
+
align: 'end',
|
|
74
|
+
kind: 'number',
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
const roomColumns = (_) => [
|
|
78
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
79
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
80
|
+
{
|
|
81
|
+
key: 'roomType',
|
|
82
|
+
label: _('hospitality_core.col.roomType'),
|
|
83
|
+
cell: (row) => row.roomType?.name ?? code(row.roomTypeId),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: 'location',
|
|
87
|
+
label: _('hospitality_core.col.location'),
|
|
88
|
+
cell: (row) => [row.building?.name ?? row.building?.code, row.floor?.name ?? row.floor?.code]
|
|
89
|
+
.filter(Boolean)
|
|
90
|
+
.join(' · ') || '—',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: 'capacity',
|
|
94
|
+
label: _('hospitality_core.col.capacity'),
|
|
95
|
+
cell: (row) => String(row.capacity),
|
|
96
|
+
align: 'end',
|
|
97
|
+
kind: 'number',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: 'status',
|
|
101
|
+
label: _('hospitality_core.col.status'),
|
|
102
|
+
cell: (row) => badge(_(`hospitality_core.roomStatus.${row.status}`), statusTone(row.status), row.status),
|
|
103
|
+
kind: 'status',
|
|
104
|
+
priority: 'primary',
|
|
105
|
+
},
|
|
106
|
+
];
|
|
107
|
+
const buildingColumns = (_) => [
|
|
108
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
109
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
110
|
+
{
|
|
111
|
+
key: 'floors',
|
|
112
|
+
label: _('hospitality_core.room.metric.floors'),
|
|
113
|
+
cell: (row) => String(row.floors?.filter((floor) => floor.active !== false).length ?? 0),
|
|
114
|
+
align: 'end',
|
|
115
|
+
kind: 'number',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: 'rooms',
|
|
119
|
+
label: _('hospitality_core.col.rooms'),
|
|
120
|
+
cell: (row) => String(row.rooms?.filter((room) => room.active !== false).length ?? 0),
|
|
121
|
+
align: 'end',
|
|
122
|
+
kind: 'number',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: 'active',
|
|
126
|
+
label: _('hospitality_core.col.status'),
|
|
127
|
+
cell: (row) => badge(_(row.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), row.active ? 'positive' : 'neutral'),
|
|
128
|
+
kind: 'status',
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
const floorColumns = (_) => [
|
|
132
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
133
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
134
|
+
{
|
|
135
|
+
key: 'building',
|
|
136
|
+
label: _('hospitality_core.room.field.building'),
|
|
137
|
+
cell: (row) => row.building?.name ?? row.building?.code ?? code(row.buildingId),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: 'sequence',
|
|
141
|
+
label: _('hospitality_core.room.field.sequence'),
|
|
142
|
+
cell: (row) => String(row.sequence),
|
|
143
|
+
align: 'end',
|
|
144
|
+
kind: 'number',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: 'rooms',
|
|
148
|
+
label: _('hospitality_core.col.rooms'),
|
|
149
|
+
cell: (row) => String(row.rooms?.filter((room) => room.active !== false).length ?? 0),
|
|
150
|
+
align: 'end',
|
|
151
|
+
kind: 'number',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: 'active',
|
|
155
|
+
label: _('hospitality_core.col.status'),
|
|
156
|
+
cell: (row) => badge(_(row.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), row.active ? 'positive' : 'neutral'),
|
|
157
|
+
kind: 'status',
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
const roomTypeColumns = (_) => [
|
|
161
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
162
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
163
|
+
{
|
|
164
|
+
key: 'capacity',
|
|
165
|
+
label: _('hospitality_core.col.capacity'),
|
|
166
|
+
cell: (row) => String(row.defaultCapacity),
|
|
167
|
+
align: 'end',
|
|
168
|
+
kind: 'number',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
key: 'rooms',
|
|
172
|
+
label: _('hospitality_core.col.rooms'),
|
|
173
|
+
cell: (row) => String(row.rooms?.length ?? 0),
|
|
174
|
+
align: 'end',
|
|
175
|
+
kind: 'number',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: 'baseRate',
|
|
179
|
+
label: _('hospitality_core.col.baseRate'),
|
|
180
|
+
cell: (row) => formatMoney(_, row.baseRate),
|
|
181
|
+
align: 'end',
|
|
182
|
+
kind: 'currency',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: 'published',
|
|
186
|
+
label: _('hospitality_core.col.published'),
|
|
187
|
+
cell: (row) => badge(_(row.published ? 'hospitality_core.value.yes' : 'hospitality_core.value.no'), row.published ? 'positive' : 'neutral'),
|
|
188
|
+
kind: 'status',
|
|
189
|
+
},
|
|
190
|
+
];
|
|
191
|
+
const amenityColumns = (_) => [
|
|
192
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
193
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
194
|
+
{
|
|
195
|
+
key: 'scope',
|
|
196
|
+
label: _('hospitality_core.col.scope'),
|
|
197
|
+
cell: (row) => badge(_(`hospitality_core.amenityScope.${row.scope}`)),
|
|
198
|
+
kind: 'status',
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
const policyColumns = (_) => [
|
|
202
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
203
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
204
|
+
{
|
|
205
|
+
key: 'policy',
|
|
206
|
+
label: _('hospitality_core.col.policy'),
|
|
207
|
+
cell: (row) => badge(_(`hospitality_core.policy.${row.type}`)),
|
|
208
|
+
kind: 'status',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
key: 'freeCancellation',
|
|
212
|
+
label: _('hospitality_core.col.freeCancellation'),
|
|
213
|
+
cell: (row) => _('hospitality_core.value.hours', { count: row.freeCancellationHours }),
|
|
214
|
+
align: 'end',
|
|
215
|
+
kind: 'number',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
key: 'penalty',
|
|
219
|
+
label: _('hospitality_core.col.penalty'),
|
|
220
|
+
cell: (row) => _('hospitality_core.value.percent', { count: Number(row.penaltyPercent) }),
|
|
221
|
+
align: 'end',
|
|
222
|
+
kind: 'number',
|
|
223
|
+
},
|
|
224
|
+
];
|
|
225
|
+
const ratePlanColumns = (_) => [
|
|
226
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
227
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
228
|
+
{
|
|
229
|
+
key: 'roomType',
|
|
230
|
+
label: _('hospitality_core.col.roomType'),
|
|
231
|
+
cell: (row) => row.roomType?.name ?? row.roomType?.code ?? code(row.roomTypeId),
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: 'rateType',
|
|
235
|
+
label: _('hospitality_core.col.rateType'),
|
|
236
|
+
cell: (row) => badge(_(`hospitality_core.bookingType.${row.rateType}`)),
|
|
237
|
+
kind: 'status',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
key: 'amount',
|
|
241
|
+
label: _('hospitality_core.col.amount'),
|
|
242
|
+
cell: (row) => formatMoney(_, row.amount),
|
|
243
|
+
align: 'end',
|
|
244
|
+
kind: 'currency',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
key: 'mealPlan',
|
|
248
|
+
label: _('hospitality_core.col.mealPlan'),
|
|
249
|
+
cell: (row) => (row.mealPlan ? _(`hospitality_core.mealPlan.${row.mealPlan}`) : '—'),
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
key: 'los',
|
|
253
|
+
label: _('hospitality_core.col.los'),
|
|
254
|
+
cell: (row) => `${row.minStay || '—'} / ${row.maxStay || '∞'}`,
|
|
255
|
+
align: 'end',
|
|
256
|
+
kind: 'number',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
key: 'default',
|
|
260
|
+
label: _('hospitality_core.col.default'),
|
|
261
|
+
cell: (row) => badge(_(row.isDefault ? 'hospitality_core.value.yes' : 'hospitality_core.value.no'), row.isDefault ? 'positive' : 'neutral'),
|
|
262
|
+
kind: 'status',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
key: 'active',
|
|
266
|
+
label: _('hospitality_core.col.status'),
|
|
267
|
+
cell: (row) => badge(_(row.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), row.active ? 'positive' : 'neutral'),
|
|
268
|
+
kind: 'status',
|
|
269
|
+
},
|
|
270
|
+
];
|
|
271
|
+
const inventoryColumns = (_) => [
|
|
272
|
+
{ key: 'date', label: _('hospitality_core.col.date'), cell: (row) => row.date, kind: 'date' },
|
|
273
|
+
{
|
|
274
|
+
key: 'total',
|
|
275
|
+
label: _('hospitality_core.col.total'),
|
|
276
|
+
cell: (row) => String(row.total),
|
|
277
|
+
align: 'end',
|
|
278
|
+
kind: 'number',
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
key: 'sold',
|
|
282
|
+
label: _('hospitality_core.col.sold'),
|
|
283
|
+
cell: (row) => String(row.sold),
|
|
284
|
+
align: 'end',
|
|
285
|
+
kind: 'number',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
key: 'blocked',
|
|
289
|
+
label: _('hospitality_core.col.blocked'),
|
|
290
|
+
cell: (row) => String(row.blocked),
|
|
291
|
+
align: 'end',
|
|
292
|
+
kind: 'number',
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
key: 'available',
|
|
296
|
+
label: _('hospitality_core.col.available'),
|
|
297
|
+
cell: (row) => String(row.available),
|
|
298
|
+
align: 'end',
|
|
299
|
+
kind: 'number',
|
|
300
|
+
priority: 'primary',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
key: 'los',
|
|
304
|
+
label: _('hospitality_core.col.los'),
|
|
305
|
+
cell: (row) => `${row.minLos || '—'} / ${row.maxLos || '∞'}`,
|
|
306
|
+
align: 'end',
|
|
307
|
+
kind: 'number',
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
key: 'restrictions',
|
|
311
|
+
label: _('hospitality_core.col.restrictions'),
|
|
312
|
+
cell: (row) => {
|
|
313
|
+
const values = [
|
|
314
|
+
...(row.stopSell ? [_('hospitality_core.restriction.stopSell')] : []),
|
|
315
|
+
...(row.closedToArrival ? ['CTA'] : []),
|
|
316
|
+
...(row.closedToDeparture ? ['CTD'] : []),
|
|
317
|
+
];
|
|
318
|
+
return values.length
|
|
319
|
+
? badge(values.join(' · '), row.stopSell ? 'danger' : 'warning')
|
|
320
|
+
: badge(_('hospitality_core.restriction.open'), 'positive');
|
|
321
|
+
},
|
|
322
|
+
kind: 'status',
|
|
323
|
+
},
|
|
324
|
+
];
|
|
325
|
+
const cleaningTaskColumns = (_, locale, timezone) => [
|
|
326
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
327
|
+
{
|
|
328
|
+
key: 'room',
|
|
329
|
+
label: _('hospitality_core.col.room'),
|
|
330
|
+
cell: (row) => row.room?.name ?? row.room?.code ?? '—',
|
|
331
|
+
priority: 'primary',
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
key: 'status',
|
|
335
|
+
label: _('hospitality_core.col.status'),
|
|
336
|
+
cell: (row) => badge(_(`hospitality_core.cleaningState.${row.state}`), cleaningTone(row.state), row.state),
|
|
337
|
+
kind: 'status',
|
|
338
|
+
priority: 'primary',
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
key: 'priority',
|
|
342
|
+
label: _('hospitality_core.col.priority'),
|
|
343
|
+
cell: (row) => badge(_(`hospitality_core.cleaningPriority.${row.priority}`), row.priority === 'urgent' ? 'danger' : 'neutral'),
|
|
344
|
+
kind: 'status',
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
key: 'type',
|
|
348
|
+
label: _('hospitality_core.col.type'),
|
|
349
|
+
cell: (row) => _(`hospitality_core.cleaningType.${row.taskType}`),
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
key: 'assignee',
|
|
353
|
+
label: _('hospitality_core.col.assignee'),
|
|
354
|
+
cell: (row) => row.assigneeId ?? '—',
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
key: 'requestedAt',
|
|
358
|
+
label: _('hospitality_core.col.requestedAt'),
|
|
359
|
+
cell: (row) => dateTime(row.requestedAt, locale, timezone),
|
|
360
|
+
kind: 'date',
|
|
361
|
+
},
|
|
362
|
+
];
|
|
363
|
+
const PROPERTY_TIMEZONES = [
|
|
364
|
+
'Asia/Ho_Chi_Minh',
|
|
365
|
+
'Asia/Bangkok',
|
|
366
|
+
'Asia/Singapore',
|
|
367
|
+
'Asia/Kuala_Lumpur',
|
|
368
|
+
'Asia/Jakarta',
|
|
369
|
+
'Asia/Manila',
|
|
370
|
+
'Asia/Tokyo',
|
|
371
|
+
'Asia/Seoul',
|
|
372
|
+
'Australia/Sydney',
|
|
373
|
+
'Europe/London',
|
|
374
|
+
'America/New_York',
|
|
375
|
+
'UTC',
|
|
376
|
+
];
|
|
377
|
+
const propertyFormFields = (_, values, policies) => {
|
|
378
|
+
const timezones = [...new Set([values.timezone, ...PROPERTY_TIMEZONES])];
|
|
379
|
+
return [
|
|
380
|
+
{ name: 'code', label: _('hospitality_core.property.field.code'), value: values.code, required: true },
|
|
381
|
+
{ name: 'name', label: _('hospitality_core.property.field.name'), value: values.name, required: true },
|
|
382
|
+
{
|
|
383
|
+
name: 'publicName',
|
|
384
|
+
label: _('hospitality_core.property.field.publicName'),
|
|
385
|
+
value: values.publicName,
|
|
386
|
+
help: _('hospitality_core.property.field.publicNameHint'),
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: 'accommodationType',
|
|
390
|
+
label: _('hospitality_core.property.field.accommodationType'),
|
|
391
|
+
type: 'select',
|
|
392
|
+
value: values.accommodationType,
|
|
393
|
+
required: true,
|
|
394
|
+
options: ACCOMMODATION_TYPES.map((value) => ({
|
|
395
|
+
value,
|
|
396
|
+
label: _(`hospitality_core.accommodation.${value}`),
|
|
397
|
+
})),
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
name: 'starRating',
|
|
401
|
+
label: _('hospitality_core.property.field.starRating'),
|
|
402
|
+
type: 'number',
|
|
403
|
+
value: values.starRating,
|
|
404
|
+
required: true,
|
|
405
|
+
step: '1',
|
|
406
|
+
help: _('hospitality_core.property.field.starRatingHint'),
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
name: 'timezone',
|
|
410
|
+
label: _('hospitality_core.property.field.timezone'),
|
|
411
|
+
type: 'select',
|
|
412
|
+
value: values.timezone,
|
|
413
|
+
required: true,
|
|
414
|
+
options: timezones.map((value) => ({ value, label: value })),
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
name: 'defaultCheckIn',
|
|
418
|
+
label: _('hospitality_core.property.field.defaultCheckIn'),
|
|
419
|
+
type: 'time',
|
|
420
|
+
value: values.defaultCheckIn,
|
|
421
|
+
required: true,
|
|
422
|
+
step: '60',
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: 'defaultCheckOut',
|
|
426
|
+
label: _('hospitality_core.property.field.defaultCheckOut'),
|
|
427
|
+
type: 'time',
|
|
428
|
+
value: values.defaultCheckOut,
|
|
429
|
+
required: true,
|
|
430
|
+
step: '60',
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: 'enforceTimes',
|
|
434
|
+
label: _('hospitality_core.property.field.enforceTimes'),
|
|
435
|
+
type: 'checkbox',
|
|
436
|
+
value: values.enforceTimes,
|
|
437
|
+
help: _('hospitality_core.property.field.enforceTimesHint'),
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: 'longStayBillOnCheckIn',
|
|
441
|
+
label: _('hospitality_core.property.field.longStayBillOnCheckIn'),
|
|
442
|
+
type: 'checkbox',
|
|
443
|
+
value: values.longStayBillOnCheckIn === true,
|
|
444
|
+
help: _('hospitality_core.property.field.longStayBillOnCheckInHint'),
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: 'childrenStayFree',
|
|
448
|
+
label: _('hospitality_core.property.field.childrenStayFree'),
|
|
449
|
+
type: 'checkbox',
|
|
450
|
+
value: values.childrenStayFree,
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
name: 'minimumGuestAge',
|
|
454
|
+
label: _('hospitality_core.property.field.minimumGuestAge'),
|
|
455
|
+
type: 'number',
|
|
456
|
+
value: values.minimumGuestAge,
|
|
457
|
+
step: '1',
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: 'defaultCancellationPolicyId',
|
|
461
|
+
label: _('hospitality_core.property.field.defaultCancellationPolicy'),
|
|
462
|
+
type: 'select',
|
|
463
|
+
value: values.defaultCancellationPolicyId,
|
|
464
|
+
options: [
|
|
465
|
+
{ value: '', label: _('hospitality_core.property.value.noDefaultPolicy') },
|
|
466
|
+
...choices(policies),
|
|
467
|
+
],
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: 'description',
|
|
471
|
+
label: _('hospitality_core.property.field.description'),
|
|
472
|
+
type: 'textarea',
|
|
473
|
+
value: values.description,
|
|
474
|
+
span: 'full',
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: 'houseRules',
|
|
478
|
+
label: _('hospitality_core.property.field.houseRules'),
|
|
479
|
+
type: 'textarea',
|
|
480
|
+
value: values.houseRules,
|
|
481
|
+
span: 'full',
|
|
482
|
+
},
|
|
483
|
+
];
|
|
484
|
+
};
|
|
485
|
+
const propertyForm = (_, values, policies, locale, action, submit, cancelHref) => (_jsx(RecordForm, { action: action, fields: propertyFormFields(_, values, policies), hidden: { id: values.id, lang: locale }, submit: submit, submitVariant: "primary", cancelHref: cancelHref, cancelLabel: _('hospitality_core.action.cancel') }));
|
|
486
|
+
export const propertiesScreen = (_, rows, totals, locale, frame) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.properties.title'), frame: frame, body: stack([
|
|
487
|
+
linkButton({
|
|
488
|
+
label: _('hospitality_core.property.action.create'),
|
|
489
|
+
href: `/admin/hospitality/properties/new?lang=${encodeURIComponent(locale)}`,
|
|
490
|
+
variant: 'primary',
|
|
491
|
+
}),
|
|
492
|
+
cardGrid({
|
|
493
|
+
items: [
|
|
494
|
+
{ id: 'properties', label: _('hospitality_core.metric.properties'), value: rows.length },
|
|
495
|
+
{ id: 'rooms', label: _('hospitality_core.metric.rooms'), value: totals.rooms },
|
|
496
|
+
{ id: 'available', label: _('hospitality_core.metric.available'), value: totals.available },
|
|
497
|
+
{ id: 'attention', label: _('hospitality_core.metric.attention'), value: totals.attention },
|
|
498
|
+
],
|
|
499
|
+
id: (item) => item.id,
|
|
500
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
501
|
+
}),
|
|
502
|
+
rows.length
|
|
503
|
+
? dataTable(_, {
|
|
504
|
+
columns: propertyColumns(_),
|
|
505
|
+
rows,
|
|
506
|
+
id: (row) => row.id,
|
|
507
|
+
rowHref: (row) => `/admin/hospitality/properties/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
508
|
+
})
|
|
509
|
+
: emptyState(_('hospitality_core.screen.properties.empty'), _('hospitality_core.screen.properties.emptyHint')),
|
|
510
|
+
]) }));
|
|
511
|
+
const propertyFeedback = (_, status, errors = []) => {
|
|
512
|
+
if (status === 'created' || status === 'saved')
|
|
513
|
+
return notice({
|
|
514
|
+
title: _(`hospitality_core.property.feedback.${status}`),
|
|
515
|
+
message: _('hospitality_core.property.feedback.savedHint'),
|
|
516
|
+
tone: 'positive',
|
|
517
|
+
});
|
|
518
|
+
if (errors.length)
|
|
519
|
+
return notice({
|
|
520
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
521
|
+
message: errors.join(' '),
|
|
522
|
+
tone: 'danger',
|
|
523
|
+
});
|
|
524
|
+
return null;
|
|
525
|
+
};
|
|
526
|
+
export const newPropertyScreen = (_, values, policies, locale, frame, errors = []) => (_jsx(Framed, { translator: _, title: _('hospitality_core.property.create.title'), frame: frame, body: stack([
|
|
527
|
+
propertyFeedback(_, null, errors),
|
|
528
|
+
_jsx(Section, { title: _('hospitality_core.property.create.title'), description: _('hospitality_core.property.create.hint'), body: propertyForm(_, values, policies, locale, `/admin/hospitality/properties/new?lang=${encodeURIComponent(locale)}`, _('hospitality_core.property.action.create'), `/admin/hospitality/properties?lang=${encodeURIComponent(locale)}`) }),
|
|
529
|
+
]) }));
|
|
530
|
+
export const propertyDetailScreen = (_, property, policies, locale, frame, status, errors = [], attempted) => {
|
|
531
|
+
const query = `lang=${encodeURIComponent(locale)}`;
|
|
532
|
+
const values = attempted ?? property;
|
|
533
|
+
const rooms = property.rooms ?? [];
|
|
534
|
+
return (_jsx(Framed, { translator: _, title: property.name, frame: frame, body: stack([
|
|
535
|
+
propertyFeedback(_, status, errors),
|
|
536
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.property.detail.kicker'), title: property.name, subtitle: `${property.code} · ${property.publicName || property.name}`, imageFallback: icon('hotel'), badges: [
|
|
537
|
+
badge(_(`hospitality_core.accommodation.${property.accommodationType}`), 'info'),
|
|
538
|
+
badge(_(property.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), property.active ? 'positive' : 'neutral'),
|
|
539
|
+
], summary: [
|
|
540
|
+
{
|
|
541
|
+
id: 'rooms',
|
|
542
|
+
label: _('hospitality_core.metric.rooms'),
|
|
543
|
+
value: rooms.length,
|
|
544
|
+
href: `/admin/hospitality/rooms?property=${encodeURIComponent(property.id)}&${query}`,
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
id: 'room-types',
|
|
548
|
+
label: _('hospitality_core.menu.roomTypes'),
|
|
549
|
+
value: property.roomTypes?.length ?? 0,
|
|
550
|
+
href: `/admin/hospitality/room-types?property=${encodeURIComponent(property.id)}&${query}`,
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
id: 'buildings',
|
|
554
|
+
label: _('hospitality_core.property.metric.buildings'),
|
|
555
|
+
value: property.buildings?.length ?? 0,
|
|
556
|
+
},
|
|
557
|
+
], navigation: linkButton({
|
|
558
|
+
label: _('hospitality_core.property.action.back'),
|
|
559
|
+
href: `/admin/hospitality/properties?${query}`,
|
|
560
|
+
variant: 'tertiary',
|
|
561
|
+
icon: 'chevron-left',
|
|
562
|
+
}), body: stack([
|
|
563
|
+
_jsx(Section, { title: _('hospitality_core.property.section.information'), description: _('hospitality_core.property.section.informationHint'), body: definitionList({
|
|
564
|
+
title: property.publicName || property.name,
|
|
565
|
+
items: [
|
|
566
|
+
{
|
|
567
|
+
key: 'address',
|
|
568
|
+
term: _('hospitality_core.property.field.address'),
|
|
569
|
+
value: property.addressLine || '—',
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
key: 'timezone',
|
|
573
|
+
term: _('hospitality_core.property.field.timezone'),
|
|
574
|
+
value: property.timezone,
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
key: 'check-in',
|
|
578
|
+
term: _('hospitality_core.property.field.defaultCheckIn'),
|
|
579
|
+
value: property.defaultCheckIn,
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
key: 'check-out',
|
|
583
|
+
term: _('hospitality_core.property.field.defaultCheckOut'),
|
|
584
|
+
value: property.defaultCheckOut,
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
key: 'policy',
|
|
588
|
+
term: _('hospitality_core.property.field.defaultCancellationPolicy'),
|
|
589
|
+
value: property.defaultCancellationPolicy?.name ??
|
|
590
|
+
property.defaultCancellationPolicy?.code ??
|
|
591
|
+
_('hospitality_core.property.value.noDefaultPolicy'),
|
|
592
|
+
},
|
|
593
|
+
],
|
|
594
|
+
}) }),
|
|
595
|
+
_jsx(Section, { title: _('hospitality_core.property.section.settings'), description: _('hospitality_core.property.section.settingsHint'), body: propertyForm(_, values, policies, locale, `/admin/hospitality/properties/${encodeURIComponent(property.id)}?${query}`, _('hospitality_core.property.action.save'), `/admin/hospitality/properties?${query}`) }),
|
|
596
|
+
_jsx(Section, { title: _('hospitality_core.property.section.next'), description: _('hospitality_core.property.section.nextHint'), body: stack([
|
|
597
|
+
linkButton({
|
|
598
|
+
label: _('hospitality_core.menu.roomTypes'),
|
|
599
|
+
href: `/admin/hospitality/room-types?property=${encodeURIComponent(property.id)}&${query}`,
|
|
600
|
+
variant: 'secondary',
|
|
601
|
+
}),
|
|
602
|
+
linkButton({
|
|
603
|
+
label: _('hospitality_core.menu.rooms'),
|
|
604
|
+
href: `/admin/hospitality/rooms?property=${encodeURIComponent(property.id)}&${query}`,
|
|
605
|
+
variant: 'secondary',
|
|
606
|
+
}),
|
|
607
|
+
linkButton({
|
|
608
|
+
label: _('hospitality_core.menu.inventory'),
|
|
609
|
+
href: `/admin/hospitality/inventory?property=${encodeURIComponent(property.id)}&${query}`,
|
|
610
|
+
variant: 'secondary',
|
|
611
|
+
}),
|
|
612
|
+
linkButton({
|
|
613
|
+
label: _('hospitality_core.menu.content'),
|
|
614
|
+
href: `/admin/hospitality/content?property=${encodeURIComponent(property.id)}&${query}`,
|
|
615
|
+
variant: 'secondary',
|
|
616
|
+
}),
|
|
617
|
+
], 'compact') }),
|
|
618
|
+
]) }),
|
|
619
|
+
]) }));
|
|
620
|
+
};
|
|
621
|
+
const roomFeedback = (_, status, errors = []) => {
|
|
622
|
+
if (status === 'building-created' ||
|
|
623
|
+
status === 'floor-created' ||
|
|
624
|
+
status === 'created' ||
|
|
625
|
+
status === 'saved' ||
|
|
626
|
+
status === 'archived' ||
|
|
627
|
+
status === 'restored')
|
|
628
|
+
return notice({
|
|
629
|
+
title: _(`hospitality_core.room.feedback.${status}`),
|
|
630
|
+
message: _(status === 'archived' || status === 'restored'
|
|
631
|
+
? `hospitality_core.room.feedback.${status}Hint`
|
|
632
|
+
: 'hospitality_core.room.feedback.savedHint'),
|
|
633
|
+
tone: 'positive',
|
|
634
|
+
});
|
|
635
|
+
if (status === 'invalid' || errors.length)
|
|
636
|
+
return notice({
|
|
637
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
638
|
+
message: errors.join(' ') || _('hospitality_core.feedback.invalidHint'),
|
|
639
|
+
tone: 'danger',
|
|
640
|
+
});
|
|
641
|
+
return null;
|
|
642
|
+
};
|
|
643
|
+
const roomFormFields = (_, values, properties, roomTypes, buildings, floors) => [
|
|
644
|
+
{
|
|
645
|
+
name: 'propertyId',
|
|
646
|
+
label: _('hospitality_core.room.field.property'),
|
|
647
|
+
type: 'select',
|
|
648
|
+
value: values.propertyId,
|
|
649
|
+
options: choices(properties),
|
|
650
|
+
required: true,
|
|
651
|
+
disabled: true,
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
name: 'roomTypeId',
|
|
655
|
+
label: _('hospitality_core.room.field.roomType'),
|
|
656
|
+
type: 'select',
|
|
657
|
+
value: values.roomTypeId,
|
|
658
|
+
options: choices(roomTypes),
|
|
659
|
+
required: true,
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: 'code',
|
|
663
|
+
label: _('hospitality_core.room.field.code'),
|
|
664
|
+
value: values.code,
|
|
665
|
+
required: true,
|
|
666
|
+
help: _('hospitality_core.room.field.codeHint'),
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
name: 'name',
|
|
670
|
+
label: _('hospitality_core.room.field.name'),
|
|
671
|
+
value: values.name,
|
|
672
|
+
required: true,
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
name: 'buildingId',
|
|
676
|
+
label: _('hospitality_core.room.field.building'),
|
|
677
|
+
type: 'select',
|
|
678
|
+
value: values.buildingId,
|
|
679
|
+
options: [{ value: '', label: _('hospitality_core.room.value.noBuilding') }, ...choices(buildings)],
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: 'floorId',
|
|
683
|
+
label: _('hospitality_core.room.field.floor'),
|
|
684
|
+
type: 'select',
|
|
685
|
+
value: values.floorId,
|
|
686
|
+
options: [
|
|
687
|
+
{ value: '', label: _('hospitality_core.room.value.noFloor') },
|
|
688
|
+
...floors.map((floor) => ({
|
|
689
|
+
value: floor.id,
|
|
690
|
+
label: `${floor.building?.name ?? floor.building?.code ?? ''}${floor.building ? ' · ' : ''}${floor.name}`,
|
|
691
|
+
})),
|
|
692
|
+
],
|
|
693
|
+
help: _('hospitality_core.room.field.floorHint'),
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
name: 'capacity',
|
|
697
|
+
label: _('hospitality_core.room.field.capacity'),
|
|
698
|
+
type: 'number',
|
|
699
|
+
value: values.capacity,
|
|
700
|
+
required: true,
|
|
701
|
+
step: '1',
|
|
702
|
+
},
|
|
703
|
+
];
|
|
704
|
+
const roomForm = (_, values, properties, roomTypes, buildings, floors, locale, action, submit, cancelHref) => (_jsx(RecordForm, { action: action, fields: roomFormFields(_, values, properties, roomTypes, buildings, floors), hidden: {
|
|
705
|
+
lang: locale,
|
|
706
|
+
propertyId: values.propertyId,
|
|
707
|
+
}, submit: submit, submitVariant: "primary", cancelHref: cancelHref, cancelLabel: _('hospitality_core.action.cancel') }));
|
|
708
|
+
export const roomsScreen = (_, data, locale, frame, status, errors = []) => {
|
|
709
|
+
const query = new URLSearchParams({ lang: locale });
|
|
710
|
+
if (data.propertyId)
|
|
711
|
+
query.set('property', data.propertyId);
|
|
712
|
+
const action = `/admin/hospitality/rooms?${query.toString()}`;
|
|
713
|
+
const activeBuildings = data.buildings.filter((row) => row.active);
|
|
714
|
+
const activeFloors = data.floors.filter((row) => row.active);
|
|
715
|
+
const canCreateRoom = Boolean(data.propertyId && data.roomTypes.length);
|
|
716
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.rooms.title'), frame: frame, body: stack([
|
|
717
|
+
roomFeedback(_, status, errors),
|
|
718
|
+
_jsx(RecordForm, { action: "/admin/hospitality/rooms", method: "get", layout: "inline", fields: [
|
|
719
|
+
{
|
|
720
|
+
name: 'property',
|
|
721
|
+
label: _('hospitality_core.room.field.property'),
|
|
722
|
+
type: 'select',
|
|
723
|
+
value: data.propertyId,
|
|
724
|
+
options: choices(data.properties),
|
|
725
|
+
},
|
|
726
|
+
], hidden: { lang: locale }, submit: _('hospitality_core.action.apply'), submitVariant: "secondary" }),
|
|
727
|
+
canCreateRoom
|
|
728
|
+
? linkButton({
|
|
729
|
+
label: _('hospitality_core.room.action.create'),
|
|
730
|
+
href: `/admin/hospitality/rooms/new?${query.toString()}`,
|
|
731
|
+
variant: 'primary',
|
|
732
|
+
})
|
|
733
|
+
: notice({
|
|
734
|
+
title: _('hospitality_core.room.empty.prerequisite'),
|
|
735
|
+
message: _('hospitality_core.room.empty.prerequisiteHint'),
|
|
736
|
+
tone: 'warning',
|
|
737
|
+
}),
|
|
738
|
+
cardGrid({
|
|
739
|
+
items: [
|
|
740
|
+
{ id: 'rooms', label: _('hospitality_core.metric.rooms'), value: data.rows.length },
|
|
741
|
+
{
|
|
742
|
+
id: 'buildings',
|
|
743
|
+
label: _('hospitality_core.property.metric.buildings'),
|
|
744
|
+
value: activeBuildings.length,
|
|
745
|
+
},
|
|
746
|
+
{ id: 'floors', label: _('hospitality_core.room.metric.floors'), value: activeFloors.length },
|
|
747
|
+
{
|
|
748
|
+
id: 'available',
|
|
749
|
+
label: _('hospitality_core.metric.available'),
|
|
750
|
+
value: data.rows.filter((row) => row.status === 'available').length,
|
|
751
|
+
},
|
|
752
|
+
],
|
|
753
|
+
id: (item) => item.id,
|
|
754
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
755
|
+
}),
|
|
756
|
+
...(data.propertyId
|
|
757
|
+
? [
|
|
758
|
+
_jsx(Section, { title: _('hospitality_core.room.section.locationSetup'), description: _('hospitality_core.room.section.locationSetupHint'), body: _jsx(FormCluster, { label: _('hospitality_core.room.section.locationSetup'), forms: [
|
|
759
|
+
_jsx(RecordForm, { action: action, hidden: {
|
|
760
|
+
id: 'new-building',
|
|
761
|
+
operation: 'save-building',
|
|
762
|
+
propertyId: data.propertyId,
|
|
763
|
+
}, submit: _('hospitality_core.room.action.createBuilding'), submitVariant: "secondary", fields: [
|
|
764
|
+
{
|
|
765
|
+
name: 'code',
|
|
766
|
+
label: _('hospitality_core.room.field.buildingCode'),
|
|
767
|
+
required: true,
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: 'name',
|
|
771
|
+
label: _('hospitality_core.room.field.buildingName'),
|
|
772
|
+
required: true,
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: 'sequence',
|
|
776
|
+
label: _('hospitality_core.room.field.sequence'),
|
|
777
|
+
type: 'number',
|
|
778
|
+
value: 10,
|
|
779
|
+
step: '1',
|
|
780
|
+
},
|
|
781
|
+
] }),
|
|
782
|
+
...(activeBuildings.length
|
|
783
|
+
? [
|
|
784
|
+
_jsx(RecordForm, { action: action, hidden: {
|
|
785
|
+
id: 'new-floor',
|
|
786
|
+
operation: 'save-floor',
|
|
787
|
+
propertyId: data.propertyId,
|
|
788
|
+
}, submit: _('hospitality_core.room.action.createFloor'), submitVariant: "secondary", fields: [
|
|
789
|
+
{
|
|
790
|
+
name: 'buildingId',
|
|
791
|
+
label: _('hospitality_core.room.field.building'),
|
|
792
|
+
type: 'select',
|
|
793
|
+
options: choices(activeBuildings),
|
|
794
|
+
required: true,
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
name: 'code',
|
|
798
|
+
label: _('hospitality_core.room.field.floorCode'),
|
|
799
|
+
required: true,
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
name: 'name',
|
|
803
|
+
label: _('hospitality_core.room.field.floorName'),
|
|
804
|
+
required: true,
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
name: 'sequence',
|
|
808
|
+
label: _('hospitality_core.room.field.sequence'),
|
|
809
|
+
type: 'number',
|
|
810
|
+
value: 10,
|
|
811
|
+
step: '1',
|
|
812
|
+
},
|
|
813
|
+
] }),
|
|
814
|
+
]
|
|
815
|
+
: []),
|
|
816
|
+
] }) }),
|
|
817
|
+
_jsx(Section, { title: _('hospitality_core.room.section.buildings'), description: _('hospitality_core.room.section.buildingsHint'), body: data.buildings.length
|
|
818
|
+
? dataTable(_, {
|
|
819
|
+
columns: buildingColumns(_),
|
|
820
|
+
rows: data.buildings,
|
|
821
|
+
id: (row) => row.id,
|
|
822
|
+
rowHref: (row) => `/admin/hospitality/buildings/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
823
|
+
})
|
|
824
|
+
: emptyState(_('hospitality_core.room.empty.buildings'), _('hospitality_core.room.empty.buildingsHint')) }),
|
|
825
|
+
_jsx(Section, { title: _('hospitality_core.room.section.floors'), description: _('hospitality_core.room.section.floorsHint'), body: data.floors.length
|
|
826
|
+
? dataTable(_, {
|
|
827
|
+
columns: floorColumns(_),
|
|
828
|
+
rows: data.floors,
|
|
829
|
+
id: (row) => row.id,
|
|
830
|
+
rowHref: (row) => `/admin/hospitality/levels/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
831
|
+
})
|
|
832
|
+
: emptyState(_('hospitality_core.room.empty.floors'), _('hospitality_core.room.empty.floorsHint')) }),
|
|
833
|
+
]
|
|
834
|
+
: []),
|
|
835
|
+
_jsx(Section, { title: _('hospitality_core.room.section.rooms'), description: _('hospitality_core.room.section.roomsHint'), body: data.rows.length
|
|
836
|
+
? dataTable(_, {
|
|
837
|
+
columns: roomColumns(_),
|
|
838
|
+
rows: data.rows,
|
|
839
|
+
id: (row) => row.id,
|
|
840
|
+
rowHref: (row) => `/admin/hospitality/rooms/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
841
|
+
})
|
|
842
|
+
: emptyState(_('hospitality_core.screen.rooms.empty'), _('hospitality_core.screen.rooms.emptyHint')) }),
|
|
843
|
+
]) }));
|
|
844
|
+
};
|
|
845
|
+
const locationFeedback = (_, resource, status, errors = []) => {
|
|
846
|
+
if (status === 'saved' || status === 'archived' || status === 'restored')
|
|
847
|
+
return notice({
|
|
848
|
+
title: _(`hospitality_core.${resource}.feedback.${status}`),
|
|
849
|
+
message: _(`hospitality_core.${resource}.feedback.${status}Hint`),
|
|
850
|
+
tone: 'positive',
|
|
851
|
+
});
|
|
852
|
+
if (errors.length)
|
|
853
|
+
return notice({
|
|
854
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
855
|
+
message: errors.join(' '),
|
|
856
|
+
tone: 'danger',
|
|
857
|
+
});
|
|
858
|
+
return null;
|
|
859
|
+
};
|
|
860
|
+
const buildingForm = (_, values, locale) => (_jsx(RecordForm, { action: `/admin/hospitality/buildings/${encodeURIComponent(values.id)}?lang=${encodeURIComponent(locale)}`, hidden: { propertyId: values.propertyId }, submit: _('hospitality_core.building.action.save'), submitVariant: "primary", fields: [
|
|
861
|
+
{
|
|
862
|
+
name: 'code',
|
|
863
|
+
label: _('hospitality_core.building.field.code'),
|
|
864
|
+
value: values.code,
|
|
865
|
+
required: true,
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
name: 'name',
|
|
869
|
+
label: _('hospitality_core.building.field.name'),
|
|
870
|
+
value: values.name,
|
|
871
|
+
required: true,
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
name: 'sequence',
|
|
875
|
+
label: _('hospitality_core.building.field.sequence'),
|
|
876
|
+
type: 'number',
|
|
877
|
+
value: values.sequence,
|
|
878
|
+
step: '1',
|
|
879
|
+
},
|
|
880
|
+
] }));
|
|
881
|
+
export const buildingDetailScreen = (_, building, values, locale, frame, status, errors = []) => {
|
|
882
|
+
const query = `lang=${encodeURIComponent(locale)}`;
|
|
883
|
+
const propertyName = building.property?.name ?? building.property?.code ?? building.propertyId;
|
|
884
|
+
const activeFloors = building.floors.filter((row) => row.active);
|
|
885
|
+
const activeRooms = building.rooms.filter((row) => row.active);
|
|
886
|
+
return (_jsx(Framed, { translator: _, title: building.name, frame: frame, body: stack([
|
|
887
|
+
locationFeedback(_, 'building', status, errors),
|
|
888
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.building.detail.kicker'), title: building.name, subtitle: `${building.code} · ${propertyName}`, imageFallback: icon('hotel'), badges: [
|
|
889
|
+
badge(_(building.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), building.active ? 'positive' : 'neutral'),
|
|
890
|
+
], summary: [
|
|
891
|
+
{
|
|
892
|
+
id: 'floors',
|
|
893
|
+
label: _('hospitality_core.room.metric.floors'),
|
|
894
|
+
value: activeFloors.length,
|
|
895
|
+
},
|
|
896
|
+
{ id: 'rooms', label: _('hospitality_core.metric.rooms'), value: activeRooms.length },
|
|
897
|
+
{
|
|
898
|
+
id: 'sequence',
|
|
899
|
+
label: _('hospitality_core.building.field.sequence'),
|
|
900
|
+
value: building.sequence,
|
|
901
|
+
},
|
|
902
|
+
], navigation: linkButton({
|
|
903
|
+
label: _('hospitality_core.building.action.back'),
|
|
904
|
+
href: `/admin/hospitality/rooms?property=${encodeURIComponent(building.propertyId)}&${query}`,
|
|
905
|
+
variant: 'tertiary',
|
|
906
|
+
icon: 'chevron-left',
|
|
907
|
+
}), body: stack([
|
|
908
|
+
_jsx(Section, { title: _('hospitality_core.building.section.information'), description: _('hospitality_core.building.section.informationHint'), body: definitionList({
|
|
909
|
+
title: building.name,
|
|
910
|
+
items: [
|
|
911
|
+
{
|
|
912
|
+
key: 'property',
|
|
913
|
+
term: _('hospitality_core.building.field.property'),
|
|
914
|
+
value: propertyName,
|
|
915
|
+
},
|
|
916
|
+
{ key: 'code', term: _('hospitality_core.building.field.code'), value: building.code },
|
|
917
|
+
{
|
|
918
|
+
key: 'status',
|
|
919
|
+
term: _('hospitality_core.col.status'),
|
|
920
|
+
value: _(building.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'),
|
|
921
|
+
},
|
|
922
|
+
],
|
|
923
|
+
}) }),
|
|
924
|
+
_jsx(Section, { title: _('hospitality_core.building.section.settings'), description: _('hospitality_core.building.section.settingsHint'), body: buildingForm(_, values, locale) }),
|
|
925
|
+
_jsx(Section, { title: _('hospitality_core.building.section.floors'), description: _('hospitality_core.building.section.floorsHint'), body: building.floors.length
|
|
926
|
+
? dataTable(_, {
|
|
927
|
+
columns: floorColumns(_),
|
|
928
|
+
rows: building.floors,
|
|
929
|
+
id: (row) => row.id,
|
|
930
|
+
rowHref: (row) => `/admin/hospitality/levels/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
931
|
+
})
|
|
932
|
+
: emptyState(_('hospitality_core.building.empty.floors'), _('hospitality_core.building.empty.floorsHint')) }),
|
|
933
|
+
_jsx(Section, { title: _('hospitality_core.building.section.lifecycle'), description: _('hospitality_core.building.section.lifecycleHint'), body: _jsx(Surface, { body: recordActions({
|
|
934
|
+
action: `/admin/hospitality/buildings/${encodeURIComponent(building.id)}/archive?${query}`,
|
|
935
|
+
actions: [
|
|
936
|
+
building.active
|
|
937
|
+
? {
|
|
938
|
+
value: 'archive',
|
|
939
|
+
label: _('hospitality_core.building.action.archive'),
|
|
940
|
+
variant: 'destructive',
|
|
941
|
+
}
|
|
942
|
+
: {
|
|
943
|
+
value: 'restore',
|
|
944
|
+
label: _('hospitality_core.building.action.restore'),
|
|
945
|
+
variant: 'secondary',
|
|
946
|
+
},
|
|
947
|
+
],
|
|
948
|
+
}) }) }),
|
|
949
|
+
]) }),
|
|
950
|
+
]) }));
|
|
951
|
+
};
|
|
952
|
+
const floorForm = (_, values, locale) => (_jsx(RecordForm, { action: `/admin/hospitality/levels/${encodeURIComponent(values.id)}?lang=${encodeURIComponent(locale)}`, hidden: { propertyId: values.propertyId, buildingId: values.buildingId }, submit: _('hospitality_core.floor.action.save'), submitVariant: "primary", fields: [
|
|
953
|
+
{
|
|
954
|
+
name: 'code',
|
|
955
|
+
label: _('hospitality_core.floor.field.code'),
|
|
956
|
+
value: values.code,
|
|
957
|
+
required: true,
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
name: 'name',
|
|
961
|
+
label: _('hospitality_core.floor.field.name'),
|
|
962
|
+
value: values.name,
|
|
963
|
+
required: true,
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
name: 'sequence',
|
|
967
|
+
label: _('hospitality_core.floor.field.sequence'),
|
|
968
|
+
type: 'number',
|
|
969
|
+
value: values.sequence,
|
|
970
|
+
step: '1',
|
|
971
|
+
},
|
|
972
|
+
] }));
|
|
973
|
+
export const floorDetailScreen = (_, floor, values, locale, frame, status, errors = []) => {
|
|
974
|
+
const query = `lang=${encodeURIComponent(locale)}`;
|
|
975
|
+
const propertyName = floor.property?.name ?? floor.property?.code ?? floor.propertyId;
|
|
976
|
+
const buildingName = floor.building?.name ?? floor.building?.code ?? floor.buildingId;
|
|
977
|
+
const activeRooms = floor.rooms.filter((row) => row.active);
|
|
978
|
+
return (_jsx(Framed, { translator: _, title: floor.name, frame: frame, body: stack([
|
|
979
|
+
locationFeedback(_, 'floor', status, errors),
|
|
980
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.floor.detail.kicker'), title: floor.name, subtitle: `${floor.code} · ${buildingName}`, imageFallback: icon('hotel'), badges: [
|
|
981
|
+
badge(_(floor.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), floor.active ? 'positive' : 'neutral'),
|
|
982
|
+
], summary: [
|
|
983
|
+
{ id: 'rooms', label: _('hospitality_core.metric.rooms'), value: activeRooms.length },
|
|
984
|
+
{
|
|
985
|
+
id: 'building',
|
|
986
|
+
label: _('hospitality_core.floor.field.building'),
|
|
987
|
+
value: buildingName,
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
id: 'sequence',
|
|
991
|
+
label: _('hospitality_core.floor.field.sequence'),
|
|
992
|
+
value: floor.sequence,
|
|
993
|
+
},
|
|
994
|
+
], navigation: linkButton({
|
|
995
|
+
label: _('hospitality_core.floor.action.back'),
|
|
996
|
+
href: `/admin/hospitality/buildings/${encodeURIComponent(floor.buildingId)}?${query}`,
|
|
997
|
+
variant: 'tertiary',
|
|
998
|
+
icon: 'chevron-left',
|
|
999
|
+
}), body: stack([
|
|
1000
|
+
_jsx(Section, { title: _('hospitality_core.floor.section.information'), description: _('hospitality_core.floor.section.informationHint'), body: definitionList({
|
|
1001
|
+
title: floor.name,
|
|
1002
|
+
items: [
|
|
1003
|
+
{ key: 'property', term: _('hospitality_core.floor.field.property'), value: propertyName },
|
|
1004
|
+
{ key: 'building', term: _('hospitality_core.floor.field.building'), value: buildingName },
|
|
1005
|
+
{ key: 'code', term: _('hospitality_core.floor.field.code'), value: floor.code },
|
|
1006
|
+
{
|
|
1007
|
+
key: 'status',
|
|
1008
|
+
term: _('hospitality_core.col.status'),
|
|
1009
|
+
value: _(floor.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'),
|
|
1010
|
+
},
|
|
1011
|
+
],
|
|
1012
|
+
}) }),
|
|
1013
|
+
_jsx(Section, { title: _('hospitality_core.floor.section.settings'), description: _('hospitality_core.floor.section.settingsHint'), body: floorForm(_, values, locale) }),
|
|
1014
|
+
_jsx(Section, { title: _('hospitality_core.floor.section.rooms'), description: _('hospitality_core.floor.section.roomsHint'), body: floor.rooms.length
|
|
1015
|
+
? dataTable(_, {
|
|
1016
|
+
columns: roomColumns(_),
|
|
1017
|
+
rows: floor.rooms,
|
|
1018
|
+
id: (row) => row.id,
|
|
1019
|
+
rowHref: (row) => `/admin/hospitality/rooms/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
1020
|
+
})
|
|
1021
|
+
: emptyState(_('hospitality_core.floor.empty.rooms'), _('hospitality_core.floor.empty.roomsHint')) }),
|
|
1022
|
+
_jsx(Section, { title: _('hospitality_core.floor.section.lifecycle'), description: _('hospitality_core.floor.section.lifecycleHint'), body: _jsx(Surface, { body: recordActions({
|
|
1023
|
+
action: `/admin/hospitality/levels/${encodeURIComponent(floor.id)}/archive?${query}`,
|
|
1024
|
+
actions: [
|
|
1025
|
+
floor.active
|
|
1026
|
+
? {
|
|
1027
|
+
value: 'archive',
|
|
1028
|
+
label: _('hospitality_core.floor.action.archive'),
|
|
1029
|
+
variant: 'destructive',
|
|
1030
|
+
}
|
|
1031
|
+
: {
|
|
1032
|
+
value: 'restore',
|
|
1033
|
+
label: _('hospitality_core.floor.action.restore'),
|
|
1034
|
+
variant: 'secondary',
|
|
1035
|
+
},
|
|
1036
|
+
],
|
|
1037
|
+
}) }) }),
|
|
1038
|
+
]) }),
|
|
1039
|
+
]) }));
|
|
1040
|
+
};
|
|
1041
|
+
export const newRoomScreen = (_, values, properties, roomTypes, buildings, floors, locale, frame, errors = []) => (_jsx(Framed, { translator: _, title: _('hospitality_core.room.create.title'), frame: frame, body: stack([
|
|
1042
|
+
roomFeedback(_, null, errors),
|
|
1043
|
+
_jsx(Section, { title: _('hospitality_core.room.create.title'), description: _('hospitality_core.room.create.hint'), body: roomForm(_, values, properties, roomTypes, buildings, floors, locale, `/admin/hospitality/rooms/new?lang=${encodeURIComponent(locale)}`, _('hospitality_core.room.action.create'), `/admin/hospitality/rooms?property=${encodeURIComponent(values.propertyId)}&lang=${encodeURIComponent(locale)}`) }),
|
|
1044
|
+
]) }));
|
|
1045
|
+
export const roomDetailScreen = (_, room, values, properties, roomTypes, buildings, floors, locale, frame, status, errors = []) => {
|
|
1046
|
+
const query = `lang=${encodeURIComponent(locale)}`;
|
|
1047
|
+
const propertyName = room.property?.name ?? room.property?.code ?? room.propertyId;
|
|
1048
|
+
const location = [room.building?.name ?? room.building?.code, room.floor?.name ?? room.floor?.code]
|
|
1049
|
+
.filter(Boolean)
|
|
1050
|
+
.join(' · ');
|
|
1051
|
+
return (_jsx(Framed, { translator: _, title: room.name, frame: frame, body: stack([
|
|
1052
|
+
roomFeedback(_, status, errors),
|
|
1053
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.room.detail.kicker'), title: room.name, subtitle: `${room.code} · ${propertyName}`, imageFallback: icon('hotel'), badges: [
|
|
1054
|
+
badge(_(`hospitality_core.roomStatus.${room.status}`), statusTone(room.status), room.status),
|
|
1055
|
+
badge(_(room.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), room.active ? 'positive' : 'neutral'),
|
|
1056
|
+
], summary: [
|
|
1057
|
+
{ id: 'capacity', label: _('hospitality_core.col.capacity'), value: room.capacity },
|
|
1058
|
+
{
|
|
1059
|
+
id: 'roomType',
|
|
1060
|
+
label: _('hospitality_core.col.roomType'),
|
|
1061
|
+
value: room.roomType?.name ?? room.roomType?.code ?? room.roomTypeId,
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
id: 'location',
|
|
1065
|
+
label: _('hospitality_core.col.location'),
|
|
1066
|
+
value: location || _('hospitality_core.room.value.unassignedLocation'),
|
|
1067
|
+
},
|
|
1068
|
+
], navigation: linkButton({
|
|
1069
|
+
label: _('hospitality_core.room.action.back'),
|
|
1070
|
+
href: `/admin/hospitality/rooms?property=${encodeURIComponent(room.propertyId)}&${query}`,
|
|
1071
|
+
variant: 'tertiary',
|
|
1072
|
+
icon: 'chevron-left',
|
|
1073
|
+
}), body: stack([
|
|
1074
|
+
_jsx(Section, { title: _('hospitality_core.room.section.information'), description: _('hospitality_core.room.section.informationHint'), body: definitionList({
|
|
1075
|
+
title: room.name,
|
|
1076
|
+
items: [
|
|
1077
|
+
{ key: 'property', term: _('hospitality_core.room.field.property'), value: propertyName },
|
|
1078
|
+
{
|
|
1079
|
+
key: 'type',
|
|
1080
|
+
term: _('hospitality_core.room.field.roomType'),
|
|
1081
|
+
value: room.roomType?.name ?? room.roomType?.code ?? room.roomTypeId,
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
key: 'location',
|
|
1085
|
+
term: _('hospitality_core.col.location'),
|
|
1086
|
+
value: location || _('hospitality_core.room.value.unassignedLocation'),
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
key: 'status',
|
|
1090
|
+
term: _('hospitality_core.col.status'),
|
|
1091
|
+
value: _(`hospitality_core.roomStatus.${room.status}`),
|
|
1092
|
+
},
|
|
1093
|
+
],
|
|
1094
|
+
}) }),
|
|
1095
|
+
_jsx(Section, { title: _('hospitality_core.room.section.settings'), description: _('hospitality_core.room.section.settingsHint'), body: roomForm(_, values, properties, roomTypes, buildings, floors, locale, `/admin/hospitality/rooms/${encodeURIComponent(room.id)}?${query}`, _('hospitality_core.room.action.save'), `/admin/hospitality/rooms?property=${encodeURIComponent(room.propertyId)}&${query}`) }),
|
|
1096
|
+
_jsx(Section, { title: _('hospitality_core.room.section.lifecycle'), description: _('hospitality_core.room.section.lifecycleHint'), body: stack([
|
|
1097
|
+
linkButton({
|
|
1098
|
+
label: _('hospitality_core.room.action.openHousekeeping'),
|
|
1099
|
+
href: `/admin/hospitality/housekeeping/rooms/${encodeURIComponent(room.id)}?${query}`,
|
|
1100
|
+
variant: 'secondary',
|
|
1101
|
+
}),
|
|
1102
|
+
_jsx(Surface, { body: recordActions({
|
|
1103
|
+
action: `/admin/hospitality/rooms/${encodeURIComponent(room.id)}/archive?${query}`,
|
|
1104
|
+
actions: [
|
|
1105
|
+
room.active
|
|
1106
|
+
? {
|
|
1107
|
+
value: 'archive',
|
|
1108
|
+
label: _('hospitality_core.room.action.archive'),
|
|
1109
|
+
variant: 'destructive',
|
|
1110
|
+
}
|
|
1111
|
+
: {
|
|
1112
|
+
value: 'restore',
|
|
1113
|
+
label: _('hospitality_core.room.action.restore'),
|
|
1114
|
+
variant: 'secondary',
|
|
1115
|
+
},
|
|
1116
|
+
],
|
|
1117
|
+
}) }),
|
|
1118
|
+
]) }),
|
|
1119
|
+
]) }),
|
|
1120
|
+
]) }));
|
|
1121
|
+
};
|
|
1122
|
+
export const cleaningTasksScreen = (_, data, locale, timezone, frame, status) => {
|
|
1123
|
+
const visibleRows = data.state === 'all' ? data.rows : data.rows.filter((row) => row.state === data.state);
|
|
1124
|
+
const query = new URLSearchParams({ lang: locale });
|
|
1125
|
+
if (data.propertyId)
|
|
1126
|
+
query.set('property', data.propertyId);
|
|
1127
|
+
if (data.state !== 'all')
|
|
1128
|
+
query.set('state', data.state);
|
|
1129
|
+
const action = `/admin/hospitality/housekeeping?${query.toString()}`;
|
|
1130
|
+
const feedback = status === 'created'
|
|
1131
|
+
? notice({
|
|
1132
|
+
title: _('hospitality_core.housekeeping.feedback.created'),
|
|
1133
|
+
message: _('hospitality_core.housekeeping.feedback.createdHint'),
|
|
1134
|
+
tone: 'positive',
|
|
1135
|
+
})
|
|
1136
|
+
: status === 'invalid'
|
|
1137
|
+
? notice({
|
|
1138
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
1139
|
+
message: _('hospitality_core.housekeeping.feedback.invalidHint'),
|
|
1140
|
+
tone: 'danger',
|
|
1141
|
+
})
|
|
1142
|
+
: null;
|
|
1143
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.cleaningTasks.title'), frame: frame, body: stack([
|
|
1144
|
+
feedback,
|
|
1145
|
+
_jsx(RecordForm, { action: "/admin/hospitality/housekeeping", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { lang: locale }, fields: [
|
|
1146
|
+
{
|
|
1147
|
+
name: 'property',
|
|
1148
|
+
label: _('hospitality_core.menu.properties'),
|
|
1149
|
+
type: 'select',
|
|
1150
|
+
value: data.propertyId,
|
|
1151
|
+
required: true,
|
|
1152
|
+
options: choices(data.properties),
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
name: 'state',
|
|
1156
|
+
label: _('hospitality_core.col.status'),
|
|
1157
|
+
type: 'select',
|
|
1158
|
+
value: data.state,
|
|
1159
|
+
options: ['all', 'todo', 'in_progress', 'done', 'cancelled'].map((value) => ({
|
|
1160
|
+
value,
|
|
1161
|
+
label: _(`hospitality_core.cleaningState.${value}`),
|
|
1162
|
+
})),
|
|
1163
|
+
},
|
|
1164
|
+
] }),
|
|
1165
|
+
cardGrid({
|
|
1166
|
+
items: ['todo', 'in_progress', 'done'].map((state) => ({
|
|
1167
|
+
state,
|
|
1168
|
+
count: state === 'todo'
|
|
1169
|
+
? data.summary.todo
|
|
1170
|
+
: state === 'in_progress'
|
|
1171
|
+
? data.summary.inProgress
|
|
1172
|
+
: data.summary.done,
|
|
1173
|
+
})),
|
|
1174
|
+
id: (item) => item.state,
|
|
1175
|
+
card: (item) => metric({
|
|
1176
|
+
label: _(`hospitality_core.cleaningState.${item.state}`),
|
|
1177
|
+
value: String(item.count),
|
|
1178
|
+
tone: item.state,
|
|
1179
|
+
}),
|
|
1180
|
+
}),
|
|
1181
|
+
_jsx(Section, { title: _('hospitality_core.housekeeping.section.create'), description: _('hospitality_core.housekeeping.section.createHint'), body: data.rooms.length ? (_jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.housekeeping.action.create'), submitVariant: "secondary", hidden: {
|
|
1182
|
+
operation: 'create',
|
|
1183
|
+
lang: locale,
|
|
1184
|
+
id: data.id,
|
|
1185
|
+
code: data.code,
|
|
1186
|
+
propertyId: data.propertyId ?? '',
|
|
1187
|
+
state: data.state,
|
|
1188
|
+
}, fields: [
|
|
1189
|
+
{
|
|
1190
|
+
name: 'roomId',
|
|
1191
|
+
label: _('hospitality_core.col.room'),
|
|
1192
|
+
type: 'select',
|
|
1193
|
+
value: data.selectedRoomId,
|
|
1194
|
+
required: true,
|
|
1195
|
+
options: data.rooms.map((room) => ({
|
|
1196
|
+
value: room.id,
|
|
1197
|
+
label: `${room.code} · ${room.name} · ${_(`hospitality_core.roomStatus.${room.status}`)}`,
|
|
1198
|
+
})),
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
name: 'taskType',
|
|
1202
|
+
label: _('hospitality_core.col.type'),
|
|
1203
|
+
type: 'select',
|
|
1204
|
+
value: 'daily_clean',
|
|
1205
|
+
required: true,
|
|
1206
|
+
options: ['checkout_clean', 'daily_clean', 'maintenance', 'inspection'].map((value) => ({
|
|
1207
|
+
value,
|
|
1208
|
+
label: _(`hospitality_core.cleaningType.${value}`),
|
|
1209
|
+
})),
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
name: 'priority',
|
|
1213
|
+
label: _('hospitality_core.col.priority'),
|
|
1214
|
+
type: 'select',
|
|
1215
|
+
value: 'normal',
|
|
1216
|
+
required: true,
|
|
1217
|
+
options: ['normal', 'urgent'].map((value) => ({
|
|
1218
|
+
value,
|
|
1219
|
+
label: _(`hospitality_core.cleaningPriority.${value}`),
|
|
1220
|
+
})),
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
name: 'assigneeId',
|
|
1224
|
+
label: _('hospitality_core.col.assignee'),
|
|
1225
|
+
help: _('hospitality_core.housekeeping.field.assigneeHint'),
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
name: 'notes',
|
|
1229
|
+
label: _('hospitality_core.housekeeping.field.notes'),
|
|
1230
|
+
type: 'textarea',
|
|
1231
|
+
span: 'full',
|
|
1232
|
+
},
|
|
1233
|
+
] })) : (emptyState(_('hospitality_core.housekeeping.empty.rooms'), _('hospitality_core.housekeeping.empty.roomsHint'))) }),
|
|
1234
|
+
_jsx(Section, { title: _('hospitality_core.housekeeping.section.queue'), description: _('hospitality_core.housekeeping.section.queueHint'), body: visibleRows.length
|
|
1235
|
+
? dataTable(_, {
|
|
1236
|
+
columns: cleaningTaskColumns(_, locale, timezone),
|
|
1237
|
+
rows: visibleRows,
|
|
1238
|
+
id: (row) => row.id,
|
|
1239
|
+
rowHref: (row) => `/admin/hospitality/housekeeping/tasks/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
1240
|
+
})
|
|
1241
|
+
: emptyState(_('hospitality_core.screen.cleaningTasks.empty'), _('hospitality_core.screen.cleaningTasks.emptyHint')) }),
|
|
1242
|
+
]) }));
|
|
1243
|
+
};
|
|
1244
|
+
const cleaningTaskFeedback = (_, status, errors = []) => {
|
|
1245
|
+
if (status === 'started' || status === 'completed' || status === 'cancelled')
|
|
1246
|
+
return notice({
|
|
1247
|
+
title: _(`hospitality_core.housekeeping.feedback.${status}`),
|
|
1248
|
+
message: _(`hospitality_core.housekeeping.feedback.${status}Hint`),
|
|
1249
|
+
tone: status === 'cancelled' ? 'warning' : 'positive',
|
|
1250
|
+
});
|
|
1251
|
+
if (errors.length)
|
|
1252
|
+
return notice({
|
|
1253
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
1254
|
+
message: errors.join(' '),
|
|
1255
|
+
tone: 'danger',
|
|
1256
|
+
});
|
|
1257
|
+
return null;
|
|
1258
|
+
};
|
|
1259
|
+
export const cleaningTaskDetailScreen = (_, task, locale, timezone, frame, status, errors = []) => {
|
|
1260
|
+
const action = `/admin/hospitality/housekeeping/tasks/${encodeURIComponent(task.id)}?lang=${encodeURIComponent(locale)}`;
|
|
1261
|
+
const room = task.room?.name ?? task.room?.code ?? task.roomId;
|
|
1262
|
+
const actions = [];
|
|
1263
|
+
if (task.state === 'todo')
|
|
1264
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.housekeeping.action.start'), description: _('hospitality_core.housekeeping.action.startHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.housekeeping.action.start'), submitVariant: "primary", hidden: { operation: 'start', lang: locale }, fields: [
|
|
1265
|
+
{
|
|
1266
|
+
name: 'assigneeId',
|
|
1267
|
+
label: _('hospitality_core.col.assignee'),
|
|
1268
|
+
value: task.assigneeId,
|
|
1269
|
+
help: _('hospitality_core.housekeeping.field.assigneeHint'),
|
|
1270
|
+
},
|
|
1271
|
+
] }) }));
|
|
1272
|
+
if (task.state === 'in_progress')
|
|
1273
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.housekeeping.action.complete'), description: _('hospitality_core.housekeeping.action.completeHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.housekeeping.action.complete'), submitVariant: "primary", hidden: { operation: 'complete', lang: locale }, fields: [] }) }));
|
|
1274
|
+
if (task.state === 'todo' || task.state === 'in_progress')
|
|
1275
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.housekeeping.action.cancel'), description: _('hospitality_core.housekeeping.action.cancelHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.housekeeping.action.cancel'), submitVariant: "destructive", hidden: { operation: 'cancel', lang: locale }, fields: [] }) }));
|
|
1276
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.housekeeping.detail.title', { code: task.code }), frame: frame, body: stack([
|
|
1277
|
+
cleaningTaskFeedback(_, status, errors),
|
|
1278
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.housekeeping.detail.kicker'), title: task.code, subtitle: room, imageFallback: icon('check-circle'), badges: [
|
|
1279
|
+
badge(_(`hospitality_core.cleaningState.${task.state}`), cleaningTone(task.state), task.state),
|
|
1280
|
+
badge(_(`hospitality_core.cleaningPriority.${task.priority}`), task.priority === 'urgent' ? 'danger' : 'neutral'),
|
|
1281
|
+
], summary: [
|
|
1282
|
+
{
|
|
1283
|
+
id: 'room',
|
|
1284
|
+
label: _('hospitality_core.col.room'),
|
|
1285
|
+
value: room,
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
id: 'type',
|
|
1289
|
+
label: _('hospitality_core.col.type'),
|
|
1290
|
+
value: _(`hospitality_core.cleaningType.${task.taskType}`),
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
id: 'assignee',
|
|
1294
|
+
label: _('hospitality_core.col.assignee'),
|
|
1295
|
+
value: task.assigneeId || '—',
|
|
1296
|
+
},
|
|
1297
|
+
], navigation: linkButton({
|
|
1298
|
+
label: _('hospitality_core.housekeeping.action.back'),
|
|
1299
|
+
href: `/admin/hospitality/housekeeping?property=${encodeURIComponent(task.propertyId)}&lang=${encodeURIComponent(locale)}`,
|
|
1300
|
+
variant: 'tertiary',
|
|
1301
|
+
icon: 'chevron-left',
|
|
1302
|
+
}), body: stack([
|
|
1303
|
+
_jsx(Section, { title: _('hospitality_core.housekeeping.section.information'), description: _('hospitality_core.housekeeping.section.informationHint'), body: definitionList({
|
|
1304
|
+
title: task.code,
|
|
1305
|
+
items: [
|
|
1306
|
+
{
|
|
1307
|
+
key: 'property',
|
|
1308
|
+
term: _('hospitality_core.menu.properties'),
|
|
1309
|
+
value: task.property?.name ?? task.property?.code ?? task.propertyId,
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
key: 'room',
|
|
1313
|
+
term: _('hospitality_core.col.room'),
|
|
1314
|
+
value: room,
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
key: 'requested',
|
|
1318
|
+
term: _('hospitality_core.col.requestedAt'),
|
|
1319
|
+
value: dateTime(task.requestedAt, locale, timezone),
|
|
1320
|
+
},
|
|
1321
|
+
...(task.startedAt
|
|
1322
|
+
? [
|
|
1323
|
+
{
|
|
1324
|
+
key: 'started',
|
|
1325
|
+
term: _('hospitality_core.housekeeping.field.startedAt'),
|
|
1326
|
+
value: dateTime(task.startedAt, locale, timezone),
|
|
1327
|
+
},
|
|
1328
|
+
]
|
|
1329
|
+
: []),
|
|
1330
|
+
...(task.doneAt
|
|
1331
|
+
? [
|
|
1332
|
+
{
|
|
1333
|
+
key: 'done',
|
|
1334
|
+
term: _('hospitality_core.housekeeping.field.doneAt'),
|
|
1335
|
+
value: dateTime(task.doneAt, locale, timezone),
|
|
1336
|
+
},
|
|
1337
|
+
]
|
|
1338
|
+
: []),
|
|
1339
|
+
...(task.stayId
|
|
1340
|
+
? [
|
|
1341
|
+
{
|
|
1342
|
+
key: 'stay',
|
|
1343
|
+
term: _('hospitality_core.menu.stays'),
|
|
1344
|
+
value: task.stay?.code ?? task.stayId,
|
|
1345
|
+
},
|
|
1346
|
+
]
|
|
1347
|
+
: []),
|
|
1348
|
+
...(task.notes
|
|
1349
|
+
? [
|
|
1350
|
+
{
|
|
1351
|
+
key: 'notes',
|
|
1352
|
+
term: _('hospitality_core.housekeeping.field.notes'),
|
|
1353
|
+
value: task.notes,
|
|
1354
|
+
},
|
|
1355
|
+
]
|
|
1356
|
+
: []),
|
|
1357
|
+
],
|
|
1358
|
+
}) }),
|
|
1359
|
+
...actions,
|
|
1360
|
+
]) }),
|
|
1361
|
+
]) }));
|
|
1362
|
+
};
|
|
1363
|
+
const housekeepingRoomColumns = (_) => [
|
|
1364
|
+
{ key: 'code', label: _('hospitality_core.col.code'), cell: (row) => code(row.code), kind: 'identifier' },
|
|
1365
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
1366
|
+
{
|
|
1367
|
+
key: 'status',
|
|
1368
|
+
label: _('hospitality_core.col.status'),
|
|
1369
|
+
cell: (row) => badge(_(`hospitality_core.roomStatus.${row.status}`), statusTone(row.status), row.status),
|
|
1370
|
+
kind: 'status',
|
|
1371
|
+
priority: 'primary',
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
key: 'roomType',
|
|
1375
|
+
label: _('hospitality_core.col.roomType'),
|
|
1376
|
+
cell: (row) => row.roomType?.name ?? row.roomType?.code ?? code(row.roomTypeId),
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
key: 'location',
|
|
1380
|
+
label: _('hospitality_core.col.location'),
|
|
1381
|
+
cell: (row) => [row.building?.name ?? row.building?.code, row.floor?.name ?? row.floor?.code]
|
|
1382
|
+
.filter(Boolean)
|
|
1383
|
+
.join(' · ') || '—',
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
key: 'note',
|
|
1387
|
+
label: _('hospitality_core.housekeeping.field.notes'),
|
|
1388
|
+
cell: (row) => row.note || '—',
|
|
1389
|
+
},
|
|
1390
|
+
];
|
|
1391
|
+
export const housekeepingRoomsScreen = (_, data, locale, frame) => {
|
|
1392
|
+
const total = data.summary.available +
|
|
1393
|
+
data.summary.occupied +
|
|
1394
|
+
data.summary.dirty +
|
|
1395
|
+
data.summary.cleaning +
|
|
1396
|
+
data.summary.maintenance +
|
|
1397
|
+
data.summary.outOfOrder;
|
|
1398
|
+
const attention = data.summary.dirty + data.summary.cleaning + data.summary.maintenance + data.summary.outOfOrder;
|
|
1399
|
+
const metrics = [
|
|
1400
|
+
{ id: 'rooms', value: total },
|
|
1401
|
+
{ id: 'available', value: data.summary.available },
|
|
1402
|
+
{ id: 'occupied', value: data.summary.occupied },
|
|
1403
|
+
{ id: 'attention', value: attention },
|
|
1404
|
+
];
|
|
1405
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.housekeepingRooms.title'), frame: frame, body: stack([
|
|
1406
|
+
_jsx(RecordForm, { action: "/admin/hospitality/housekeeping/rooms", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { lang: locale }, fields: [
|
|
1407
|
+
{
|
|
1408
|
+
name: 'property',
|
|
1409
|
+
label: _('hospitality_core.menu.properties'),
|
|
1410
|
+
type: 'select',
|
|
1411
|
+
value: data.propertyId,
|
|
1412
|
+
required: true,
|
|
1413
|
+
options: choices(data.properties),
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
name: 'state',
|
|
1417
|
+
label: _('hospitality_core.col.status'),
|
|
1418
|
+
type: 'select',
|
|
1419
|
+
value: data.state,
|
|
1420
|
+
options: ['all', ...ROOM_STATUSES].map((value) => ({
|
|
1421
|
+
value,
|
|
1422
|
+
label: _(`hospitality_core.roomStatus.${value}`),
|
|
1423
|
+
})),
|
|
1424
|
+
},
|
|
1425
|
+
] }),
|
|
1426
|
+
cardGrid({
|
|
1427
|
+
items: metrics,
|
|
1428
|
+
id: (item) => item.id,
|
|
1429
|
+
card: (item) => metric({
|
|
1430
|
+
label: _(`hospitality_core.metric.${item.id}`),
|
|
1431
|
+
value: String(item.value),
|
|
1432
|
+
tone: item.id,
|
|
1433
|
+
}),
|
|
1434
|
+
}),
|
|
1435
|
+
_jsx(Section, { title: _('hospitality_core.housekeeping.rooms.section.board'), description: _('hospitality_core.housekeeping.rooms.section.boardHint'), body: data.rows.length
|
|
1436
|
+
? dataTable(_, {
|
|
1437
|
+
columns: housekeepingRoomColumns(_),
|
|
1438
|
+
rows: data.rows,
|
|
1439
|
+
id: (row) => row.id,
|
|
1440
|
+
rowHref: (row) => `/admin/hospitality/housekeeping/rooms/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
1441
|
+
})
|
|
1442
|
+
: emptyState(_('hospitality_core.screen.housekeepingRooms.empty'), _('hospitality_core.screen.housekeepingRooms.emptyHint')) }),
|
|
1443
|
+
]) }));
|
|
1444
|
+
};
|
|
1445
|
+
const housekeepingRoomFeedback = (_, status, errors = []) => {
|
|
1446
|
+
if (status === 'updated')
|
|
1447
|
+
return notice({
|
|
1448
|
+
title: _('hospitality_core.housekeeping.rooms.feedback.updated'),
|
|
1449
|
+
message: _('hospitality_core.housekeeping.rooms.feedback.updatedHint'),
|
|
1450
|
+
tone: 'positive',
|
|
1451
|
+
});
|
|
1452
|
+
if (errors.length)
|
|
1453
|
+
return notice({
|
|
1454
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
1455
|
+
message: errors.join(' '),
|
|
1456
|
+
tone: 'danger',
|
|
1457
|
+
});
|
|
1458
|
+
return null;
|
|
1459
|
+
};
|
|
1460
|
+
export const housekeepingRoomDetailScreen = (_, room, tasks, locale, timezone, frame, status, errors = []) => {
|
|
1461
|
+
const action = `/admin/hospitality/housekeeping/rooms/${encodeURIComponent(room.id)}?lang=${encodeURIComponent(locale)}`;
|
|
1462
|
+
const taskQueue = `/admin/hospitality/housekeeping?property=${encodeURIComponent(room.propertyId)}&room=${encodeURIComponent(room.id)}&lang=${encodeURIComponent(locale)}`;
|
|
1463
|
+
const location = [room.building?.name ?? room.building?.code, room.floor?.name ?? room.floor?.code]
|
|
1464
|
+
.filter(Boolean)
|
|
1465
|
+
.join(' · ');
|
|
1466
|
+
const actions = [];
|
|
1467
|
+
if (room.status === 'available' || room.status === 'dirty')
|
|
1468
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.housekeeping.rooms.section.service'), description: _('hospitality_core.housekeeping.rooms.section.serviceHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.housekeeping.rooms.action.takeOut'), submitVariant: "destructive", hidden: { operation: 'set-status', expectedStatus: room.status, lang: locale }, fields: [
|
|
1469
|
+
{
|
|
1470
|
+
name: 'status',
|
|
1471
|
+
label: _('hospitality_core.housekeeping.rooms.field.targetStatus'),
|
|
1472
|
+
type: 'select',
|
|
1473
|
+
value: 'maintenance',
|
|
1474
|
+
required: true,
|
|
1475
|
+
options: ['maintenance', 'out_of_order'].map((value) => ({
|
|
1476
|
+
value,
|
|
1477
|
+
label: _(`hospitality_core.roomStatus.${value}`),
|
|
1478
|
+
})),
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
name: 'note',
|
|
1482
|
+
label: _('hospitality_core.housekeeping.rooms.field.reason'),
|
|
1483
|
+
type: 'textarea',
|
|
1484
|
+
required: true,
|
|
1485
|
+
span: 'full',
|
|
1486
|
+
},
|
|
1487
|
+
] }) }));
|
|
1488
|
+
if (room.status === 'maintenance' || room.status === 'out_of_order')
|
|
1489
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.housekeeping.rooms.section.release'), description: _('hospitality_core.housekeeping.rooms.section.releaseHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.housekeeping.rooms.action.release'), submitVariant: "primary", hidden: {
|
|
1490
|
+
operation: 'set-status',
|
|
1491
|
+
expectedStatus: room.status,
|
|
1492
|
+
status: 'dirty',
|
|
1493
|
+
lang: locale,
|
|
1494
|
+
}, fields: [] }) }));
|
|
1495
|
+
const currentStay = room.currentStay;
|
|
1496
|
+
const guest = currentStay?.partner?.name;
|
|
1497
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.housekeeping.rooms.detail.title', { code: room.code }), frame: frame, body: stack([
|
|
1498
|
+
housekeepingRoomFeedback(_, status, errors),
|
|
1499
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.housekeeping.rooms.detail.kicker'), title: room.code, subtitle: room.name, imageFallback: icon('hotel'), badges: [
|
|
1500
|
+
badge(_(`hospitality_core.roomStatus.${room.status}`), statusTone(room.status), room.status),
|
|
1501
|
+
], summary: [
|
|
1502
|
+
{
|
|
1503
|
+
id: 'room-type',
|
|
1504
|
+
label: _('hospitality_core.col.roomType'),
|
|
1505
|
+
value: room.roomType?.name ?? room.roomType?.code ?? room.roomTypeId,
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
id: 'capacity',
|
|
1509
|
+
label: _('hospitality_core.col.capacity'),
|
|
1510
|
+
value: room.capacity,
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
id: 'tasks',
|
|
1514
|
+
label: _('hospitality_core.housekeeping.rooms.metric.openTasks'),
|
|
1515
|
+
value: tasks.filter((task) => task.state === 'todo' || task.state === 'in_progress').length,
|
|
1516
|
+
},
|
|
1517
|
+
], navigation: linkButton({
|
|
1518
|
+
label: _('hospitality_core.housekeeping.rooms.action.back'),
|
|
1519
|
+
href: `/admin/hospitality/housekeeping/rooms?property=${encodeURIComponent(room.propertyId)}&lang=${encodeURIComponent(locale)}`,
|
|
1520
|
+
variant: 'tertiary',
|
|
1521
|
+
icon: 'chevron-left',
|
|
1522
|
+
}), body: stack([
|
|
1523
|
+
_jsx(Section, { title: _('hospitality_core.housekeeping.rooms.section.information'), description: _('hospitality_core.housekeeping.rooms.section.informationHint'), body: stack([
|
|
1524
|
+
definitionList({
|
|
1525
|
+
title: room.name,
|
|
1526
|
+
items: [
|
|
1527
|
+
{
|
|
1528
|
+
key: 'property',
|
|
1529
|
+
term: _('hospitality_core.menu.properties'),
|
|
1530
|
+
value: room.property?.name ?? room.property?.code ?? room.propertyId,
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
key: 'room-type',
|
|
1534
|
+
term: _('hospitality_core.col.roomType'),
|
|
1535
|
+
value: room.roomType?.name ?? room.roomType?.code ?? room.roomTypeId,
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
key: 'location',
|
|
1539
|
+
term: _('hospitality_core.col.location'),
|
|
1540
|
+
value: location || '—',
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
key: 'guest',
|
|
1544
|
+
term: _('hospitality_core.reservation.field.guest'),
|
|
1545
|
+
value: guest ?? '—',
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
key: 'note',
|
|
1549
|
+
term: _('hospitality_core.housekeeping.field.notes'),
|
|
1550
|
+
value: room.note || '—',
|
|
1551
|
+
},
|
|
1552
|
+
],
|
|
1553
|
+
}),
|
|
1554
|
+
currentStay?.id
|
|
1555
|
+
? linkButton({
|
|
1556
|
+
label: _('hospitality_core.housekeeping.rooms.action.openStay'),
|
|
1557
|
+
href: `/admin/hospitality/stays/${encodeURIComponent(currentStay.id)}?lang=${encodeURIComponent(locale)}`,
|
|
1558
|
+
variant: 'secondary',
|
|
1559
|
+
})
|
|
1560
|
+
: null,
|
|
1561
|
+
]) }),
|
|
1562
|
+
_jsx(Section, { title: _('hospitality_core.housekeeping.rooms.section.tasks'), description: _('hospitality_core.housekeeping.rooms.section.tasksHint'), body: stack([
|
|
1563
|
+
tasks.length
|
|
1564
|
+
? dataTable(_, {
|
|
1565
|
+
columns: cleaningTaskColumns(_, locale, timezone),
|
|
1566
|
+
rows: tasks,
|
|
1567
|
+
id: (task) => task.id,
|
|
1568
|
+
rowHref: (task) => `/admin/hospitality/housekeeping/tasks/${encodeURIComponent(task.id)}?lang=${encodeURIComponent(locale)}`,
|
|
1569
|
+
})
|
|
1570
|
+
: emptyState(_('hospitality_core.housekeeping.rooms.empty.tasks'), _('hospitality_core.housekeeping.rooms.empty.tasksHint')),
|
|
1571
|
+
linkButton({
|
|
1572
|
+
label: _('hospitality_core.housekeeping.action.create'),
|
|
1573
|
+
href: taskQueue,
|
|
1574
|
+
variant: 'secondary',
|
|
1575
|
+
}),
|
|
1576
|
+
]) }),
|
|
1577
|
+
...actions,
|
|
1578
|
+
]) }),
|
|
1579
|
+
]) }));
|
|
1580
|
+
};
|
|
1581
|
+
const roomTypeFormFields = (_, values, properties, policies, creating) => [
|
|
1582
|
+
{
|
|
1583
|
+
name: 'propertyId',
|
|
1584
|
+
label: _('hospitality_core.roomType.field.property'),
|
|
1585
|
+
type: 'select',
|
|
1586
|
+
value: values.propertyId,
|
|
1587
|
+
options: choices(properties),
|
|
1588
|
+
required: true,
|
|
1589
|
+
disabled: !creating,
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: 'code',
|
|
1593
|
+
label: _('hospitality_core.roomType.field.code'),
|
|
1594
|
+
value: values.code,
|
|
1595
|
+
required: true,
|
|
1596
|
+
help: _('hospitality_core.roomType.field.codeHint'),
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
name: 'name',
|
|
1600
|
+
label: _('hospitality_core.roomType.field.name'),
|
|
1601
|
+
value: values.name,
|
|
1602
|
+
required: true,
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
name: 'publicName',
|
|
1606
|
+
label: _('hospitality_core.roomType.field.publicName'),
|
|
1607
|
+
value: values.publicName,
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
name: 'defaultCapacity',
|
|
1611
|
+
label: _('hospitality_core.roomType.field.defaultCapacity'),
|
|
1612
|
+
type: 'number',
|
|
1613
|
+
value: values.defaultCapacity,
|
|
1614
|
+
required: true,
|
|
1615
|
+
step: '1',
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
name: 'maxAdults',
|
|
1619
|
+
label: _('hospitality_core.roomType.field.maxAdults'),
|
|
1620
|
+
type: 'number',
|
|
1621
|
+
value: values.maxAdults,
|
|
1622
|
+
required: true,
|
|
1623
|
+
step: '1',
|
|
1624
|
+
},
|
|
1625
|
+
{
|
|
1626
|
+
name: 'maxChildren',
|
|
1627
|
+
label: _('hospitality_core.roomType.field.maxChildren'),
|
|
1628
|
+
type: 'number',
|
|
1629
|
+
value: values.maxChildren,
|
|
1630
|
+
required: true,
|
|
1631
|
+
step: '1',
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
name: 'maxInfants',
|
|
1635
|
+
label: _('hospitality_core.roomType.field.maxInfants'),
|
|
1636
|
+
type: 'number',
|
|
1637
|
+
value: values.maxInfants,
|
|
1638
|
+
required: true,
|
|
1639
|
+
step: '1',
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
name: 'maxExtraBeds',
|
|
1643
|
+
label: _('hospitality_core.roomType.field.maxExtraBeds'),
|
|
1644
|
+
type: 'number',
|
|
1645
|
+
value: values.maxExtraBeds,
|
|
1646
|
+
required: true,
|
|
1647
|
+
step: '1',
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
name: 'sizeSqm',
|
|
1651
|
+
label: _('hospitality_core.roomType.field.sizeSqm'),
|
|
1652
|
+
type: 'decimal',
|
|
1653
|
+
value: values.sizeSqm,
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
name: 'viewType',
|
|
1657
|
+
label: _('hospitality_core.roomType.field.viewType'),
|
|
1658
|
+
type: 'select',
|
|
1659
|
+
value: values.viewType,
|
|
1660
|
+
options: [
|
|
1661
|
+
{ value: '', label: _('hospitality_core.roomType.value.noViewType') },
|
|
1662
|
+
...ROOM_VIEW_TYPES.map((value) => ({
|
|
1663
|
+
value,
|
|
1664
|
+
label: _(`hospitality_core.roomType.view.${value}`),
|
|
1665
|
+
})),
|
|
1666
|
+
],
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
name: 'sharedBathroom',
|
|
1670
|
+
label: _('hospitality_core.roomType.field.sharedBathroom'),
|
|
1671
|
+
type: 'checkbox',
|
|
1672
|
+
value: values.sharedBathroom,
|
|
1673
|
+
},
|
|
1674
|
+
{
|
|
1675
|
+
name: 'baseRate',
|
|
1676
|
+
label: _('hospitality_core.roomType.field.baseRate'),
|
|
1677
|
+
type: 'decimal',
|
|
1678
|
+
value: values.baseRate,
|
|
1679
|
+
required: true,
|
|
1680
|
+
help: _('hospitality_core.roomType.field.baseRateHint'),
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
name: 'color',
|
|
1684
|
+
label: _('hospitality_core.roomType.field.color'),
|
|
1685
|
+
type: 'color',
|
|
1686
|
+
value: values.color || '#2563eb',
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
name: 'cancellationPolicyId',
|
|
1690
|
+
label: _('hospitality_core.roomType.field.cancellationPolicy'),
|
|
1691
|
+
type: 'select',
|
|
1692
|
+
value: values.cancellationPolicyId,
|
|
1693
|
+
options: [{ value: '', label: _('hospitality_core.roomType.value.inheritPolicy') }, ...choices(policies)],
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
name: 'published',
|
|
1697
|
+
label: _('hospitality_core.roomType.field.published'),
|
|
1698
|
+
type: 'checkbox',
|
|
1699
|
+
value: values.published,
|
|
1700
|
+
help: _('hospitality_core.roomType.field.publishedHint'),
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
name: 'description',
|
|
1704
|
+
label: _('hospitality_core.roomType.field.description'),
|
|
1705
|
+
type: 'textarea',
|
|
1706
|
+
value: values.description,
|
|
1707
|
+
span: 'full',
|
|
1708
|
+
},
|
|
1709
|
+
];
|
|
1710
|
+
const roomTypeForm = (_, values, properties, policies, locale, action, submit, cancelHref, creating) => (_jsx(RecordForm, { action: action, fields: roomTypeFormFields(_, values, properties, policies, creating), hidden: {
|
|
1711
|
+
lang: locale,
|
|
1712
|
+
...(!creating ? { propertyId: values.propertyId } : {}),
|
|
1713
|
+
}, submit: submit, submitVariant: "primary", cancelHref: cancelHref, cancelLabel: _('hospitality_core.action.cancel') }));
|
|
1714
|
+
const roomTypeFeedback = (_, status, errors = []) => {
|
|
1715
|
+
if (status === 'created' || status === 'saved')
|
|
1716
|
+
return notice({
|
|
1717
|
+
title: _(`hospitality_core.roomType.feedback.${status}`),
|
|
1718
|
+
message: _('hospitality_core.roomType.feedback.savedHint'),
|
|
1719
|
+
tone: 'positive',
|
|
1720
|
+
});
|
|
1721
|
+
if (errors.length)
|
|
1722
|
+
return notice({
|
|
1723
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
1724
|
+
message: errors.join(' '),
|
|
1725
|
+
tone: 'danger',
|
|
1726
|
+
});
|
|
1727
|
+
return null;
|
|
1728
|
+
};
|
|
1729
|
+
export const roomTypesScreen = (_, rows, properties, propertyId, locale, frame) => {
|
|
1730
|
+
const propertyQuery = propertyId ? `&property=${encodeURIComponent(propertyId)}` : '';
|
|
1731
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.roomTypes.title'), frame: frame, body: stack([
|
|
1732
|
+
_jsx(RecordForm, { action: "/admin/hospitality/room-types", method: "get", layout: "inline", fields: [
|
|
1733
|
+
{
|
|
1734
|
+
name: 'property',
|
|
1735
|
+
label: _('hospitality_core.roomType.field.property'),
|
|
1736
|
+
type: 'select',
|
|
1737
|
+
value: propertyId,
|
|
1738
|
+
options: choices(properties),
|
|
1739
|
+
},
|
|
1740
|
+
], hidden: { lang: locale }, submit: _('hospitality_core.action.apply'), submitVariant: "secondary" }),
|
|
1741
|
+
properties.length
|
|
1742
|
+
? linkButton({
|
|
1743
|
+
label: _('hospitality_core.roomType.action.create'),
|
|
1744
|
+
href: `/admin/hospitality/room-types/new?lang=${encodeURIComponent(locale)}${propertyQuery}`,
|
|
1745
|
+
variant: 'primary',
|
|
1746
|
+
})
|
|
1747
|
+
: notice({
|
|
1748
|
+
title: _('hospitality_core.roomType.empty.noProperty'),
|
|
1749
|
+
message: _('hospitality_core.roomType.empty.noPropertyHint'),
|
|
1750
|
+
tone: 'warning',
|
|
1751
|
+
}),
|
|
1752
|
+
cardGrid({
|
|
1753
|
+
items: [
|
|
1754
|
+
{ id: 'types', label: _('hospitality_core.roomType.metric.types'), value: rows.length },
|
|
1755
|
+
{
|
|
1756
|
+
id: 'published',
|
|
1757
|
+
label: _('hospitality_core.roomType.metric.published'),
|
|
1758
|
+
value: rows.filter((row) => row.published).length,
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
id: 'rooms',
|
|
1762
|
+
label: _('hospitality_core.metric.rooms'),
|
|
1763
|
+
value: rows.reduce((sum, row) => sum + (row.rooms?.length ?? 0), 0),
|
|
1764
|
+
},
|
|
1765
|
+
],
|
|
1766
|
+
id: (item) => item.id,
|
|
1767
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
1768
|
+
}),
|
|
1769
|
+
rows.length
|
|
1770
|
+
? dataTable(_, {
|
|
1771
|
+
columns: roomTypeColumns(_),
|
|
1772
|
+
rows,
|
|
1773
|
+
id: (row) => row.id,
|
|
1774
|
+
rowHref: (row) => `/admin/hospitality/room-types/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
1775
|
+
})
|
|
1776
|
+
: emptyState(_('hospitality_core.screen.roomTypes.empty'), _('hospitality_core.screen.roomTypes.emptyHint')),
|
|
1777
|
+
]) }));
|
|
1778
|
+
};
|
|
1779
|
+
export const newRoomTypeScreen = (_, values, properties, policies, locale, frame, errors = []) => (_jsx(Framed, { translator: _, title: _('hospitality_core.roomType.create.title'), frame: frame, body: stack([
|
|
1780
|
+
roomTypeFeedback(_, null, errors),
|
|
1781
|
+
_jsx(Section, { title: _('hospitality_core.roomType.create.title'), description: _('hospitality_core.roomType.create.hint'), body: roomTypeForm(_, values, properties, policies, locale, `/admin/hospitality/room-types/new?lang=${encodeURIComponent(locale)}`, _('hospitality_core.roomType.action.create'), `/admin/hospitality/room-types?property=${encodeURIComponent(values.propertyId)}&lang=${encodeURIComponent(locale)}`, true) }),
|
|
1782
|
+
]) }));
|
|
1783
|
+
export const roomTypeDetailScreen = (_, roomType, properties, policies, locale, frame, status, errors = [], attempted) => {
|
|
1784
|
+
const query = `lang=${encodeURIComponent(locale)}`;
|
|
1785
|
+
const values = attempted ?? roomType;
|
|
1786
|
+
const propertyName = roomType.property?.name ?? roomType.property?.code ?? roomType.propertyId;
|
|
1787
|
+
return (_jsx(Framed, { translator: _, title: roomType.name, frame: frame, body: stack([
|
|
1788
|
+
roomTypeFeedback(_, status, errors),
|
|
1789
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.roomType.detail.kicker'), title: roomType.name, subtitle: `${roomType.code} · ${propertyName}`, imageFallback: icon('hotel'), badges: [
|
|
1790
|
+
badge(_(roomType.published ? 'hospitality_core.value.published' : 'hospitality_core.value.draft'), roomType.published ? 'positive' : 'neutral'),
|
|
1791
|
+
badge(_(roomType.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), roomType.active ? 'positive' : 'neutral'),
|
|
1792
|
+
], summary: [
|
|
1793
|
+
{
|
|
1794
|
+
id: 'rooms',
|
|
1795
|
+
label: _('hospitality_core.metric.rooms'),
|
|
1796
|
+
value: roomType.rooms?.length ?? 0,
|
|
1797
|
+
href: `/admin/hospitality/rooms?property=${encodeURIComponent(roomType.propertyId)}&${query}`,
|
|
1798
|
+
},
|
|
1799
|
+
{
|
|
1800
|
+
id: 'rates',
|
|
1801
|
+
label: _('hospitality_core.menu.ratePlans'),
|
|
1802
|
+
value: roomType.ratePlans?.length ?? 0,
|
|
1803
|
+
href: `/admin/hospitality/rate-plans?property=${encodeURIComponent(roomType.propertyId)}&${query}`,
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
id: 'beds',
|
|
1807
|
+
label: _('hospitality_core.roomType.metric.beds'),
|
|
1808
|
+
value: (roomType.beds ?? []).reduce((sum, bed) => sum + Number(bed.quantity ?? 0), 0),
|
|
1809
|
+
},
|
|
1810
|
+
], navigation: linkButton({
|
|
1811
|
+
label: _('hospitality_core.roomType.action.back'),
|
|
1812
|
+
href: `/admin/hospitality/room-types?property=${encodeURIComponent(roomType.propertyId)}&${query}`,
|
|
1813
|
+
variant: 'tertiary',
|
|
1814
|
+
icon: 'chevron-left',
|
|
1815
|
+
}), body: stack([
|
|
1816
|
+
_jsx(Section, { title: _('hospitality_core.roomType.section.information'), description: _('hospitality_core.roomType.section.informationHint'), body: definitionList({
|
|
1817
|
+
title: roomType.publicName || roomType.name,
|
|
1818
|
+
items: [
|
|
1819
|
+
{
|
|
1820
|
+
key: 'property',
|
|
1821
|
+
term: _('hospitality_core.roomType.field.property'),
|
|
1822
|
+
value: propertyName,
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
key: 'capacity',
|
|
1826
|
+
term: _('hospitality_core.roomType.field.defaultCapacity'),
|
|
1827
|
+
value: _('hospitality_core.roomType.value.capacity', {
|
|
1828
|
+
default: roomType.defaultCapacity,
|
|
1829
|
+
adults: roomType.maxAdults,
|
|
1830
|
+
children: roomType.maxChildren,
|
|
1831
|
+
}),
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
key: 'rate',
|
|
1835
|
+
term: _('hospitality_core.roomType.field.baseRate'),
|
|
1836
|
+
value: formatMoney(_, roomType.baseRate),
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
key: 'policy',
|
|
1840
|
+
term: _('hospitality_core.roomType.field.cancellationPolicy'),
|
|
1841
|
+
value: roomType.cancellationPolicy?.name ??
|
|
1842
|
+
roomType.cancellationPolicy?.code ??
|
|
1843
|
+
_('hospitality_core.roomType.value.inheritPolicy'),
|
|
1844
|
+
},
|
|
1845
|
+
],
|
|
1846
|
+
}) }),
|
|
1847
|
+
_jsx(Section, { title: _('hospitality_core.roomType.section.settings'), description: _('hospitality_core.roomType.section.settingsHint'), body: roomTypeForm(_, values, properties, policies, locale, `/admin/hospitality/room-types/${encodeURIComponent(roomType.id)}?${query}`, _('hospitality_core.roomType.action.save'), `/admin/hospitality/room-types?property=${encodeURIComponent(roomType.propertyId)}&${query}`, false) }),
|
|
1848
|
+
_jsx(Section, { title: _('hospitality_core.roomType.section.next'), description: _('hospitality_core.roomType.section.nextHint'), body: stack([
|
|
1849
|
+
linkButton({
|
|
1850
|
+
label: _('hospitality_core.menu.rooms'),
|
|
1851
|
+
href: `/admin/hospitality/rooms?property=${encodeURIComponent(roomType.propertyId)}&${query}`,
|
|
1852
|
+
variant: 'secondary',
|
|
1853
|
+
}),
|
|
1854
|
+
linkButton({
|
|
1855
|
+
label: _('hospitality_core.menu.ratePlans'),
|
|
1856
|
+
href: `/admin/hospitality/rate-plans?property=${encodeURIComponent(roomType.propertyId)}&${query}`,
|
|
1857
|
+
variant: 'secondary',
|
|
1858
|
+
}),
|
|
1859
|
+
linkButton({
|
|
1860
|
+
label: _('hospitality_core.menu.inventory'),
|
|
1861
|
+
href: `/admin/hospitality/inventory?property=${encodeURIComponent(roomType.propertyId)}&roomType=${encodeURIComponent(roomType.id)}&${query}`,
|
|
1862
|
+
variant: 'secondary',
|
|
1863
|
+
}),
|
|
1864
|
+
linkButton({
|
|
1865
|
+
label: _('hospitality_core.menu.content'),
|
|
1866
|
+
href: `/admin/hospitality/content?property=${encodeURIComponent(roomType.propertyId)}&target=room_type%3A${encodeURIComponent(roomType.id)}&${query}`,
|
|
1867
|
+
variant: 'secondary',
|
|
1868
|
+
}),
|
|
1869
|
+
], 'compact') }),
|
|
1870
|
+
]) }),
|
|
1871
|
+
]) }));
|
|
1872
|
+
};
|
|
1873
|
+
export const amenitiesScreen = (_, rows, frame) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.amenities.title'), frame: frame, body: rows.length
|
|
1874
|
+
? dataTable(_, { columns: amenityColumns(_), rows, id: (row) => row.id })
|
|
1875
|
+
: emptyState(_('hospitality_core.screen.amenities.empty'), _('hospitality_core.screen.amenities.emptyHint')) }));
|
|
1876
|
+
export const policiesScreen = (_, rows, frame) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.policies.title'), frame: frame, body: rows.length
|
|
1877
|
+
? dataTable(_, { columns: policyColumns(_), rows, id: (row) => row.id })
|
|
1878
|
+
: emptyState(_('hospitality_core.screen.policies.empty'), _('hospitality_core.screen.policies.emptyHint')) }));
|
|
1879
|
+
const contentFeedback = (_, state) => {
|
|
1880
|
+
if (state === 'saved')
|
|
1881
|
+
return notice({
|
|
1882
|
+
title: _('hospitality_core.content.feedback.saved'),
|
|
1883
|
+
message: _('hospitality_core.content.feedback.savedHint'),
|
|
1884
|
+
tone: 'positive',
|
|
1885
|
+
});
|
|
1886
|
+
if (state === 'invalid')
|
|
1887
|
+
return notice({
|
|
1888
|
+
title: _('hospitality_core.content.feedback.invalid'),
|
|
1889
|
+
message: _('hospitality_core.content.feedback.invalidHint'),
|
|
1890
|
+
tone: 'danger',
|
|
1891
|
+
});
|
|
1892
|
+
return null;
|
|
1893
|
+
};
|
|
1894
|
+
export const contentScreen = (_, properties, roomTypes, propertyId, target, images, completeness, locale, query, frame, status) => {
|
|
1895
|
+
const property = properties.find((row) => row.id === propertyId);
|
|
1896
|
+
const roomTypeId = target.startsWith('room_type:') ? target.slice('room_type:'.length) : null;
|
|
1897
|
+
const roomType = roomTypes.find((row) => row.id === roomTypeId);
|
|
1898
|
+
const selectedLabel = roomType?.name ?? property?.name ?? _('hospitality_core.content.target.none');
|
|
1899
|
+
const categoryOptions = ['exterior', 'lobby', 'room', 'bathroom', 'restaurant', 'pool', 'other'].map((value) => ({ value, label: _(`hospitality_core.content.category.${value}`) }));
|
|
1900
|
+
const targetOptions = property
|
|
1901
|
+
? [
|
|
1902
|
+
{ value: 'property', label: _('hospitality_core.content.target.property') },
|
|
1903
|
+
...roomTypes.map((row) => ({
|
|
1904
|
+
value: `room_type:${row.id}`,
|
|
1905
|
+
label: `${_('hospitality_core.content.target.roomType')} · ${row.name}`,
|
|
1906
|
+
})),
|
|
1907
|
+
]
|
|
1908
|
+
: [];
|
|
1909
|
+
const suffix = query ? `?${query}` : '';
|
|
1910
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.content.title'), frame: frame, body: stack([
|
|
1911
|
+
contentFeedback(_, status),
|
|
1912
|
+
properties.length ? (_jsx(Section, { title: _('hospitality_core.screen.content.selection'), description: _('hospitality_core.screen.content.selectionHint'), body: _jsx(RecordForm, { action: "/admin/hospitality/content", method: "get", layout: "inline", fields: [
|
|
1913
|
+
{
|
|
1914
|
+
name: 'property',
|
|
1915
|
+
label: _('hospitality_core.content.field.property'),
|
|
1916
|
+
type: 'select',
|
|
1917
|
+
value: propertyId,
|
|
1918
|
+
options: choices(properties),
|
|
1919
|
+
required: true,
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
name: 'target',
|
|
1923
|
+
label: _('hospitality_core.content.field.target'),
|
|
1924
|
+
type: 'select',
|
|
1925
|
+
value: target,
|
|
1926
|
+
options: targetOptions,
|
|
1927
|
+
required: true,
|
|
1928
|
+
},
|
|
1929
|
+
], hidden: { lang: locale }, submit: _('hospitality_core.action.select'), submitVariant: "secondary" }) })) : (emptyState(_('hospitality_core.screen.content.noProperty'), _('hospitality_core.screen.content.noPropertyHint'))),
|
|
1930
|
+
...(property
|
|
1931
|
+
? [
|
|
1932
|
+
cardGrid({
|
|
1933
|
+
items: [
|
|
1934
|
+
{
|
|
1935
|
+
id: 'target',
|
|
1936
|
+
label: _('hospitality_core.content.metric.target'),
|
|
1937
|
+
value: selectedLabel,
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
id: 'images',
|
|
1941
|
+
label: _('hospitality_core.content.metric.images'),
|
|
1942
|
+
value: String(images.length),
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
id: 'complete',
|
|
1946
|
+
label: _('hospitality_core.content.metric.completeness'),
|
|
1947
|
+
value: `${completeness.percent}%`,
|
|
1948
|
+
detail: _(`hospitality_core.content.metric.fields`, {
|
|
1949
|
+
completed: completeness.completed,
|
|
1950
|
+
total: completeness.total,
|
|
1951
|
+
}),
|
|
1952
|
+
},
|
|
1953
|
+
],
|
|
1954
|
+
id: (item) => item.id,
|
|
1955
|
+
card: (item) => metric({
|
|
1956
|
+
label: item.label,
|
|
1957
|
+
value: item.value,
|
|
1958
|
+
detail: 'detail' in item ? item.detail : null,
|
|
1959
|
+
tone: item.id,
|
|
1960
|
+
}),
|
|
1961
|
+
}),
|
|
1962
|
+
_jsx(Section, { title: _('hospitality_core.screen.content.library'), description: _('hospitality_core.screen.content.libraryHint'), body: mediaPanel({
|
|
1963
|
+
status: 'ready',
|
|
1964
|
+
images: images.map((image, index) => ({
|
|
1965
|
+
id: image.id,
|
|
1966
|
+
src: `/files/${image.attachmentId}`,
|
|
1967
|
+
alt: image.caption || image.attachment?.name || selectedLabel,
|
|
1968
|
+
primary: image.primary,
|
|
1969
|
+
actions: {
|
|
1970
|
+
primary: `/admin/hospitality/content/images/${image.id}/primary${suffix}`,
|
|
1971
|
+
remove: `/admin/hospitality/content/images/${image.id}/remove${suffix}`,
|
|
1972
|
+
...(index > 0
|
|
1973
|
+
? { moveUp: `/admin/hospitality/content/images/${image.id}/move-up${suffix}` }
|
|
1974
|
+
: {}),
|
|
1975
|
+
...(index < images.length - 1
|
|
1976
|
+
? { moveDown: `/admin/hospitality/content/images/${image.id}/move-down${suffix}` }
|
|
1977
|
+
: {}),
|
|
1978
|
+
},
|
|
1979
|
+
})),
|
|
1980
|
+
uploadAction: `/admin/hospitality/content/upload${suffix}`,
|
|
1981
|
+
labels: {
|
|
1982
|
+
empty: _('hospitality_core.content.media.empty'),
|
|
1983
|
+
primary: _('hospitality_core.content.media.primary'),
|
|
1984
|
+
makePrimary: _('hospitality_core.content.media.makePrimary'),
|
|
1985
|
+
moveUp: _('hospitality_core.content.media.moveUp'),
|
|
1986
|
+
moveDown: _('hospitality_core.content.media.moveDown'),
|
|
1987
|
+
remove: _('hospitality_core.content.media.remove'),
|
|
1988
|
+
choose: _('hospitality_core.content.media.choose'),
|
|
1989
|
+
add: _('hospitality_core.content.media.add'),
|
|
1990
|
+
},
|
|
1991
|
+
extension: images.length ? (_jsx(FormCluster, { label: _('hospitality_core.content.metadata.group'), forms: images.map((image) => (_jsx(RecordForm, { action: `/admin/hospitality/content/images/${image.id}/metadata${suffix}`, layout: "inline", fields: [
|
|
1992
|
+
{
|
|
1993
|
+
name: 'category',
|
|
1994
|
+
label: _('hospitality_core.content.field.category'),
|
|
1995
|
+
type: 'select',
|
|
1996
|
+
value: image.category,
|
|
1997
|
+
options: categoryOptions,
|
|
1998
|
+
required: true,
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
name: 'caption',
|
|
2002
|
+
label: _('hospitality_core.content.field.caption'),
|
|
2003
|
+
value: image.caption,
|
|
2004
|
+
placeholder: image.attachment?.name ?? null,
|
|
2005
|
+
},
|
|
2006
|
+
], hidden: { id: image.id }, submit: _('hospitality_core.content.action.saveMetadata'), submitVariant: "secondary", submitSize: "compact" }))) })) : undefined,
|
|
2007
|
+
}) }),
|
|
2008
|
+
]
|
|
2009
|
+
: []),
|
|
2010
|
+
]) }));
|
|
2011
|
+
};
|
|
2012
|
+
const choices = (rows) => rows.map((row) => ({
|
|
2013
|
+
value: row.id,
|
|
2014
|
+
label: `${row.code ? `${row.code} · ` : ''}${row.name}`,
|
|
2015
|
+
}));
|
|
2016
|
+
const feedback = (_, state) => {
|
|
2017
|
+
if (state === 'saved')
|
|
2018
|
+
return notice({
|
|
2019
|
+
title: _('hospitality_core.feedback.saved'),
|
|
2020
|
+
message: _('hospitality_core.feedback.savedHint'),
|
|
2021
|
+
tone: 'positive',
|
|
2022
|
+
});
|
|
2023
|
+
if (state === 'invalid')
|
|
2024
|
+
return notice({
|
|
2025
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
2026
|
+
message: _('hospitality_core.feedback.invalidHint'),
|
|
2027
|
+
tone: 'danger',
|
|
2028
|
+
});
|
|
2029
|
+
return null;
|
|
2030
|
+
};
|
|
2031
|
+
const nightAuditFeedback = (_, state) => {
|
|
2032
|
+
if (state === 'queued')
|
|
2033
|
+
return notice({
|
|
2034
|
+
title: _('hospitality_core.nightAudit.feedback.queued'),
|
|
2035
|
+
message: _('hospitality_core.nightAudit.feedback.queuedHint'),
|
|
2036
|
+
tone: 'positive',
|
|
2037
|
+
});
|
|
2038
|
+
if (state === 'invalid')
|
|
2039
|
+
return notice({
|
|
2040
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
2041
|
+
message: _('hospitality_core.nightAudit.feedback.invalidHint'),
|
|
2042
|
+
tone: 'danger',
|
|
2043
|
+
});
|
|
2044
|
+
return null;
|
|
2045
|
+
};
|
|
2046
|
+
const nightAuditColumns = (_, locale) => [
|
|
2047
|
+
{
|
|
2048
|
+
key: 'date',
|
|
2049
|
+
label: _('hospitality_core.nightAudit.col.date'),
|
|
2050
|
+
cell: (row) => new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeZone: 'UTC' }).format(new Date(`${row.auditDate}T12:00:00Z`)),
|
|
2051
|
+
kind: 'date',
|
|
2052
|
+
priority: 'primary',
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
key: 'status',
|
|
2056
|
+
label: _('hospitality_core.col.status'),
|
|
2057
|
+
cell: (row) => badge(_(`hospitality_core.nightAudit.state.${row.state}`), row.state === 'completed'
|
|
2058
|
+
? 'positive'
|
|
2059
|
+
: row.state === 'failed'
|
|
2060
|
+
? 'danger'
|
|
2061
|
+
: row.state === 'running'
|
|
2062
|
+
? 'warning'
|
|
2063
|
+
: 'info'),
|
|
2064
|
+
kind: 'status',
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
key: 'inHouse',
|
|
2068
|
+
label: _('hospitality_core.nightAudit.metric.inHouse'),
|
|
2069
|
+
cell: (row) => String(row.inHouseCount),
|
|
2070
|
+
align: 'end',
|
|
2071
|
+
kind: 'number',
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
key: 'services',
|
|
2075
|
+
label: _('hospitality_core.nightAudit.metric.services'),
|
|
2076
|
+
cell: (row) => String(row.servicePosted),
|
|
2077
|
+
align: 'end',
|
|
2078
|
+
kind: 'number',
|
|
2079
|
+
},
|
|
2080
|
+
{
|
|
2081
|
+
key: 'rent',
|
|
2082
|
+
label: _('hospitality_core.nightAudit.metric.rent'),
|
|
2083
|
+
cell: (row) => String(row.rentPosted),
|
|
2084
|
+
align: 'end',
|
|
2085
|
+
kind: 'number',
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
key: 'amount',
|
|
2089
|
+
label: _('hospitality_core.col.amount'),
|
|
2090
|
+
cell: (row) => formatMoney(_, row.totalAmount),
|
|
2091
|
+
align: 'end',
|
|
2092
|
+
kind: 'currency',
|
|
2093
|
+
},
|
|
2094
|
+
{
|
|
2095
|
+
key: 'attempt',
|
|
2096
|
+
label: _('hospitality_core.nightAudit.col.attempt'),
|
|
2097
|
+
cell: (row) => String(row.attempt),
|
|
2098
|
+
align: 'end',
|
|
2099
|
+
kind: 'number',
|
|
2100
|
+
},
|
|
2101
|
+
];
|
|
2102
|
+
export const nightAuditScreen = (_, data, locale, frame, state) => {
|
|
2103
|
+
if (!data.propertyId)
|
|
2104
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.nightAudit.title'), frame: frame, body: emptyState(_('hospitality_core.nightAudit.empty.property'), _('hospitality_core.nightAudit.empty.propertyHint')) }));
|
|
2105
|
+
const lang = { lang: locale };
|
|
2106
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.nightAudit.title'), frame: frame, body: stack([
|
|
2107
|
+
nightAuditFeedback(_, state),
|
|
2108
|
+
_jsx(FormCluster, { label: _('hospitality_core.nightAudit.section.selection'), forms: [
|
|
2109
|
+
_jsx(RecordForm, { action: "/admin/hospitality/night-audit", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { ...lang, auditDate: data.auditDate }, fields: [
|
|
2110
|
+
{
|
|
2111
|
+
name: 'property',
|
|
2112
|
+
label: _('hospitality_core.menu.properties'),
|
|
2113
|
+
type: 'select',
|
|
2114
|
+
value: data.propertyId,
|
|
2115
|
+
options: choices(data.properties),
|
|
2116
|
+
required: true,
|
|
2117
|
+
},
|
|
2118
|
+
] }),
|
|
2119
|
+
datePicker({
|
|
2120
|
+
action: '/admin/hospitality/night-audit',
|
|
2121
|
+
label: _('hospitality_core.nightAudit.field.auditDate'),
|
|
2122
|
+
fields: [
|
|
2123
|
+
{
|
|
2124
|
+
name: 'auditDate',
|
|
2125
|
+
label: _('hospitality_core.nightAudit.field.auditDate'),
|
|
2126
|
+
value: data.auditDate,
|
|
2127
|
+
max: data.today,
|
|
2128
|
+
required: true,
|
|
2129
|
+
},
|
|
2130
|
+
],
|
|
2131
|
+
hidden: { ...lang, property: data.propertyId },
|
|
2132
|
+
submit: _('hospitality_core.nightAudit.action.preview'),
|
|
2133
|
+
}),
|
|
2134
|
+
] }),
|
|
2135
|
+
data.preview
|
|
2136
|
+
? cardGrid({
|
|
2137
|
+
items: [
|
|
2138
|
+
{
|
|
2139
|
+
id: 'in-house',
|
|
2140
|
+
label: _('hospitality_core.nightAudit.metric.inHouse'),
|
|
2141
|
+
value: data.preview.inHouseCount,
|
|
2142
|
+
},
|
|
2143
|
+
{
|
|
2144
|
+
id: 'services',
|
|
2145
|
+
label: _('hospitality_core.nightAudit.metric.servicesDue'),
|
|
2146
|
+
value: data.preview.serviceDue,
|
|
2147
|
+
},
|
|
2148
|
+
{
|
|
2149
|
+
id: 'rent',
|
|
2150
|
+
label: _('hospitality_core.nightAudit.metric.rentDue'),
|
|
2151
|
+
value: data.preview.rentDue,
|
|
2152
|
+
},
|
|
2153
|
+
{
|
|
2154
|
+
id: 'night-audit-amount',
|
|
2155
|
+
label: _('hospitality_core.nightAudit.metric.estimated'),
|
|
2156
|
+
value: formatMoney(_, data.preview.estimatedAmount),
|
|
2157
|
+
},
|
|
2158
|
+
],
|
|
2159
|
+
id: (item) => item.id,
|
|
2160
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
2161
|
+
})
|
|
2162
|
+
: null,
|
|
2163
|
+
_jsx(Section, { title: _('hospitality_core.nightAudit.section.run'), description: _('hospitality_core.nightAudit.section.runHint'), body: _jsx(RecordForm, { action: "/admin/hospitality/night-audit", method: "post", submit: _('hospitality_core.nightAudit.action.run'), submitVariant: "primary", hidden: {
|
|
2164
|
+
...lang,
|
|
2165
|
+
operation: 'request-night-audit',
|
|
2166
|
+
propertyId: data.propertyId,
|
|
2167
|
+
auditDate: data.auditDate,
|
|
2168
|
+
}, fields: [] }) }),
|
|
2169
|
+
_jsx(Section, { title: _('hospitality_core.nightAudit.section.history'), description: _('hospitality_core.nightAudit.section.historyHint'), body: data.runs.length
|
|
2170
|
+
? dataTable(_, { columns: nightAuditColumns(_, locale), rows: data.runs, id: (row) => row.id })
|
|
2171
|
+
: emptyState(_('hospitality_core.nightAudit.empty.runs'), _('hospitality_core.nightAudit.empty.runsHint')) }),
|
|
2172
|
+
]) }));
|
|
2173
|
+
};
|
|
2174
|
+
const stayNoticeFeedback = (_, state) => {
|
|
2175
|
+
if (state === 'refreshed' || state === 'submitted' || state === 'confirmed')
|
|
2176
|
+
return notice({
|
|
2177
|
+
title: _(`hospitality_core.stayNotice.feedback.${state}`),
|
|
2178
|
+
message: _(`hospitality_core.stayNotice.feedback.${state}Hint`),
|
|
2179
|
+
tone: 'positive',
|
|
2180
|
+
});
|
|
2181
|
+
if (state === 'invalid')
|
|
2182
|
+
return notice({
|
|
2183
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
2184
|
+
message: _('hospitality_core.stayNotice.feedback.invalidHint'),
|
|
2185
|
+
tone: 'danger',
|
|
2186
|
+
});
|
|
2187
|
+
return null;
|
|
2188
|
+
};
|
|
2189
|
+
const stayNoticeStateTone = (state) => state === 'attention'
|
|
2190
|
+
? 'danger'
|
|
2191
|
+
: state === 'ready'
|
|
2192
|
+
? 'warning'
|
|
2193
|
+
: state === 'submitted'
|
|
2194
|
+
? 'info'
|
|
2195
|
+
: 'positive';
|
|
2196
|
+
const stayNoticeDocument = (_, row) => {
|
|
2197
|
+
if (!row.documentType || !row.documentLast4)
|
|
2198
|
+
return _('hospitality_core.stayNotice.value.missing');
|
|
2199
|
+
return `${_(`hospitality_core.document.${row.documentType}`)} · •••• ${row.documentLast4}`;
|
|
2200
|
+
};
|
|
2201
|
+
const stayNoticeIssues = (_, row) => row.issueCodes.length
|
|
2202
|
+
? row.issueCodes.map((item) => _(`hospitality_core.stayNotice.issue.${item}`)).join(', ')
|
|
2203
|
+
: _('hospitality_core.stayNotice.value.complete');
|
|
2204
|
+
const stayNoticeColumns = (_, locale, timezone) => [
|
|
2205
|
+
{
|
|
2206
|
+
key: 'guest',
|
|
2207
|
+
label: _('hospitality_core.stayNotice.col.guest'),
|
|
2208
|
+
cell: (row) => row.guestName,
|
|
2209
|
+
priority: 'primary',
|
|
2210
|
+
kind: 'person',
|
|
2211
|
+
},
|
|
2212
|
+
{
|
|
2213
|
+
key: 'document',
|
|
2214
|
+
label: _('hospitality_core.stayNotice.col.document'),
|
|
2215
|
+
cell: (row) => stayNoticeDocument(_, row),
|
|
2216
|
+
priority: 'secondary',
|
|
2217
|
+
kind: 'identifier',
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
key: 'due',
|
|
2221
|
+
label: _('hospitality_core.stayNotice.col.due'),
|
|
2222
|
+
cell: (row) => new Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short', timeZone: timezone }).format(new Date(row.dueAt)),
|
|
2223
|
+
priority: 'secondary',
|
|
2224
|
+
kind: 'date',
|
|
2225
|
+
},
|
|
2226
|
+
{
|
|
2227
|
+
key: 'state',
|
|
2228
|
+
label: _('hospitality_core.col.status'),
|
|
2229
|
+
cell: (row) => badge(_(`hospitality_core.stayNotice.state.${row.state}`), stayNoticeStateTone(row.state)),
|
|
2230
|
+
kind: 'status',
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
key: 'issues',
|
|
2234
|
+
label: _('hospitality_core.stayNotice.col.readiness'),
|
|
2235
|
+
cell: (row) => stayNoticeIssues(_, row),
|
|
2236
|
+
priority: 'tertiary',
|
|
2237
|
+
optional: true,
|
|
2238
|
+
},
|
|
2239
|
+
];
|
|
2240
|
+
const stayNoticeHref = (locale, propertyId, state, noticeId) => {
|
|
2241
|
+
const query = new URLSearchParams({ lang: locale, property: propertyId, notice: noticeId });
|
|
2242
|
+
if (state !== 'all')
|
|
2243
|
+
query.set('state', state);
|
|
2244
|
+
return `/admin/hospitality/stay-notices?${query.toString()}`;
|
|
2245
|
+
};
|
|
2246
|
+
const stayNoticeAction = (_, selected, locale, propertyId, state) => {
|
|
2247
|
+
const hidden = {
|
|
2248
|
+
lang: locale,
|
|
2249
|
+
id: selected.id,
|
|
2250
|
+
stayId: selected.stayId,
|
|
2251
|
+
property: propertyId,
|
|
2252
|
+
state,
|
|
2253
|
+
};
|
|
2254
|
+
if (selected.state === 'attention')
|
|
2255
|
+
return (_jsx(RecordForm, { action: "/admin/hospitality/stay-notices", method: "post", submit: _('hospitality_core.stayNotice.action.refresh'), submitVariant: "secondary", hidden: { ...hidden, operation: 'refresh' }, fields: [] }));
|
|
2256
|
+
if (selected.state === 'ready')
|
|
2257
|
+
return (_jsx(RecordForm, { action: "/admin/hospitality/stay-notices", method: "post", submit: _('hospitality_core.stayNotice.action.recordSubmission'), submitVariant: "primary", hidden: { ...hidden, operation: 'record-submission' }, fields: [
|
|
2258
|
+
{
|
|
2259
|
+
name: 'reason',
|
|
2260
|
+
label: _('hospitality_core.stayNotice.field.reason'),
|
|
2261
|
+
type: 'select',
|
|
2262
|
+
value: selected.reason,
|
|
2263
|
+
required: true,
|
|
2264
|
+
options: [
|
|
2265
|
+
{ value: '', label: _('hospitality_core.stayNotice.reason.select') },
|
|
2266
|
+
...['tourism', 'business', 'family', 'other'].map((value) => ({
|
|
2267
|
+
value,
|
|
2268
|
+
label: _(`hospitality_core.stayNotice.reason.${value}`),
|
|
2269
|
+
})),
|
|
2270
|
+
],
|
|
2271
|
+
},
|
|
2272
|
+
{
|
|
2273
|
+
name: 'channel',
|
|
2274
|
+
label: _('hospitality_core.stayNotice.field.channel'),
|
|
2275
|
+
type: 'select',
|
|
2276
|
+
required: true,
|
|
2277
|
+
options: ['online', 'vneid', 'email', 'phone', 'software'].map((value) => ({
|
|
2278
|
+
value,
|
|
2279
|
+
label: _(`hospitality_core.stayNotice.channel.${value}`),
|
|
2280
|
+
})),
|
|
2281
|
+
},
|
|
2282
|
+
{
|
|
2283
|
+
name: 'evidenceRef',
|
|
2284
|
+
label: _('hospitality_core.stayNotice.field.evidenceRef'),
|
|
2285
|
+
help: _('hospitality_core.stayNotice.field.evidenceRefHint'),
|
|
2286
|
+
required: true,
|
|
2287
|
+
},
|
|
2288
|
+
] }));
|
|
2289
|
+
if (selected.state === 'submitted')
|
|
2290
|
+
return (_jsx(RecordForm, { action: "/admin/hospitality/stay-notices", method: "post", submit: _('hospitality_core.stayNotice.action.confirm'), submitVariant: "primary", hidden: { ...hidden, operation: 'confirm' }, fields: [
|
|
2291
|
+
{
|
|
2292
|
+
name: 'receiptRef',
|
|
2293
|
+
label: _('hospitality_core.stayNotice.field.receiptRef'),
|
|
2294
|
+
value: selected.receiptRef,
|
|
2295
|
+
required: true,
|
|
2296
|
+
},
|
|
2297
|
+
] }));
|
|
2298
|
+
return null;
|
|
2299
|
+
};
|
|
2300
|
+
export const stayNoticesScreen = (_, data, locale, timezone, frame, feedbackState) => {
|
|
2301
|
+
if (!data.propertyId)
|
|
2302
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.stayNotices.title'), frame: frame, body: emptyState(_('hospitality_core.stayNotice.empty.property'), _('hospitality_core.stayNotice.empty.propertyHint')) }));
|
|
2303
|
+
const counts = Object.fromEntries(['attention', 'ready', 'submitted', 'confirmed'].map((state) => [
|
|
2304
|
+
state,
|
|
2305
|
+
data.rows.filter((row) => row.state === state).length,
|
|
2306
|
+
]));
|
|
2307
|
+
const visibleRows = data.state === 'all' ? data.rows : data.rows.filter((row) => row.state === data.state);
|
|
2308
|
+
const action = data.selected
|
|
2309
|
+
? stayNoticeAction(_, data.selected, locale, data.propertyId, data.state)
|
|
2310
|
+
: null;
|
|
2311
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.stayNotices.title'), frame: frame, body: stack([
|
|
2312
|
+
stayNoticeFeedback(_, feedbackState),
|
|
2313
|
+
notice({
|
|
2314
|
+
tone: 'info',
|
|
2315
|
+
title: _('hospitality_core.stayNotice.privacy.title'),
|
|
2316
|
+
message: _('hospitality_core.stayNotice.privacy.hint'),
|
|
2317
|
+
}),
|
|
2318
|
+
_jsx(RecordForm, { action: "/admin/hospitality/stay-notices", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { lang: locale }, fields: [
|
|
2319
|
+
{
|
|
2320
|
+
name: 'property',
|
|
2321
|
+
label: _('hospitality_core.menu.properties'),
|
|
2322
|
+
type: 'select',
|
|
2323
|
+
value: data.propertyId,
|
|
2324
|
+
options: choices(data.properties),
|
|
2325
|
+
required: true,
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
name: 'state',
|
|
2329
|
+
label: _('hospitality_core.col.status'),
|
|
2330
|
+
type: 'select',
|
|
2331
|
+
value: data.state,
|
|
2332
|
+
options: ['all', 'attention', 'ready', 'submitted', 'confirmed'].map((value) => ({
|
|
2333
|
+
value,
|
|
2334
|
+
label: _(`hospitality_core.stayNotice.state.${value}`),
|
|
2335
|
+
})),
|
|
2336
|
+
},
|
|
2337
|
+
] }),
|
|
2338
|
+
cardGrid({
|
|
2339
|
+
items: ['attention', 'ready', 'submitted', 'confirmed'].map((state) => ({
|
|
2340
|
+
state,
|
|
2341
|
+
count: Number(counts[state] ?? 0),
|
|
2342
|
+
})),
|
|
2343
|
+
id: (item) => item.state,
|
|
2344
|
+
card: (item) => metric({
|
|
2345
|
+
label: _(`hospitality_core.stayNotice.state.${item.state}`),
|
|
2346
|
+
value: String(item.count),
|
|
2347
|
+
tone: item.state,
|
|
2348
|
+
}),
|
|
2349
|
+
}),
|
|
2350
|
+
...(data.selected
|
|
2351
|
+
? [
|
|
2352
|
+
_jsx(Section, { title: _('hospitality_core.stayNotice.section.selected'), description: _('hospitality_core.stayNotice.section.selectedHint'), body: stack([
|
|
2353
|
+
definitionList({
|
|
2354
|
+
title: data.selected.guestName,
|
|
2355
|
+
items: [
|
|
2356
|
+
{
|
|
2357
|
+
key: 'state',
|
|
2358
|
+
term: _('hospitality_core.col.status'),
|
|
2359
|
+
value: _(`hospitality_core.stayNotice.state.${data.selected.state}`),
|
|
2360
|
+
},
|
|
2361
|
+
{
|
|
2362
|
+
key: 'document',
|
|
2363
|
+
term: _('hospitality_core.stayNotice.col.document'),
|
|
2364
|
+
value: stayNoticeDocument(_, data.selected),
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
key: 'reason',
|
|
2368
|
+
term: _('hospitality_core.stayNotice.field.reason'),
|
|
2369
|
+
value: data.selected.reason
|
|
2370
|
+
? _(`hospitality_core.stayNotice.reason.${data.selected.reason}`)
|
|
2371
|
+
: _('hospitality_core.stayNotice.value.missing'),
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
key: 'readiness',
|
|
2375
|
+
term: _('hospitality_core.stayNotice.col.readiness'),
|
|
2376
|
+
value: stayNoticeIssues(_, data.selected),
|
|
2377
|
+
},
|
|
2378
|
+
{
|
|
2379
|
+
key: 'evidence',
|
|
2380
|
+
term: _('hospitality_core.stayNotice.field.evidenceRef'),
|
|
2381
|
+
value: data.selected.receiptRef || _('hospitality_core.stayNotice.value.missing'),
|
|
2382
|
+
},
|
|
2383
|
+
],
|
|
2384
|
+
}),
|
|
2385
|
+
action,
|
|
2386
|
+
]) }),
|
|
2387
|
+
]
|
|
2388
|
+
: []),
|
|
2389
|
+
_jsx(Section, { title: _('hospitality_core.stayNotice.section.queue'), description: _('hospitality_core.stayNotice.section.queueHint'), body: visibleRows.length
|
|
2390
|
+
? dataTable(_, {
|
|
2391
|
+
columns: stayNoticeColumns(_, locale, timezone),
|
|
2392
|
+
rows: visibleRows,
|
|
2393
|
+
id: (row) => row.id,
|
|
2394
|
+
rowHref: (row) => stayNoticeHref(locale, data.propertyId, data.state, row.id),
|
|
2395
|
+
})
|
|
2396
|
+
: emptyState(_('hospitality_core.stayNotice.empty.rows'), _('hospitality_core.stayNotice.empty.rowsHint')) }),
|
|
2397
|
+
]) }));
|
|
2398
|
+
};
|
|
2399
|
+
const propertyChargeColumns = (_) => [
|
|
2400
|
+
{
|
|
2401
|
+
key: 'type',
|
|
2402
|
+
label: _('hospitality_core.col.type'),
|
|
2403
|
+
cell: (row) => badge(_(`hospitality_core.propertyCharge.${row.chargeType}`), 'info'),
|
|
2404
|
+
kind: 'status',
|
|
2405
|
+
},
|
|
2406
|
+
{ key: 'name', label: _('hospitality_core.col.name'), cell: (row) => row.name, priority: 'primary' },
|
|
2407
|
+
{
|
|
2408
|
+
key: 'amount',
|
|
2409
|
+
label: _('hospitality_core.col.amount'),
|
|
2410
|
+
cell: (row) => formatMoney(_, row.amount),
|
|
2411
|
+
align: 'end',
|
|
2412
|
+
kind: 'currency',
|
|
2413
|
+
},
|
|
2414
|
+
{
|
|
2415
|
+
key: 'status',
|
|
2416
|
+
label: _('hospitality_core.col.status'),
|
|
2417
|
+
cell: (row) => badge(_(row.active ? 'hospitality_core.value.active' : 'hospitality_core.value.inactive'), row.active ? 'positive' : 'neutral'),
|
|
2418
|
+
kind: 'status',
|
|
2419
|
+
},
|
|
2420
|
+
];
|
|
2421
|
+
const extraLineColumns = (_) => [
|
|
2422
|
+
{
|
|
2423
|
+
key: 'target',
|
|
2424
|
+
label: _('hospitality_core.services.col.target'),
|
|
2425
|
+
cell: (row) => code(row.reservation?.code ?? row.stay?.code ?? row.reservationId ?? row.stayId ?? '—'),
|
|
2426
|
+
kind: 'identifier',
|
|
2427
|
+
},
|
|
2428
|
+
{
|
|
2429
|
+
key: 'service',
|
|
2430
|
+
label: _('hospitality_core.services.col.service'),
|
|
2431
|
+
cell: (row) => `${row.productCode ? `${row.productCode} · ` : ''}${row.description}`,
|
|
2432
|
+
priority: 'primary',
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
key: 'recurrence',
|
|
2436
|
+
label: _('hospitality_core.services.col.recurrence'),
|
|
2437
|
+
cell: (row) => badge(_(`hospitality_core.extraRecurrence.${row.recurrence}`), 'info'),
|
|
2438
|
+
kind: 'status',
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
key: 'price',
|
|
2442
|
+
label: _('hospitality_core.services.col.unitPrice'),
|
|
2443
|
+
cell: (row) => `${row.quantity} × ${formatMoney(_, row.unitPrice)}`,
|
|
2444
|
+
align: 'end',
|
|
2445
|
+
kind: 'currency',
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
key: 'posted',
|
|
2449
|
+
label: _('hospitality_core.services.col.materialized'),
|
|
2450
|
+
cell: (row) => row.materializedCount
|
|
2451
|
+
? badge(_('hospitality_core.services.value.posted', {
|
|
2452
|
+
count: row.materializedCount,
|
|
2453
|
+
amount: formatMoney(_, row.materializedAmount),
|
|
2454
|
+
}), 'positive')
|
|
2455
|
+
: badge(_('hospitality_core.services.value.pending'), 'warning'),
|
|
2456
|
+
kind: 'status',
|
|
2457
|
+
},
|
|
2458
|
+
];
|
|
2459
|
+
const serviceChargeColumns = (_, locale, timezone) => [
|
|
2460
|
+
{
|
|
2461
|
+
key: 'occurredAt',
|
|
2462
|
+
label: _('hospitality_core.col.date'),
|
|
2463
|
+
cell: (row) => row.serviceDate ?? dateTime(row.occurredAt, locale, timezone),
|
|
2464
|
+
kind: 'date',
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
key: 'folio',
|
|
2468
|
+
label: _('hospitality_core.services.col.folio'),
|
|
2469
|
+
cell: (row) => code(row.folio?.code ?? row.folioId),
|
|
2470
|
+
kind: 'identifier',
|
|
2471
|
+
},
|
|
2472
|
+
{
|
|
2473
|
+
key: 'service',
|
|
2474
|
+
label: _('hospitality_core.services.col.service'),
|
|
2475
|
+
cell: (row) => row.description,
|
|
2476
|
+
priority: 'primary',
|
|
2477
|
+
},
|
|
2478
|
+
{
|
|
2479
|
+
key: 'quantity',
|
|
2480
|
+
label: _('hospitality_core.col.quantity'),
|
|
2481
|
+
cell: (row) => String(row.quantity),
|
|
2482
|
+
align: 'end',
|
|
2483
|
+
kind: 'number',
|
|
2484
|
+
},
|
|
2485
|
+
{
|
|
2486
|
+
key: 'amount',
|
|
2487
|
+
label: _('hospitality_core.col.amount'),
|
|
2488
|
+
cell: (row) => formatMoney(_, row.amount),
|
|
2489
|
+
align: 'end',
|
|
2490
|
+
kind: 'currency',
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
key: 'state',
|
|
2494
|
+
label: _('hospitality_core.col.status'),
|
|
2495
|
+
cell: (row) => badge(_(`hospitality_core.chargeState.${row.state}`), row.state === 'active' ? 'positive' : 'neutral'),
|
|
2496
|
+
kind: 'status',
|
|
2497
|
+
},
|
|
2498
|
+
];
|
|
2499
|
+
export const servicesScreen = (_, data, locale, timezone, frame, state) => {
|
|
2500
|
+
const serviceQuery = new URLSearchParams({ lang: locale });
|
|
2501
|
+
if (data.propertyId)
|
|
2502
|
+
serviceQuery.set('property', data.propertyId);
|
|
2503
|
+
const baseQuery = `?${serviceQuery.toString()}`;
|
|
2504
|
+
const activeCharges = data.charges.filter((row) => row.state === 'active');
|
|
2505
|
+
const totalPosted = activeCharges.reduce((sum, row) => sum + Number(row.amount), 0);
|
|
2506
|
+
const targetOptions = data.targets.map((row) => ({
|
|
2507
|
+
value: `${row.type}:${row.id}`,
|
|
2508
|
+
label: `${row.type === 'reservation' ? _('hospitality_core.services.target.reservation') : _('hospitality_core.services.target.stay')} · ${row.code ? `${row.code} · ` : ''}${row.name}`,
|
|
2509
|
+
}));
|
|
2510
|
+
const productOptions = data.products.map((row) => ({
|
|
2511
|
+
value: row.id,
|
|
2512
|
+
label: `${row.code ? `${row.code} · ` : ''}${row.name} · ${formatMoney(_, row.unitPrice)}`,
|
|
2513
|
+
}));
|
|
2514
|
+
const extraOptions = data.extraLines
|
|
2515
|
+
.filter((row) => row.active)
|
|
2516
|
+
.map((row) => ({
|
|
2517
|
+
value: row.id,
|
|
2518
|
+
label: `${row.description} · ${_(`hospitality_core.extraRecurrence.${row.recurrence}`)}`,
|
|
2519
|
+
}));
|
|
2520
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.services.title'), frame: frame, body: stack([
|
|
2521
|
+
feedback(_, state),
|
|
2522
|
+
_jsx(RecordForm, { action: "/admin/hospitality/services", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { lang: locale }, fields: [
|
|
2523
|
+
{
|
|
2524
|
+
name: 'property',
|
|
2525
|
+
label: _('hospitality_core.menu.properties'),
|
|
2526
|
+
type: 'select',
|
|
2527
|
+
value: data.propertyId,
|
|
2528
|
+
options: choices(data.properties),
|
|
2529
|
+
required: true,
|
|
2530
|
+
},
|
|
2531
|
+
] }),
|
|
2532
|
+
cardGrid({
|
|
2533
|
+
items: [
|
|
2534
|
+
{
|
|
2535
|
+
id: 'fees',
|
|
2536
|
+
label: _('hospitality_core.services.metric.fees'),
|
|
2537
|
+
value: data.propertyCharges.length,
|
|
2538
|
+
},
|
|
2539
|
+
{
|
|
2540
|
+
id: 'extras',
|
|
2541
|
+
label: _('hospitality_core.services.metric.extras'),
|
|
2542
|
+
value: data.extraLines.length,
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
id: 'posted',
|
|
2546
|
+
label: _('hospitality_core.services.metric.posted'),
|
|
2547
|
+
value: activeCharges.length,
|
|
2548
|
+
},
|
|
2549
|
+
{
|
|
2550
|
+
id: 'value',
|
|
2551
|
+
label: _('hospitality_core.services.metric.postedValue'),
|
|
2552
|
+
value: formatMoney(_, totalPosted),
|
|
2553
|
+
},
|
|
2554
|
+
],
|
|
2555
|
+
id: (item) => item.id,
|
|
2556
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
2557
|
+
}),
|
|
2558
|
+
_jsx(Section, { title: _('hospitality_core.services.section.fees'), description: _('hospitality_core.services.section.feesHint'), body: _jsx(FormCluster, { label: _('hospitality_core.services.form.fee'), forms: [
|
|
2559
|
+
_jsx(RecordForm, { action: `/admin/hospitality/services${baseQuery}`, submit: _('hospitality_core.services.action.saveFee'), submitVariant: "secondary", hidden: {
|
|
2560
|
+
operation: 'save-property-charge',
|
|
2561
|
+
id: data.ids.propertyCharge,
|
|
2562
|
+
propertyId: data.propertyId ?? '',
|
|
2563
|
+
}, fields: [
|
|
2564
|
+
{
|
|
2565
|
+
name: 'chargeType',
|
|
2566
|
+
label: _('hospitality_core.col.type'),
|
|
2567
|
+
type: 'select',
|
|
2568
|
+
options: ['parking', 'city_tax', 'internet', 'resort_fee', 'other'].map((value) => ({
|
|
2569
|
+
value,
|
|
2570
|
+
label: _(`hospitality_core.propertyCharge.${value}`),
|
|
2571
|
+
})),
|
|
2572
|
+
required: true,
|
|
2573
|
+
},
|
|
2574
|
+
{ name: 'name', label: _('hospitality_core.col.name'), required: true },
|
|
2575
|
+
{
|
|
2576
|
+
name: 'amount',
|
|
2577
|
+
label: _('hospitality_core.col.amount'),
|
|
2578
|
+
type: 'decimal',
|
|
2579
|
+
required: true,
|
|
2580
|
+
},
|
|
2581
|
+
{
|
|
2582
|
+
name: 'description',
|
|
2583
|
+
label: _('hospitality_core.services.field.description'),
|
|
2584
|
+
type: 'textarea',
|
|
2585
|
+
span: 'full',
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
name: 'active',
|
|
2589
|
+
label: _('hospitality_core.field.active'),
|
|
2590
|
+
type: 'checkbox',
|
|
2591
|
+
value: true,
|
|
2592
|
+
},
|
|
2593
|
+
] }),
|
|
2594
|
+
] }) }),
|
|
2595
|
+
data.propertyCharges.length
|
|
2596
|
+
? dataTable(_, {
|
|
2597
|
+
columns: propertyChargeColumns(_),
|
|
2598
|
+
rows: data.propertyCharges,
|
|
2599
|
+
id: (row) => row.id,
|
|
2600
|
+
})
|
|
2601
|
+
: emptyState(_('hospitality_core.services.empty.fees'), _('hospitality_core.services.empty.feesHint')),
|
|
2602
|
+
_jsx(Section, { title: _('hospitality_core.services.section.intentions'), description: _('hospitality_core.services.section.intentionsHint'), body: data.targets.length && data.products.length ? (_jsx(FormCluster, { label: _('hospitality_core.services.form.intention'), forms: [
|
|
2603
|
+
_jsx(RecordForm, { action: `/admin/hospitality/services${baseQuery}`, submit: _('hospitality_core.services.action.addIntention'), submitVariant: "primary", hidden: {
|
|
2604
|
+
operation: 'save-extra-line',
|
|
2605
|
+
id: data.ids.extraLine,
|
|
2606
|
+
}, fields: [
|
|
2607
|
+
{
|
|
2608
|
+
name: 'target',
|
|
2609
|
+
label: _('hospitality_core.services.field.target'),
|
|
2610
|
+
type: 'select',
|
|
2611
|
+
options: targetOptions,
|
|
2612
|
+
required: true,
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
name: 'productId',
|
|
2616
|
+
label: _('hospitality_core.services.field.product'),
|
|
2617
|
+
type: 'select',
|
|
2618
|
+
options: productOptions,
|
|
2619
|
+
required: true,
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
name: 'description',
|
|
2623
|
+
label: _('hospitality_core.services.field.description'),
|
|
2624
|
+
placeholder: _('hospitality_core.services.field.descriptionHint'),
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
name: 'quantity',
|
|
2628
|
+
label: _('hospitality_core.col.quantity'),
|
|
2629
|
+
type: 'decimal',
|
|
2630
|
+
value: 1,
|
|
2631
|
+
required: true,
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
name: 'unitPrice',
|
|
2635
|
+
label: _('hospitality_core.services.col.unitPrice'),
|
|
2636
|
+
type: 'decimal',
|
|
2637
|
+
help: _('hospitality_core.services.field.unitPriceHint'),
|
|
2638
|
+
},
|
|
2639
|
+
{
|
|
2640
|
+
name: 'recurrence',
|
|
2641
|
+
label: _('hospitality_core.services.col.recurrence'),
|
|
2642
|
+
type: 'select',
|
|
2643
|
+
options: ['once', 'per_night', 'per_unit'].map((value) => ({
|
|
2644
|
+
value,
|
|
2645
|
+
label: _(`hospitality_core.extraRecurrence.${value}`),
|
|
2646
|
+
})),
|
|
2647
|
+
required: true,
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
name: 'active',
|
|
2651
|
+
label: _('hospitality_core.field.active'),
|
|
2652
|
+
type: 'checkbox',
|
|
2653
|
+
value: true,
|
|
2654
|
+
},
|
|
2655
|
+
] }),
|
|
2656
|
+
] })) : (emptyState(_('hospitality_core.services.empty.catalogue'), _('hospitality_core.services.empty.catalogueHint'))) }),
|
|
2657
|
+
data.extraLines.length
|
|
2658
|
+
? dataTable(_, { columns: extraLineColumns(_), rows: data.extraLines, id: (row) => row.id })
|
|
2659
|
+
: emptyState(_('hospitality_core.services.empty.intentions'), _('hospitality_core.services.empty.intentionsHint')),
|
|
2660
|
+
_jsx(Section, { title: _('hospitality_core.services.section.post'), description: _('hospitality_core.services.section.postHint'), body: extraOptions.length ? (_jsx(RecordForm, { action: `/admin/hospitality/services${baseQuery}`, submit: _('hospitality_core.services.action.post'), submitVariant: "primary", hidden: { operation: 'materialize-extra', requestKey: data.ids.requestKey }, fields: [
|
|
2661
|
+
{
|
|
2662
|
+
name: 'id',
|
|
2663
|
+
label: _('hospitality_core.services.field.intention'),
|
|
2664
|
+
type: 'select',
|
|
2665
|
+
options: extraOptions,
|
|
2666
|
+
required: true,
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
name: 'serviceDate',
|
|
2670
|
+
label: _('hospitality_core.services.field.serviceDate'),
|
|
2671
|
+
type: 'date',
|
|
2672
|
+
help: _('hospitality_core.services.field.serviceDateHint'),
|
|
2673
|
+
},
|
|
2674
|
+
{
|
|
2675
|
+
name: 'quantity',
|
|
2676
|
+
label: _('hospitality_core.col.quantity'),
|
|
2677
|
+
type: 'decimal',
|
|
2678
|
+
help: _('hospitality_core.services.field.postQuantityHint'),
|
|
2679
|
+
},
|
|
2680
|
+
] })) : (emptyState(_('hospitality_core.services.empty.post'), _('hospitality_core.services.empty.postHint'))) }),
|
|
2681
|
+
_jsx(Section, { title: _('hospitality_core.services.section.ledger'), description: _('hospitality_core.services.section.ledgerHint'), body: data.charges.length
|
|
2682
|
+
? dataTable(_, {
|
|
2683
|
+
columns: serviceChargeColumns(_, locale, timezone),
|
|
2684
|
+
rows: data.charges,
|
|
2685
|
+
id: (row) => row.id,
|
|
2686
|
+
})
|
|
2687
|
+
: emptyState(_('hospitality_core.services.empty.ledger'), _('hospitality_core.services.empty.ledgerHint')) }),
|
|
2688
|
+
]) }));
|
|
2689
|
+
};
|
|
2690
|
+
export const ratePlansScreen = (_, rows, properties, roomTypes, propertyId, frame, state) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.ratePlans.title'), frame: frame, body: stack([
|
|
2691
|
+
feedback(_, state),
|
|
2692
|
+
_jsx(RecordForm, { action: "/admin/hospitality/rate-plans", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", fields: [
|
|
2693
|
+
{
|
|
2694
|
+
name: 'property',
|
|
2695
|
+
label: _('hospitality_core.menu.properties'),
|
|
2696
|
+
type: 'select',
|
|
2697
|
+
value: propertyId,
|
|
2698
|
+
options: choices(properties),
|
|
2699
|
+
required: true,
|
|
2700
|
+
},
|
|
2701
|
+
] }),
|
|
2702
|
+
_jsx(Section, { title: _('hospitality_core.screen.ratePlans.create'), description: _('hospitality_core.screen.ratePlans.createHint'), body: roomTypes.length ? (_jsx(RecordForm, { action: `/admin/hospitality/rate-plans${propertyId ? `?property=${encodeURIComponent(propertyId)}` : ''}`, method: "post", submit: _('hospitality_core.action.saveRatePlan'), submitVariant: "primary", hidden: { operation: 'save-rate-plan', propertyId: propertyId ?? '' }, fields: [
|
|
2703
|
+
{
|
|
2704
|
+
name: 'roomTypeId',
|
|
2705
|
+
label: _('hospitality_core.col.roomType'),
|
|
2706
|
+
type: 'select',
|
|
2707
|
+
options: choices(roomTypes),
|
|
2708
|
+
required: true,
|
|
2709
|
+
},
|
|
2710
|
+
{ name: 'code', label: _('hospitality_core.col.code'), required: true },
|
|
2711
|
+
{ name: 'name', label: _('hospitality_core.col.name'), required: true },
|
|
2712
|
+
{
|
|
2713
|
+
name: 'rateType',
|
|
2714
|
+
label: _('hospitality_core.col.rateType'),
|
|
2715
|
+
type: 'select',
|
|
2716
|
+
value: 'nightly',
|
|
2717
|
+
options: ['nightly', 'hourly', 'weekly', 'monthly'].map((value) => ({
|
|
2718
|
+
value,
|
|
2719
|
+
label: _(`hospitality_core.bookingType.${value}`),
|
|
2720
|
+
})),
|
|
2721
|
+
required: true,
|
|
2722
|
+
},
|
|
2723
|
+
{ name: 'amount', label: _('hospitality_core.col.amount'), type: 'decimal', required: true },
|
|
2724
|
+
{
|
|
2725
|
+
name: 'mealPlan',
|
|
2726
|
+
label: _('hospitality_core.col.mealPlan'),
|
|
2727
|
+
type: 'select',
|
|
2728
|
+
options: [
|
|
2729
|
+
{ value: '', label: '—' },
|
|
2730
|
+
...['RO', 'BB', 'HB', 'FB', 'AI'].map((value) => ({
|
|
2731
|
+
value,
|
|
2732
|
+
label: _(`hospitality_core.mealPlan.${value}`),
|
|
2733
|
+
})),
|
|
2734
|
+
],
|
|
2735
|
+
},
|
|
2736
|
+
{ name: 'minStay', label: _('hospitality_core.field.minStay'), type: 'number', value: 0 },
|
|
2737
|
+
{ name: 'maxStay', label: _('hospitality_core.field.maxStay'), type: 'number', value: 0 },
|
|
2738
|
+
{
|
|
2739
|
+
name: 'isDefault',
|
|
2740
|
+
label: _('hospitality_core.field.isDefault'),
|
|
2741
|
+
type: 'checkbox',
|
|
2742
|
+
help: _('hospitality_core.field.isDefaultHint'),
|
|
2743
|
+
},
|
|
2744
|
+
{ name: 'active', label: _('hospitality_core.field.active'), type: 'checkbox', value: true },
|
|
2745
|
+
] })) : (emptyState(_('hospitality_core.screen.ratePlans.noRoomTypes'), _('hospitality_core.screen.ratePlans.noRoomTypesHint'))) }),
|
|
2746
|
+
_jsx(Section, { title: _('hospitality_core.screen.ratePlans.list'), body: rows.length
|
|
2747
|
+
? dataTable(_, { columns: ratePlanColumns(_), rows, id: (row) => row.id })
|
|
2748
|
+
: emptyState(_('hospitality_core.screen.ratePlans.empty'), _('hospitality_core.screen.ratePlans.emptyHint')) }),
|
|
2749
|
+
]) }));
|
|
2750
|
+
export const inventoryScreen = (_, rows, properties, roomTypes, selected, frame, state) => {
|
|
2751
|
+
const selectedRoomTypes = roomTypes.filter((row) => row.propertyId === selected.propertyId);
|
|
2752
|
+
const hidden = {
|
|
2753
|
+
propertyId: selected.propertyId ?? '',
|
|
2754
|
+
roomTypeId: selected.roomTypeId ?? '',
|
|
2755
|
+
};
|
|
2756
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.inventory.title'), frame: frame, body: stack([
|
|
2757
|
+
feedback(_, state),
|
|
2758
|
+
_jsx(FormCluster, { label: _('hospitality_core.screen.inventory.filters'), forms: [
|
|
2759
|
+
_jsx(RecordForm, { action: "/admin/hospitality/inventory", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { from: selected.from, to: selected.to }, fields: [
|
|
2760
|
+
{
|
|
2761
|
+
name: 'property',
|
|
2762
|
+
label: _('hospitality_core.menu.properties'),
|
|
2763
|
+
type: 'select',
|
|
2764
|
+
value: selected.propertyId,
|
|
2765
|
+
options: choices(properties),
|
|
2766
|
+
required: true,
|
|
2767
|
+
},
|
|
2768
|
+
{
|
|
2769
|
+
name: 'roomType',
|
|
2770
|
+
label: _('hospitality_core.col.roomType'),
|
|
2771
|
+
type: 'select',
|
|
2772
|
+
value: selected.roomTypeId,
|
|
2773
|
+
options: choices(selectedRoomTypes),
|
|
2774
|
+
required: true,
|
|
2775
|
+
},
|
|
2776
|
+
] }),
|
|
2777
|
+
datePicker({
|
|
2778
|
+
action: '/admin/hospitality/inventory',
|
|
2779
|
+
label: _('hospitality_core.screen.inventory.dateRange'),
|
|
2780
|
+
fields: [
|
|
2781
|
+
{
|
|
2782
|
+
name: 'from',
|
|
2783
|
+
label: _('hospitality_core.field.from'),
|
|
2784
|
+
value: selected.from,
|
|
2785
|
+
required: true,
|
|
2786
|
+
},
|
|
2787
|
+
{ name: 'to', label: _('hospitality_core.field.to'), value: selected.to, required: true },
|
|
2788
|
+
],
|
|
2789
|
+
hidden: {
|
|
2790
|
+
property: selected.propertyId ?? '',
|
|
2791
|
+
roomType: selected.roomTypeId ?? '',
|
|
2792
|
+
},
|
|
2793
|
+
submit: _('hospitality_core.action.apply'),
|
|
2794
|
+
}),
|
|
2795
|
+
] }),
|
|
2796
|
+
cardGrid({
|
|
2797
|
+
items: [
|
|
2798
|
+
{ id: 'days', label: _('hospitality_core.metric.inventoryDays'), value: rows.length },
|
|
2799
|
+
{
|
|
2800
|
+
id: 'available',
|
|
2801
|
+
label: _('hospitality_core.metric.minimumAvailable'),
|
|
2802
|
+
value: rows.length ? Math.min(...rows.map((row) => row.available)) : 0,
|
|
2803
|
+
},
|
|
2804
|
+
{
|
|
2805
|
+
id: 'sold',
|
|
2806
|
+
label: _('hospitality_core.metric.sold'),
|
|
2807
|
+
value: rows.reduce((sum, row) => sum + row.sold, 0),
|
|
2808
|
+
},
|
|
2809
|
+
{
|
|
2810
|
+
id: 'blocked',
|
|
2811
|
+
label: _('hospitality_core.metric.blocked'),
|
|
2812
|
+
value: rows.reduce((sum, row) => sum + row.blocked, 0),
|
|
2813
|
+
},
|
|
2814
|
+
],
|
|
2815
|
+
id: (item) => item.id,
|
|
2816
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
2817
|
+
}),
|
|
2818
|
+
_jsx(Section, { title: _('hospitality_core.screen.inventory.allotment'), description: _('hospitality_core.screen.inventory.allotmentHint'), body: selected.roomTypeId ? (_jsx(RecordForm, { action: "/admin/hospitality/inventory", method: "post", submit: _('hospitality_core.action.updateAllotment'), submitVariant: "primary", hidden: { ...hidden, operation: 'set-inventory' }, fields: [
|
|
2819
|
+
{
|
|
2820
|
+
name: 'from',
|
|
2821
|
+
label: _('hospitality_core.field.from'),
|
|
2822
|
+
type: 'date',
|
|
2823
|
+
value: selected.from,
|
|
2824
|
+
required: true,
|
|
2825
|
+
},
|
|
2826
|
+
{
|
|
2827
|
+
name: 'to',
|
|
2828
|
+
label: _('hospitality_core.field.to'),
|
|
2829
|
+
type: 'date',
|
|
2830
|
+
value: selected.to,
|
|
2831
|
+
required: true,
|
|
2832
|
+
},
|
|
2833
|
+
{ name: 'total', label: _('hospitality_core.col.total'), type: 'number', required: true },
|
|
2834
|
+
{ name: 'blocked', label: _('hospitality_core.col.blocked'), type: 'number' },
|
|
2835
|
+
] })) : (emptyState(_('hospitality_core.screen.inventory.noRoomType'), _('hospitality_core.screen.inventory.noRoomTypeHint'))) }),
|
|
2836
|
+
_jsx(Section, { title: _('hospitality_core.screen.inventory.restrictions'), description: _('hospitality_core.screen.inventory.restrictionsHint'), body: selected.roomTypeId ? (_jsx(RecordForm, { action: "/admin/hospitality/inventory", method: "post", submit: _('hospitality_core.action.updateRestrictions'), submitVariant: "secondary", hidden: { ...hidden, operation: 'set-restrictions' }, fields: [
|
|
2837
|
+
{
|
|
2838
|
+
name: 'from',
|
|
2839
|
+
label: _('hospitality_core.field.from'),
|
|
2840
|
+
type: 'date',
|
|
2841
|
+
value: selected.from,
|
|
2842
|
+
required: true,
|
|
2843
|
+
},
|
|
2844
|
+
{
|
|
2845
|
+
name: 'to',
|
|
2846
|
+
label: _('hospitality_core.field.to'),
|
|
2847
|
+
type: 'date',
|
|
2848
|
+
value: selected.to,
|
|
2849
|
+
required: true,
|
|
2850
|
+
},
|
|
2851
|
+
{ name: 'minLos', label: _('hospitality_core.field.minLos'), type: 'number', value: 0 },
|
|
2852
|
+
{ name: 'maxLos', label: _('hospitality_core.field.maxLos'), type: 'number', value: 0 },
|
|
2853
|
+
{ name: 'stopSell', label: _('hospitality_core.restriction.stopSell'), type: 'checkbox' },
|
|
2854
|
+
{ name: 'closedToArrival', label: _('hospitality_core.restriction.cta'), type: 'checkbox' },
|
|
2855
|
+
{
|
|
2856
|
+
name: 'closedToDeparture',
|
|
2857
|
+
label: _('hospitality_core.restriction.ctd'),
|
|
2858
|
+
type: 'checkbox',
|
|
2859
|
+
},
|
|
2860
|
+
] })) : null }),
|
|
2861
|
+
rows.length
|
|
2862
|
+
? dataTable(_, { columns: inventoryColumns(_), rows, id: (row) => row.id })
|
|
2863
|
+
: emptyState(_('hospitality_core.screen.inventory.empty'), _('hospitality_core.screen.inventory.emptyHint')),
|
|
2864
|
+
]) }));
|
|
2865
|
+
};
|
|
2866
|
+
const reservationColumns = (_, locale, timezone) => [
|
|
2867
|
+
{
|
|
2868
|
+
key: 'code',
|
|
2869
|
+
label: _('hospitality_core.col.code'),
|
|
2870
|
+
cell: (row) => linkButton({
|
|
2871
|
+
label: row.code,
|
|
2872
|
+
href: `/admin/hospitality/reservations/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
2873
|
+
variant: 'tertiary',
|
|
2874
|
+
size: 'compact',
|
|
2875
|
+
}),
|
|
2876
|
+
kind: 'identifier',
|
|
2877
|
+
},
|
|
2878
|
+
{
|
|
2879
|
+
key: 'guest',
|
|
2880
|
+
label: _('hospitality_core.col.guest'),
|
|
2881
|
+
cell: (row) => person(guestName(row)),
|
|
2882
|
+
kind: 'person',
|
|
2883
|
+
priority: 'primary',
|
|
2884
|
+
},
|
|
2885
|
+
{
|
|
2886
|
+
key: 'provider',
|
|
2887
|
+
label: _('hospitality_core.col.provider'),
|
|
2888
|
+
cell: (row) => badge(providerName(_, row.provider), 'neutral'),
|
|
2889
|
+
kind: 'status',
|
|
2890
|
+
},
|
|
2891
|
+
{
|
|
2892
|
+
key: 'roomType',
|
|
2893
|
+
label: _('hospitality_core.col.roomType'),
|
|
2894
|
+
cell: (row) => row.roomType?.name ?? code(row.roomTypeId),
|
|
2895
|
+
},
|
|
2896
|
+
{
|
|
2897
|
+
key: 'checkIn',
|
|
2898
|
+
label: _('hospitality_core.col.checkIn'),
|
|
2899
|
+
cell: (row) => dateTime(row.checkIn, locale, timezone),
|
|
2900
|
+
kind: 'date',
|
|
2901
|
+
},
|
|
2902
|
+
{
|
|
2903
|
+
key: 'checkOut',
|
|
2904
|
+
label: _('hospitality_core.col.checkOut'),
|
|
2905
|
+
cell: (row) => dateTime(row.checkOut, locale, timezone),
|
|
2906
|
+
kind: 'date',
|
|
2907
|
+
},
|
|
2908
|
+
{
|
|
2909
|
+
key: 'amount',
|
|
2910
|
+
label: _('hospitality_core.col.amount'),
|
|
2911
|
+
cell: (row) => formatMoney(_, row.amountTotal),
|
|
2912
|
+
align: 'end',
|
|
2913
|
+
kind: 'currency',
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
key: 'status',
|
|
2917
|
+
label: _('hospitality_core.col.status'),
|
|
2918
|
+
cell: (row) => badge(_(`hospitality_core.reservationState.${row.state}`), workflowTone(row.state), row.state),
|
|
2919
|
+
kind: 'status',
|
|
2920
|
+
priority: 'primary',
|
|
2921
|
+
},
|
|
2922
|
+
];
|
|
2923
|
+
const stayColumns = (_, locale, timezone) => [
|
|
2924
|
+
{
|
|
2925
|
+
key: 'code',
|
|
2926
|
+
label: _('hospitality_core.col.code'),
|
|
2927
|
+
cell: (row) => linkButton({
|
|
2928
|
+
label: row.code,
|
|
2929
|
+
href: `/admin/hospitality/stays/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
2930
|
+
variant: 'tertiary',
|
|
2931
|
+
size: 'compact',
|
|
2932
|
+
}),
|
|
2933
|
+
kind: 'identifier',
|
|
2934
|
+
},
|
|
2935
|
+
{
|
|
2936
|
+
key: 'guest',
|
|
2937
|
+
label: _('hospitality_core.col.guest'),
|
|
2938
|
+
cell: (row) => person(guestName(row)),
|
|
2939
|
+
kind: 'person',
|
|
2940
|
+
priority: 'primary',
|
|
2941
|
+
},
|
|
2942
|
+
{
|
|
2943
|
+
key: 'room',
|
|
2944
|
+
label: _('hospitality_core.col.room'),
|
|
2945
|
+
cell: (row) => row.currentRoom?.name ?? row.currentRoom?.code ?? '—',
|
|
2946
|
+
},
|
|
2947
|
+
{
|
|
2948
|
+
key: 'checkIn',
|
|
2949
|
+
label: _('hospitality_core.col.checkIn'),
|
|
2950
|
+
cell: (row) => dateTime(row.checkIn, locale, timezone),
|
|
2951
|
+
kind: 'date',
|
|
2952
|
+
},
|
|
2953
|
+
{
|
|
2954
|
+
key: 'checkOut',
|
|
2955
|
+
label: _('hospitality_core.col.checkOut'),
|
|
2956
|
+
cell: (row) => dateTime(row.checkOut, locale, timezone),
|
|
2957
|
+
kind: 'date',
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
key: 'guests',
|
|
2961
|
+
label: _('hospitality_core.col.guests'),
|
|
2962
|
+
cell: (row) => String(row.adults + row.children),
|
|
2963
|
+
align: 'end',
|
|
2964
|
+
kind: 'number',
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
key: 'status',
|
|
2968
|
+
label: _('hospitality_core.col.status'),
|
|
2969
|
+
cell: (row) => badge(_(`hospitality_core.stayState.${row.state}`), workflowTone(row.state), row.state),
|
|
2970
|
+
kind: 'status',
|
|
2971
|
+
priority: 'primary',
|
|
2972
|
+
},
|
|
2973
|
+
];
|
|
2974
|
+
const folioColumns = (_, locale, timezone) => [
|
|
2975
|
+
{
|
|
2976
|
+
key: 'code',
|
|
2977
|
+
label: _('hospitality_core.col.code'),
|
|
2978
|
+
cell: (row) => linkButton({
|
|
2979
|
+
label: row.code,
|
|
2980
|
+
href: `/admin/hospitality/folios/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
2981
|
+
variant: 'tertiary',
|
|
2982
|
+
size: 'compact',
|
|
2983
|
+
}),
|
|
2984
|
+
kind: 'identifier',
|
|
2985
|
+
},
|
|
2986
|
+
{
|
|
2987
|
+
key: 'guest',
|
|
2988
|
+
label: _('hospitality_core.col.guest'),
|
|
2989
|
+
cell: (row) => person(guestName(row)),
|
|
2990
|
+
kind: 'person',
|
|
2991
|
+
priority: 'primary',
|
|
2992
|
+
},
|
|
2993
|
+
{
|
|
2994
|
+
key: 'opened',
|
|
2995
|
+
label: _('hospitality_core.col.checkIn'),
|
|
2996
|
+
cell: (row) => dateTime(row.openedAt, locale, timezone),
|
|
2997
|
+
kind: 'date',
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
key: 'stays',
|
|
3001
|
+
label: _('hospitality_core.col.stays'),
|
|
3002
|
+
cell: (row) => String(row.stays?.length ?? 0),
|
|
3003
|
+
align: 'end',
|
|
3004
|
+
kind: 'number',
|
|
3005
|
+
},
|
|
3006
|
+
{
|
|
3007
|
+
key: 'amount',
|
|
3008
|
+
label: _('hospitality_core.col.amount'),
|
|
3009
|
+
cell: (row) => formatMoney(_, row.amountTotal),
|
|
3010
|
+
align: 'end',
|
|
3011
|
+
kind: 'currency',
|
|
3012
|
+
},
|
|
3013
|
+
{
|
|
3014
|
+
key: 'status',
|
|
3015
|
+
label: _('hospitality_core.col.status'),
|
|
3016
|
+
cell: (row) => badge(_(`hospitality_core.folioState.${row.state}`), workflowTone(row.state), row.state),
|
|
3017
|
+
kind: 'status',
|
|
3018
|
+
priority: 'primary',
|
|
3019
|
+
},
|
|
3020
|
+
];
|
|
3021
|
+
const folioChargeColumns = (_, locale, timezone, stays) => [
|
|
3022
|
+
{
|
|
3023
|
+
key: 'occurred',
|
|
3024
|
+
label: _('hospitality_core.folio.charge.occurredAt'),
|
|
3025
|
+
cell: (row) => dateTime(row.occurredAt, locale, timezone),
|
|
3026
|
+
kind: 'date',
|
|
3027
|
+
},
|
|
3028
|
+
{
|
|
3029
|
+
key: 'description',
|
|
3030
|
+
label: _('hospitality_core.folio.charge.description'),
|
|
3031
|
+
cell: (row) => row.type === 'room' && row.description.startsWith('room:')
|
|
3032
|
+
? _('hospitality_core.folio.charge.roomDescription')
|
|
3033
|
+
: row.description,
|
|
3034
|
+
priority: 'primary',
|
|
3035
|
+
},
|
|
3036
|
+
{
|
|
3037
|
+
key: 'type',
|
|
3038
|
+
label: _('hospitality_core.folio.charge.type'),
|
|
3039
|
+
cell: (row) => badge(_(`hospitality_core.charge.${row.type}`), 'info', row.type),
|
|
3040
|
+
kind: 'status',
|
|
3041
|
+
},
|
|
3042
|
+
{
|
|
3043
|
+
key: 'stay',
|
|
3044
|
+
label: _('hospitality_core.col.stays'),
|
|
3045
|
+
cell: (row) => (row.stayId ? code(stays.get(row.stayId)?.code ?? row.stayId) : '—'),
|
|
3046
|
+
},
|
|
3047
|
+
{
|
|
3048
|
+
key: 'quantity',
|
|
3049
|
+
label: _('hospitality_core.folio.charge.quantity'),
|
|
3050
|
+
cell: (row) => String(row.quantity),
|
|
3051
|
+
align: 'end',
|
|
3052
|
+
kind: 'number',
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
key: 'unit-price',
|
|
3056
|
+
label: _('hospitality_core.folio.charge.unitPrice'),
|
|
3057
|
+
cell: (row) => formatMoney(_, row.unitPrice),
|
|
3058
|
+
align: 'end',
|
|
3059
|
+
kind: 'currency',
|
|
3060
|
+
},
|
|
3061
|
+
{
|
|
3062
|
+
key: 'amount',
|
|
3063
|
+
label: _('hospitality_core.col.amount'),
|
|
3064
|
+
cell: (row) => formatMoney(_, row.amount),
|
|
3065
|
+
align: 'end',
|
|
3066
|
+
kind: 'currency',
|
|
3067
|
+
},
|
|
3068
|
+
{
|
|
3069
|
+
key: 'correction',
|
|
3070
|
+
label: _('hospitality_core.folio.field.voidReason'),
|
|
3071
|
+
cell: (row) => row.voidReason || '—',
|
|
3072
|
+
},
|
|
3073
|
+
{
|
|
3074
|
+
key: 'status',
|
|
3075
|
+
label: _('hospitality_core.col.status'),
|
|
3076
|
+
cell: (row) => badge(_(`hospitality_core.chargeState.${row.state}`), row.state === 'active' ? 'positive' : 'neutral', row.state),
|
|
3077
|
+
kind: 'status',
|
|
3078
|
+
},
|
|
3079
|
+
];
|
|
3080
|
+
const folioStayColumns = (_, locale, timezone) => [
|
|
3081
|
+
{
|
|
3082
|
+
key: 'code',
|
|
3083
|
+
label: _('hospitality_core.col.code'),
|
|
3084
|
+
cell: (row) => linkButton({
|
|
3085
|
+
label: row.code,
|
|
3086
|
+
href: `/admin/hospitality/stays/${encodeURIComponent(row.id)}?lang=${encodeURIComponent(locale)}`,
|
|
3087
|
+
variant: 'tertiary',
|
|
3088
|
+
size: 'compact',
|
|
3089
|
+
}),
|
|
3090
|
+
kind: 'identifier',
|
|
3091
|
+
priority: 'primary',
|
|
3092
|
+
},
|
|
3093
|
+
{
|
|
3094
|
+
key: 'check-in',
|
|
3095
|
+
label: _('hospitality_core.col.checkIn'),
|
|
3096
|
+
cell: (row) => dateTime(row.checkIn, locale, timezone),
|
|
3097
|
+
kind: 'date',
|
|
3098
|
+
},
|
|
3099
|
+
{
|
|
3100
|
+
key: 'check-out',
|
|
3101
|
+
label: _('hospitality_core.col.checkOut'),
|
|
3102
|
+
cell: (row) => dateTime(row.checkOut, locale, timezone),
|
|
3103
|
+
kind: 'date',
|
|
3104
|
+
},
|
|
3105
|
+
{
|
|
3106
|
+
key: 'status',
|
|
3107
|
+
label: _('hospitality_core.col.status'),
|
|
3108
|
+
cell: (row) => badge(_(`hospitality_core.stayState.${row.state}`), workflowTone(row.state), row.state),
|
|
3109
|
+
kind: 'status',
|
|
3110
|
+
},
|
|
3111
|
+
];
|
|
3112
|
+
export const frontDeskScreen = (_, rows, overdueRows, totals, locale, timezone, frame) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.frontDesk.title'), frame: frame, body: stack([
|
|
3113
|
+
cardGrid({
|
|
3114
|
+
items: [
|
|
3115
|
+
{ id: 'arrivals', label: _('hospitality_core.metric.arrivals'), value: totals.arrivals },
|
|
3116
|
+
{ id: 'in-house', label: _('hospitality_core.metric.inHouse'), value: totals.inHouse },
|
|
3117
|
+
{ id: 'departures', label: _('hospitality_core.metric.departures'), value: totals.departures },
|
|
3118
|
+
{ id: 'overdue', label: _('hospitality_core.metric.overdue'), value: totals.overdue },
|
|
3119
|
+
{ id: 'folios', label: _('hospitality_core.metric.openFolios'), value: totals.openFolios },
|
|
3120
|
+
],
|
|
3121
|
+
id: (item) => item.id,
|
|
3122
|
+
card: (item) => metric({ label: item.label, value: String(item.value), tone: item.id }),
|
|
3123
|
+
}),
|
|
3124
|
+
overdueRows.length ? (_jsx(Section, { title: _('hospitality_core.screen.frontDesk.overdue'), description: _('hospitality_core.screen.frontDesk.overdueHint', {
|
|
3125
|
+
count: overdueRows.length,
|
|
3126
|
+
}), body: dataTable(_, {
|
|
3127
|
+
columns: stayColumns(_, locale, timezone),
|
|
3128
|
+
rows: overdueRows,
|
|
3129
|
+
id: (row) => row.id,
|
|
3130
|
+
}) })) : null,
|
|
3131
|
+
rows.length
|
|
3132
|
+
? dataTable(_, { columns: stayColumns(_, locale, timezone), rows, id: (row) => row.id })
|
|
3133
|
+
: emptyState(_('hospitality_core.screen.frontDesk.empty'), _('hospitality_core.screen.frontDesk.emptyHint')),
|
|
3134
|
+
]) }));
|
|
3135
|
+
const reservationFeedback = (_, status) => {
|
|
3136
|
+
if (status === 'saved')
|
|
3137
|
+
return notice({
|
|
3138
|
+
title: _('hospitality_core.reservation.feedback.saved'),
|
|
3139
|
+
message: _('hospitality_core.reservation.feedback.savedHint'),
|
|
3140
|
+
tone: 'positive',
|
|
3141
|
+
});
|
|
3142
|
+
if (status === 'quoted')
|
|
3143
|
+
return notice({
|
|
3144
|
+
title: _('hospitality_core.reservation.feedback.quoted'),
|
|
3145
|
+
message: _('hospitality_core.reservation.feedback.quotedHint'),
|
|
3146
|
+
tone: 'info',
|
|
3147
|
+
});
|
|
3148
|
+
if (status === 'invalid')
|
|
3149
|
+
return notice({
|
|
3150
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
3151
|
+
message: _('hospitality_core.reservation.feedback.invalidHint'),
|
|
3152
|
+
tone: 'danger',
|
|
3153
|
+
});
|
|
3154
|
+
return null;
|
|
3155
|
+
};
|
|
3156
|
+
export const reservationsScreen = (_, data, locale, timezone, frame, status) => {
|
|
3157
|
+
const errors = (data.quote?.errors ?? []).map((error) => error.messageKey ? _(error.messageKey, error.params) : _('hospitality_core.feedback.invalid'));
|
|
3158
|
+
const quote = data.quote?.ok ? data.quote : null;
|
|
3159
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.reservations.title'), frame: frame, body: stack([
|
|
3160
|
+
reservationFeedback(_, status),
|
|
3161
|
+
_jsx(RecordForm, { action: "/admin/hospitality/reservations", method: "get", layout: "inline", submit: _('hospitality_core.action.select'), submitVariant: "secondary", hidden: { lang: locale }, fields: [
|
|
3162
|
+
{
|
|
3163
|
+
name: 'property',
|
|
3164
|
+
label: _('hospitality_core.reservation.field.property'),
|
|
3165
|
+
type: 'select',
|
|
3166
|
+
value: data.values.propertyId,
|
|
3167
|
+
options: choices(data.properties),
|
|
3168
|
+
required: true,
|
|
3169
|
+
},
|
|
3170
|
+
] }),
|
|
3171
|
+
_jsx(Section, { title: _('hospitality_core.reservation.section.intake'), description: _('hospitality_core.reservation.section.intakeHint'), body: data.roomTypes.length && data.partners.length ? (_jsx(RecordForm, { action: "/admin/hospitality/reservations", method: "post", submit: _('hospitality_core.reservation.action.quote'), submitVariant: "primary", errors: errors, hidden: {
|
|
3172
|
+
operation: 'quote',
|
|
3173
|
+
lang: locale,
|
|
3174
|
+
property: data.values.propertyId,
|
|
3175
|
+
id: data.values.id,
|
|
3176
|
+
}, fields: [
|
|
3177
|
+
{
|
|
3178
|
+
name: 'code',
|
|
3179
|
+
label: _('hospitality_core.reservation.field.code'),
|
|
3180
|
+
value: data.values.code,
|
|
3181
|
+
help: _('hospitality_core.reservation.field.codeHint'),
|
|
3182
|
+
},
|
|
3183
|
+
{
|
|
3184
|
+
name: 'partnerId',
|
|
3185
|
+
label: _('hospitality_core.reservation.field.guest'),
|
|
3186
|
+
type: 'select',
|
|
3187
|
+
value: data.values.partnerId,
|
|
3188
|
+
options: [
|
|
3189
|
+
{ value: '', label: _('hospitality_core.reservation.value.selectGuest') },
|
|
3190
|
+
...choices(data.partners),
|
|
3191
|
+
],
|
|
3192
|
+
required: true,
|
|
3193
|
+
},
|
|
3194
|
+
{
|
|
3195
|
+
name: 'roomTypeId',
|
|
3196
|
+
label: _('hospitality_core.reservation.field.roomType'),
|
|
3197
|
+
type: 'select',
|
|
3198
|
+
value: data.values.roomTypeId,
|
|
3199
|
+
options: choices(data.roomTypes),
|
|
3200
|
+
required: true,
|
|
3201
|
+
},
|
|
3202
|
+
{
|
|
3203
|
+
name: 'bookingType',
|
|
3204
|
+
label: _('hospitality_core.reservation.field.bookingType'),
|
|
3205
|
+
type: 'select',
|
|
3206
|
+
value: data.values.bookingType,
|
|
3207
|
+
options: ['nightly', 'weekly', 'monthly'].map((value) => ({
|
|
3208
|
+
value,
|
|
3209
|
+
label: _(`hospitality_core.bookingType.${value}`),
|
|
3210
|
+
})),
|
|
3211
|
+
required: true,
|
|
3212
|
+
},
|
|
3213
|
+
{
|
|
3214
|
+
name: 'checkIn',
|
|
3215
|
+
label: _('hospitality_core.col.checkIn'),
|
|
3216
|
+
type: 'datetime-local',
|
|
3217
|
+
value: data.values.checkIn,
|
|
3218
|
+
required: true,
|
|
3219
|
+
},
|
|
3220
|
+
{
|
|
3221
|
+
name: 'checkOut',
|
|
3222
|
+
label: _('hospitality_core.col.checkOut'),
|
|
3223
|
+
type: 'datetime-local',
|
|
3224
|
+
value: data.values.checkOut,
|
|
3225
|
+
required: true,
|
|
3226
|
+
},
|
|
3227
|
+
{
|
|
3228
|
+
name: 'adults',
|
|
3229
|
+
label: _('hospitality_core.reservation.field.adults'),
|
|
3230
|
+
type: 'number',
|
|
3231
|
+
value: data.values.adults,
|
|
3232
|
+
required: true,
|
|
3233
|
+
step: '1',
|
|
3234
|
+
},
|
|
3235
|
+
{
|
|
3236
|
+
name: 'children',
|
|
3237
|
+
label: _('hospitality_core.reservation.field.children'),
|
|
3238
|
+
type: 'number',
|
|
3239
|
+
value: data.values.children,
|
|
3240
|
+
required: true,
|
|
3241
|
+
step: '1',
|
|
3242
|
+
},
|
|
3243
|
+
{
|
|
3244
|
+
name: 'rate',
|
|
3245
|
+
label: _('hospitality_core.reservation.field.rate'),
|
|
3246
|
+
type: 'decimal',
|
|
3247
|
+
value: data.values.rate,
|
|
3248
|
+
help: _('hospitality_core.reservation.field.rateHint'),
|
|
3249
|
+
},
|
|
3250
|
+
] })) : (emptyState(data.roomTypes.length
|
|
3251
|
+
? _('hospitality_core.reservation.empty.partners')
|
|
3252
|
+
: _('hospitality_core.reservation.empty.roomTypes'), data.roomTypes.length
|
|
3253
|
+
? _('hospitality_core.reservation.empty.partnersHint')
|
|
3254
|
+
: _('hospitality_core.reservation.empty.roomTypesHint'))) }),
|
|
3255
|
+
...(quote
|
|
3256
|
+
? [
|
|
3257
|
+
_jsx(Section, { title: _('hospitality_core.reservation.section.quote'), description: _('hospitality_core.reservation.section.quoteHint'), body: stack([
|
|
3258
|
+
cardGrid({
|
|
3259
|
+
items: [
|
|
3260
|
+
{
|
|
3261
|
+
id: 'rate',
|
|
3262
|
+
label: _('hospitality_core.reservation.quote.rate'),
|
|
3263
|
+
value: formatMoney(_, quote.rate ?? 0),
|
|
3264
|
+
},
|
|
3265
|
+
{
|
|
3266
|
+
id: 'quantity',
|
|
3267
|
+
label: _('hospitality_core.reservation.quote.quantity'),
|
|
3268
|
+
value: String(quote.quantity ?? 0),
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
id: 'availability',
|
|
3272
|
+
label: _('hospitality_core.reservation.quote.availability'),
|
|
3273
|
+
value: String(quote.minimumAvailable ?? 0),
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
id: 'total',
|
|
3277
|
+
label: _('hospitality_core.reservation.quote.total'),
|
|
3278
|
+
value: formatMoney(_, quote.amountTotal ?? 0),
|
|
3279
|
+
},
|
|
3280
|
+
],
|
|
3281
|
+
id: (item) => item.id,
|
|
3282
|
+
card: (item) => metric({ label: item.label, value: item.value, tone: item.id }),
|
|
3283
|
+
}),
|
|
3284
|
+
_jsx(RecordForm, { action: "/admin/hospitality/reservations", method: "post", submit: _('hospitality_core.reservation.action.create'), submitVariant: "primary", hidden: {
|
|
3285
|
+
operation: 'create',
|
|
3286
|
+
lang: locale,
|
|
3287
|
+
property: data.values.propertyId,
|
|
3288
|
+
id: data.values.id,
|
|
3289
|
+
code: data.values.code,
|
|
3290
|
+
partnerId: data.values.partnerId,
|
|
3291
|
+
roomTypeId: data.values.roomTypeId,
|
|
3292
|
+
bookingType: data.values.bookingType,
|
|
3293
|
+
checkIn: data.values.checkIn,
|
|
3294
|
+
checkOut: data.values.checkOut,
|
|
3295
|
+
adults: String(data.values.adults),
|
|
3296
|
+
children: String(data.values.children),
|
|
3297
|
+
rate: String(quote.rate ?? ''),
|
|
3298
|
+
}, fields: [] }),
|
|
3299
|
+
]) }),
|
|
3300
|
+
]
|
|
3301
|
+
: []),
|
|
3302
|
+
_jsx(Section, { title: _('hospitality_core.reservation.section.list'), description: _('hospitality_core.reservation.section.listHint'), body: data.rows.length
|
|
3303
|
+
? dataTable(_, {
|
|
3304
|
+
columns: reservationColumns(_, locale, timezone),
|
|
3305
|
+
rows: data.rows,
|
|
3306
|
+
id: (row) => row.id,
|
|
3307
|
+
})
|
|
3308
|
+
: emptyState(_('hospitality_core.screen.reservations.empty'), _('hospitality_core.screen.reservations.emptyHint')) }),
|
|
3309
|
+
]) }));
|
|
3310
|
+
};
|
|
3311
|
+
const reservationDetailFeedback = (_, status, errors = []) => {
|
|
3312
|
+
if (status === 'checked-in')
|
|
3313
|
+
return notice({
|
|
3314
|
+
title: _('hospitality_core.reservation.feedback.checkedIn'),
|
|
3315
|
+
message: _('hospitality_core.reservation.feedback.checkedInHint'),
|
|
3316
|
+
tone: 'positive',
|
|
3317
|
+
});
|
|
3318
|
+
if (status === 'checked-out')
|
|
3319
|
+
return notice({
|
|
3320
|
+
title: _('hospitality_core.reservation.feedback.checkedOut'),
|
|
3321
|
+
message: _('hospitality_core.reservation.feedback.checkedOutHint'),
|
|
3322
|
+
tone: 'positive',
|
|
3323
|
+
});
|
|
3324
|
+
if (status === 'checked-out-early')
|
|
3325
|
+
return notice({
|
|
3326
|
+
title: _('hospitality_core.reservation.feedback.checkedOutEarly'),
|
|
3327
|
+
message: _('hospitality_core.reservation.feedback.checkedOutEarlyHint'),
|
|
3328
|
+
tone: 'warning',
|
|
3329
|
+
});
|
|
3330
|
+
if (status === 'cancelled')
|
|
3331
|
+
return notice({
|
|
3332
|
+
title: _('hospitality_core.reservation.feedback.cancelled'),
|
|
3333
|
+
message: _('hospitality_core.reservation.feedback.cancelledHint'),
|
|
3334
|
+
tone: 'warning',
|
|
3335
|
+
});
|
|
3336
|
+
if (status === 'amended')
|
|
3337
|
+
return notice({
|
|
3338
|
+
title: _('hospitality_core.reservation.feedback.amended'),
|
|
3339
|
+
message: _('hospitality_core.reservation.feedback.amendedHint'),
|
|
3340
|
+
tone: 'positive',
|
|
3341
|
+
});
|
|
3342
|
+
if (status === 'departure-adjusted')
|
|
3343
|
+
return notice({
|
|
3344
|
+
title: _('hospitality_core.reservation.feedback.departureAdjusted'),
|
|
3345
|
+
message: _('hospitality_core.reservation.feedback.departureAdjustedHint'),
|
|
3346
|
+
tone: 'positive',
|
|
3347
|
+
});
|
|
3348
|
+
if (status === 'no-show')
|
|
3349
|
+
return notice({
|
|
3350
|
+
title: _('hospitality_core.reservation.feedback.noShow'),
|
|
3351
|
+
message: _('hospitality_core.reservation.feedback.noShowHint'),
|
|
3352
|
+
tone: 'warning',
|
|
3353
|
+
});
|
|
3354
|
+
if (errors.length)
|
|
3355
|
+
return notice({
|
|
3356
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
3357
|
+
message: errors.join(' '),
|
|
3358
|
+
tone: 'danger',
|
|
3359
|
+
});
|
|
3360
|
+
return null;
|
|
3361
|
+
};
|
|
3362
|
+
export const reservationDetailScreen = (_, reservation, rooms, roomTypes, partners, amendment, departure, locale, timezone, frame, status, errors = []) => {
|
|
3363
|
+
const guest = guestName(reservation);
|
|
3364
|
+
const room = reservation.stay?.currentRoom;
|
|
3365
|
+
const backHref = `/admin/hospitality/reservations?property=${encodeURIComponent(reservation.propertyId)}&lang=${encodeURIComponent(locale)}`;
|
|
3366
|
+
const action = `/admin/hospitality/reservations/${encodeURIComponent(reservation.id)}?lang=${encodeURIComponent(locale)}`;
|
|
3367
|
+
const actions = [];
|
|
3368
|
+
if (reservation.state === 'confirmed' && reservation.provider === 'direct') {
|
|
3369
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.reservation.action.amend'), description: _('hospitality_core.reservation.action.amendHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.reservation.action.amend'), submitVariant: "secondary", hidden: { operation: 'amend', lang: locale }, fields: [
|
|
3370
|
+
{
|
|
3371
|
+
name: 'partnerId',
|
|
3372
|
+
label: _('hospitality_core.reservation.field.guest'),
|
|
3373
|
+
type: 'select',
|
|
3374
|
+
value: amendment.partnerId,
|
|
3375
|
+
options: choices(partners),
|
|
3376
|
+
required: true,
|
|
3377
|
+
},
|
|
3378
|
+
{
|
|
3379
|
+
name: 'roomTypeId',
|
|
3380
|
+
label: _('hospitality_core.reservation.field.roomType'),
|
|
3381
|
+
type: 'select',
|
|
3382
|
+
value: amendment.roomTypeId,
|
|
3383
|
+
options: choices(roomTypes),
|
|
3384
|
+
required: true,
|
|
3385
|
+
},
|
|
3386
|
+
{
|
|
3387
|
+
name: 'checkIn',
|
|
3388
|
+
label: _('hospitality_core.col.checkIn'),
|
|
3389
|
+
type: 'datetime-local',
|
|
3390
|
+
value: amendment.checkIn,
|
|
3391
|
+
required: true,
|
|
3392
|
+
},
|
|
3393
|
+
{
|
|
3394
|
+
name: 'checkOut',
|
|
3395
|
+
label: _('hospitality_core.col.checkOut'),
|
|
3396
|
+
type: 'datetime-local',
|
|
3397
|
+
value: amendment.checkOut,
|
|
3398
|
+
required: true,
|
|
3399
|
+
},
|
|
3400
|
+
{
|
|
3401
|
+
name: 'adults',
|
|
3402
|
+
label: _('hospitality_core.reservation.field.adults'),
|
|
3403
|
+
type: 'number',
|
|
3404
|
+
value: amendment.adults,
|
|
3405
|
+
step: '1',
|
|
3406
|
+
required: true,
|
|
3407
|
+
},
|
|
3408
|
+
{
|
|
3409
|
+
name: 'children',
|
|
3410
|
+
label: _('hospitality_core.reservation.field.children'),
|
|
3411
|
+
type: 'number',
|
|
3412
|
+
value: amendment.children,
|
|
3413
|
+
step: '1',
|
|
3414
|
+
required: true,
|
|
3415
|
+
},
|
|
3416
|
+
{
|
|
3417
|
+
name: 'rate',
|
|
3418
|
+
label: _('hospitality_core.reservation.field.rate'),
|
|
3419
|
+
type: 'decimal',
|
|
3420
|
+
value: amendment.rate,
|
|
3421
|
+
required: true,
|
|
3422
|
+
},
|
|
3423
|
+
] }) }));
|
|
3424
|
+
}
|
|
3425
|
+
if (reservation.state === 'confirmed' && reservation.stayId) {
|
|
3426
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.reservation.action.checkIn'), description: _('hospitality_core.reservation.action.checkInHint'), body: rooms.length ? (_jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.reservation.action.checkIn'), submitVariant: "primary", hidden: { operation: 'check-in', lang: locale }, fields: [
|
|
3427
|
+
{
|
|
3428
|
+
name: 'roomId',
|
|
3429
|
+
label: _('hospitality_core.reservation.field.room'),
|
|
3430
|
+
type: 'select',
|
|
3431
|
+
required: true,
|
|
3432
|
+
options: rooms.map((candidate) => ({
|
|
3433
|
+
value: candidate.id,
|
|
3434
|
+
label: `${candidate.code} · ${candidate.name}`,
|
|
3435
|
+
})),
|
|
3436
|
+
},
|
|
3437
|
+
] })) : (emptyState(_('hospitality_core.reservation.empty.availableRooms'), _('hospitality_core.reservation.empty.availableRoomsHint'))) }));
|
|
3438
|
+
}
|
|
3439
|
+
if (reservation.state === 'checked_in' && reservation.stayId) {
|
|
3440
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.reservation.action.adjustDeparture'), description: _('hospitality_core.reservation.action.adjustDepartureHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.reservation.action.adjustDeparture'), submitVariant: "secondary", hidden: { operation: 'adjust-departure', lang: locale }, fields: [
|
|
3441
|
+
{
|
|
3442
|
+
name: 'checkOut',
|
|
3443
|
+
label: _('hospitality_core.col.checkOut'),
|
|
3444
|
+
type: 'datetime-local',
|
|
3445
|
+
value: departure,
|
|
3446
|
+
required: true,
|
|
3447
|
+
},
|
|
3448
|
+
] }) }), _jsx(Section, { title: _('hospitality_core.reservation.action.checkOut'), description: _('hospitality_core.reservation.action.checkOutHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.reservation.action.checkOut'), submitVariant: "primary", hidden: { operation: 'check-out', lang: locale }, fields: [] }) }));
|
|
3449
|
+
}
|
|
3450
|
+
if (reservation.state === 'draft' || reservation.state === 'confirmed') {
|
|
3451
|
+
if (reservation.state === 'confirmed')
|
|
3452
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.reservation.action.noShow'), description: _('hospitality_core.reservation.action.noShowHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.reservation.action.noShow'), submitVariant: "destructive", hidden: { operation: 'no-show', lang: locale }, fields: [
|
|
3453
|
+
{
|
|
3454
|
+
name: 'reason',
|
|
3455
|
+
label: _('hospitality_core.reservation.field.noShowReason'),
|
|
3456
|
+
type: 'textarea',
|
|
3457
|
+
help: _('hospitality_core.reservation.field.noShowReasonHint'),
|
|
3458
|
+
required: true,
|
|
3459
|
+
},
|
|
3460
|
+
] }) }));
|
|
3461
|
+
actions.push(_jsx(Section, { title: _('hospitality_core.reservation.action.cancel'), description: _('hospitality_core.reservation.action.cancelHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.reservation.action.cancel'), submitVariant: "destructive", hidden: { operation: 'cancel', lang: locale }, fields: [
|
|
3462
|
+
{
|
|
3463
|
+
name: 'reason',
|
|
3464
|
+
label: _('hospitality_core.reservation.field.cancelReason'),
|
|
3465
|
+
type: 'textarea',
|
|
3466
|
+
help: _('hospitality_core.reservation.field.cancelReasonHint'),
|
|
3467
|
+
},
|
|
3468
|
+
] }) }));
|
|
3469
|
+
}
|
|
3470
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.reservation.detail.title', { code: reservation.code }), frame: frame, body: stack([
|
|
3471
|
+
reservationDetailFeedback(_, status, errors),
|
|
3472
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.reservation.detail.kicker'), title: reservation.code, subtitle: guest, imageFallback: icon('hotel'), badges: [
|
|
3473
|
+
badge(_(`hospitality_core.reservationState.${reservation.state}`), workflowTone(reservation.state), reservation.state),
|
|
3474
|
+
badge(providerName(_, reservation.provider), 'neutral'),
|
|
3475
|
+
], summary: [
|
|
3476
|
+
{
|
|
3477
|
+
id: 'room-type',
|
|
3478
|
+
label: _('hospitality_core.col.roomType'),
|
|
3479
|
+
value: reservation.roomType?.name ?? reservation.roomTypeId,
|
|
3480
|
+
},
|
|
3481
|
+
{
|
|
3482
|
+
id: 'guests',
|
|
3483
|
+
label: _('hospitality_core.col.guests'),
|
|
3484
|
+
value: reservation.adults + reservation.children,
|
|
3485
|
+
},
|
|
3486
|
+
{
|
|
3487
|
+
id: 'total',
|
|
3488
|
+
label: _('hospitality_core.col.amount'),
|
|
3489
|
+
value: formatMoney(_, reservation.amountTotal),
|
|
3490
|
+
},
|
|
3491
|
+
], navigation: linkButton({
|
|
3492
|
+
label: _('hospitality_core.reservation.action.back'),
|
|
3493
|
+
href: backHref,
|
|
3494
|
+
variant: 'tertiary',
|
|
3495
|
+
icon: 'chevron-left',
|
|
3496
|
+
}), body: stack([
|
|
3497
|
+
_jsx(Section, { title: _('hospitality_core.reservation.detail.stay'), description: _('hospitality_core.reservation.detail.stayHint'), body: definitionList({
|
|
3498
|
+
title: reservation.code,
|
|
3499
|
+
items: [
|
|
3500
|
+
{
|
|
3501
|
+
key: 'guest',
|
|
3502
|
+
term: _('hospitality_core.reservation.field.guest'),
|
|
3503
|
+
value: guest,
|
|
3504
|
+
},
|
|
3505
|
+
{
|
|
3506
|
+
key: 'room',
|
|
3507
|
+
term: _('hospitality_core.reservation.field.room'),
|
|
3508
|
+
value: room?.name ?? room?.code ?? _('hospitality_core.reservation.value.unassigned'),
|
|
3509
|
+
},
|
|
3510
|
+
{
|
|
3511
|
+
key: 'check-in',
|
|
3512
|
+
term: _('hospitality_core.col.checkIn'),
|
|
3513
|
+
value: dateTime(reservation.checkIn, locale, timezone),
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
key: 'check-out',
|
|
3517
|
+
term: _('hospitality_core.col.checkOut'),
|
|
3518
|
+
value: dateTime(reservation.checkOut, locale, timezone),
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
key: 'booking-type',
|
|
3522
|
+
term: _('hospitality_core.reservation.field.bookingType'),
|
|
3523
|
+
value: _(`hospitality_core.bookingType.${reservation.bookingType}`),
|
|
3524
|
+
},
|
|
3525
|
+
{
|
|
3526
|
+
key: 'billing',
|
|
3527
|
+
term: _('hospitality_core.reservation.field.billingMode'),
|
|
3528
|
+
value: _(`hospitality_core.billing.${reservation.billingMode}`),
|
|
3529
|
+
},
|
|
3530
|
+
{
|
|
3531
|
+
key: 'rate',
|
|
3532
|
+
term: _('hospitality_core.reservation.field.rate'),
|
|
3533
|
+
value: formatMoney(_, reservation.rate),
|
|
3534
|
+
},
|
|
3535
|
+
{
|
|
3536
|
+
key: 'quantity',
|
|
3537
|
+
term: _('hospitality_core.reservation.quote.quantity'),
|
|
3538
|
+
value: String(reservation.quantity),
|
|
3539
|
+
},
|
|
3540
|
+
{
|
|
3541
|
+
key: 'folio',
|
|
3542
|
+
term: _('hospitality_core.reservation.field.folio'),
|
|
3543
|
+
value: reservation.folio?.code ?? reservation.folioId,
|
|
3544
|
+
},
|
|
3545
|
+
...(reservation.cancelReason
|
|
3546
|
+
? [
|
|
3547
|
+
{
|
|
3548
|
+
key: 'cancel-reason',
|
|
3549
|
+
term: _('hospitality_core.reservation.field.cancelReason'),
|
|
3550
|
+
value: reservation.cancelReason,
|
|
3551
|
+
},
|
|
3552
|
+
]
|
|
3553
|
+
: []),
|
|
3554
|
+
],
|
|
3555
|
+
}) }),
|
|
3556
|
+
...actions,
|
|
3557
|
+
]) }),
|
|
3558
|
+
]) }));
|
|
3559
|
+
};
|
|
3560
|
+
const stayAssignmentColumns = (_, locale, timezone) => [
|
|
3561
|
+
{
|
|
3562
|
+
key: 'room',
|
|
3563
|
+
label: _('hospitality_core.stay.field.room'),
|
|
3564
|
+
cell: (row) => row.roomName ?? code(row.roomId),
|
|
3565
|
+
priority: 'primary',
|
|
3566
|
+
},
|
|
3567
|
+
{
|
|
3568
|
+
key: 'start',
|
|
3569
|
+
label: _('hospitality_core.stay.assignment.start'),
|
|
3570
|
+
cell: (row) => dateTime(row.startAt, locale, timezone),
|
|
3571
|
+
kind: 'date',
|
|
3572
|
+
},
|
|
3573
|
+
{
|
|
3574
|
+
key: 'end',
|
|
3575
|
+
label: _('hospitality_core.stay.assignment.end'),
|
|
3576
|
+
cell: (row) => (row.endAt ? dateTime(row.endAt, locale, timezone) : '—'),
|
|
3577
|
+
kind: 'date',
|
|
3578
|
+
},
|
|
3579
|
+
{
|
|
3580
|
+
key: 'reason',
|
|
3581
|
+
label: _('hospitality_core.stay.field.moveReason'),
|
|
3582
|
+
cell: (row) => row.reason || '—',
|
|
3583
|
+
},
|
|
3584
|
+
{
|
|
3585
|
+
key: 'state',
|
|
3586
|
+
label: _('hospitality_core.col.status'),
|
|
3587
|
+
cell: (row) => badge(_(`hospitality_core.assignmentState.${row.state}`), workflowTone(row.state), row.state),
|
|
3588
|
+
kind: 'status',
|
|
3589
|
+
},
|
|
3590
|
+
];
|
|
3591
|
+
const stayGuestColumns = (_) => [
|
|
3592
|
+
{
|
|
3593
|
+
key: 'guest',
|
|
3594
|
+
label: _('hospitality_core.col.guest'),
|
|
3595
|
+
cell: (row) => person(row.displayName),
|
|
3596
|
+
kind: 'person',
|
|
3597
|
+
priority: 'primary',
|
|
3598
|
+
},
|
|
3599
|
+
{
|
|
3600
|
+
key: 'role',
|
|
3601
|
+
label: _('hospitality_core.stay.guest.role'),
|
|
3602
|
+
cell: (row) => badge(row.primary ? _('hospitality_core.stay.guest.primary') : _('hospitality_core.stay.guest.companion'), row.primary ? 'positive' : 'neutral'),
|
|
3603
|
+
kind: 'status',
|
|
3604
|
+
},
|
|
3605
|
+
];
|
|
3606
|
+
const guestDocumentColumns = (_) => [
|
|
3607
|
+
{
|
|
3608
|
+
key: 'name',
|
|
3609
|
+
label: _('hospitality_core.stay.document.fullName'),
|
|
3610
|
+
cell: (row) => person(row.fullName),
|
|
3611
|
+
kind: 'person',
|
|
3612
|
+
priority: 'primary',
|
|
3613
|
+
},
|
|
3614
|
+
{
|
|
3615
|
+
key: 'type',
|
|
3616
|
+
label: _('hospitality_core.stay.document.type'),
|
|
3617
|
+
cell: (row) => _(`hospitality_core.document.${row.type}`),
|
|
3618
|
+
},
|
|
3619
|
+
{
|
|
3620
|
+
key: 'number',
|
|
3621
|
+
label: _('hospitality_core.stay.document.number'),
|
|
3622
|
+
cell: (row) => (row.numberLast4 ? code(`•••• ${row.numberLast4}`) : '—'),
|
|
3623
|
+
},
|
|
3624
|
+
{
|
|
3625
|
+
key: 'nationality',
|
|
3626
|
+
label: _('hospitality_core.stay.document.nationality'),
|
|
3627
|
+
cell: (row) => row.nationality || '—',
|
|
3628
|
+
},
|
|
3629
|
+
{
|
|
3630
|
+
key: 'readiness',
|
|
3631
|
+
label: _('hospitality_core.stay.document.readiness'),
|
|
3632
|
+
cell: (row) => badge(row.numberLast4 && row.dateOfBirthPresent
|
|
3633
|
+
? _('hospitality_core.stay.document.ready')
|
|
3634
|
+
: _('hospitality_core.stay.document.attention'), row.numberLast4 && row.dateOfBirthPresent ? 'positive' : 'warning'),
|
|
3635
|
+
kind: 'status',
|
|
3636
|
+
},
|
|
3637
|
+
];
|
|
3638
|
+
const stayDetailFeedback = (_, status, errors = []) => {
|
|
3639
|
+
if (status === 'guest-added')
|
|
3640
|
+
return notice({
|
|
3641
|
+
title: _('hospitality_core.stay.feedback.guestAdded'),
|
|
3642
|
+
message: _('hospitality_core.stay.feedback.guestAddedHint'),
|
|
3643
|
+
tone: 'positive',
|
|
3644
|
+
});
|
|
3645
|
+
if (status === 'room-moved')
|
|
3646
|
+
return notice({
|
|
3647
|
+
title: _('hospitality_core.stay.feedback.roomMoved'),
|
|
3648
|
+
message: _('hospitality_core.stay.feedback.roomMovedHint'),
|
|
3649
|
+
tone: 'positive',
|
|
3650
|
+
});
|
|
3651
|
+
if (status === 'document-saved')
|
|
3652
|
+
return notice({
|
|
3653
|
+
title: _('hospitality_core.stay.feedback.documentSaved'),
|
|
3654
|
+
message: _('hospitality_core.stay.feedback.documentSavedHint'),
|
|
3655
|
+
tone: 'positive',
|
|
3656
|
+
});
|
|
3657
|
+
if (errors.length)
|
|
3658
|
+
return notice({
|
|
3659
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
3660
|
+
message: errors.join(' '),
|
|
3661
|
+
tone: 'danger',
|
|
3662
|
+
});
|
|
3663
|
+
return null;
|
|
3664
|
+
};
|
|
3665
|
+
export const stayDetailScreen = (_, stay, rooms, partners, documents, documentId, locale, timezone, frame, status, errors = []) => {
|
|
3666
|
+
const guest = guestName(stay);
|
|
3667
|
+
const action = `/admin/hospitality/stays/${encodeURIComponent(stay.id)}?lang=${encodeURIComponent(locale)}`;
|
|
3668
|
+
const roomNames = new Map(rooms.map((room) => [room.id, `${room.code} · ${room.name}`]));
|
|
3669
|
+
const assignments = (stay.assignments ?? []).map((assignment) => ({
|
|
3670
|
+
...assignment,
|
|
3671
|
+
roomName: roomNames.get(assignment.roomId) ?? assignment.roomId,
|
|
3672
|
+
}));
|
|
3673
|
+
const guests = stay.guests ?? [];
|
|
3674
|
+
const registeredGuests = guests.filter((registered) => !!registered.partnerId);
|
|
3675
|
+
const availableRooms = rooms.filter((room) => room.active && room.status === 'available' && room.id !== stay.currentRoomId);
|
|
3676
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.stay.detail.title', { code: stay.code }), frame: frame, body: stack([
|
|
3677
|
+
stayDetailFeedback(_, status, errors),
|
|
3678
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.stay.detail.kicker'), title: stay.code, subtitle: guest, imageFallback: icon('hotel'), badges: [
|
|
3679
|
+
badge(_(`hospitality_core.stayState.${stay.state}`), workflowTone(stay.state), stay.state),
|
|
3680
|
+
badge(_(`hospitality_core.bookingType.${stay.bookingType}`), 'neutral'),
|
|
3681
|
+
], summary: [
|
|
3682
|
+
{
|
|
3683
|
+
id: 'room',
|
|
3684
|
+
label: _('hospitality_core.stay.field.room'),
|
|
3685
|
+
value: stay.currentRoom?.name ??
|
|
3686
|
+
stay.currentRoom?.code ??
|
|
3687
|
+
_('hospitality_core.reservation.value.unassigned'),
|
|
3688
|
+
},
|
|
3689
|
+
{
|
|
3690
|
+
id: 'guests',
|
|
3691
|
+
label: _('hospitality_core.col.guests'),
|
|
3692
|
+
value: guests.length,
|
|
3693
|
+
},
|
|
3694
|
+
{
|
|
3695
|
+
id: 'rate',
|
|
3696
|
+
label: _('hospitality_core.reservation.field.rate'),
|
|
3697
|
+
value: formatMoney(_, stay.rate),
|
|
3698
|
+
},
|
|
3699
|
+
], navigation: linkButton({
|
|
3700
|
+
label: _('hospitality_core.stay.action.back'),
|
|
3701
|
+
href: `/admin/hospitality/stays?property=${encodeURIComponent(stay.propertyId)}&lang=${encodeURIComponent(locale)}`,
|
|
3702
|
+
variant: 'tertiary',
|
|
3703
|
+
icon: 'chevron-left',
|
|
3704
|
+
}), body: stack([
|
|
3705
|
+
_jsx(Section, { title: _('hospitality_core.stay.section.information'), description: _('hospitality_core.stay.section.informationHint'), body: definitionList({
|
|
3706
|
+
title: stay.code,
|
|
3707
|
+
items: [
|
|
3708
|
+
{
|
|
3709
|
+
key: 'guest',
|
|
3710
|
+
term: _('hospitality_core.reservation.field.guest'),
|
|
3711
|
+
value: guest,
|
|
3712
|
+
},
|
|
3713
|
+
{
|
|
3714
|
+
key: 'room-type',
|
|
3715
|
+
term: _('hospitality_core.col.roomType'),
|
|
3716
|
+
value: stay.roomType?.name ?? stay.roomTypeId,
|
|
3717
|
+
},
|
|
3718
|
+
{
|
|
3719
|
+
key: 'check-in',
|
|
3720
|
+
term: _('hospitality_core.col.checkIn'),
|
|
3721
|
+
value: dateTime(stay.checkIn, locale, timezone),
|
|
3722
|
+
},
|
|
3723
|
+
{
|
|
3724
|
+
key: 'check-out',
|
|
3725
|
+
term: _('hospitality_core.col.checkOut'),
|
|
3726
|
+
value: dateTime(stay.checkOut, locale, timezone),
|
|
3727
|
+
},
|
|
3728
|
+
{
|
|
3729
|
+
key: 'billing',
|
|
3730
|
+
term: _('hospitality_core.reservation.field.billingMode'),
|
|
3731
|
+
value: _(`hospitality_core.billing.${stay.billingMode}`),
|
|
3732
|
+
},
|
|
3733
|
+
...(stay.nextBillDate
|
|
3734
|
+
? [
|
|
3735
|
+
{
|
|
3736
|
+
key: 'next-bill',
|
|
3737
|
+
term: _('hospitality_core.stay.field.nextBillDate'),
|
|
3738
|
+
value: stay.nextBillDate,
|
|
3739
|
+
},
|
|
3740
|
+
]
|
|
3741
|
+
: []),
|
|
3742
|
+
{
|
|
3743
|
+
key: 'folio',
|
|
3744
|
+
term: _('hospitality_core.reservation.field.folio'),
|
|
3745
|
+
value: stay.folioId,
|
|
3746
|
+
},
|
|
3747
|
+
...(stay.reservationId
|
|
3748
|
+
? [
|
|
3749
|
+
{
|
|
3750
|
+
key: 'reservation',
|
|
3751
|
+
term: _('hospitality_core.stay.field.reservation'),
|
|
3752
|
+
value: stay.reservation?.code ?? stay.reservationId,
|
|
3753
|
+
},
|
|
3754
|
+
]
|
|
3755
|
+
: []),
|
|
3756
|
+
],
|
|
3757
|
+
}) }),
|
|
3758
|
+
_jsx(Section, { title: _('hospitality_core.stay.section.assignments'), description: _('hospitality_core.stay.section.assignmentsHint'), body: stack([
|
|
3759
|
+
assignments.length
|
|
3760
|
+
? dataTable(_, {
|
|
3761
|
+
columns: stayAssignmentColumns(_, locale, timezone),
|
|
3762
|
+
rows: assignments,
|
|
3763
|
+
id: (assignment) => assignment.id,
|
|
3764
|
+
})
|
|
3765
|
+
: emptyState(_('hospitality_core.stay.empty.assignments'), _('hospitality_core.stay.empty.assignmentsHint')),
|
|
3766
|
+
stay.state === 'checked_in' ? (availableRooms.length ? (_jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.stay.action.moveRoom'), submitVariant: "secondary", hidden: { operation: 'move-room', lang: locale }, fields: [
|
|
3767
|
+
{
|
|
3768
|
+
name: 'roomId',
|
|
3769
|
+
label: _('hospitality_core.stay.field.newRoom'),
|
|
3770
|
+
type: 'select',
|
|
3771
|
+
required: true,
|
|
3772
|
+
options: availableRooms.map((room) => ({
|
|
3773
|
+
value: room.id,
|
|
3774
|
+
label: `${room.code} · ${room.name} · ${room.roomType?.name ?? room.roomTypeId}`,
|
|
3775
|
+
})),
|
|
3776
|
+
},
|
|
3777
|
+
{
|
|
3778
|
+
name: 'reason',
|
|
3779
|
+
label: _('hospitality_core.stay.field.moveReason'),
|
|
3780
|
+
type: 'textarea',
|
|
3781
|
+
required: true,
|
|
3782
|
+
help: _('hospitality_core.stay.field.moveReasonHint'),
|
|
3783
|
+
},
|
|
3784
|
+
] })) : (notice({
|
|
3785
|
+
title: _('hospitality_core.stay.empty.availableRooms'),
|
|
3786
|
+
message: _('hospitality_core.stay.empty.availableRoomsHint'),
|
|
3787
|
+
tone: 'warning',
|
|
3788
|
+
}))) : null,
|
|
3789
|
+
]) }),
|
|
3790
|
+
_jsx(Section, { title: _('hospitality_core.stay.section.guests'), description: _('hospitality_core.stay.section.guestsHint'), body: stack([
|
|
3791
|
+
guests.length
|
|
3792
|
+
? dataTable(_, { columns: stayGuestColumns(_), rows: guests, id: (row) => row.id })
|
|
3793
|
+
: emptyState(_('hospitality_core.stay.empty.guests'), _('hospitality_core.stay.empty.guestsHint')),
|
|
3794
|
+
stay.state === 'draft' || stay.state === 'checked_in' ? (_jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.stay.action.addGuest'), submitVariant: "secondary", hidden: { operation: 'add-guest', lang: locale }, fields: [
|
|
3795
|
+
{
|
|
3796
|
+
name: 'displayName',
|
|
3797
|
+
label: _('hospitality_core.stay.field.guestName'),
|
|
3798
|
+
required: true,
|
|
3799
|
+
},
|
|
3800
|
+
{
|
|
3801
|
+
name: 'partnerId',
|
|
3802
|
+
label: _('hospitality_core.stay.field.linkedPartner'),
|
|
3803
|
+
type: 'select',
|
|
3804
|
+
options: [
|
|
3805
|
+
{ value: '', label: _('hospitality_core.stay.value.noLinkedPartner') },
|
|
3806
|
+
...choices(partners),
|
|
3807
|
+
],
|
|
3808
|
+
help: _('hospitality_core.stay.field.linkedPartnerHint'),
|
|
3809
|
+
},
|
|
3810
|
+
] })) : null,
|
|
3811
|
+
]) }),
|
|
3812
|
+
_jsx(Section, { title: _('hospitality_core.stay.section.documents'), description: _('hospitality_core.stay.section.documentsHint'), body: stack([
|
|
3813
|
+
documents.length
|
|
3814
|
+
? dataTable(_, {
|
|
3815
|
+
columns: guestDocumentColumns(_),
|
|
3816
|
+
rows: documents,
|
|
3817
|
+
id: (row) => row.id,
|
|
3818
|
+
})
|
|
3819
|
+
: emptyState(_('hospitality_core.stay.empty.documents'), _('hospitality_core.stay.empty.documentsHint')),
|
|
3820
|
+
stay.state !== 'cancelled' ? (registeredGuests.length ? (_jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.stay.action.saveDocument'), submitVariant: "secondary", hidden: {
|
|
3821
|
+
operation: 'save-document',
|
|
3822
|
+
documentId,
|
|
3823
|
+
lang: locale,
|
|
3824
|
+
}, fields: [
|
|
3825
|
+
{
|
|
3826
|
+
name: 'partnerId',
|
|
3827
|
+
label: _('hospitality_core.stay.document.guest'),
|
|
3828
|
+
type: 'select',
|
|
3829
|
+
required: true,
|
|
3830
|
+
options: registeredGuests.map((registered) => ({
|
|
3831
|
+
value: registered.partnerId,
|
|
3832
|
+
label: registered.displayName,
|
|
3833
|
+
})),
|
|
3834
|
+
},
|
|
3835
|
+
{
|
|
3836
|
+
name: 'type',
|
|
3837
|
+
label: _('hospitality_core.stay.document.type'),
|
|
3838
|
+
type: 'select',
|
|
3839
|
+
required: true,
|
|
3840
|
+
value: 'cccd',
|
|
3841
|
+
options: DOCUMENT_TYPES.map((value) => ({
|
|
3842
|
+
value,
|
|
3843
|
+
label: _(`hospitality_core.document.${value}`),
|
|
3844
|
+
})),
|
|
3845
|
+
},
|
|
3846
|
+
{
|
|
3847
|
+
name: 'number',
|
|
3848
|
+
label: _('hospitality_core.stay.document.number'),
|
|
3849
|
+
required: true,
|
|
3850
|
+
help: _('hospitality_core.stay.document.numberHint'),
|
|
3851
|
+
},
|
|
3852
|
+
{
|
|
3853
|
+
name: 'fullName',
|
|
3854
|
+
label: _('hospitality_core.stay.document.fullName'),
|
|
3855
|
+
required: true,
|
|
3856
|
+
value: registeredGuests[0]?.displayName ?? '',
|
|
3857
|
+
},
|
|
3858
|
+
{
|
|
3859
|
+
name: 'dateOfBirth',
|
|
3860
|
+
label: _('hospitality_core.stay.document.dateOfBirth'),
|
|
3861
|
+
type: 'date',
|
|
3862
|
+
required: true,
|
|
3863
|
+
},
|
|
3864
|
+
{
|
|
3865
|
+
name: 'gender',
|
|
3866
|
+
label: _('hospitality_core.stay.document.gender'),
|
|
3867
|
+
type: 'select',
|
|
3868
|
+
options: [
|
|
3869
|
+
{ value: '', label: _('hospitality_core.stay.document.genderUnknown') },
|
|
3870
|
+
...GENDERS.map((value) => ({
|
|
3871
|
+
value,
|
|
3872
|
+
label: _(`hospitality_core.gender.${value}`),
|
|
3873
|
+
})),
|
|
3874
|
+
],
|
|
3875
|
+
},
|
|
3876
|
+
{
|
|
3877
|
+
name: 'nationality',
|
|
3878
|
+
label: _('hospitality_core.stay.document.nationality'),
|
|
3879
|
+
value: 'VN',
|
|
3880
|
+
help: _('hospitality_core.stay.document.nationalityHint'),
|
|
3881
|
+
},
|
|
3882
|
+
{
|
|
3883
|
+
name: 'permanentAddress',
|
|
3884
|
+
label: _('hospitality_core.stay.document.permanentAddress'),
|
|
3885
|
+
type: 'textarea',
|
|
3886
|
+
},
|
|
3887
|
+
{
|
|
3888
|
+
name: 'issueDate',
|
|
3889
|
+
label: _('hospitality_core.stay.document.issueDate'),
|
|
3890
|
+
type: 'date',
|
|
3891
|
+
},
|
|
3892
|
+
{
|
|
3893
|
+
name: 'issuePlace',
|
|
3894
|
+
label: _('hospitality_core.stay.document.issuePlace'),
|
|
3895
|
+
},
|
|
3896
|
+
] })) : (notice({
|
|
3897
|
+
title: _('hospitality_core.stay.empty.documentGuests'),
|
|
3898
|
+
message: _('hospitality_core.stay.empty.documentGuestsHint'),
|
|
3899
|
+
tone: 'warning',
|
|
3900
|
+
}))) : null,
|
|
3901
|
+
]) }),
|
|
3902
|
+
]) }),
|
|
3903
|
+
]) }));
|
|
3904
|
+
};
|
|
3905
|
+
export const staysScreen = (_, rows, locale, timezone, frame) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.stays.title'), frame: frame, body: rows.length
|
|
3906
|
+
? dataTable(_, { columns: stayColumns(_, locale, timezone), rows, id: (row) => row.id })
|
|
3907
|
+
: emptyState(_('hospitality_core.screen.stays.empty'), _('hospitality_core.screen.stays.emptyHint')) }));
|
|
3908
|
+
const folioDetailFeedback = (_, status, errors = []) => {
|
|
3909
|
+
if (status === 'charge-posted')
|
|
3910
|
+
return notice({
|
|
3911
|
+
title: _('hospitality_core.folio.feedback.chargePosted'),
|
|
3912
|
+
message: _('hospitality_core.folio.feedback.chargePostedHint'),
|
|
3913
|
+
tone: 'positive',
|
|
3914
|
+
});
|
|
3915
|
+
if (status === 'charge-voided')
|
|
3916
|
+
return notice({
|
|
3917
|
+
title: _('hospitality_core.folio.feedback.chargeVoided'),
|
|
3918
|
+
message: _('hospitality_core.folio.feedback.chargeVoidedHint'),
|
|
3919
|
+
tone: 'positive',
|
|
3920
|
+
});
|
|
3921
|
+
if (errors.length)
|
|
3922
|
+
return notice({
|
|
3923
|
+
title: _('hospitality_core.feedback.invalid'),
|
|
3924
|
+
message: errors.join(' '),
|
|
3925
|
+
tone: 'danger',
|
|
3926
|
+
});
|
|
3927
|
+
return null;
|
|
3928
|
+
};
|
|
3929
|
+
export const folioDetailScreen = (_, folio, locale, timezone, frame, chargeId, status, errors = []) => {
|
|
3930
|
+
const stays = folio.stays ?? [];
|
|
3931
|
+
const charges = folio.charges ?? [];
|
|
3932
|
+
const activeCharges = charges.filter((charge) => charge.state === 'active');
|
|
3933
|
+
const staysById = new Map(stays.map((stay) => [stay.id, stay]));
|
|
3934
|
+
const guest = folio.partner?.name ?? folio.partnerId;
|
|
3935
|
+
const action = `/admin/hospitality/folios/${encodeURIComponent(folio.id)}?lang=${encodeURIComponent(locale)}`;
|
|
3936
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.folio.detail.title', { code: folio.code }), frame: frame, body: stack([
|
|
3937
|
+
folioDetailFeedback(_, status, errors),
|
|
3938
|
+
notice({
|
|
3939
|
+
title: _('hospitality_core.folio.notice.operational'),
|
|
3940
|
+
message: _('hospitality_core.folio.notice.operationalHint'),
|
|
3941
|
+
tone: 'info',
|
|
3942
|
+
}),
|
|
3943
|
+
_jsx(RecordWorkspace, { kicker: _('hospitality_core.folio.detail.kicker'), title: folio.code, subtitle: guest, imageFallback: icon('receipt-text'), badges: [
|
|
3944
|
+
badge(_(`hospitality_core.folioState.${folio.state}`), workflowTone(folio.state), folio.state),
|
|
3945
|
+
], summary: [
|
|
3946
|
+
{
|
|
3947
|
+
id: 'amount',
|
|
3948
|
+
label: _('hospitality_core.folio.metric.activeTotal'),
|
|
3949
|
+
value: formatMoney(_, folio.amountTotal),
|
|
3950
|
+
},
|
|
3951
|
+
{
|
|
3952
|
+
id: 'charges',
|
|
3953
|
+
label: _('hospitality_core.folio.metric.activeCharges'),
|
|
3954
|
+
value: activeCharges.length,
|
|
3955
|
+
},
|
|
3956
|
+
{
|
|
3957
|
+
id: 'stays',
|
|
3958
|
+
label: _('hospitality_core.col.stays'),
|
|
3959
|
+
value: stays.length,
|
|
3960
|
+
},
|
|
3961
|
+
], navigation: linkButton({
|
|
3962
|
+
label: _('hospitality_core.folio.action.back'),
|
|
3963
|
+
href: `/admin/hospitality/folios?property=${encodeURIComponent(folio.propertyId)}&lang=${encodeURIComponent(locale)}`,
|
|
3964
|
+
variant: 'tertiary',
|
|
3965
|
+
icon: 'chevron-left',
|
|
3966
|
+
}), body: stack([
|
|
3967
|
+
_jsx(Section, { title: _('hospitality_core.folio.section.information'), description: _('hospitality_core.folio.section.informationHint'), body: definitionList({
|
|
3968
|
+
title: folio.code,
|
|
3969
|
+
items: [
|
|
3970
|
+
{
|
|
3971
|
+
key: 'guest',
|
|
3972
|
+
term: _('hospitality_core.col.guest'),
|
|
3973
|
+
value: guest,
|
|
3974
|
+
},
|
|
3975
|
+
{
|
|
3976
|
+
key: 'opened',
|
|
3977
|
+
term: _('hospitality_core.folio.field.openedAt'),
|
|
3978
|
+
value: dateTime(folio.openedAt, locale, timezone),
|
|
3979
|
+
},
|
|
3980
|
+
...(folio.closedAt
|
|
3981
|
+
? [
|
|
3982
|
+
{
|
|
3983
|
+
key: 'closed',
|
|
3984
|
+
term: _('hospitality_core.folio.field.closedAt'),
|
|
3985
|
+
value: dateTime(folio.closedAt, locale, timezone),
|
|
3986
|
+
},
|
|
3987
|
+
]
|
|
3988
|
+
: []),
|
|
3989
|
+
],
|
|
3990
|
+
}) }),
|
|
3991
|
+
_jsx(Section, { title: _('hospitality_core.folio.section.charges'), description: _('hospitality_core.folio.section.chargesHint'), body: stack([
|
|
3992
|
+
charges.length
|
|
3993
|
+
? dataTable(_, {
|
|
3994
|
+
columns: folioChargeColumns(_, locale, timezone, staysById),
|
|
3995
|
+
rows: charges,
|
|
3996
|
+
id: (charge) => charge.id,
|
|
3997
|
+
})
|
|
3998
|
+
: emptyState(_('hospitality_core.folio.empty.charges'), _('hospitality_core.folio.empty.chargesHint')),
|
|
3999
|
+
folio.state === 'open' ? (_jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.folio.action.postCharge'), submitVariant: "secondary", hidden: { operation: 'post-charge', id: chargeId, lang: locale }, fields: [
|
|
4000
|
+
{
|
|
4001
|
+
name: 'stayId',
|
|
4002
|
+
label: _('hospitality_core.folio.charge.stay'),
|
|
4003
|
+
type: 'select',
|
|
4004
|
+
options: [
|
|
4005
|
+
{ value: '', label: _('hospitality_core.folio.value.noStay') },
|
|
4006
|
+
...stays.map((stay) => ({ value: stay.id, label: stay.code })),
|
|
4007
|
+
],
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
name: 'description',
|
|
4011
|
+
label: _('hospitality_core.folio.charge.description'),
|
|
4012
|
+
required: true,
|
|
4013
|
+
},
|
|
4014
|
+
{
|
|
4015
|
+
name: 'type',
|
|
4016
|
+
label: _('hospitality_core.folio.charge.type'),
|
|
4017
|
+
type: 'select',
|
|
4018
|
+
required: true,
|
|
4019
|
+
value: 'service',
|
|
4020
|
+
options: CHARGE_TYPES.map((type) => ({
|
|
4021
|
+
value: type,
|
|
4022
|
+
label: _(`hospitality_core.charge.${type}`),
|
|
4023
|
+
})),
|
|
4024
|
+
},
|
|
4025
|
+
{
|
|
4026
|
+
name: 'quantity',
|
|
4027
|
+
label: _('hospitality_core.folio.charge.quantity'),
|
|
4028
|
+
type: 'decimal',
|
|
4029
|
+
value: '1',
|
|
4030
|
+
step: '0.01',
|
|
4031
|
+
required: true,
|
|
4032
|
+
},
|
|
4033
|
+
{
|
|
4034
|
+
name: 'unitPrice',
|
|
4035
|
+
label: _('hospitality_core.folio.charge.unitPrice'),
|
|
4036
|
+
type: 'decimal',
|
|
4037
|
+
step: '0.01',
|
|
4038
|
+
required: true,
|
|
4039
|
+
},
|
|
4040
|
+
] })) : null,
|
|
4041
|
+
]) }),
|
|
4042
|
+
activeCharges.length && folio.state === 'open' ? (_jsx(Section, { title: _('hospitality_core.folio.section.correction'), description: _('hospitality_core.folio.section.correctionHint'), body: _jsx(RecordForm, { action: action, method: "post", submit: _('hospitality_core.folio.action.voidCharge'), submitVariant: "destructive", hidden: { operation: 'void-charge', lang: locale }, fields: [
|
|
4043
|
+
{
|
|
4044
|
+
name: 'chargeId',
|
|
4045
|
+
label: _('hospitality_core.folio.field.charge'),
|
|
4046
|
+
type: 'select',
|
|
4047
|
+
required: true,
|
|
4048
|
+
options: activeCharges.map((charge) => ({
|
|
4049
|
+
value: charge.id,
|
|
4050
|
+
label: `${charge.type === 'room' && charge.description.startsWith('room:')
|
|
4051
|
+
? _('hospitality_core.folio.charge.roomDescription')
|
|
4052
|
+
: charge.description} · ${formatMoney(_, charge.amount)}`,
|
|
4053
|
+
})),
|
|
4054
|
+
},
|
|
4055
|
+
{
|
|
4056
|
+
name: 'reason',
|
|
4057
|
+
label: _('hospitality_core.folio.field.voidReason'),
|
|
4058
|
+
type: 'textarea',
|
|
4059
|
+
required: true,
|
|
4060
|
+
help: _('hospitality_core.folio.field.voidReasonHint'),
|
|
4061
|
+
},
|
|
4062
|
+
] }) })) : null,
|
|
4063
|
+
_jsx(Section, { title: _('hospitality_core.folio.section.stays'), description: _('hospitality_core.folio.section.staysHint'), body: stays.length
|
|
4064
|
+
? dataTable(_, {
|
|
4065
|
+
columns: folioStayColumns(_, locale, timezone),
|
|
4066
|
+
rows: stays,
|
|
4067
|
+
id: (stay) => stay.id,
|
|
4068
|
+
})
|
|
4069
|
+
: emptyState(_('hospitality_core.folio.empty.stays'), _('hospitality_core.folio.empty.staysHint')) }),
|
|
4070
|
+
]) }),
|
|
4071
|
+
]) }));
|
|
4072
|
+
};
|
|
4073
|
+
export const foliosScreen = (_, rows, locale, timezone, frame) => (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.folios.title'), frame: frame, body: rows.length
|
|
4074
|
+
? dataTable(_, { columns: folioColumns(_, locale, timezone), rows, id: (row) => row.id })
|
|
4075
|
+
: emptyState(_('hospitality_core.screen.folios.empty'), _('hospitality_core.screen.folios.emptyHint')) }));
|
|
4076
|
+
export const tapeChartScreen = (_, chart, locale, frame) => {
|
|
4077
|
+
const timezone = chart.timezone || 'UTC';
|
|
4078
|
+
const startKey = dateKeyIn(new Date(chart.from), timezone);
|
|
4079
|
+
const endKey = dateKeyIn(new Date(chart.to), timezone);
|
|
4080
|
+
const dayCount = Math.max(1, Math.round((Date.parse(`${endKey}T00:00:00Z`) - Date.parse(`${startKey}T00:00:00Z`)) / 86_400_000));
|
|
4081
|
+
const nowKey = dateKeyIn(new Date(), timezone);
|
|
4082
|
+
const boundaries = Array.from({ length: dayCount + 1 }, (_, index) => zonedMidnight(addCalendarDays(startKey, index), timezone).getTime());
|
|
4083
|
+
const days = Array.from({ length: dayCount }, (_, index) => {
|
|
4084
|
+
const key = addCalendarDays(startKey, index);
|
|
4085
|
+
const value = new Date(`${key}T12:00:00Z`);
|
|
4086
|
+
return {
|
|
4087
|
+
key,
|
|
4088
|
+
label: new Intl.DateTimeFormat(locale, { timeZone: 'UTC', weekday: 'short' }).format(value),
|
|
4089
|
+
detail: new Intl.DateTimeFormat(locale, {
|
|
4090
|
+
timeZone: 'UTC',
|
|
4091
|
+
day: '2-digit',
|
|
4092
|
+
month: '2-digit',
|
|
4093
|
+
}).format(value),
|
|
4094
|
+
today: key === nowKey,
|
|
4095
|
+
};
|
|
4096
|
+
});
|
|
4097
|
+
const unassigned = chart.events.filter((event) => !event.roomId);
|
|
4098
|
+
const rows = [
|
|
4099
|
+
...chart.rooms.map((room) => ({
|
|
4100
|
+
id: room.id,
|
|
4101
|
+
label: room.name,
|
|
4102
|
+
detail: room.roomType?.name ?? room.code,
|
|
4103
|
+
state: room.status,
|
|
4104
|
+
})),
|
|
4105
|
+
...unassigned.map((event) => ({
|
|
4106
|
+
id: `__unassigned:${event.id}`,
|
|
4107
|
+
label: _('hospitality_core.screen.tapeChart.unassigned'),
|
|
4108
|
+
detail: event.guest,
|
|
4109
|
+
state: 'unassigned',
|
|
4110
|
+
})),
|
|
4111
|
+
];
|
|
4112
|
+
const events = chart.events.map((event) => {
|
|
4113
|
+
const startsAt = new Date(event.start).getTime();
|
|
4114
|
+
const endsAt = new Date(event.end).getTime();
|
|
4115
|
+
const matchingStart = boundaries.findIndex((_boundary, index) => index < dayCount && startsAt < boundaries[index + 1]);
|
|
4116
|
+
const eventStart = matchingStart < 0 ? dayCount - 1 : Math.max(0, matchingStart);
|
|
4117
|
+
const boundaryAfterEnd = boundaries.findIndex((boundary, index) => index > 0 && endsAt <= boundary);
|
|
4118
|
+
const eventEnd = boundaryAfterEnd < 0 ? dayCount : boundaryAfterEnd;
|
|
4119
|
+
return {
|
|
4120
|
+
id: event.id,
|
|
4121
|
+
rowId: event.roomId ?? `__unassigned:${event.id}`,
|
|
4122
|
+
start: Math.min(dayCount - 1, eventStart),
|
|
4123
|
+
span: Math.max(1, eventEnd - eventStart),
|
|
4124
|
+
label: event.guest,
|
|
4125
|
+
detail: providerName(_, event.provider),
|
|
4126
|
+
state: event.state,
|
|
4127
|
+
tone: workflowTone(event.state),
|
|
4128
|
+
};
|
|
4129
|
+
});
|
|
4130
|
+
return (_jsx(Framed, { translator: _, title: _('hospitality_core.screen.tapeChart.title'), frame: frame, body: scheduleBoard({
|
|
4131
|
+
corner: _('hospitality_core.screen.tapeChart.corner'),
|
|
4132
|
+
days,
|
|
4133
|
+
rows,
|
|
4134
|
+
events,
|
|
4135
|
+
empty: emptyState(_('hospitality_core.screen.tapeChart.empty'), _('hospitality_core.screen.tapeChart.emptyHint')),
|
|
4136
|
+
}) }));
|
|
4137
|
+
};
|
|
4138
|
+
//# sourceMappingURL=screens.js.map
|