@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.
Files changed (437) hide show
  1. package/esm/constants/ANALYTICS.js +146 -0
  2. package/esm/constants/API_ERRORS.js +6 -0
  3. package/esm/constants/COMMON.js +369 -0
  4. package/esm/constants/DELIVERY.js +45 -0
  5. package/esm/constants/DIALER_ENUMS.js +11 -0
  6. package/esm/constants/ENUMS.js +1988 -0
  7. package/esm/constants/FBR_ENUMS.js +18 -0
  8. package/esm/constants/HUBRISE_ENUMS.js +179 -0
  9. package/esm/constants/INTERNAL_ENUMS.js +49 -0
  10. package/esm/constants/NOTIFICATIONS.js +6 -0
  11. package/esm/constants/ORDER.js +251 -0
  12. package/esm/constants/PRA_ENUMS.js +18 -0
  13. package/esm/constants/REPORT_WEBVIEW.js +28 -0
  14. package/esm/constants/RFQ_GO.js +83 -0
  15. package/esm/constants/SMARTPAY_ENUMS.js +55 -0
  16. package/esm/constants/SOCKET.js +149 -0
  17. package/esm/constants/SRB_ENUMS.js +13 -0
  18. package/esm/constants/SWITCHPAY.js +28 -0
  19. package/esm/constants/TENANT_ENUMS.js +90 -0
  20. package/esm/constants/TENANT_PURCHASE_ORDER.js +91 -0
  21. package/esm/constants/WALLET.js +51 -0
  22. package/esm/constants/WAREHOUSE_ANALYTICS.js +28 -0
  23. package/esm/constants/WAREHOUSE_ENUMS.js +420 -0
  24. package/esm/constants/WAREHOUSE_PURCHASE_ORDER.js +97 -0
  25. package/esm/constants/WEBVIEW.js +43 -0
  26. package/esm/constants/WORKER_ENDPOINTS.js +79 -0
  27. package/esm/constants/index.js +27 -0
  28. package/esm/constants/types.js +2 -0
  29. package/esm/helpers/fbr/generate-invoice.js +94 -0
  30. package/esm/helpers/fbr/index.js +1 -0
  31. package/esm/helpers/hubrise/hubrise-catalog.js +304 -0
  32. package/esm/helpers/hubrise/index.js +1 -0
  33. package/esm/helpers/index.js +9 -0
  34. package/esm/helpers/kpra/generate-invoice.js +26 -0
  35. package/esm/helpers/kpra/index.js +1 -0
  36. package/esm/helpers/order/generate-order.js +508 -0
  37. package/esm/helpers/order/generate-warehouse-internal-movement.js +71 -0
  38. package/esm/helpers/order/generate-warehouse-purchase-order-rfq.js +176 -0
  39. package/esm/helpers/order/generate-warehouse-purchase-order.js +187 -0
  40. package/esm/helpers/order/generate-warehouse-sale-order-rfq.js +176 -0
  41. package/esm/helpers/order/generate-warehouse-sale-order.js +149 -0
  42. package/esm/helpers/order/index.js +6 -0
  43. package/esm/helpers/pra/generate-invoice.js +94 -0
  44. package/esm/helpers/pra/index.js +1 -0
  45. package/esm/helpers/srb/generate-invoice.js +68 -0
  46. package/esm/helpers/srb/index.js +1 -0
  47. package/esm/helpers/store/all-orders-actions.js +17 -0
  48. package/esm/helpers/store/all-tenant-purchase-orders-actions.js +45 -0
  49. package/esm/helpers/store/all-warehouse-purchase-order-rfqs-actions.js +66 -0
  50. package/esm/helpers/store/all-warehouse-purchase-order-vendor-return-actions.js +50 -0
  51. package/esm/helpers/store/all-warehouse-purchase-orders-actions.js +49 -0
  52. package/esm/helpers/store/all-warehouse-sale-order-invoices-actions.js +132 -0
  53. package/esm/helpers/store/all-warehouse-sale-order-rfqs-actions.js +66 -0
  54. package/esm/helpers/store/all-warehouse-sale-orders-actions.js +72 -0
  55. package/esm/helpers/store/cart-actions.js +3563 -0
  56. package/esm/helpers/store/catalog-actions.js +379 -0
  57. package/esm/helpers/store/common-order-actions.js +937 -0
  58. package/esm/helpers/store/common-tenant-purchase-order-actions.js +440 -0
  59. package/esm/helpers/store/common-warehouse-internal-movement-actions.js +95 -0
  60. package/esm/helpers/store/common-warehouse-purchase-order-actions.js +530 -0
  61. package/esm/helpers/store/common-warehouse-purchase-order-receipt-actions.js +33 -0
  62. package/esm/helpers/store/common-warehouse-purchase-order-rfq-actions.js +523 -0
  63. package/esm/helpers/store/common-warehouse-purchase-order-vendor-return-actions.js +25 -0
  64. package/esm/helpers/store/common-warehouse-sale-order-actions.js +483 -0
  65. package/esm/helpers/store/common-warehouse-sale-order-invoice-actions.js +54 -0
  66. package/esm/helpers/store/common-warehouse-sale-order-rfq-actions.js +523 -0
  67. package/esm/helpers/store/index.js +26 -0
  68. package/esm/helpers/store/offline-ordering.js +251 -0
  69. package/esm/helpers/store/tenant-purchase-orders-cart-actions.js +379 -0
  70. package/esm/helpers/store/warehouse-purchase-order-rfq-cart-actions.js +360 -0
  71. package/esm/helpers/store/warehouse-purchase-orders-cart-actions.js +470 -0
  72. package/esm/helpers/store/warehouse-sale-order-rfq-cart-actions.js +359 -0
  73. package/esm/helpers/store/warehouse-sale-orders-cart-actions.js +456 -0
  74. package/esm/helpers/types/api-types.js +1 -0
  75. package/esm/helpers/types/cart-actions.js +1 -0
  76. package/esm/helpers/types/cart-helpers.js +1 -0
  77. package/esm/helpers/types/catalog.js +1 -0
  78. package/esm/helpers/types/common.js +1 -0
  79. package/esm/helpers/types/deliverect_menu.js +1 -0
  80. package/esm/helpers/types/email-templates.js +1 -0
  81. package/esm/helpers/types/fbr-generate-invoice.js +1 -0
  82. package/esm/helpers/types/halfhalf.js +1 -0
  83. package/esm/helpers/types/hubrise_catalog.js +1 -0
  84. package/esm/helpers/types/hubrise_customers.js +1 -0
  85. package/esm/helpers/types/hubrise_deliveries.js +1 -0
  86. package/esm/helpers/types/hubrise_location.js +1 -0
  87. package/esm/helpers/types/hubrise_orders.js +1 -0
  88. package/esm/helpers/types/index.js +33 -0
  89. package/esm/helpers/types/internal-leads.js +1 -0
  90. package/esm/helpers/types/inventory-catalog.js +1 -0
  91. package/esm/helpers/types/kpra-generate-invoice.js +1 -0
  92. package/esm/helpers/types/marketing.js +1 -0
  93. package/esm/helpers/types/order-engine.js +1 -0
  94. package/esm/helpers/types/pra-generate-invoice.js +1 -0
  95. package/esm/helpers/types/report-webview.js +1 -0
  96. package/esm/helpers/types/reports.js +1 -0
  97. package/esm/helpers/types/smartpay-apis.js +2 -0
  98. package/esm/helpers/types/specials.js +1 -0
  99. package/esm/helpers/types/split_bill.js +1 -0
  100. package/esm/helpers/types/srb-generate-invoice.js +1 -0
  101. package/esm/helpers/types/switchpay.js +1 -0
  102. package/esm/helpers/types/tenant-purchase-order-cart-actions.js +1 -0
  103. package/esm/helpers/types/warehouse-catalog.js +1 -0
  104. package/esm/helpers/types/warehouse-purchase-order-cart-actions.js +1 -0
  105. package/esm/helpers/types/warehouse-purchase-order-rfq-cart-actions.js +1 -0
  106. package/esm/helpers/types/warehouse-sale-order-cart-actions.js +1 -0
  107. package/esm/helpers/types/warehouse-sale-order-rfq-cart-actions.js +1 -0
  108. package/esm/helpers/types/workers.js +1 -0
  109. package/esm/helpers/utils/asaanbill-identifier-helpers.js +31 -0
  110. package/esm/helpers/utils/business-day-helpers.js +201 -0
  111. package/esm/helpers/utils/cart-helpers.js +156 -0
  112. package/esm/helpers/utils/catalog-conversion.js +129 -0
  113. package/esm/helpers/utils/code-redemption-helpers.js +452 -0
  114. package/esm/helpers/utils/color-helpers.js +31 -0
  115. package/esm/helpers/utils/common.js +368 -0
  116. package/esm/helpers/utils/crypt.js +40 -0
  117. package/esm/helpers/utils/customers-helpers.js +15 -0
  118. package/esm/helpers/utils/delivery-area-helpers.js +42 -0
  119. package/esm/helpers/utils/delivery-helpers.js +87 -0
  120. package/esm/helpers/utils/denominations-helpers.js +53 -0
  121. package/esm/helpers/utils/dinein.js +39 -0
  122. package/esm/helpers/utils/discount-helpers.js +55 -0
  123. package/esm/helpers/utils/email-helpers.js +111 -0
  124. package/esm/helpers/utils/error-helpers.js +14 -0
  125. package/esm/helpers/utils/expense.js +26 -0
  126. package/esm/helpers/utils/getFormFieldsDiff.js +15 -0
  127. package/esm/helpers/utils/gift-card-helpers.js +258 -0
  128. package/esm/helpers/utils/halfhalf-setup-helpers.js +779 -0
  129. package/esm/helpers/utils/hourly-comparison-report-helpers.js +851 -0
  130. package/esm/helpers/utils/hr-helpers.js +62 -0
  131. package/esm/helpers/utils/hubrise-utils.js +32 -0
  132. package/esm/helpers/utils/image-helpers.js +95 -0
  133. package/esm/helpers/utils/image-url-helpers.js +96 -0
  134. package/esm/helpers/utils/index.js +96 -0
  135. package/esm/helpers/utils/ingredients.js +26 -0
  136. package/esm/helpers/utils/internal-amount-helpers.js +49 -0
  137. package/esm/helpers/utils/inventory.js +123 -0
  138. package/esm/helpers/utils/inventory_entries.js +91 -0
  139. package/esm/helpers/utils/inventory_transactions.js +91 -0
  140. package/esm/helpers/utils/item-report-helpers.js +2603 -0
  141. package/esm/helpers/utils/items-comparison-report-helpers.js +1057 -0
  142. package/esm/helpers/utils/kds-helpers.js +43 -0
  143. package/esm/helpers/utils/location-helpers.js +13 -0
  144. package/esm/helpers/utils/menu-helpers.js +44 -0
  145. package/esm/helpers/utils/minified-catalog.js +428 -0
  146. package/esm/helpers/utils/offer-apply-helpers.js +613 -0
  147. package/esm/helpers/utils/offers-helpers.js +3351 -0
  148. package/esm/helpers/utils/operational-roles-helpers.js +33 -0
  149. package/esm/helpers/utils/order-engine.js +1409 -0
  150. package/esm/helpers/utils/order-history.js +208 -0
  151. package/esm/helpers/utils/payment-comparison-report-helpers.js +873 -0
  152. package/esm/helpers/utils/payment-helpers.js +302 -0
  153. package/esm/helpers/utils/pdf-generator.js +110 -0
  154. package/esm/helpers/utils/platform-catalog.js +306 -0
  155. package/esm/helpers/utils/platform-num.js +188 -0
  156. package/esm/helpers/utils/platform-specific-tenant-shifts.js +19 -0
  157. package/esm/helpers/utils/price-conversion.js +24 -0
  158. package/esm/helpers/utils/printer-helpers.js +319 -0
  159. package/esm/helpers/utils/public-holidays-helpers.js +8 -0
  160. package/esm/helpers/utils/ratings-comparison-report-helpers.js +1187 -0
  161. package/esm/helpers/utils/receipt-engine.js +1050 -0
  162. package/esm/helpers/utils/review-helpers.js +391 -0
  163. package/esm/helpers/utils/rider-tracking.js +12 -0
  164. package/esm/helpers/utils/riders-report-helpers.js +1590 -0
  165. package/esm/helpers/utils/sales-comparison-report-helpers.js +1259 -0
  166. package/esm/helpers/utils/sales-comparitive-report-helpers.js +939 -0
  167. package/esm/helpers/utils/sales-overview-report-helpers.js +1046 -0
  168. package/esm/helpers/utils/sales-summary-report-helpers.js +877 -0
  169. package/esm/helpers/utils/scan-code-helpers.js +31 -0
  170. package/esm/helpers/utils/selection-model.js +68 -0
  171. package/esm/helpers/utils/shift-window-helpers.js +148 -0
  172. package/esm/helpers/utils/simplified-catalog.js +107 -0
  173. package/esm/helpers/utils/simplified-halfhalf.js +101 -0
  174. package/esm/helpers/utils/simplified-specials.js +107 -0
  175. package/esm/helpers/utils/simplified-tenant.js +411 -0
  176. package/esm/helpers/utils/specials-helpers.js +727 -0
  177. package/esm/helpers/utils/tenant-calendar-helpers.js +67 -0
  178. package/esm/helpers/utils/tenant-cash-drawer-sessions-helpers.js +248 -0
  179. package/esm/helpers/utils/tenant-cash-drawers-helpers.js +31 -0
  180. package/esm/helpers/utils/tenant-cash-in-out-helpers.js +47 -0
  181. package/esm/helpers/utils/tenant-day-sessions-helpers.js +167 -0
  182. package/esm/helpers/utils/tenant-instore-shift-sessions-helpers.js +227 -0
  183. package/esm/helpers/utils/tenant-staff-helpers.js +19 -0
  184. package/esm/helpers/utils/tenant_cash_in_hand_transactions.js +31 -0
  185. package/esm/helpers/utils/time-helpers.js +142 -0
  186. package/esm/helpers/utils/void-items-report-helpers.js +529 -0
  187. package/esm/helpers/utils/void-order-items-helpers.js +32 -0
  188. package/esm/helpers/utils/voidations-summary-report-helpers.js +800 -0
  189. package/esm/helpers/utils/wallet-helpers.js +22 -0
  190. package/esm/helpers/utils/wallet-redemption-helpers.js +46 -0
  191. package/esm/helpers/utils/warehouse-catalog-conversion.js +117 -0
  192. package/esm/helpers/utils/warehouse-inventory.js +59 -0
  193. package/esm/helpers/utils/warehouse-purchase-order-engine.js +27 -0
  194. package/esm/helpers/utils/warehouse-purchase-order-receipt-engine.js +205 -0
  195. package/esm/helpers/utils/warehouse-purchase-order-x-report-helpers.js +1432 -0
  196. package/esm/helpers/utils/warehouse-sale-order-engine.js +27 -0
  197. package/esm/helpers/utils/warehouse-sale-order-receipt-engine.js +207 -0
  198. package/esm/helpers/utils/warehouse-sale-order-x-report-helpers.js +1 -0
  199. package/esm/helpers/utils/warehouse-sale-x-report-helpers.js +1434 -0
  200. package/esm/helpers/utils/warehouse-settings-helpers.js +37 -0
  201. package/esm/helpers/utils/warehouse-void-purchase-order-items-helpers.js +34 -0
  202. package/esm/helpers/utils/warehouse-void-purchase-order-items-report-helpers.js +18 -0
  203. package/esm/helpers/utils/warehouse-void-sale-order-items-helpers.js +34 -0
  204. package/esm/helpers/utils/warehouse-void-sale-order-items-report-helpers.js +18 -0
  205. package/esm/helpers/utils/warehouse_inventory_transactions.js +91 -0
  206. package/esm/helpers/utils/x-report-helpers.js +1850 -0
  207. package/esm/index.js +3 -0
  208. package/esm/schemas/index.js +2 -0
  209. package/esm/schemas/models/app_configs.js +36 -0
  210. package/esm/schemas/models/applied_order_discounts.js +103 -0
  211. package/esm/schemas/models/brands.js +56 -0
  212. package/esm/schemas/models/categories.js +74 -0
  213. package/esm/schemas/models/close_dates.js +63 -0
  214. package/esm/schemas/models/common-models.js +449 -0
  215. package/esm/schemas/models/courses.js +62 -0
  216. package/esm/schemas/models/customer_redemptions.js +82 -0
  217. package/esm/schemas/models/customers.js +269 -0
  218. package/esm/schemas/models/deliveries.js +137 -0
  219. package/esm/schemas/models/delivery_areas.js +97 -0
  220. package/esm/schemas/models/dinein_floors.js +55 -0
  221. package/esm/schemas/models/dinein_tables.js +97 -0
  222. package/esm/schemas/models/dinein_tables_fingerprints.js +96 -0
  223. package/esm/schemas/models/discounts.js +87 -0
  224. package/esm/schemas/models/expense_categories.js +61 -0
  225. package/esm/schemas/models/expense_details.js +130 -0
  226. package/esm/schemas/models/gift_cards.js +342 -0
  227. package/esm/schemas/models/halfhalf_setup.js +142 -0
  228. package/esm/schemas/models/index.js +111 -0
  229. package/esm/schemas/models/internal_customers.js +139 -0
  230. package/esm/schemas/models/internal_invoices.js +119 -0
  231. package/esm/schemas/models/internal_leads.js +78 -0
  232. package/esm/schemas/models/internal_operational_roles.js +85 -0
  233. package/esm/schemas/models/internal_staffs.js +65 -0
  234. package/esm/schemas/models/inventories.js +103 -0
  235. package/esm/schemas/models/inventory_categories.js +52 -0
  236. package/esm/schemas/models/inventory_transactions.js +143 -0
  237. package/esm/schemas/models/item_transactions.js +117 -0
  238. package/esm/schemas/models/items.js +341 -0
  239. package/esm/schemas/models/marketing_fingerprints.js +92 -0
  240. package/esm/schemas/models/menus.js +66 -0
  241. package/esm/schemas/models/messaging_devices.js +99 -0
  242. package/esm/schemas/models/modifier_extras.js +120 -0
  243. package/esm/schemas/models/offers.js +470 -0
  244. package/esm/schemas/models/offers_fingerprints.js +61 -0
  245. package/esm/schemas/models/operational_roles.js +155 -0
  246. package/esm/schemas/models/orders.js +1051 -0
  247. package/esm/schemas/models/printer_settings.js +245 -0
  248. package/esm/schemas/models/public_holidays.js +58 -0
  249. package/esm/schemas/models/reservations.js +127 -0
  250. package/esm/schemas/models/reviews.js +145 -0
  251. package/esm/schemas/models/rewards_usage.js +61 -0
  252. package/esm/schemas/models/riders.js +75 -0
  253. package/esm/schemas/models/specials.js +169 -0
  254. package/esm/schemas/models/staff_shifts.js +66 -0
  255. package/esm/schemas/models/tenant-activity-logs.js +126 -0
  256. package/esm/schemas/models/tenant_active_jobs.js +77 -0
  257. package/esm/schemas/models/tenant_calendar.js +89 -0
  258. package/esm/schemas/models/tenant_cash_drawer_sessions.js +208 -0
  259. package/esm/schemas/models/tenant_cash_drawers.js +60 -0
  260. package/esm/schemas/models/tenant_cash_in_hand_transactions.js +69 -0
  261. package/esm/schemas/models/tenant_cash_in_out.js +104 -0
  262. package/esm/schemas/models/tenant_clients.js +66 -0
  263. package/esm/schemas/models/tenant_day_sessions.js +166 -0
  264. package/esm/schemas/models/tenant_hr_attendance_records.js +87 -0
  265. package/esm/schemas/models/tenant_hr_biometric_enrollments.js +69 -0
  266. package/esm/schemas/models/tenant_hr_departments.js +42 -0
  267. package/esm/schemas/models/tenant_hr_documents.js +71 -0
  268. package/esm/schemas/models/tenant_hr_employees.js +172 -0
  269. package/esm/schemas/models/tenant_hr_leave_requests.js +80 -0
  270. package/esm/schemas/models/tenant_hr_payrolls.js +131 -0
  271. package/esm/schemas/models/tenant_hr_performance_reviews.js +58 -0
  272. package/esm/schemas/models/tenant_hr_policies.js +57 -0
  273. package/esm/schemas/models/tenant_hr_positions.js +48 -0
  274. package/esm/schemas/models/tenant_hr_shift_schedules.js +84 -0
  275. package/esm/schemas/models/tenant_hr_shifts.js +64 -0
  276. package/esm/schemas/models/tenant_instore_shift_sessions.js +204 -0
  277. package/esm/schemas/models/tenant_instore_shifts.js +63 -0
  278. package/esm/schemas/models/tenant_inventory_department_transactions.js +116 -0
  279. package/esm/schemas/models/tenant_inventory_department_utilities.js +85 -0
  280. package/esm/schemas/models/tenant_inventory_departments.js +55 -0
  281. package/esm/schemas/models/tenant_inventory_entries.js +131 -0
  282. package/esm/schemas/models/tenant_metadata.js +88 -0
  283. package/esm/schemas/models/tenant_order_item_instructions.js +66 -0
  284. package/esm/schemas/models/tenant_purchase_order_vendor_returns.js +80 -0
  285. package/esm/schemas/models/tenant_purchase_orders.js +158 -0
  286. package/esm/schemas/models/tenant_shifts.js +57 -0
  287. package/esm/schemas/models/tenant_staffs.js +129 -0
  288. package/esm/schemas/models/tenant_vendors.js +99 -0
  289. package/esm/schemas/models/tenants.js +811 -0
  290. package/esm/schemas/models/terminal_devices.js +63 -0
  291. package/esm/schemas/models/tokens.js +73 -0
  292. package/esm/schemas/models/track_order_numbers.js +42 -0
  293. package/esm/schemas/models/void_order_items.js +210 -0
  294. package/esm/schemas/models/vouchers.js +101 -0
  295. package/esm/schemas/models/wallet_transactions.js +128 -0
  296. package/esm/schemas/models/wallets.js +44 -0
  297. package/esm/schemas/models/warehouse-activity-logs.js +144 -0
  298. package/esm/schemas/models/warehouse_categories.js +83 -0
  299. package/esm/schemas/models/warehouse_clients.js +81 -0
  300. package/esm/schemas/models/warehouse_communications.js +226 -0
  301. package/esm/schemas/models/warehouse_internal_movements.js +463 -0
  302. package/esm/schemas/models/warehouse_inventory_entries.js +125 -0
  303. package/esm/schemas/models/warehouse_inventory_lot_serial_numbers.js +188 -0
  304. package/esm/schemas/models/warehouse_inventory_transactions.js +133 -0
  305. package/esm/schemas/models/warehouse_item_transactions.js +97 -0
  306. package/esm/schemas/models/warehouse_items.js +173 -0
  307. package/esm/schemas/models/warehouse_operational_roles.js +87 -0
  308. package/esm/schemas/models/warehouse_purchase_order_receipts.js +163 -0
  309. package/esm/schemas/models/warehouse_purchase_order_rfqs.js +339 -0
  310. package/esm/schemas/models/warehouse_purchase_order_vendor_returns.js +199 -0
  311. package/esm/schemas/models/warehouse_purchase_orders.js +334 -0
  312. package/esm/schemas/models/warehouse_sale_deliveries.js +155 -0
  313. package/esm/schemas/models/warehouse_sale_invoices.js +229 -0
  314. package/esm/schemas/models/warehouse_sale_order_rfqs.js +340 -0
  315. package/esm/schemas/models/warehouse_sale_orders.js +322 -0
  316. package/esm/schemas/models/warehouse_staffs.js +104 -0
  317. package/esm/schemas/models/warehouse_track_order_numbers.js +73 -0
  318. package/esm/schemas/models/warehouse_vendors.js +99 -0
  319. package/esm/schemas/models/warehouse_void_purchase_order_items.js +174 -0
  320. package/esm/schemas/models/warehouse_void_sale_order_items.js +174 -0
  321. package/esm/schemas/models/warehouses.js +253 -0
  322. package/esm/schemas/types/app_configs.js +1 -0
  323. package/esm/schemas/types/applied_order_discounts.js +1 -0
  324. package/esm/schemas/types/brands.js +1 -0
  325. package/esm/schemas/types/categories.js +1 -0
  326. package/esm/schemas/types/close_dates.js +1 -0
  327. package/esm/schemas/types/common.js +1 -0
  328. package/esm/schemas/types/courses.js +1 -0
  329. package/esm/schemas/types/customer_redemptions.js +1 -0
  330. package/esm/schemas/types/customers.js +1 -0
  331. package/esm/schemas/types/deliveries.js +1 -0
  332. package/esm/schemas/types/delivery_areas.js +1 -0
  333. package/esm/schemas/types/dinein_floors.js +1 -0
  334. package/esm/schemas/types/dinein_tables.js +1 -0
  335. package/esm/schemas/types/dinein_tables_fingerprints.js +1 -0
  336. package/esm/schemas/types/discounts.js +1 -0
  337. package/esm/schemas/types/expense_categories.js +1 -0
  338. package/esm/schemas/types/expense_details.js +1 -0
  339. package/esm/schemas/types/gift_cards.js +1 -0
  340. package/esm/schemas/types/halfhalf_setup.js +1 -0
  341. package/esm/schemas/types/index.js +113 -0
  342. package/esm/schemas/types/internal_customers.js +1 -0
  343. package/esm/schemas/types/internal_invoices.js +1 -0
  344. package/esm/schemas/types/internal_leads.js +1 -0
  345. package/esm/schemas/types/internal_operational_roles.js +16 -0
  346. package/esm/schemas/types/internal_staffs.js +1 -0
  347. package/esm/schemas/types/inventories.js +1 -0
  348. package/esm/schemas/types/inventory_categories.js +1 -0
  349. package/esm/schemas/types/inventory_department_transactions.js +1 -0
  350. package/esm/schemas/types/inventory_department_utilities.js +1 -0
  351. package/esm/schemas/types/inventory_departments.js +1 -0
  352. package/esm/schemas/types/inventory_transactions.js +1 -0
  353. package/esm/schemas/types/item_transactions.js +1 -0
  354. package/esm/schemas/types/items.js +1 -0
  355. package/esm/schemas/types/marketing_fingerprints.js +1 -0
  356. package/esm/schemas/types/menus.js +1 -0
  357. package/esm/schemas/types/messaging_devices.js +1 -0
  358. package/esm/schemas/types/modifier_extras.js +1 -0
  359. package/esm/schemas/types/multi_tenants.js +1 -0
  360. package/esm/schemas/types/offers.js +1 -0
  361. package/esm/schemas/types/offers_fingerprints.js +1 -0
  362. package/esm/schemas/types/operational_roles.js +15 -0
  363. package/esm/schemas/types/orders.js +1 -0
  364. package/esm/schemas/types/printer_settings.js +1 -0
  365. package/esm/schemas/types/public_holidays.js +1 -0
  366. package/esm/schemas/types/reservations.js +1 -0
  367. package/esm/schemas/types/reviews.js +1 -0
  368. package/esm/schemas/types/rewards_usage.js +1 -0
  369. package/esm/schemas/types/riders.js +1 -0
  370. package/esm/schemas/types/specials.js +1 -0
  371. package/esm/schemas/types/staff_shifts.js +1 -0
  372. package/esm/schemas/types/tenant-activity-logs.js +1 -0
  373. package/esm/schemas/types/tenant_active_jobs.js +1 -0
  374. package/esm/schemas/types/tenant_calendar.js +1 -0
  375. package/esm/schemas/types/tenant_cash_drawer_sessions.js +1 -0
  376. package/esm/schemas/types/tenant_cash_drawers.js +1 -0
  377. package/esm/schemas/types/tenant_cash_in_hand_transactions.js +1 -0
  378. package/esm/schemas/types/tenant_cash_in_out.js +1 -0
  379. package/esm/schemas/types/tenant_clients.js +1 -0
  380. package/esm/schemas/types/tenant_day_sessions.js +1 -0
  381. package/esm/schemas/types/tenant_hr_attendance_records.js +1 -0
  382. package/esm/schemas/types/tenant_hr_biometric_enrollments.js +1 -0
  383. package/esm/schemas/types/tenant_hr_departments.js +1 -0
  384. package/esm/schemas/types/tenant_hr_documents.js +1 -0
  385. package/esm/schemas/types/tenant_hr_employees.js +1 -0
  386. package/esm/schemas/types/tenant_hr_leave_requests.js +1 -0
  387. package/esm/schemas/types/tenant_hr_payrolls.js +1 -0
  388. package/esm/schemas/types/tenant_hr_performance_reviews.js +1 -0
  389. package/esm/schemas/types/tenant_hr_policies.js +1 -0
  390. package/esm/schemas/types/tenant_hr_positions.js +1 -0
  391. package/esm/schemas/types/tenant_hr_shift_schedules.js +1 -0
  392. package/esm/schemas/types/tenant_hr_shifts.js +1 -0
  393. package/esm/schemas/types/tenant_instore_shift_sessions.js +1 -0
  394. package/esm/schemas/types/tenant_instore_shifts.js +1 -0
  395. package/esm/schemas/types/tenant_inventory_entries.js +1 -0
  396. package/esm/schemas/types/tenant_metadata.js +1 -0
  397. package/esm/schemas/types/tenant_order_item_instructions.js +1 -0
  398. package/esm/schemas/types/tenant_purchase_order_vendor_returns.js +1 -0
  399. package/esm/schemas/types/tenant_purchase_orders.js +1 -0
  400. package/esm/schemas/types/tenant_shifts.js +1 -0
  401. package/esm/schemas/types/tenant_staffs.js +1 -0
  402. package/esm/schemas/types/tenant_vendors.js +1 -0
  403. package/esm/schemas/types/tenants.js +1 -0
  404. package/esm/schemas/types/terminal_devices.js +1 -0
  405. package/esm/schemas/types/tokens.js +1 -0
  406. package/esm/schemas/types/track_order_numbers.js +1 -0
  407. package/esm/schemas/types/void_order_items.js +1 -0
  408. package/esm/schemas/types/vouchers.js +1 -0
  409. package/esm/schemas/types/wallet_transactions.js +1 -0
  410. package/esm/schemas/types/wallets.js +1 -0
  411. package/esm/schemas/types/warehouse-activity-logs.js +1 -0
  412. package/esm/schemas/types/warehouse_categories.js +1 -0
  413. package/esm/schemas/types/warehouse_clients.js +1 -0
  414. package/esm/schemas/types/warehouse_communications.js +1 -0
  415. package/esm/schemas/types/warehouse_internal_movements.js +1 -0
  416. package/esm/schemas/types/warehouse_inventory_entries.js +1 -0
  417. package/esm/schemas/types/warehouse_inventory_lot_serial_numbers.js +1 -0
  418. package/esm/schemas/types/warehouse_inventory_transactions.js +1 -0
  419. package/esm/schemas/types/warehouse_item_transactions.js +1 -0
  420. package/esm/schemas/types/warehouse_items.js +1 -0
  421. package/esm/schemas/types/warehouse_operational_roles.js +15 -0
  422. package/esm/schemas/types/warehouse_purchase_order_receipts.js +18 -0
  423. package/esm/schemas/types/warehouse_purchase_order_rfqs.js +1 -0
  424. package/esm/schemas/types/warehouse_purchase_order_vendor_returns.js +1 -0
  425. package/esm/schemas/types/warehouse_purchase_orders.js +1 -0
  426. package/esm/schemas/types/warehouse_sale_deliveries.js +1 -0
  427. package/esm/schemas/types/warehouse_sale_invoices.js +1 -0
  428. package/esm/schemas/types/warehouse_sale_order_rfqs.js +1 -0
  429. package/esm/schemas/types/warehouse_sale_orders.js +1 -0
  430. package/esm/schemas/types/warehouse_staffs.js +1 -0
  431. package/esm/schemas/types/warehouse_track_order_numbers.js +1 -0
  432. package/esm/schemas/types/warehouse_vendors.js +1 -0
  433. package/esm/schemas/types/warehouse_void_purchase_order_items.js +1 -0
  434. package/esm/schemas/types/warehouse_void_sale_order_items.js +1 -0
  435. package/esm/schemas/types/warehouses.js +1 -0
  436. package/lib/helpers/types/api-types.d.ts +37 -0
  437. package/package.json +6 -3
