@managesome/eposmatic-toolkit 0.3.8 → 0.3.10
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/esm/constants/ANALYTICS.js +146 -0
- package/esm/constants/API_ERRORS.js +6 -0
- package/esm/constants/COMMON.js +369 -0
- package/esm/constants/DELIVERY.js +45 -0
- package/esm/constants/DIALER_ENUMS.js +11 -0
- package/esm/constants/ENUMS.js +1988 -0
- package/esm/constants/FBR_ENUMS.js +18 -0
- package/esm/constants/HUBRISE_ENUMS.js +179 -0
- package/esm/constants/INTERNAL_ENUMS.js +49 -0
- package/esm/constants/NOTIFICATIONS.js +6 -0
- package/esm/constants/ORDER.js +251 -0
- package/esm/constants/PRA_ENUMS.js +18 -0
- package/esm/constants/REPORT_WEBVIEW.js +28 -0
- package/esm/constants/RFQ_GO.js +83 -0
- package/esm/constants/SMARTPAY_ENUMS.js +55 -0
- package/esm/constants/SOCKET.js +149 -0
- package/esm/constants/SRB_ENUMS.js +13 -0
- package/esm/constants/SWITCHPAY.js +28 -0
- package/esm/constants/TENANT_ENUMS.js +90 -0
- package/esm/constants/TENANT_PURCHASE_ORDER.js +91 -0
- package/esm/constants/WALLET.js +51 -0
- package/esm/constants/WAREHOUSE_ANALYTICS.js +28 -0
- package/esm/constants/WAREHOUSE_ENUMS.js +420 -0
- package/esm/constants/WAREHOUSE_PURCHASE_ORDER.js +97 -0
- package/esm/constants/WEBVIEW.js +43 -0
- package/esm/constants/WORKER_ENDPOINTS.js +79 -0
- package/esm/constants/index.js +27 -0
- package/esm/constants/types.js +2 -0
- package/esm/helpers/fbr/generate-invoice.js +94 -0
- package/esm/helpers/fbr/index.js +1 -0
- package/esm/helpers/hubrise/hubrise-catalog.js +304 -0
- package/esm/helpers/hubrise/index.js +1 -0
- package/esm/helpers/index.js +9 -0
- package/esm/helpers/kpra/generate-invoice.js +26 -0
- package/esm/helpers/kpra/index.js +1 -0
- package/esm/helpers/order/generate-order.js +508 -0
- package/esm/helpers/order/generate-warehouse-internal-movement.js +71 -0
- package/esm/helpers/order/generate-warehouse-purchase-order-rfq.js +176 -0
- package/esm/helpers/order/generate-warehouse-purchase-order.js +187 -0
- package/esm/helpers/order/generate-warehouse-sale-order-rfq.js +176 -0
- package/esm/helpers/order/generate-warehouse-sale-order.js +149 -0
- package/esm/helpers/order/index.js +6 -0
- package/esm/helpers/pra/generate-invoice.js +94 -0
- package/esm/helpers/pra/index.js +1 -0
- package/esm/helpers/srb/generate-invoice.js +68 -0
- package/esm/helpers/srb/index.js +1 -0
- package/esm/helpers/store/all-orders-actions.js +17 -0
- package/esm/helpers/store/all-tenant-purchase-orders-actions.js +45 -0
- package/esm/helpers/store/all-warehouse-purchase-order-rfqs-actions.js +66 -0
- package/esm/helpers/store/all-warehouse-purchase-order-vendor-return-actions.js +50 -0
- package/esm/helpers/store/all-warehouse-purchase-orders-actions.js +49 -0
- package/esm/helpers/store/all-warehouse-sale-order-invoices-actions.js +132 -0
- package/esm/helpers/store/all-warehouse-sale-order-rfqs-actions.js +66 -0
- package/esm/helpers/store/all-warehouse-sale-orders-actions.js +72 -0
- package/esm/helpers/store/cart-actions.js +3563 -0
- package/esm/helpers/store/catalog-actions.js +379 -0
- package/esm/helpers/store/common-order-actions.js +937 -0
- package/esm/helpers/store/common-tenant-purchase-order-actions.js +440 -0
- package/esm/helpers/store/common-warehouse-internal-movement-actions.js +95 -0
- package/esm/helpers/store/common-warehouse-purchase-order-actions.js +530 -0
- package/esm/helpers/store/common-warehouse-purchase-order-receipt-actions.js +33 -0
- package/esm/helpers/store/common-warehouse-purchase-order-rfq-actions.js +523 -0
- package/esm/helpers/store/common-warehouse-purchase-order-vendor-return-actions.js +25 -0
- package/esm/helpers/store/common-warehouse-sale-order-actions.js +483 -0
- package/esm/helpers/store/common-warehouse-sale-order-invoice-actions.js +54 -0
- package/esm/helpers/store/common-warehouse-sale-order-rfq-actions.js +523 -0
- package/esm/helpers/store/index.js +26 -0
- package/esm/helpers/store/offline-ordering.js +251 -0
- package/esm/helpers/store/tenant-purchase-orders-cart-actions.js +379 -0
- package/esm/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +360 -0
- package/esm/helpers/store/warehouse-purchase-orders-cart-actions.js +470 -0
- package/esm/helpers/store/warehouse-sale-order-rfq-cart-actions.js +359 -0
- package/esm/helpers/store/warehouse-sale-orders-cart-actions.js +456 -0
- package/esm/helpers/types/api-types.js +1 -0
- package/esm/helpers/types/cart-actions.js +1 -0
- package/esm/helpers/types/cart-helpers.js +1 -0
- package/esm/helpers/types/catalog.js +1 -0
- package/esm/helpers/types/common.js +1 -0
- package/esm/helpers/types/deliverect_menu.js +1 -0
- package/esm/helpers/types/email-templates.js +1 -0
- package/esm/helpers/types/fbr-generate-invoice.js +1 -0
- package/esm/helpers/types/halfhalf.js +1 -0
- package/esm/helpers/types/hubrise_catalog.js +1 -0
- package/esm/helpers/types/hubrise_customers.js +1 -0
- package/esm/helpers/types/hubrise_deliveries.js +1 -0
- package/esm/helpers/types/hubrise_location.js +1 -0
- package/esm/helpers/types/hubrise_orders.js +1 -0
- package/esm/helpers/types/index.js +33 -0
- package/esm/helpers/types/internal-leads.js +1 -0
- package/esm/helpers/types/inventory-catalog.js +1 -0
- package/esm/helpers/types/kpra-generate-invoice.js +1 -0
- package/esm/helpers/types/marketing.js +1 -0
- package/esm/helpers/types/order-engine.js +1 -0
- package/esm/helpers/types/pra-generate-invoice.js +1 -0
- package/esm/helpers/types/report-webview.js +1 -0
- package/esm/helpers/types/reports.js +1 -0
- package/esm/helpers/types/smartpay-apis.js +2 -0
- package/esm/helpers/types/specials.js +1 -0
- package/esm/helpers/types/split_bill.js +1 -0
- package/esm/helpers/types/srb-generate-invoice.js +1 -0
- package/esm/helpers/types/switchpay.js +1 -0
- package/esm/helpers/types/tenant-purchase-order-cart-actions.js +1 -0
- package/esm/helpers/types/warehouse-catalog.js +1 -0
- package/esm/helpers/types/warehouse-purchase-order-cart-actions.js +1 -0
- package/esm/helpers/types/warehouse-purchase-order-rfq-cart-actions.js +1 -0
- package/esm/helpers/types/warehouse-sale-order-cart-actions.js +1 -0
- package/esm/helpers/types/warehouse-sale-order-rfq-cart-actions.js +1 -0
- package/esm/helpers/types/workers.js +1 -0
- package/esm/helpers/utils/asaanbill-identifier-helpers.js +31 -0
- package/esm/helpers/utils/business-day-helpers.js +201 -0
- package/esm/helpers/utils/cart-helpers.js +156 -0
- package/esm/helpers/utils/catalog-conversion.js +129 -0
- package/esm/helpers/utils/code-redemption-helpers.js +452 -0
- package/esm/helpers/utils/color-helpers.js +31 -0
- package/esm/helpers/utils/common.js +368 -0
- package/esm/helpers/utils/crypt.js +40 -0
- package/esm/helpers/utils/customers-helpers.js +15 -0
- package/esm/helpers/utils/delivery-area-helpers.js +42 -0
- package/esm/helpers/utils/delivery-helpers.js +87 -0
- package/esm/helpers/utils/denominations-helpers.js +53 -0
- package/esm/helpers/utils/dinein.js +39 -0
- package/esm/helpers/utils/discount-helpers.js +55 -0
- package/esm/helpers/utils/email-helpers.js +111 -0
- package/esm/helpers/utils/error-helpers.js +14 -0
- package/esm/helpers/utils/expense.js +26 -0
- package/esm/helpers/utils/getFormFieldsDiff.js +15 -0
- package/esm/helpers/utils/gift-card-helpers.js +258 -0
- package/esm/helpers/utils/halfhalf-setup-helpers.js +779 -0
- package/esm/helpers/utils/hourly-comparison-report-helpers.js +851 -0
- package/esm/helpers/utils/hr-helpers.js +62 -0
- package/esm/helpers/utils/hubrise-utils.js +32 -0
- package/esm/helpers/utils/image-helpers.js +95 -0
- package/esm/helpers/utils/image-url-helpers.js +96 -0
- package/esm/helpers/utils/index.js +96 -0
- package/esm/helpers/utils/ingredients.js +26 -0
- package/esm/helpers/utils/internal-amount-helpers.js +49 -0
- package/esm/helpers/utils/inventory.js +123 -0
- package/esm/helpers/utils/inventory_entries.js +91 -0
- package/esm/helpers/utils/inventory_transactions.js +91 -0
- package/esm/helpers/utils/item-report-helpers.js +2603 -0
- package/esm/helpers/utils/items-comparison-report-helpers.js +1057 -0
- package/esm/helpers/utils/kds-helpers.js +43 -0
- package/esm/helpers/utils/location-helpers.js +13 -0
- package/esm/helpers/utils/menu-helpers.js +44 -0
- package/esm/helpers/utils/minified-catalog.js +428 -0
- package/esm/helpers/utils/offer-apply-helpers.js +613 -0
- package/esm/helpers/utils/offers-helpers.js +3351 -0
- package/esm/helpers/utils/operational-roles-helpers.js +33 -0
- package/esm/helpers/utils/order-engine.js +1409 -0
- package/esm/helpers/utils/order-history.js +208 -0
- package/esm/helpers/utils/payment-comparison-report-helpers.js +873 -0
- package/esm/helpers/utils/payment-helpers.js +302 -0
- package/esm/helpers/utils/pdf-generator.js +110 -0
- package/esm/helpers/utils/platform-catalog.js +306 -0
- package/esm/helpers/utils/platform-num.js +188 -0
- package/esm/helpers/utils/platform-specific-tenant-shifts.js +19 -0
- package/esm/helpers/utils/price-conversion.js +24 -0
- package/esm/helpers/utils/printer-helpers.js +319 -0
- package/esm/helpers/utils/public-holidays-helpers.js +8 -0
- package/esm/helpers/utils/ratings-comparison-report-helpers.js +1187 -0
- package/esm/helpers/utils/receipt-engine.js +1050 -0
- package/esm/helpers/utils/review-helpers.js +391 -0
- package/esm/helpers/utils/rider-tracking.js +12 -0
- package/esm/helpers/utils/riders-report-helpers.js +1590 -0
- package/esm/helpers/utils/sales-comparison-report-helpers.js +1259 -0
- package/esm/helpers/utils/sales-comparitive-report-helpers.js +939 -0
- package/esm/helpers/utils/sales-overview-report-helpers.js +1046 -0
- package/esm/helpers/utils/sales-summary-report-helpers.js +877 -0
- package/esm/helpers/utils/scan-code-helpers.js +31 -0
- package/esm/helpers/utils/selection-model.js +68 -0
- package/esm/helpers/utils/shift-window-helpers.js +148 -0
- package/esm/helpers/utils/simplified-catalog.js +107 -0
- package/esm/helpers/utils/simplified-halfhalf.js +101 -0
- package/esm/helpers/utils/simplified-specials.js +107 -0
- package/esm/helpers/utils/simplified-tenant.js +411 -0
- package/esm/helpers/utils/specials-helpers.js +727 -0
- package/esm/helpers/utils/tenant-calendar-helpers.js +67 -0
- package/esm/helpers/utils/tenant-cash-drawer-sessions-helpers.js +248 -0
- package/esm/helpers/utils/tenant-cash-drawers-helpers.js +31 -0
- package/esm/helpers/utils/tenant-cash-in-out-helpers.js +47 -0
- package/esm/helpers/utils/tenant-day-sessions-helpers.js +167 -0
- package/esm/helpers/utils/tenant-instore-shift-sessions-helpers.js +227 -0
- package/esm/helpers/utils/tenant-staff-helpers.js +19 -0
- package/esm/helpers/utils/tenant_cash_in_hand_transactions.js +31 -0
- package/esm/helpers/utils/time-helpers.js +142 -0
- package/esm/helpers/utils/void-items-report-helpers.js +529 -0
- package/esm/helpers/utils/void-order-items-helpers.js +32 -0
- package/esm/helpers/utils/voidations-summary-report-helpers.js +800 -0
- package/esm/helpers/utils/wallet-helpers.js +22 -0
- package/esm/helpers/utils/wallet-redemption-helpers.js +46 -0
- package/esm/helpers/utils/warehouse-catalog-conversion.js +117 -0
- package/esm/helpers/utils/warehouse-inventory.js +59 -0
- package/esm/helpers/utils/warehouse-purchase-order-engine.js +27 -0
- package/esm/helpers/utils/warehouse-purchase-order-receipt-engine.js +205 -0
- package/esm/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1432 -0
- package/esm/helpers/utils/warehouse-sale-order-engine.js +27 -0
- package/esm/helpers/utils/warehouse-sale-order-receipt-engine.js +207 -0
- package/esm/helpers/utils/warehouse-sale-order-x-report-helpers.js +1 -0
- package/esm/helpers/utils/warehouse-sale-x-report-helpers.js +1434 -0
- package/esm/helpers/utils/warehouse-settings-helpers.js +37 -0
- package/esm/helpers/utils/warehouse-void-purchase-order-items-helpers.js +34 -0
- package/esm/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +18 -0
- package/esm/helpers/utils/warehouse-void-sale-order-items-helpers.js +34 -0
- package/esm/helpers/utils/warehouse-void-sale-order-items-report-helpers.js +18 -0
- package/esm/helpers/utils/warehouse_inventory_transactions.js +91 -0
- package/esm/helpers/utils/x-report-helpers.js +1850 -0
- package/esm/index.js +3 -0
- package/esm/schemas/index.js +2 -0
- package/esm/schemas/models/app_configs.js +36 -0
- package/esm/schemas/models/applied_order_discounts.js +103 -0
- package/esm/schemas/models/brands.js +56 -0
- package/esm/schemas/models/categories.js +74 -0
- package/esm/schemas/models/close_dates.js +63 -0
- package/esm/schemas/models/common-models.js +449 -0
- package/esm/schemas/models/courses.js +62 -0
- package/esm/schemas/models/customer_redemptions.js +82 -0
- package/esm/schemas/models/customers.js +269 -0
- package/esm/schemas/models/deliveries.js +137 -0
- package/esm/schemas/models/delivery_areas.js +97 -0
- package/esm/schemas/models/dinein_floors.js +55 -0
- package/esm/schemas/models/dinein_tables.js +97 -0
- package/esm/schemas/models/dinein_tables_fingerprints.js +96 -0
- package/esm/schemas/models/discounts.js +87 -0
- package/esm/schemas/models/expense_categories.js +61 -0
- package/esm/schemas/models/expense_details.js +130 -0
- package/esm/schemas/models/gift_cards.js +342 -0
- package/esm/schemas/models/halfhalf_setup.js +142 -0
- package/esm/schemas/models/index.js +111 -0
- package/esm/schemas/models/internal_customers.js +139 -0
- package/esm/schemas/models/internal_invoices.js +119 -0
- package/esm/schemas/models/internal_leads.js +78 -0
- package/esm/schemas/models/internal_operational_roles.js +85 -0
- package/esm/schemas/models/internal_staffs.js +65 -0
- package/esm/schemas/models/inventories.js +103 -0
- package/esm/schemas/models/inventory_categories.js +52 -0
- package/esm/schemas/models/inventory_transactions.js +143 -0
- package/esm/schemas/models/item_transactions.js +117 -0
- package/esm/schemas/models/items.js +341 -0
- package/esm/schemas/models/marketing_fingerprints.js +92 -0
- package/esm/schemas/models/menus.js +66 -0
- package/esm/schemas/models/messaging_devices.js +99 -0
- package/esm/schemas/models/modifier_extras.js +120 -0
- package/esm/schemas/models/offers.js +470 -0
- package/esm/schemas/models/offers_fingerprints.js +61 -0
- package/esm/schemas/models/operational_roles.js +155 -0
- package/esm/schemas/models/orders.js +1051 -0
- package/esm/schemas/models/printer_settings.js +245 -0
- package/esm/schemas/models/public_holidays.js +58 -0
- package/esm/schemas/models/reservations.js +127 -0
- package/esm/schemas/models/reviews.js +145 -0
- package/esm/schemas/models/rewards_usage.js +61 -0
- package/esm/schemas/models/riders.js +75 -0
- package/esm/schemas/models/specials.js +169 -0
- package/esm/schemas/models/staff_shifts.js +66 -0
- package/esm/schemas/models/tenant-activity-logs.js +126 -0
- package/esm/schemas/models/tenant_active_jobs.js +77 -0
- package/esm/schemas/models/tenant_calendar.js +89 -0
- package/esm/schemas/models/tenant_cash_drawer_sessions.js +208 -0
- package/esm/schemas/models/tenant_cash_drawers.js +60 -0
- package/esm/schemas/models/tenant_cash_in_hand_transactions.js +69 -0
- package/esm/schemas/models/tenant_cash_in_out.js +104 -0
- package/esm/schemas/models/tenant_clients.js +66 -0
- package/esm/schemas/models/tenant_day_sessions.js +166 -0
- package/esm/schemas/models/tenant_hr_attendance_records.js +87 -0
- package/esm/schemas/models/tenant_hr_biometric_enrollments.js +69 -0
- package/esm/schemas/models/tenant_hr_departments.js +42 -0
- package/esm/schemas/models/tenant_hr_documents.js +71 -0
- package/esm/schemas/models/tenant_hr_employees.js +172 -0
- package/esm/schemas/models/tenant_hr_leave_requests.js +80 -0
- package/esm/schemas/models/tenant_hr_payrolls.js +131 -0
- package/esm/schemas/models/tenant_hr_performance_reviews.js +58 -0
- package/esm/schemas/models/tenant_hr_policies.js +57 -0
- package/esm/schemas/models/tenant_hr_positions.js +48 -0
- package/esm/schemas/models/tenant_hr_shift_schedules.js +84 -0
- package/esm/schemas/models/tenant_hr_shifts.js +64 -0
- package/esm/schemas/models/tenant_instore_shift_sessions.js +204 -0
- package/esm/schemas/models/tenant_instore_shifts.js +63 -0
- package/esm/schemas/models/tenant_inventory_department_transactions.js +116 -0
- package/esm/schemas/models/tenant_inventory_department_utilities.js +85 -0
- package/esm/schemas/models/tenant_inventory_departments.js +55 -0
- package/esm/schemas/models/tenant_inventory_entries.js +131 -0
- package/esm/schemas/models/tenant_metadata.js +88 -0
- package/esm/schemas/models/tenant_order_item_instructions.js +66 -0
- package/esm/schemas/models/tenant_purchase_order_vendor_returns.js +80 -0
- package/esm/schemas/models/tenant_purchase_orders.js +158 -0
- package/esm/schemas/models/tenant_shifts.js +57 -0
- package/esm/schemas/models/tenant_staffs.js +129 -0
- package/esm/schemas/models/tenant_vendors.js +99 -0
- package/esm/schemas/models/tenants.js +811 -0
- package/esm/schemas/models/terminal_devices.js +63 -0
- package/esm/schemas/models/tokens.js +73 -0
- package/esm/schemas/models/track_order_numbers.js +42 -0
- package/esm/schemas/models/void_order_items.js +210 -0
- package/esm/schemas/models/vouchers.js +101 -0
- package/esm/schemas/models/wallet_transactions.js +128 -0
- package/esm/schemas/models/wallets.js +44 -0
- package/esm/schemas/models/warehouse-activity-logs.js +144 -0
- package/esm/schemas/models/warehouse_categories.js +83 -0
- package/esm/schemas/models/warehouse_clients.js +81 -0
- package/esm/schemas/models/warehouse_communications.js +226 -0
- package/esm/schemas/models/warehouse_internal_movements.js +463 -0
- package/esm/schemas/models/warehouse_inventory_entries.js +125 -0
- package/esm/schemas/models/warehouse_inventory_lot_serial_numbers.js +188 -0
- package/esm/schemas/models/warehouse_inventory_transactions.js +133 -0
- package/esm/schemas/models/warehouse_item_transactions.js +97 -0
- package/esm/schemas/models/warehouse_items.js +173 -0
- package/esm/schemas/models/warehouse_operational_roles.js +87 -0
- package/esm/schemas/models/warehouse_purchase_order_receipts.js +163 -0
- package/esm/schemas/models/warehouse_purchase_order_rfqs.js +339 -0
- package/esm/schemas/models/warehouse_purchase_order_vendor_returns.js +199 -0
- package/esm/schemas/models/warehouse_purchase_orders.js +334 -0
- package/esm/schemas/models/warehouse_sale_deliveries.js +155 -0
- package/esm/schemas/models/warehouse_sale_invoices.js +229 -0
- package/esm/schemas/models/warehouse_sale_order_rfqs.js +340 -0
- package/esm/schemas/models/warehouse_sale_orders.js +322 -0
- package/esm/schemas/models/warehouse_staffs.js +104 -0
- package/esm/schemas/models/warehouse_track_order_numbers.js +73 -0
- package/esm/schemas/models/warehouse_vendors.js +99 -0
- package/esm/schemas/models/warehouse_void_purchase_order_items.js +174 -0
- package/esm/schemas/models/warehouse_void_sale_order_items.js +174 -0
- package/esm/schemas/models/warehouses.js +253 -0
- package/esm/schemas/types/app_configs.js +1 -0
- package/esm/schemas/types/applied_order_discounts.js +1 -0
- package/esm/schemas/types/brands.js +1 -0
- package/esm/schemas/types/categories.js +1 -0
- package/esm/schemas/types/close_dates.js +1 -0
- package/esm/schemas/types/common.js +1 -0
- package/esm/schemas/types/courses.js +1 -0
- package/esm/schemas/types/customer_redemptions.js +1 -0
- package/esm/schemas/types/customers.js +1 -0
- package/esm/schemas/types/deliveries.js +1 -0
- package/esm/schemas/types/delivery_areas.js +1 -0
- package/esm/schemas/types/dinein_floors.js +1 -0
- package/esm/schemas/types/dinein_tables.js +1 -0
- package/esm/schemas/types/dinein_tables_fingerprints.js +1 -0
- package/esm/schemas/types/discounts.js +1 -0
- package/esm/schemas/types/expense_categories.js +1 -0
- package/esm/schemas/types/expense_details.js +1 -0
- package/esm/schemas/types/gift_cards.js +1 -0
- package/esm/schemas/types/halfhalf_setup.js +1 -0
- package/esm/schemas/types/index.js +113 -0
- package/esm/schemas/types/internal_customers.js +1 -0
- package/esm/schemas/types/internal_invoices.js +1 -0
- package/esm/schemas/types/internal_leads.js +1 -0
- package/esm/schemas/types/internal_operational_roles.js +16 -0
- package/esm/schemas/types/internal_staffs.js +1 -0
- package/esm/schemas/types/inventories.js +1 -0
- package/esm/schemas/types/inventory_categories.js +1 -0
- package/esm/schemas/types/inventory_department_transactions.js +1 -0
- package/esm/schemas/types/inventory_department_utilities.js +1 -0
- package/esm/schemas/types/inventory_departments.js +1 -0
- package/esm/schemas/types/inventory_transactions.js +1 -0
- package/esm/schemas/types/item_transactions.js +1 -0
- package/esm/schemas/types/items.js +1 -0
- package/esm/schemas/types/marketing_fingerprints.js +1 -0
- package/esm/schemas/types/menus.js +1 -0
- package/esm/schemas/types/messaging_devices.js +1 -0
- package/esm/schemas/types/modifier_extras.js +1 -0
- package/esm/schemas/types/multi_tenants.js +1 -0
- package/esm/schemas/types/offers.js +1 -0
- package/esm/schemas/types/offers_fingerprints.js +1 -0
- package/esm/schemas/types/operational_roles.js +15 -0
- package/esm/schemas/types/orders.js +1 -0
- package/esm/schemas/types/printer_settings.js +1 -0
- package/esm/schemas/types/public_holidays.js +1 -0
- package/esm/schemas/types/reservations.js +1 -0
- package/esm/schemas/types/reviews.js +1 -0
- package/esm/schemas/types/rewards_usage.js +1 -0
- package/esm/schemas/types/riders.js +1 -0
- package/esm/schemas/types/specials.js +1 -0
- package/esm/schemas/types/staff_shifts.js +1 -0
- package/esm/schemas/types/tenant-activity-logs.js +1 -0
- package/esm/schemas/types/tenant_active_jobs.js +1 -0
- package/esm/schemas/types/tenant_calendar.js +1 -0
- package/esm/schemas/types/tenant_cash_drawer_sessions.js +1 -0
- package/esm/schemas/types/tenant_cash_drawers.js +1 -0
- package/esm/schemas/types/tenant_cash_in_hand_transactions.js +1 -0
- package/esm/schemas/types/tenant_cash_in_out.js +1 -0
- package/esm/schemas/types/tenant_clients.js +1 -0
- package/esm/schemas/types/tenant_day_sessions.js +1 -0
- package/esm/schemas/types/tenant_hr_attendance_records.js +1 -0
- package/esm/schemas/types/tenant_hr_biometric_enrollments.js +1 -0
- package/esm/schemas/types/tenant_hr_departments.js +1 -0
- package/esm/schemas/types/tenant_hr_documents.js +1 -0
- package/esm/schemas/types/tenant_hr_employees.js +1 -0
- package/esm/schemas/types/tenant_hr_leave_requests.js +1 -0
- package/esm/schemas/types/tenant_hr_payrolls.js +1 -0
- package/esm/schemas/types/tenant_hr_performance_reviews.js +1 -0
- package/esm/schemas/types/tenant_hr_policies.js +1 -0
- package/esm/schemas/types/tenant_hr_positions.js +1 -0
- package/esm/schemas/types/tenant_hr_shift_schedules.js +1 -0
- package/esm/schemas/types/tenant_hr_shifts.js +1 -0
- package/esm/schemas/types/tenant_instore_shift_sessions.js +1 -0
- package/esm/schemas/types/tenant_instore_shifts.js +1 -0
- package/esm/schemas/types/tenant_inventory_entries.js +1 -0
- package/esm/schemas/types/tenant_metadata.js +1 -0
- package/esm/schemas/types/tenant_order_item_instructions.js +1 -0
- package/esm/schemas/types/tenant_purchase_order_vendor_returns.js +1 -0
- package/esm/schemas/types/tenant_purchase_orders.js +1 -0
- package/esm/schemas/types/tenant_shifts.js +1 -0
- package/esm/schemas/types/tenant_staffs.js +1 -0
- package/esm/schemas/types/tenant_vendors.js +1 -0
- package/esm/schemas/types/tenants.js +1 -0
- package/esm/schemas/types/terminal_devices.js +1 -0
- package/esm/schemas/types/tokens.js +1 -0
- package/esm/schemas/types/track_order_numbers.js +1 -0
- package/esm/schemas/types/void_order_items.js +1 -0
- package/esm/schemas/types/vouchers.js +1 -0
- package/esm/schemas/types/wallet_transactions.js +1 -0
- package/esm/schemas/types/wallets.js +1 -0
- package/esm/schemas/types/warehouse-activity-logs.js +1 -0
- package/esm/schemas/types/warehouse_categories.js +1 -0
- package/esm/schemas/types/warehouse_clients.js +1 -0
- package/esm/schemas/types/warehouse_communications.js +1 -0
- package/esm/schemas/types/warehouse_internal_movements.js +1 -0
- package/esm/schemas/types/warehouse_inventory_entries.js +1 -0
- package/esm/schemas/types/warehouse_inventory_lot_serial_numbers.js +1 -0
- package/esm/schemas/types/warehouse_inventory_transactions.js +1 -0
- package/esm/schemas/types/warehouse_item_transactions.js +1 -0
- package/esm/schemas/types/warehouse_items.js +1 -0
- package/esm/schemas/types/warehouse_operational_roles.js +15 -0
- package/esm/schemas/types/warehouse_purchase_order_receipts.js +18 -0
- package/esm/schemas/types/warehouse_purchase_order_rfqs.js +1 -0
- package/esm/schemas/types/warehouse_purchase_order_vendor_returns.js +1 -0
- package/esm/schemas/types/warehouse_purchase_orders.js +1 -0
- package/esm/schemas/types/warehouse_sale_deliveries.js +1 -0
- package/esm/schemas/types/warehouse_sale_invoices.js +1 -0
- package/esm/schemas/types/warehouse_sale_order_rfqs.js +1 -0
- package/esm/schemas/types/warehouse_sale_orders.js +1 -0
- package/esm/schemas/types/warehouse_staffs.js +1 -0
- package/esm/schemas/types/warehouse_track_order_numbers.js +1 -0
- package/esm/schemas/types/warehouse_vendors.js +1 -0
- package/esm/schemas/types/warehouse_void_purchase_order_items.js +1 -0
- package/esm/schemas/types/warehouse_void_sale_order_items.js +1 -0
- package/esm/schemas/types/warehouses.js +1 -0
- package/lib/helpers/types/api-types.d.ts +37 -0
- package/package.json +6 -3
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { ALL_PRINTER_BRAND_TYPES, ALL_PRINTER_COMMAND_LANGUAGES, ALL_PRINTER_INTERFACES, ALL_RECEIPT_TYPES, KITCHEN_DOCKET_FONT_TYPE_ENUM, PRINTER_INTERFACE_ENUM, PRINTING_PREFERENCE_ENUM, RECEIPT_TYPE_ENUM, } from '../../constants';
|
|
3
|
+
const ReceiptTypesSchema = { type: String, enum: ALL_RECEIPT_TYPES };
|
|
4
|
+
export const PrinterSettingsSchema = new Schema({
|
|
5
|
+
_id: {
|
|
6
|
+
type: Schema.Types.ObjectId,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
tenant_id: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
immutable: true,
|
|
13
|
+
ref: 'tenants',
|
|
14
|
+
},
|
|
15
|
+
target: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
mac_address: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
brand_type: {
|
|
24
|
+
type: String,
|
|
25
|
+
enum: [...ALL_PRINTER_BRAND_TYPES, null],
|
|
26
|
+
required: false,
|
|
27
|
+
},
|
|
28
|
+
cmd_language: {
|
|
29
|
+
type: String,
|
|
30
|
+
enum: [...ALL_PRINTER_COMMAND_LANGUAGES, null],
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
interface_type: {
|
|
34
|
+
type: String,
|
|
35
|
+
enum: ALL_PRINTER_INTERFACES,
|
|
36
|
+
default: PRINTER_INTERFACE_ENUM.LAN,
|
|
37
|
+
},
|
|
38
|
+
name: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
pos_id: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
46
|
+
backup_printer_target: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: false,
|
|
49
|
+
},
|
|
50
|
+
num_of_columns: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 48,
|
|
53
|
+
},
|
|
54
|
+
receiptTypes: {
|
|
55
|
+
type: ReceiptTypesSchema,
|
|
56
|
+
default: ALL_RECEIPT_TYPES,
|
|
57
|
+
},
|
|
58
|
+
boolSettings: {
|
|
59
|
+
isActive: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true,
|
|
62
|
+
},
|
|
63
|
+
syncWithCloud: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true,
|
|
66
|
+
},
|
|
67
|
+
experimentalFastPrinting: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false,
|
|
70
|
+
},
|
|
71
|
+
autoRetry: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
printReviews: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
rasterOnlyReceipt: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: false,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
[RECEIPT_TYPE_ENUM.KITCHEN]: {
|
|
85
|
+
quantityByOrderType: {
|
|
86
|
+
type: Schema.Types.Mixed,
|
|
87
|
+
required: true,
|
|
88
|
+
},
|
|
89
|
+
selectedPlatforms: {
|
|
90
|
+
type: Schema.Types.Mixed,
|
|
91
|
+
required: true,
|
|
92
|
+
},
|
|
93
|
+
menuPreference: {
|
|
94
|
+
type: Schema.Types.Mixed,
|
|
95
|
+
default: PRINTING_PREFERENCE_ENUM.DEFAULT,
|
|
96
|
+
},
|
|
97
|
+
partialMenus: {
|
|
98
|
+
type: [Schema.Types.Mixed],
|
|
99
|
+
default: [],
|
|
100
|
+
},
|
|
101
|
+
dineinPreference: {
|
|
102
|
+
type: Schema.Types.Mixed,
|
|
103
|
+
default: PRINTING_PREFERENCE_ENUM.DEFAULT,
|
|
104
|
+
},
|
|
105
|
+
partialDinein: {
|
|
106
|
+
type: Schema.Types.Mixed,
|
|
107
|
+
default: {},
|
|
108
|
+
},
|
|
109
|
+
fontType: {
|
|
110
|
+
type: Schema.Types.String,
|
|
111
|
+
default: KITCHEN_DOCKET_FONT_TYPE_ENUM.DEFAULT,
|
|
112
|
+
},
|
|
113
|
+
boolSettings: {
|
|
114
|
+
displayCurrency: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false,
|
|
117
|
+
},
|
|
118
|
+
displayModifiersOnSeparateLines: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: true,
|
|
121
|
+
},
|
|
122
|
+
hideModifierName: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
displayItemPrice: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false,
|
|
129
|
+
},
|
|
130
|
+
displayStaffName: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: true,
|
|
133
|
+
},
|
|
134
|
+
displayDeliveryInstructions: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
default: true,
|
|
137
|
+
},
|
|
138
|
+
displayOldItems: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: false,
|
|
141
|
+
},
|
|
142
|
+
keepConcise: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: true,
|
|
145
|
+
},
|
|
146
|
+
addExtraSpaceOnTop: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: false,
|
|
149
|
+
},
|
|
150
|
+
beepOnPrint: {
|
|
151
|
+
type: Boolean,
|
|
152
|
+
default: false,
|
|
153
|
+
},
|
|
154
|
+
singleQuantityTickets: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
required: false,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
[RECEIPT_TYPE_ENUM.CUSTOMER]: {
|
|
161
|
+
quantityByOrderType: {
|
|
162
|
+
type: Schema.Types.Mixed,
|
|
163
|
+
required: true,
|
|
164
|
+
},
|
|
165
|
+
selectedPlatforms: {
|
|
166
|
+
type: Schema.Types.Mixed,
|
|
167
|
+
required: true,
|
|
168
|
+
},
|
|
169
|
+
boolSettings: {
|
|
170
|
+
displayCurrency: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: true,
|
|
173
|
+
},
|
|
174
|
+
displayModifiersOnSeparateLines: {
|
|
175
|
+
type: Boolean,
|
|
176
|
+
default: true,
|
|
177
|
+
},
|
|
178
|
+
hideModifierName: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: false,
|
|
181
|
+
},
|
|
182
|
+
displayStoreImage: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: true,
|
|
185
|
+
},
|
|
186
|
+
displayStoreEmail: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: true,
|
|
189
|
+
},
|
|
190
|
+
displayQRCode: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: true,
|
|
193
|
+
},
|
|
194
|
+
displayDeliveryInstructions: {
|
|
195
|
+
type: Boolean,
|
|
196
|
+
default: true,
|
|
197
|
+
},
|
|
198
|
+
displayStaffName: {
|
|
199
|
+
type: Boolean,
|
|
200
|
+
default: true,
|
|
201
|
+
},
|
|
202
|
+
displayItemModifiers: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
default: true,
|
|
205
|
+
},
|
|
206
|
+
displayItemInstructions: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
default: true,
|
|
209
|
+
},
|
|
210
|
+
displayOrderInstructions: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: true,
|
|
213
|
+
},
|
|
214
|
+
displayUnitItemPrice: {
|
|
215
|
+
type: Boolean,
|
|
216
|
+
default: true,
|
|
217
|
+
},
|
|
218
|
+
displayMetadata: {
|
|
219
|
+
type: Boolean,
|
|
220
|
+
default: false,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
customMessage: {
|
|
224
|
+
type: Schema.Types.String,
|
|
225
|
+
required: false,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
createdAt: {
|
|
229
|
+
type: Schema.Types.Date,
|
|
230
|
+
required: true,
|
|
231
|
+
default: () => new Date(),
|
|
232
|
+
immutable: true,
|
|
233
|
+
},
|
|
234
|
+
updatedAt: {
|
|
235
|
+
type: Schema.Types.Date,
|
|
236
|
+
required: true,
|
|
237
|
+
default: () => new Date(),
|
|
238
|
+
},
|
|
239
|
+
}, {
|
|
240
|
+
timestamps: true,
|
|
241
|
+
versionKey: false,
|
|
242
|
+
minimize: false,
|
|
243
|
+
});
|
|
244
|
+
export const PRINTER_SETTINGS_COLLECTION_NAME = 'printer_settings';
|
|
245
|
+
export const PRINTERS_COLLECTION = 'printers';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { PriceSchema } from './common-models';
|
|
3
|
+
import { PlatformsSchema } from './items';
|
|
4
|
+
export const PublicHolidaySchema = new Schema({
|
|
5
|
+
_id: {
|
|
6
|
+
type: Schema.Types.ObjectId,
|
|
7
|
+
required: true,
|
|
8
|
+
immutable: true,
|
|
9
|
+
},
|
|
10
|
+
tenant_id: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
immutable: true,
|
|
14
|
+
ref: 'tenants',
|
|
15
|
+
},
|
|
16
|
+
included_platforms: {
|
|
17
|
+
type: [PlatformsSchema],
|
|
18
|
+
required: true,
|
|
19
|
+
min: 1,
|
|
20
|
+
},
|
|
21
|
+
name: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
dates: {
|
|
30
|
+
type: [Schema.Types.Date],
|
|
31
|
+
required: true,
|
|
32
|
+
min: 1,
|
|
33
|
+
},
|
|
34
|
+
surcharge: {
|
|
35
|
+
type: PriceSchema,
|
|
36
|
+
default: null,
|
|
37
|
+
},
|
|
38
|
+
is_surcharge_percentage: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
createdAt: {
|
|
43
|
+
type: Schema.Types.Date,
|
|
44
|
+
required: true,
|
|
45
|
+
default: () => new Date(),
|
|
46
|
+
immutable: true,
|
|
47
|
+
},
|
|
48
|
+
updatedAt: {
|
|
49
|
+
type: Schema.Types.Date,
|
|
50
|
+
required: true,
|
|
51
|
+
default: () => new Date(),
|
|
52
|
+
},
|
|
53
|
+
}, {
|
|
54
|
+
timestamps: true,
|
|
55
|
+
versionKey: false,
|
|
56
|
+
minimize: false,
|
|
57
|
+
});
|
|
58
|
+
export const PUBLIC_HOLIDAYS_COLLECTION_NAME = 'public_holidays';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { ALL_ORDER_FROM_NAMES, ALL_RESERVATION_STATUS_TYPES, RESERVATION_STATUS_ENUM } from '../../constants';
|
|
3
|
+
const StaffDetailsSchema = new Schema({
|
|
4
|
+
staff_id: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
staff_name: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: '',
|
|
11
|
+
},
|
|
12
|
+
staff_mobile: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: null,
|
|
15
|
+
},
|
|
16
|
+
staff_email: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: null,
|
|
19
|
+
},
|
|
20
|
+
}, { _id: false, minimize: false });
|
|
21
|
+
export const ReservationsSchema = new Schema({
|
|
22
|
+
_id: {
|
|
23
|
+
type: Schema.Types.ObjectId,
|
|
24
|
+
required: true,
|
|
25
|
+
immutable: true,
|
|
26
|
+
},
|
|
27
|
+
tenant_id: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
immutable: true,
|
|
31
|
+
ref: 'tenants',
|
|
32
|
+
},
|
|
33
|
+
customer_phone: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
ref: 'customers',
|
|
37
|
+
},
|
|
38
|
+
customer_name: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
customer_email: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
tables: {
|
|
47
|
+
type: [
|
|
48
|
+
{
|
|
49
|
+
type: Schema.Types.ObjectId,
|
|
50
|
+
ref: 'dinein_tables',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
reservation_time: {
|
|
56
|
+
type: Schema.Types.Date,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
reservation_duration: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 40,
|
|
62
|
+
},
|
|
63
|
+
num_of_guests: {
|
|
64
|
+
type: Number,
|
|
65
|
+
required: true,
|
|
66
|
+
},
|
|
67
|
+
reservation_status: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: true,
|
|
70
|
+
enum: ALL_RESERVATION_STATUS_TYPES,
|
|
71
|
+
default: RESERVATION_STATUS_ENUM.PENDING,
|
|
72
|
+
},
|
|
73
|
+
special_instructions: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '',
|
|
76
|
+
},
|
|
77
|
+
cancellation_requested: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
required: false,
|
|
80
|
+
},
|
|
81
|
+
cancellation_requested_at: {
|
|
82
|
+
type: Schema.Types.Date,
|
|
83
|
+
required: false,
|
|
84
|
+
},
|
|
85
|
+
cancellation_requested_by: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: false,
|
|
88
|
+
},
|
|
89
|
+
cancellation_request_note: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false,
|
|
92
|
+
},
|
|
93
|
+
staff_details: {
|
|
94
|
+
type: StaffDetailsSchema,
|
|
95
|
+
required: false,
|
|
96
|
+
},
|
|
97
|
+
order_from: {
|
|
98
|
+
type: String,
|
|
99
|
+
enum: ALL_ORDER_FROM_NAMES,
|
|
100
|
+
required: false,
|
|
101
|
+
},
|
|
102
|
+
createdAt_mins: {
|
|
103
|
+
type: Number,
|
|
104
|
+
required: true,
|
|
105
|
+
immutable: true,
|
|
106
|
+
default: () => {
|
|
107
|
+
const date = new Date();
|
|
108
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
createdAt: {
|
|
112
|
+
type: Schema.Types.Date,
|
|
113
|
+
required: true,
|
|
114
|
+
default: () => new Date(),
|
|
115
|
+
immutable: true,
|
|
116
|
+
},
|
|
117
|
+
updatedAt: {
|
|
118
|
+
type: Schema.Types.Date,
|
|
119
|
+
required: true,
|
|
120
|
+
default: () => new Date(),
|
|
121
|
+
},
|
|
122
|
+
}, {
|
|
123
|
+
timestamps: true,
|
|
124
|
+
versionKey: false,
|
|
125
|
+
minimize: false,
|
|
126
|
+
});
|
|
127
|
+
export const RESERVATIONS_COLLECTION_NAME = 'reservations';
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { ALL_PLATFORMS } from '../../constants';
|
|
3
|
+
export const ReviewSchema = new Schema({
|
|
4
|
+
_id: {
|
|
5
|
+
type: Schema.Types.ObjectId,
|
|
6
|
+
required: true,
|
|
7
|
+
immutable: true,
|
|
8
|
+
},
|
|
9
|
+
tenant_id: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
immutable: true,
|
|
13
|
+
ref: 'tenants',
|
|
14
|
+
},
|
|
15
|
+
order_id: {
|
|
16
|
+
type: Schema.Types.ObjectId,
|
|
17
|
+
required: true,
|
|
18
|
+
immutable: true,
|
|
19
|
+
ref: 'orders',
|
|
20
|
+
},
|
|
21
|
+
order_number: {
|
|
22
|
+
type: Number,
|
|
23
|
+
min: 0,
|
|
24
|
+
default: null,
|
|
25
|
+
},
|
|
26
|
+
token_id: {
|
|
27
|
+
type: Schema.Types.ObjectId,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
customer_phone: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '',
|
|
33
|
+
},
|
|
34
|
+
customer_name: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '',
|
|
37
|
+
},
|
|
38
|
+
review: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: '',
|
|
41
|
+
},
|
|
42
|
+
rating: {
|
|
43
|
+
type: Number,
|
|
44
|
+
min: 1,
|
|
45
|
+
max: 5,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
average_rating: {
|
|
49
|
+
type: Number,
|
|
50
|
+
min: 0,
|
|
51
|
+
max: 5,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
food_quality_rating: {
|
|
55
|
+
type: Number,
|
|
56
|
+
min: 1,
|
|
57
|
+
max: 5,
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
60
|
+
service_rating: {
|
|
61
|
+
type: Number,
|
|
62
|
+
min: 1,
|
|
63
|
+
max: 5,
|
|
64
|
+
required: false,
|
|
65
|
+
},
|
|
66
|
+
delivery_rating: {
|
|
67
|
+
type: Number,
|
|
68
|
+
min: 1,
|
|
69
|
+
max: 5,
|
|
70
|
+
required: false,
|
|
71
|
+
},
|
|
72
|
+
cleanliness_rating: {
|
|
73
|
+
type: Number,
|
|
74
|
+
min: 1,
|
|
75
|
+
max: 5,
|
|
76
|
+
required: false,
|
|
77
|
+
},
|
|
78
|
+
value_for_money_rating: {
|
|
79
|
+
type: Number,
|
|
80
|
+
min: 1,
|
|
81
|
+
max: 5,
|
|
82
|
+
required: false,
|
|
83
|
+
},
|
|
84
|
+
ambience_rating: {
|
|
85
|
+
type: Number,
|
|
86
|
+
min: 1,
|
|
87
|
+
max: 5,
|
|
88
|
+
required: false,
|
|
89
|
+
},
|
|
90
|
+
wait_time_rating: {
|
|
91
|
+
type: Number,
|
|
92
|
+
min: 1,
|
|
93
|
+
max: 5,
|
|
94
|
+
required: false,
|
|
95
|
+
},
|
|
96
|
+
seating_comfort_rating: {
|
|
97
|
+
type: Number,
|
|
98
|
+
min: 1,
|
|
99
|
+
max: 5,
|
|
100
|
+
required: false,
|
|
101
|
+
},
|
|
102
|
+
image_urls: {
|
|
103
|
+
type: [String],
|
|
104
|
+
default: [],
|
|
105
|
+
required: false,
|
|
106
|
+
},
|
|
107
|
+
platform: {
|
|
108
|
+
type: String,
|
|
109
|
+
enum: ALL_PLATFORMS,
|
|
110
|
+
required: true,
|
|
111
|
+
},
|
|
112
|
+
should_publish_on_web: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: true,
|
|
115
|
+
},
|
|
116
|
+
is_published_on_google: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: false,
|
|
119
|
+
},
|
|
120
|
+
createdAt_mins: {
|
|
121
|
+
type: Number,
|
|
122
|
+
required: true,
|
|
123
|
+
immutable: true,
|
|
124
|
+
default: () => {
|
|
125
|
+
const date = new Date();
|
|
126
|
+
return Math.floor(date.getHours() * 60 + date.getMinutes());
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
createdAt: {
|
|
130
|
+
type: Schema.Types.Date,
|
|
131
|
+
required: true,
|
|
132
|
+
default: () => new Date(),
|
|
133
|
+
immutable: true,
|
|
134
|
+
},
|
|
135
|
+
updatedAt: {
|
|
136
|
+
type: Schema.Types.Date,
|
|
137
|
+
required: true,
|
|
138
|
+
default: () => new Date(),
|
|
139
|
+
},
|
|
140
|
+
}, {
|
|
141
|
+
timestamps: true,
|
|
142
|
+
versionKey: false,
|
|
143
|
+
minimize: false,
|
|
144
|
+
});
|
|
145
|
+
export const REVIEWS_COLLECTION_NAME = 'reviews';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { ALL_REWARDS_USAGE_REF_TYPES } from '../../constants';
|
|
3
|
+
export const RewardsUsageSchema = new Schema({
|
|
4
|
+
_id: {
|
|
5
|
+
type: Schema.Types.ObjectId,
|
|
6
|
+
required: true,
|
|
7
|
+
immutable: true,
|
|
8
|
+
},
|
|
9
|
+
ref_id: {
|
|
10
|
+
type: Schema.Types.ObjectId,
|
|
11
|
+
required: true,
|
|
12
|
+
immutable: true,
|
|
13
|
+
},
|
|
14
|
+
ref_type: {
|
|
15
|
+
type: String,
|
|
16
|
+
enum: ALL_REWARDS_USAGE_REF_TYPES,
|
|
17
|
+
required: true,
|
|
18
|
+
immutable: true,
|
|
19
|
+
},
|
|
20
|
+
customer_phone: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
immutable: true,
|
|
24
|
+
},
|
|
25
|
+
assigned_count: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: true,
|
|
28
|
+
default: 0,
|
|
29
|
+
},
|
|
30
|
+
last_assigned_at: {
|
|
31
|
+
type: Schema.Types.Date,
|
|
32
|
+
required: true,
|
|
33
|
+
default: null,
|
|
34
|
+
},
|
|
35
|
+
used_count: {
|
|
36
|
+
type: Number,
|
|
37
|
+
required: true,
|
|
38
|
+
default: 0,
|
|
39
|
+
},
|
|
40
|
+
last_used_at: {
|
|
41
|
+
type: Schema.Types.Date,
|
|
42
|
+
required: true,
|
|
43
|
+
default: null,
|
|
44
|
+
},
|
|
45
|
+
createdAt: {
|
|
46
|
+
type: Schema.Types.Date,
|
|
47
|
+
required: true,
|
|
48
|
+
default: () => new Date(),
|
|
49
|
+
immutable: true,
|
|
50
|
+
},
|
|
51
|
+
updatedAt: {
|
|
52
|
+
type: Schema.Types.Date,
|
|
53
|
+
required: true,
|
|
54
|
+
default: () => new Date(),
|
|
55
|
+
},
|
|
56
|
+
}, {
|
|
57
|
+
timestamps: true,
|
|
58
|
+
versionKey: false,
|
|
59
|
+
minimize: false,
|
|
60
|
+
});
|
|
61
|
+
export const REWARDS_USAGE_COLLECTION_NAME = 'rewards_usage';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export const RiderSchema = new Schema({
|
|
3
|
+
_id: {
|
|
4
|
+
type: Schema.Types.ObjectId,
|
|
5
|
+
required: true,
|
|
6
|
+
immutable: true,
|
|
7
|
+
},
|
|
8
|
+
uid: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
immutable: true,
|
|
12
|
+
},
|
|
13
|
+
is_disabled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
display_name: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: null,
|
|
20
|
+
},
|
|
21
|
+
phone_number: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
minlength: 10,
|
|
25
|
+
immutable: true,
|
|
26
|
+
},
|
|
27
|
+
email: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: null,
|
|
30
|
+
},
|
|
31
|
+
image_url: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: null,
|
|
34
|
+
},
|
|
35
|
+
lat: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0,
|
|
38
|
+
},
|
|
39
|
+
lng: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: 0,
|
|
42
|
+
},
|
|
43
|
+
is_public: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
is_available: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
is_verified: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
location_service_enabled: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
},
|
|
59
|
+
createdAt: {
|
|
60
|
+
type: Date,
|
|
61
|
+
required: true,
|
|
62
|
+
immutable: true,
|
|
63
|
+
default: () => new Date(),
|
|
64
|
+
},
|
|
65
|
+
updatedAt: {
|
|
66
|
+
type: Date,
|
|
67
|
+
required: true,
|
|
68
|
+
default: () => new Date(),
|
|
69
|
+
},
|
|
70
|
+
}, {
|
|
71
|
+
timestamps: true,
|
|
72
|
+
versionKey: false,
|
|
73
|
+
minimize: false,
|
|
74
|
+
});
|
|
75
|
+
export const RIDERS_COLLECTION_NAME = 'riders';
|