@@ -0,0 +1,1187 @@
1
+ import moment from 'moment';
2
+ import { COMPARISON_REPORT_TYPE_ENUM, PLATFORM_NAMES } from '../../constants';
3
+ import { sentenceCase } from './common';
4
+ // Generate HTML template for rating receipt report
5
+ export function getRatingReceiptReportHtml(props) {
6
+ const { tenantName, from, to, width = 800, monochrome = false, isComparative = false, isPlatformWise = false, isRatingWise = false, isAllTab = false, reportType = COMPARISON_REPORT_TYPE_ENUM.DAILY, tenantNameMap = {}, rawData = [], ratingFields = [], tableTitle = 'Rating Receipt', } = props;
7
+ const fromFormatted = from ? moment(from).format('MMM DD, YYYY') : 'N/A';
8
+ const toFormatted = to ? moment(to).format('MMM DD, YYYY') : 'N/A';
9
+ const currentDate = moment().format('MMM DD, YYYY');
10
+ const currentTime = moment().format('hh:mm A');
11
+ // Helper function to format date based on report type
12
+ const formatDateByReportType = (dateField) => {
13
+ if (reportType === COMPARISON_REPORT_TYPE_ENUM.DAILY) {
14
+ return moment(dateField, 'YYYY-MM-DD').format('MMMM D, YYYY');
15
+ }
16
+ else if (reportType === COMPARISON_REPORT_TYPE_ENUM.WEEKLY) {
17
+ const [year, month, week] = dateField.split('-');
18
+ const monthName = moment(`${year}-${month}`, 'YYYY-MM').format('MMMM');
19
+ return `Week ${parseInt(week, 10)} of ${monthName} ${year}`;
20
+ }
21
+ else {
22
+ return moment(dateField, 'YYYY-MM').format('MMMM YYYY');
23
+ }
24
+ };
25
+ // Helper function to get platform display name
26
+ const getPlatformDisplayName = (platform) => {
27
+ return PLATFORM_NAMES[platform] || platform;
28
+ };
29
+ // Helper function to get tenant display name
30
+ const getTenantDisplayName = (tenantId) => {
31
+ return tenantNameMap[tenantId] || tenantId;
32
+ };
33
+ // Generate receipt content
34
+ const generateReceiptContent = () => {
35
+ if (isAllTab) {
36
+ // For isAllTab: Simple format with centered date header and rating rows
37
+ const groupedData = new Map();
38
+ rawData.forEach((record) => {
39
+ const dateKey = record.date_field;
40
+ if (!groupedData.has(dateKey)) {
41
+ groupedData.set(dateKey, []);
42
+ }
43
+ groupedData.get(dateKey).push(record);
44
+ });
45
+ const sortedEntries = Array.from(groupedData.entries()).sort(([a], [b]) => moment(a).valueOf() - moment(b).valueOf());
46
+ return sortedEntries
47
+ .map(([date, records]) => {
48
+ let content = `
49
+ <div class="date-header">
50
+ ${formatDateByReportType(date)}
51
+ </div>
52
+ `;
53
+ // Aggregate ratings across all records for this date
54
+ const aggregatedRatings = new Map();
55
+ records.forEach((record) => {
56
+ ratingFields.forEach((field) => {
57
+ const avgField = `${field}_average`;
58
+ const countField = `${field}_count`;
59
+ const avgValue = record[avgField];
60
+ const countValue = record[countField];
61
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
62
+ if (!aggregatedRatings.has(field)) {
63
+ aggregatedRatings.set(field, {
64
+ total: 0,
65
+ count: 0,
66
+ totalCount: 0,
67
+ });
68
+ }
69
+ const current = aggregatedRatings.get(field);
70
+ current.total += avgValue * countValue;
71
+ current.totalCount += countValue;
72
+ current.count += 1;
73
+ }
74
+ });
75
+ });
76
+ aggregatedRatings.forEach((data, field) => {
77
+ const finalAverage = data.total / data.totalCount;
78
+ const displayName = sentenceCase(field.replace(/_/g, ' '));
79
+ content += `
80
+ <div class="rating-row">
81
+ <span class="rating-label">${displayName}</span>
82
+ <span class="rating-value">${finalAverage.toFixed(1)}(${data.totalCount})</span>
83
+ </div>
84
+ `;
85
+ });
86
+ return content;
87
+ })
88
+ .join('');
89
+ }
90
+ else if (isPlatformWise) {
91
+ // For isPlatformWise: Group by date, then by platform
92
+ const groupedData = new Map();
93
+ rawData.forEach((record) => {
94
+ const dateKey = record.date_field;
95
+ const platformKey = record.platform;
96
+ if (!groupedData.has(dateKey)) {
97
+ groupedData.set(dateKey, new Map());
98
+ }
99
+ if (!groupedData.get(dateKey).has(platformKey)) {
100
+ groupedData.get(dateKey).set(platformKey, []);
101
+ }
102
+ groupedData.get(dateKey).get(platformKey).push(record);
103
+ });
104
+ const sortedEntries = Array.from(groupedData.entries()).sort(([a], [b]) => moment(a).valueOf() - moment(b).valueOf());
105
+ return sortedEntries
106
+ .map(([date, platformData]) => {
107
+ let content = `
108
+ <div class="date-header">
109
+ ${formatDateByReportType(date)}
110
+ </div>
111
+ `;
112
+ Array.from(platformData.entries()).forEach(([platform, records]) => {
113
+ content += `
114
+ <div class="platform-header">
115
+ ${getPlatformDisplayName(platform)}
116
+ </div>
117
+ `;
118
+ const aggregatedRatings = new Map();
119
+ records.forEach((record) => {
120
+ ratingFields.forEach((field) => {
121
+ const avgField = `${field}_average`;
122
+ const countField = `${field}_count`;
123
+ const avgValue = record[avgField];
124
+ const countValue = record[countField];
125
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
126
+ if (!aggregatedRatings.has(field)) {
127
+ aggregatedRatings.set(field, {
128
+ total: 0,
129
+ count: 0,
130
+ totalCount: 0,
131
+ });
132
+ }
133
+ const current = aggregatedRatings.get(field);
134
+ current.total += avgValue * countValue;
135
+ current.totalCount += countValue;
136
+ current.count += 1;
137
+ }
138
+ });
139
+ });
140
+ aggregatedRatings.forEach((data, field) => {
141
+ const finalAverage = data.total / data.totalCount;
142
+ const displayName = sentenceCase(field.replace(/_/g, ' '));
143
+ content += `
144
+ <div class="rating-row indented">
145
+ <span class="rating-label">${displayName}</span>
146
+ <span class="rating-value">${finalAverage.toFixed(1)}(${data.totalCount})</span>
147
+ </div>
148
+ `;
149
+ });
150
+ });
151
+ return content;
152
+ })
153
+ .join('');
154
+ }
155
+ else if (isRatingWise) {
156
+ // For isRatingWise: Group by date, show each rating record separately
157
+ const groupedData = new Map();
158
+ rawData.forEach((record) => {
159
+ const dateKey = record.date_field;
160
+ if (!groupedData.has(dateKey)) {
161
+ groupedData.set(dateKey, []);
162
+ }
163
+ groupedData.get(dateKey).push(record);
164
+ });
165
+ const sortedEntries = Array.from(groupedData.entries()).sort(([a], [b]) => moment(a).valueOf() - moment(b).valueOf());
166
+ return sortedEntries
167
+ .map(([date, records]) => {
168
+ let content = `
169
+ <div class="date-header">
170
+ ${formatDateByReportType(date)}
171
+ </div>
172
+ `;
173
+ // Group records by rating field
174
+ const ratingGroups = new Map();
175
+ records.forEach((record) => {
176
+ ratingFields.forEach((field) => {
177
+ const avgField = `${field}_average`;
178
+ const countField = `${field}_count`;
179
+ const avgValue = record[avgField];
180
+ const countValue = record[countField];
181
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
182
+ if (!ratingGroups.has(field)) {
183
+ ratingGroups.set(field, []);
184
+ }
185
+ ratingGroups.get(field).push({ avg: avgValue, count: countValue });
186
+ }
187
+ });
188
+ });
189
+ ratingGroups.forEach((ratings, field) => {
190
+ const displayName = sentenceCase(field.replace(/_/g, ' '));
191
+ // Group ratings by their values (1, 2, 3, 4, 5)
192
+ const ratingValueGroups = new Map();
193
+ ratings.forEach((rating) => {
194
+ const ratingValue = Math.round(rating.avg);
195
+ if (ratingValueGroups.has(ratingValue)) {
196
+ ratingValueGroups.set(ratingValue, ratingValueGroups.get(ratingValue) + rating.count);
197
+ }
198
+ else {
199
+ ratingValueGroups.set(ratingValue, rating.count);
200
+ }
201
+ });
202
+ // Format as: 1(2), 2(2), 3(1), 4(10), 5(12)
203
+ const ratingDisplay = Array.from(ratingValueGroups.entries())
204
+ .sort(([a], [b]) => a - b)
205
+ .map(([value, count]) => `${value}(${count})`)
206
+ .join(', ');
207
+ content += `
208
+ <div class="rating-group">
209
+ <div class="rating-group-label">${displayName}:</div>
210
+ <div class="rating-group-values">${ratingDisplay}</div>
211
+ </div>
212
+ `;
213
+ });
214
+ return content;
215
+ })
216
+ .join('');
217
+ }
218
+ else if (isComparative) {
219
+ // For isComparative: Group by date, then by tenant
220
+ const groupedData = new Map();
221
+ rawData.forEach((record) => {
222
+ const dateKey = record.date_field;
223
+ const tenantKey = record.tenant_id;
224
+ if (!groupedData.has(dateKey)) {
225
+ groupedData.set(dateKey, new Map());
226
+ }
227
+ if (!groupedData.get(dateKey).has(tenantKey)) {
228
+ groupedData.get(dateKey).set(tenantKey, []);
229
+ }
230
+ groupedData.get(dateKey).get(tenantKey).push(record);
231
+ });
232
+ const sortedEntries = Array.from(groupedData.entries()).sort(([a], [b]) => moment(a).valueOf() - moment(b).valueOf());
233
+ return sortedEntries
234
+ .map(([date, tenantData]) => {
235
+ let content = `
236
+ <div class="date-header">
237
+ ${formatDateByReportType(date)}
238
+ </div>
239
+ `;
240
+ Array.from(tenantData.entries()).forEach(([tenantId, records]) => {
241
+ content += `
242
+ <div class="tenant-header">
243
+ ${getTenantDisplayName(tenantId)}
244
+ </div>
245
+ `;
246
+ const aggregatedRatings = new Map();
247
+ records.forEach((record) => {
248
+ ratingFields.forEach((field) => {
249
+ const avgField = `${field}_average`;
250
+ const countField = `${field}_count`;
251
+ const avgValue = record[avgField];
252
+ const countValue = record[countField];
253
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
254
+ if (!aggregatedRatings.has(field)) {
255
+ aggregatedRatings.set(field, {
256
+ total: 0,
257
+ count: 0,
258
+ totalCount: 0,
259
+ });
260
+ }
261
+ const current = aggregatedRatings.get(field);
262
+ current.total += avgValue * countValue;
263
+ current.totalCount += countValue;
264
+ current.count += 1;
265
+ }
266
+ });
267
+ });
268
+ aggregatedRatings.forEach((data, field) => {
269
+ const finalAverage = data.total / data.totalCount;
270
+ const displayName = sentenceCase(field.replace(/_/g, ' '));
271
+ content += `
272
+ <div class="rating-row indented">
273
+ <span class="rating-label">${displayName}</span>
274
+ <span class="rating-value">${finalAverage.toFixed(1)}(${data.totalCount})</span>
275
+ </div>
276
+ `;
277
+ });
278
+ });
279
+ return content;
280
+ })
281
+ .join('');
282
+ }
283
+ // Regular rows for non-comparative mode
284
+ return rawData
285
+ .map((row) => {
286
+ let content = `
287
+ <div class="date-header">
288
+ ${formatDateByReportType(row.date_field)}
289
+ </div>
290
+ <div class="tenant-header">
291
+ ${getTenantDisplayName(row.tenant_id)}
292
+ </div>
293
+ `;
294
+ ratingFields.forEach((field) => {
295
+ const avgField = `${field}_average`;
296
+ const countField = `${field}_count`;
297
+ const avgValue = row[avgField];
298
+ const countValue = row[countField];
299
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
300
+ const displayName = sentenceCase(field.replace(/_/g, ' '));
301
+ content += `
302
+ <div class="rating-row">
303
+ <span class="rating-label">${displayName}</span>
304
+ <span class="rating-value">${avgValue.toFixed(1)}(${countValue})</span>
305
+ </div>
306
+ `;
307
+ }
308
+ });
309
+ return content;
310
+ })
311
+ .join('');
312
+ };
313
+ const styles = `
314
+ <style>
315
+ * {
316
+ margin: 0;
317
+ padding: 0;
318
+ box-sizing: border-box;
319
+ font-family: 'Courier New', monospace;
320
+ }
321
+
322
+ .receipt-container {
323
+ width: ${width}px;
324
+ max-width: 100vw;
325
+ padding: 20px;
326
+ background: #ffffff;
327
+ ${monochrome ? 'color: #000000;' : 'color: #333333;'}
328
+ margin: 0 auto;
329
+ }
330
+
331
+ .header {
332
+ text-align: center;
333
+ margin-bottom: 30px;
334
+ padding-bottom: 20px;
335
+ }
336
+
337
+ .company-name {
338
+ font-size: 16px;
339
+ font-weight: bold;
340
+ margin-bottom: 8px;
341
+ ${monochrome ? 'color: #000000;' : 'color: #2c3e50;'}
342
+ }
343
+
344
+ .report-title {
345
+ font-size: 16px;
346
+ font-weight: 600;
347
+ margin-bottom: 8px;
348
+ ${monochrome ? 'color: #000000;' : 'color: #34495e;'}
349
+ }
350
+
351
+ .date-range {
352
+ font-size: 14px;
353
+ ${monochrome ? 'color: #000000;' : 'color: #95a5a6;'}
354
+ margin-bottom: 8px;
355
+ }
356
+
357
+ .content {
358
+ margin-bottom: 20px;
359
+ }
360
+
361
+ .date-header {
362
+ text-align: center;
363
+ font-size: 14px;
364
+ font-weight: bold;
365
+ margin: 15px 10px;
366
+ ${monochrome ? 'color: #000000;' : 'color: #2c3e50;'}
367
+ border-bottom: 1px solid ${monochrome ? '#000000' : '#e0e0e0'};
368
+ border-top: 1px solid ${monochrome ? '#000000' : '#e0e0e0'};
369
+ padding-bottom: 5px;
370
+ }
371
+
372
+ .platform-header,
373
+ .tenant-header {
374
+ font-size: 14px;
375
+ font-weight: bold;
376
+ margin: 15px 0 8px 0;
377
+ ${monochrome ? 'color: #000000;' : 'color: #34495e;'}
378
+ }
379
+
380
+ .rating-row {
381
+ display: flex;
382
+ justify-content: space-between;
383
+ align-items: center;
384
+ padding: 3px 0;
385
+ font-size: 11px;
386
+ border-bottom: 1px dotted ${monochrome ? '#666666' : '#ddd'};
387
+ }
388
+
389
+ .rating-row.indented {
390
+ padding-left: 15px;
391
+ }
392
+
393
+ .rating-label {
394
+ flex: 1;
395
+ font-weight: bold;
396
+ font-size: 13px;
397
+ ${monochrome ? 'color: #000000;' : 'color: #444;'}
398
+ }
399
+
400
+ .rating-value {
401
+ font-weight: bold;
402
+ ${monochrome ? 'color: #000000;' : 'color: #2c3e50;'}
403
+ min-width: 60px;
404
+ text-align: right;
405
+ }
406
+
407
+ .rating-group {
408
+ margin: 8px 0;
409
+ }
410
+
411
+ .rating-group-label {
412
+ font-size: 14px;
413
+ font-weight: bold;
414
+ ${monochrome ? 'color: #000000;' : 'color: #444;'}
415
+ margin-bottom: 3px;
416
+ }
417
+
418
+ .rating-group-values {
419
+ font-size: 14px;
420
+ ${monochrome ? 'color: #000000;' : 'color: #666;'}
421
+ padding-left: 10px;
422
+ line-height: 1.4;
423
+ }
424
+
425
+ .no-data {
426
+ text-align: center;
427
+ font-style: italic;
428
+ padding: 20px;
429
+ ${monochrome ? 'color: #000000;' : 'color: #7f8c8d;'}
430
+ }
431
+
432
+ .footer {
433
+ margin-top: 30px;
434
+ padding-top: 15px;
435
+ border-top: 1px solid ${monochrome ? '#000000' : '#e0e0e0'};
436
+ text-align: center;
437
+ font-size: 14px;
438
+ ${monochrome ? 'color: #000000;' : 'color: #7f8c8d;'}
439
+ }
440
+
441
+ .tenant-info {
442
+ font-weight: 600;
443
+ margin-bottom: 3px;
444
+ font-size: 16px;
445
+ ${monochrome ? 'color: #000000;' : 'color: #2c3e50;'}
446
+ }
447
+
448
+ .export-info {
449
+ font-size: 14px;
450
+ ${monochrome ? 'color: #000000;' : 'color: #95a5a6;'}
451
+ }
452
+
453
+ @media print {
454
+ .receipt-container {
455
+ border: none;
456
+ width: auto;
457
+ max-width: none;
458
+ }
459
+ }
460
+
461
+ ${monochrome
462
+ ? `
463
+ /* Receipt Printer Optimized Styles - Monochrome */
464
+ * {
465
+ font-family: "Roboto Condensed", Roboto, sans-serif !important;
466
+ }
467
+
468
+ .receipt-container {
469
+ padding: 4px !important;
470
+ }
471
+
472
+ .header {
473
+ margin-bottom: 8px !important;
474
+ padding-bottom: 4px !important;
475
+ }
476
+
477
+ .company-name {
478
+ font-size: 20px !important;
479
+ margin-bottom: 2px !important;
480
+ }
481
+
482
+ .report-title {
483
+ font-size: 18px !important;
484
+ margin-bottom: 2px !important;
485
+ }
486
+
487
+ .date-range {
488
+ font-size: 16px !important;
489
+ margin-bottom: 2px !important;
490
+ }
491
+
492
+ .content {
493
+ margin-bottom: 4px !important;
494
+ }
495
+
496
+ .date-header {
497
+ font-size: 17px !important;
498
+ margin: 4px 2px !important;
499
+ padding-bottom: 2px !important;
500
+ }
501
+
502
+ .platform-header,
503
+ .tenant-header {
504
+ font-size: 17px !important;
505
+ margin: 4px 0 2px 0 !important;
506
+ }
507
+
508
+ .rating-row {
509
+ padding: 1px 0 !important;
510
+ font-size: 15px !important;
511
+ }
512
+
513
+ .rating-label {
514
+ font-size: 16px !important;
515
+ }
516
+
517
+ .rating-value {
518
+ font-size: 16px !important;
519
+ }
520
+
521
+ .rating-group {
522
+ margin: 2px 0 !important;
523
+ }
524
+
525
+ .rating-group-label {
526
+ font-size: 17px !important;
527
+ margin-bottom: 1px !important;
528
+ }
529
+
530
+ .rating-group-values {
531
+ font-size: 16px !important;
532
+ padding-left: 4px !important;
533
+ line-height: 1.2 !important;
534
+ }
535
+
536
+ .no-data {
537
+ padding: 8px !important;
538
+ font-size: 16px !important;
539
+ }
540
+
541
+ .footer {
542
+ margin-top: 8px !important;
543
+ padding-top: 4px !important;
544
+ font-size: 16px !important;
545
+ }
546
+
547
+ .tenant-info {
548
+ margin-bottom: 1px !important;
549
+ font-size: 18px !important;
550
+ }
551
+
552
+ .export-info {
553
+ font-size: 16px !important;
554
+ }
555
+ `
556
+ : ''}
557
+ </style>
558
+ `;
559
+ return `
560
+ <!DOCTYPE html>
561
+ <html lang="en">
562
+ <head>
563
+ <meta charset="UTF-8">
564
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
565
+ <title>Rating Receipt</title>
566
+ ${styles}
567
+ </head>
568
+ <body translate="no">
569
+ <div class="receipt-container">
570
+ <div class="header">
571
+ <h1 class="company-name">${tenantName}</h1>
572
+ <div class="report-title">${tableTitle}</div>
573
+ <div class="date-range">${fromFormatted} - ${toFormatted}</div>
574
+ </div>
575
+
576
+ <div class="content">
577
+ ${generateReceiptContent()}
578
+ </div>
579
+
580
+ <div class="footer">
581
+ <div class="tenant-info">${tenantName}</div>
582
+ <div class="export-info">Exported on ${currentDate} ${currentTime}</div>
583
+ </div>
584
+ </div>
585
+ </body>
586
+ </html>
587
+ `;
588
+ }
589
+ // Generate HTML template for rating comparison report
590
+ export function getRatingComparisonReportHtml(props) {
591
+ const { tenantName, from, to, width = 800, monochrome = false, isComparative = false, isPlatformWise = false, isRatingWise = false, isAllTab = false, reportType = COMPARISON_REPORT_TYPE_ENUM.DAILY, tenantNameMap = {}, rawData = [], ratingFields = [], tableTitle = 'Rating Comparison', tableDescription = '', } = props;
592
+ // Calculate dynamic width based on number of columns
593
+ const baseWidth = isComparative ? 200 : 300; // Width for date/tenant columns
594
+ const columnWidth = 150; // Width per rating column
595
+ const padding = 40; // Container padding
596
+ const calculatedWidth = baseWidth + ratingFields.length * columnWidth + padding;
597
+ const dynamicWidth = Math.max(width || 800, calculatedWidth);
598
+ const mainStyle = dynamicWidth ? `style="width: ${dynamicWidth}px; max-width: ${dynamicWidth}px"` : '';
599
+ const fromFormatted = from ? moment(from).format('MMM DD, YYYY') : 'N/A';
600
+ const toFormatted = to ? moment(to).format('MMM DD, YYYY') : 'N/A';
601
+ const currentDate = moment().format('MMM DD, YYYY');
602
+ const currentTime = moment().format('hh:mm A');
603
+ // Helper function to format date based on report type
604
+ const formatDateByReportType = (dateField) => {
605
+ if (reportType === COMPARISON_REPORT_TYPE_ENUM.DAILY) {
606
+ return moment(dateField, 'YYYY-MM-DD').format('MMMM D, YYYY');
607
+ }
608
+ else if (reportType === COMPARISON_REPORT_TYPE_ENUM.WEEKLY) {
609
+ const [year, month, week] = dateField.split('-');
610
+ const monthName = moment(`${year}-${month}`, 'YYYY-MM').format('MMMM');
611
+ return `Week ${parseInt(week, 10)} of ${monthName} ${year}`;
612
+ }
613
+ else {
614
+ return moment(dateField, 'YYYY-MM').format('MMMM YYYY');
615
+ }
616
+ };
617
+ // Helper function to get date header name
618
+ const getDateHeaderName = () => {
619
+ switch (reportType) {
620
+ case COMPARISON_REPORT_TYPE_ENUM.DAILY:
621
+ return 'Date';
622
+ case COMPARISON_REPORT_TYPE_ENUM.WEEKLY:
623
+ return 'Weekly';
624
+ case COMPARISON_REPORT_TYPE_ENUM.MONTHLY:
625
+ return 'Monthly';
626
+ default:
627
+ return 'Date';
628
+ }
629
+ };
630
+ // Helper function to get platform display name
631
+ const getPlatformDisplayName = (platform) => {
632
+ return PLATFORM_NAMES[platform] || platform;
633
+ };
634
+ // Helper function to get tenant display name
635
+ const getTenantDisplayName = (tenantId) => {
636
+ return tenantNameMap[tenantId] || tenantId;
637
+ };
638
+ // Generate table headers
639
+ const generateTableHeaders = () => {
640
+ let headers = '';
641
+ // For grouped modes (comparative, platform-wise, rating-wise), don't show date header since it's in group headers
642
+ if (isComparative) {
643
+ headers += `<th class="css-6f0tvbfsdf">Tenant</th>`;
644
+ }
645
+ else if (isPlatformWise) {
646
+ headers += `<th class="css-6f0tvbfsdf">Platform</th>`;
647
+ }
648
+ else if (isRatingWise) {
649
+ // For rating-wise, we don't need any additional columns before ratings
650
+ }
651
+ else {
652
+ // For regular mode, show date and other columns
653
+ headers += `<th class="css-6f0tvbfsdf">${getDateHeaderName()}</th>`;
654
+ if (!isAllTab) {
655
+ headers += `<th class="css-6f0tvbfsdf">Tenant</th>`;
656
+ headers += `<th class="css-6f0tvbfsdf">Platform</th>`;
657
+ }
658
+ }
659
+ // Add rating columns
660
+ ratingFields.forEach((field) => {
661
+ const displayName = sentenceCase(field.replace(/_/g, ' '));
662
+ headers += `<th class="css-ed1d6wfasrf">${displayName}</th>`;
663
+ });
664
+ return headers;
665
+ };
666
+ // Generate table rows
667
+ const generateTableRows = () => {
668
+ if (isComparative) {
669
+ // Group by date for comparative mode
670
+ const groupedData = new Map();
671
+ rawData.forEach((record) => {
672
+ const dateKey = record.date_field;
673
+ if (!groupedData.has(dateKey)) {
674
+ groupedData.set(dateKey, []);
675
+ }
676
+ groupedData.get(dateKey).push(record);
677
+ });
678
+ // Sort dates
679
+ const sortedEntries = Array.from(groupedData.entries()).sort(([a], [b]) => moment(a).valueOf() - moment(b).valueOf());
680
+ return sortedEntries
681
+ .map(([date, records]) => {
682
+ const groupRows = records
683
+ .map((row) => {
684
+ let rowHtml = `
685
+ <tr class="css-11i3qbxfasf group-row">
686
+ <td class="css-1frso49fdsdv">${getTenantDisplayName(row.tenant_id)}</td>
687
+ `;
688
+ ratingFields.forEach((field) => {
689
+ const avgField = `${field}_average`;
690
+ const countField = `${field}_count`;
691
+ const avgValue = row[avgField];
692
+ const countValue = row[countField];
693
+ let displayValue = 'N/A';
694
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
695
+ displayValue = `${avgValue.toFixed(1)} (${countValue}) ⭐`;
696
+ }
697
+ rowHtml += `<td class="css-1itf2nwdsdsdd"><p class="css-l5zp2sfsdfsd">${displayValue}</p></td>`;
698
+ });
699
+ rowHtml += `</tr>`;
700
+ return rowHtml;
701
+ })
702
+ .join('');
703
+ return `
704
+ <tr class="css-11i3qbxfasf group-header">
705
+ <td class="css-6gjlp4cdvvf" colspan="${1 + ratingFields.length}">
706
+ ${formatDateByReportType(date)} (${records.length})
707
+ </td>
708
+ </tr>
709
+ ${groupRows}
710
+ `;
711
+ })
712
+ .join('');
713
+ }
714
+ else if (isPlatformWise || isRatingWise) {
715
+ // Group by date for platform-wise and rating-wise modes
716
+ const groupedData = new Map();
717
+ rawData.forEach((record) => {
718
+ const dateKey = record.date_field;
719
+ if (!groupedData.has(dateKey)) {
720
+ groupedData.set(dateKey, []);
721
+ }
722
+ groupedData.get(dateKey).push(record);
723
+ });
724
+ // Sort dates
725
+ const sortedEntries = Array.from(groupedData.entries()).sort(([a], [b]) => moment(a).valueOf() - moment(b).valueOf());
726
+ return sortedEntries
727
+ .map(([date, records]) => {
728
+ const groupRows = records
729
+ .map((row) => {
730
+ let rowHtml = `<tr class="css-11i3qbxfasf group-row">`;
731
+ // For platform-wise, show platform column
732
+ if (isPlatformWise) {
733
+ rowHtml += `<td class="css-1frso49fdsdv">${getPlatformDisplayName(row.platform)}</td>`;
734
+ }
735
+ // Add rating columns
736
+ ratingFields.forEach((field) => {
737
+ const avgField = `${field}_average`;
738
+ const countField = `${field}_count`;
739
+ const avgValue = row[avgField];
740
+ const countValue = row[countField];
741
+ let displayValue = 'N/A';
742
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
743
+ displayValue = `${avgValue.toFixed(1)} (${countValue}) ⭐`;
744
+ }
745
+ rowHtml += `<td class="css-1itf2nwdsdsdd"><p class="css-l5zp2sfsdfsd">${displayValue}</p></td>`;
746
+ });
747
+ rowHtml += `</tr>`;
748
+ return rowHtml;
749
+ })
750
+ .join('');
751
+ // Calculate colspan based on number of columns
752
+ const columnCount = (isPlatformWise ? 1 : 0) + ratingFields.length;
753
+ return `
754
+ <tr class="css-11i3qbxfasf group-header">
755
+ <td class="css-6gjlp4cdvvf" colspan="${columnCount}">
756
+ ${formatDateByReportType(date)} (${records.length})
757
+ </td>
758
+ </tr>
759
+ ${groupRows}
760
+ `;
761
+ })
762
+ .join('');
763
+ }
764
+ else {
765
+ // Regular rows for non-comparative mode
766
+ return rawData
767
+ .map((row) => {
768
+ let rowHtml = `
769
+ <tr class="css-11i3qbxfasf">
770
+ <td class="css-6gjlp4cdvvf">${formatDateByReportType(row.date_field)}</td>
771
+ `;
772
+ // Add conditional columns
773
+ if (!isAllTab) {
774
+ rowHtml += `<td class="css-1frso49fdsdv">${getTenantDisplayName(row.tenant_id)}</td>`;
775
+ rowHtml += `<td class="css-1frso49fdsdv">${getPlatformDisplayName(row.platform)}</td>`;
776
+ }
777
+ // Add rating columns
778
+ ratingFields.forEach((field) => {
779
+ const avgField = `${field}_average`;
780
+ const countField = `${field}_count`;
781
+ const avgValue = row[avgField];
782
+ const countValue = row[countField];
783
+ let displayValue = 'N/A';
784
+ if (typeof avgValue === 'number' && typeof countValue === 'number') {
785
+ displayValue = `${avgValue.toFixed(1)} (${countValue}) ⭐`;
786
+ }
787
+ rowHtml += `<td class="css-1itf2nwdsdsdd"><p class="css-l5zp2sfsdfsd">${displayValue}</p></td>`;
788
+ });
789
+ rowHtml += `</tr>`;
790
+ return rowHtml;
791
+ })
792
+ .join('');
793
+ }
794
+ };
795
+ const styles = `
796
+ <style>
797
+ * {
798
+ margin: 0;
799
+ padding: 0;
800
+ box-sizing: border-box;
801
+ font-family: 'Arial', sans-serif;
802
+ }
803
+
804
+ .report-container {
805
+ width: ${dynamicWidth}px;
806
+ max-width: 100vw;
807
+ padding: 20px;
808
+ background: #ffffff;
809
+ ${monochrome ? 'color: #000000;' : 'color: #333333;'}
810
+ overflow-x: auto;
811
+ }
812
+
813
+ .table-container {
814
+ width: 100%;
815
+ overflow-x: auto;
816
+ margin-bottom: 20px;
817
+ border: 1px solid ${monochrome ? '#000000' : '#e0e0e0'};
818
+ border-radius: 8px;
819
+ }
820
+
821
+ @media print {
822
+ .report-container {
823
+ overflow-x: visible !important;
824
+ width: auto !important;
825
+ max-width: none !important;
826
+ }
827
+ .table-container {
828
+ overflow-x: visible !important;
829
+ border: none !important;
830
+ }
831
+ .css-u6h4ltdsd {
832
+ width: auto !important;
833
+ }
834
+ }
835
+
836
+ .header {
837
+ text-align: center;
838
+ margin-bottom: 30px;
839
+ border-bottom: 2px solid ${monochrome ? '#000000' : '#e0e0e0'};
840
+ padding-bottom: 20px;
841
+ }
842
+
843
+ .company-name {
844
+ font-size: 24px;
845
+ font-weight: bold;
846
+ margin-bottom: 10px;
847
+ ${monochrome ? 'color: #000000;' : 'color: #2c3e50;'}
848
+ }
849
+
850
+ .report-title {
851
+ font-size: 20px;
852
+ font-weight: 600;
853
+ margin-bottom: 10px;
854
+ ${monochrome ? 'color: #000000;' : 'color: #34495e;'}
855
+ }
856
+
857
+ .date-range {
858
+ font-size: 14px;
859
+ ${monochrome ? 'color: #000000;' : 'color: #95a5a6;'}
860
+ margin-bottom: 10px;
861
+ }
862
+
863
+ .footer {
864
+ margin-top: 40px;
865
+ padding-top: 20px;
866
+ border-top: 1px solid ${monochrome ? '#000000' : '#e0e0e0'};
867
+ text-align: center;
868
+ font-size: 12px;
869
+ ${monochrome ? 'color: #000000;' : 'color: #7f8c8d;'}
870
+ }
871
+
872
+ .tenant-info {
873
+ font-weight: 600;
874
+ margin-bottom: 5px;
875
+ ${monochrome ? 'color: #000000;' : 'color: #2c3e50;'}
876
+ }
877
+
878
+ .export-info {
879
+ font-size: 10px;
880
+ ${monochrome ? 'color: #000000;' : 'color: #95a5a6;'}
881
+ }
882
+
883
+ .css-l5xv05dsdsd {
884
+ -webkit-font-smoothing: antialiased;
885
+ text-size-adjust: 100%;
886
+ color: rgb(51, 51, 51);
887
+ line-height: 1.3rem;
888
+ font-size: 1rem;
889
+ font-family: Roboto, "Public Sans", sans-serif;
890
+ font-weight: 400;
891
+ box-sizing: inherit;
892
+ position: relative;
893
+ margin: 0px;
894
+ }
895
+ .css-k060yydsds {
896
+ -webkit-font-smoothing: antialiased;
897
+ text-size-adjust: 100%;
898
+ line-height: 1.3rem;
899
+ font-size: 1rem;
900
+ font-family: Roboto, "Public Sans", sans-serif;
901
+ font-weight: 400;
902
+ box-sizing: inherit;
903
+ padding: 15px;
904
+ position: sticky;
905
+ top: 0px;
906
+ background-color: rgb(67, 22, 101);
907
+ color: rgb(255, 255, 255);
908
+ z-index: 1;
909
+ box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
910
+ }
911
+ .css-1fnliljdsdsd {
912
+ -webkit-font-smoothing: antialiased;
913
+ text-size-adjust: 100%;
914
+ color: rgb(255, 255, 255);
915
+ box-sizing: inherit;
916
+ margin: 0px;
917
+ font-weight: 500;
918
+ line-height: 1.4625rem;
919
+ font-family: Roboto, "Public Sans", sans-serif;
920
+ font-size: 1.5rem;
921
+ }
922
+ .css-1g652zldsfsf {
923
+ -webkit-font-smoothing: antialiased;
924
+ text-size-adjust: 100%;
925
+ color: rgb(255, 255, 255);
926
+ box-sizing: inherit;
927
+ margin: 0px;
928
+ line-height: 0.975rem;
929
+ font-family: Roboto, "Public Sans", sans-serif;
930
+ font-weight: 400;
931
+ font-size: 0.75rem;
932
+ }
933
+ .css-u6h4ltdsd {
934
+ -webkit-font-smoothing: antialiased;
935
+ text-size-adjust: 100%;
936
+ color: rgb(51, 51, 51);
937
+ line-height: 1.3rem;
938
+ font-size: 1rem;
939
+ font-family: Roboto, "Public Sans", sans-serif;
940
+ font-weight: 400;
941
+ box-sizing: inherit;
942
+ display: table;
943
+ width: max-content;
944
+ min-width: 100%;
945
+ border-collapse: collapse;
946
+ border-spacing: 0px;
947
+ }
948
+ .css-s4zxv0dsds {
949
+ -webkit-font-smoothing: antialiased;
950
+ text-size-adjust: 100%;
951
+ color: rgb(51, 51, 51);
952
+ line-height: 1.3rem;
953
+ font-size: 1rem;
954
+ font-family: Roboto, "Public Sans", sans-serif;
955
+ font-weight: 400;
956
+ border-collapse: collapse;
957
+ border-spacing: 0px;
958
+ box-sizing: inherit;
959
+ display: table-header-group;
960
+ }
961
+ .css-1gleevddads {
962
+ -webkit-font-smoothing: antialiased;
963
+ text-size-adjust: 100%;
964
+ line-height: 1.3rem;
965
+ font-size: 1rem;
966
+ font-family: Roboto, "Public Sans", sans-serif;
967
+ font-weight: 400;
968
+ border-collapse: collapse;
969
+ border-spacing: 0px;
970
+ box-sizing: inherit;
971
+ color: inherit;
972
+ display: table-row;
973
+ vertical-align: middle;
974
+ outline: 0px;
975
+ }
976
+ .css-6f0tvbfsdf {
977
+ -webkit-font-smoothing: antialiased;
978
+ text-size-adjust: 100%;
979
+ border-collapse: collapse;
980
+ border-spacing: 0px;
981
+ box-sizing: inherit;
982
+ font-size: 0.875rem;
983
+ font-family: Roboto, "Public Sans", sans-serif;
984
+ display: table-cell;
985
+ vertical-align: inherit;
986
+ text-align: left;
987
+ line-height: 1.5rem;
988
+ font-weight: 500;
989
+ border-bottom: 1px solid rgb(250, 250, 250);
990
+ padding: 16px;
991
+ background-color: rgb(232, 232, 232);
992
+ color: rgb(51, 51, 51);
993
+ min-width: 120px;
994
+ white-space: nowrap;
995
+ }
996
+ .css-ed1d6wfasrf {
997
+ -webkit-font-smoothing: antialiased;
998
+ text-size-adjust: 100%;
999
+ border-collapse: collapse;
1000
+ border-spacing: 0px;
1001
+ box-sizing: inherit;
1002
+ font-size: 0.875rem;
1003
+ font-family: Roboto, "Public Sans", sans-serif;
1004
+ display: table-cell;
1005
+ vertical-align: inherit;
1006
+ border-bottom: 1px solid rgb(250, 250, 250);
1007
+ padding: 16px;
1008
+ line-height: 1.5rem;
1009
+ font-weight: 500;
1010
+ text-align: right;
1011
+ flex-direction: row-reverse;
1012
+ background-color: rgb(232, 232, 232);
1013
+ color: rgb(51, 51, 51);
1014
+ }
1015
+ .css-y6j1myfssd {
1016
+ -webkit-font-smoothing: antialiased;
1017
+ text-size-adjust: 100%;
1018
+ color: rgb(51, 51, 51);
1019
+ line-height: 1.3rem;
1020
+ font-size: 1rem;
1021
+ font-family: Roboto, "Public Sans", sans-serif;
1022
+ font-weight: 400;
1023
+ border-collapse: collapse;
1024
+ border-spacing: 0px;
1025
+ box-sizing: inherit;
1026
+ display: table-row-group;
1027
+ }
1028
+ .css-11i3qbxfasf {
1029
+ -webkit-font-smoothing: antialiased;
1030
+ text-size-adjust: 100%;
1031
+ line-height: 1.3rem;
1032
+ font-size: 1rem;
1033
+ font-family: Roboto, "Public Sans", sans-serif;
1034
+ font-weight: 400;
1035
+ border-collapse: collapse;
1036
+ border-spacing: 0px;
1037
+ box-sizing: inherit;
1038
+ color: inherit;
1039
+ display: table-row;
1040
+ vertical-align: middle;
1041
+ outline: 0px;
1042
+ }
1043
+ .css-6gjlp4cdvvf {
1044
+ -webkit-font-smoothing: antialiased;
1045
+ text-size-adjust: 100%;
1046
+ border-collapse: collapse;
1047
+ border-spacing: 0px;
1048
+ box-sizing: inherit;
1049
+ line-height: 1.1375rem;
1050
+ font-size: 0.875rem;
1051
+ font-family: Roboto, "Public Sans", sans-serif;
1052
+ font-weight: 400;
1053
+ display: table-cell;
1054
+ vertical-align: inherit;
1055
+ border-bottom: 1px solid rgb(250, 250, 250);
1056
+ text-align: left;
1057
+ padding: 16px;
1058
+ color: rgb(51, 51, 51);
1059
+ min-width: 120px;
1060
+ white-space: nowrap;
1061
+ }
1062
+ .css-1frso49fdsdv {
1063
+ -webkit-font-smoothing: antialiased;
1064
+ text-size-adjust: 100%;
1065
+ border-collapse: collapse;
1066
+ border-spacing: 0px;
1067
+ text-align: left;
1068
+ box-sizing: inherit;
1069
+ margin: 0px;
1070
+ line-height: 1.1375rem;
1071
+ font-size: 0.875rem;
1072
+ font-family: Roboto, "Public Sans", sans-serif;
1073
+ font-weight: 400;
1074
+ color: rgb(0, 128, 0);
1075
+ display: table-cell;
1076
+ vertical-align: inherit;
1077
+ border-bottom: 1px solid rgb(250, 250, 250);
1078
+ padding: 16px;
1079
+ min-width: 120px;
1080
+ white-space: nowrap;
1081
+ }
1082
+ .css-1itf2nwdsdsdd {
1083
+ -webkit-font-smoothing: antialiased;
1084
+ text-size-adjust: 100%;
1085
+ border-collapse: collapse;
1086
+ border-spacing: 0px;
1087
+ box-sizing: inherit;
1088
+ line-height: 1.1375rem;
1089
+ font-size: 0.875rem;
1090
+ font-family: Roboto, "Public Sans", sans-serif;
1091
+ font-weight: 400;
1092
+ display: table-cell;
1093
+ vertical-align: inherit;
1094
+ border-bottom: 1px solid rgb(250, 250, 250);
1095
+ padding: 16px;
1096
+ color: rgb(51, 51, 51);
1097
+ text-align: right;
1098
+ flex-direction: row-reverse;
1099
+ }
1100
+ .css-l5zp2sfsdfsd {
1101
+ -webkit-font-smoothing: antialiased;
1102
+ text-size-adjust: 100%;
1103
+ border-collapse: collapse;
1104
+ border-spacing: 0px;
1105
+ color: rgb(51, 51, 51);
1106
+ text-align: right;
1107
+ box-sizing: inherit;
1108
+ margin: 0px;
1109
+ line-height: 1.1375rem;
1110
+ font-size: 0.875rem;
1111
+ font-family: Roboto, "Public Sans", sans-serif;
1112
+ font-weight: 700;
1113
+ }
1114
+
1115
+ /* Group header styles for comparative mode */
1116
+ .group-header {
1117
+ background-color: ${monochrome ? '#f5f5f5' : '#f8f9fa'} !important;
1118
+ font-weight: bold !important;
1119
+ }
1120
+
1121
+ .group-header td {
1122
+ background-color: ${monochrome ? '#f5f5f5' : '#f8f9fa'} !important;
1123
+ font-weight: bold !important;
1124
+ padding: 12px 16px !important;
1125
+ ${monochrome ? 'color: #000000' : 'color: #2c3e50'} !important;
1126
+ }
1127
+
1128
+ .group-row {
1129
+ background-color: ${monochrome ? '#ffffff' : '#ffffff'};
1130
+ }
1131
+
1132
+ .group-row:hover {
1133
+ background-color: ${monochrome ? '#f9f9f9' : '#f1f3f4'};
1134
+ }
1135
+
1136
+
1137
+ </style>
1138
+ `;
1139
+ return `
1140
+ <!DOCTYPE html>
1141
+ <html lang="en" ${mainStyle}>
1142
+ <head>
1143
+ <meta charset="UTF-8">
1144
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1145
+ <title>Rating Comparison</title>
1146
+ ${styles}
1147
+ </head>
1148
+ <body translate="no"
1149
+ ${mainStyle}>
1150
+ <div class="report-container">
1151
+ <div class="header">
1152
+ <div class="company-name">${tenantName}</div>
1153
+ <div class="report-title">Rating Comparison</div>
1154
+ <div class="date-range">Period: ${fromFormatted} - ${toFormatted}</div>
1155
+
1156
+ </div>
1157
+
1158
+ <div class="content">
1159
+ <div class="css-l5xv05dsdsd">
1160
+ <div class="css-k060yydsds">
1161
+ <h5 class="css-1fnliljdsdsd">${tableTitle}</h5>
1162
+ <p class="css-1g652zldsfsf">${tableDescription}</p>
1163
+ </div>
1164
+ <div class="table-container">
1165
+ <table class="css-u6h4ltdsd" aria-label="rating comparison table">
1166
+ <thead class="css-s4zxv0dsds">
1167
+ <tr class="css-1gleevddads">
1168
+ ${generateTableHeaders()}
1169
+ </tr>
1170
+ </thead>
1171
+ <tbody class="css-y6j1myfssd">
1172
+ ${generateTableRows()}
1173
+ </tbody>
1174
+ </table>
1175
+ </div>
1176
+ </div>
1177
+
1178
+
1179
+ <div class="footer">
1180
+ <div class="tenant-info">${tenantName}</div>
1181
+ <div class="export-info">Exported on ${currentDate} at ${currentTime}</div>
1182
+ </div>
1183
+ </div>
1184
+ </body>
1185
+ </html>
1186
+ `;
1187
+ }