spree_cm_commissioner 2.13.3.pre.pre3 → 2.13.3

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 (215) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +0 -1
  3. data/Gemfile.lock +1 -1
  4. data/app/controllers/spree/admin/integrations_controller.rb +7 -5
  5. data/app/controllers/spree/admin/inventory_items_controller.rb +0 -12
  6. data/app/controllers/spree_cm_commissioner/api/v2/storefront/checkout_controller_decorator.rb +0 -3
  7. data/app/factory/spree_cm_commissioner/order_telegram_message_factory.rb +2 -6
  8. data/app/models/concerns/spree_cm_commissioner/line_item_bundleable.rb +38 -0
  9. data/app/models/concerns/spree_cm_commissioner/vehicle_kind.rb +1 -1
  10. data/app/models/spree_cm_commissioner/integration.rb +0 -46
  11. data/app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb +10 -4
  12. data/app/models/spree_cm_commissioner/inventory_item.rb +0 -18
  13. data/app/models/spree_cm_commissioner/line_item_decorator.rb +1 -0
  14. data/app/models/spree_cm_commissioner/order_decorator.rb +0 -2
  15. data/app/models/spree_cm_commissioner/place.rb +0 -2
  16. data/app/models/spree_cm_commissioner/redis_stock/cached_inventory_items_builder.rb +1 -2
  17. data/app/models/spree_cm_commissioner/route.rb +0 -1
  18. data/app/models/spree_cm_commissioner/seat_layout.rb +0 -1
  19. data/app/models/spree_cm_commissioner/stock/availability_checker.rb +1 -1
  20. data/app/models/spree_cm_commissioner/stock/order_availability_checker.rb +1 -1
  21. data/app/models/spree_cm_commissioner/stock_item_decorator.rb +0 -4
  22. data/app/models/spree_cm_commissioner/trip.rb +1 -2
  23. data/app/models/spree_cm_commissioner/trip_stop.rb +0 -2
  24. data/app/models/spree_cm_commissioner/variant_decorator.rb +0 -5
  25. data/app/models/spree_cm_commissioner/vehicle.rb +0 -3
  26. data/app/models/spree_cm_commissioner/vehicle_type.rb +0 -1
  27. data/app/models/spree_cm_commissioner/vendor_decorator.rb +0 -17
  28. data/app/models/spree_cm_commissioner/vendor_place.rb +0 -2
  29. data/app/serializers/spree/v2/storefront/line_item_serializer_decorator.rb +2 -1
  30. data/app/services/spree_cm_commissioner/integrations/base/sync_manager.rb +2 -1
  31. data/app/services/spree_cm_commissioner/integrations/base/sync_result.rb +0 -11
  32. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/external_client/client.rb +15 -14
  33. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/polling/sync_matches.rb +4 -7
  34. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/polling/sync_zones.rb +3 -6
  35. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_manager.rb +3 -0
  36. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/full_sync_strategy.rb +3 -1
  37. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/incremental_sync_strategy.rb +3 -1
  38. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/webhook_sync_strategy.rb +2 -1
  39. data/app/services/spree_cm_commissioner/inventory_items/bulk_adjust_quantities_by_variant.rb +0 -4
  40. data/app/services/spree_cm_commissioner/inventory_items/reset.rb +0 -4
  41. data/app/services/spree_cm_commissioner/order_holds/hold.rb +0 -17
  42. data/app/services/spree_cm_commissioner/order_holds/release.rb +0 -17
  43. data/app/services/spree_cm_commissioner/seat_layouts/update.rb +4 -0
  44. data/app/services/spree_cm_commissioner/transit_order/create.rb +8 -2
  45. data/app/services/spree_cm_commissioner/users/backfill_device_tokens_count.rb +48 -0
  46. data/app/views/spree/admin/integrations/_form.html.erb +0 -16
  47. data/app/views/spree/admin/integrations/index.html.erb +1 -1
  48. data/config/locales/en.yml +0 -2
  49. data/config/locales/km.yml +0 -2
  50. data/config/routes.rb +0 -25
  51. data/db/migrate/20260925000000_change_commission_rate_default_on_spree_vendors.rb +5 -0
  52. data/db/migrate/20260925090000_add_parent_id_and_relation_type_to_spree_line_items.rb +6 -0
  53. data/lib/spree_cm_commissioner/cached_inventory_item.rb +1 -7
  54. data/lib/spree_cm_commissioner/test_helper/factories/integration_factory.rb +0 -17
  55. data/lib/spree_cm_commissioner/version.rb +1 -1
  56. data/lib/tasks/backfill_device_tokens_count.rake +8 -0
  57. metadata +8 -161
  58. data/app/controllers/spree/api/switch_cm/base_controller.rb +0 -98
  59. data/app/controllers/spree/api/switch_cm/ota/avail_notifs_controller.rb +0 -17
  60. data/app/controllers/spree/api/switch_cm/ota/base_controller.rb +0 -27
  61. data/app/controllers/spree/api/switch_cm/ota/product_notifs_controller.rb +0 -44
  62. data/app/controllers/spree/api/switch_cm/ota/pushes_controller.rb +0 -46
  63. data/app/controllers/spree/api/switch_cm/ota/rate_amount_notifs_controller.rb +0 -17
  64. data/app/controllers/spree/api/switch_cm/ota/res_modify_notifs_controller.rb +0 -31
  65. data/app/controllers/spree/api/switch_cm/ota/res_notifs_controller.rb +0 -29
  66. data/app/controllers/spree/api/switch_cm/ota/reservation_streams_controller.rb +0 -83
  67. data/app/controllers/spree/api/switch_cm/tokens_controller.rb +0 -68
  68. data/app/controllers/spree/api/switch_cm/xml/availabilities_controller.rb +0 -39
  69. data/app/controllers/spree/api/switch_cm/xml/base_controller.rb +0 -37
  70. data/app/controllers/spree/api/switch_cm/xml/reservation_summaries_controller.rb +0 -28
  71. data/app/controllers/spree/api/switch_cm/xml/reservations_controller.rb +0 -56
  72. data/app/controllers/spree/api/switch_cm/xml/room_rate_availabilities_controller.rb +0 -56
  73. data/app/controllers/spree/api/switch_cm/xml/room_rates_controller.rb +0 -32
  74. data/app/controllers/spree/api/v2/storefront/transit/item_availabilities_controller.rb +0 -66
  75. data/app/jobs/spree_cm_commissioner/audit_event_job.rb +0 -29
  76. data/app/models/concerns/spree_cm_commissioner/audit_wrapper.rb +0 -139
  77. data/app/models/concerns/spree_cm_commissioner/integrations/inventory_sync_cachable.rb +0 -9
  78. data/app/models/concerns/spree_cm_commissioner/variant_metadata.rb +0 -24
  79. data/app/models/spree_cm_commissioner/audit_event.rb +0 -11
  80. data/app/models/spree_cm_commissioner/currency_rate.rb +0 -15
  81. data/app/models/spree_cm_commissioner/integrations/book_me_bus_v1.rb +0 -64
  82. data/app/models/spree_cm_commissioner/integrations/larryta.rb +0 -81
  83. data/app/models/spree_cm_commissioner/integrations/switch_cm.rb +0 -86
  84. data/app/models/spree_cm_commissioner/integrations/vireak_buntham.rb +0 -82
  85. data/app/serializables/spree_cm_commissioner/item_availability_sync.rb +0 -10
  86. data/app/serializers/spree_cm_commissioner/v2/storefront/item_availability_sync_serializer.rb +0 -10
  87. data/app/services/spree_cm_commissioner/audit_logger.rb +0 -59
  88. data/app/services/spree_cm_commissioner/currency_converter/create.rb +0 -27
  89. data/app/services/spree_cm_commissioner/currency_rates/manage.rb +0 -99
  90. data/app/services/spree_cm_commissioner/google_maps_geocoder.rb +0 -41
  91. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/external_client/client.rb +0 -230
  92. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/external_client/connection.rb +0 -147
  93. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/inventory/external_inventory_item_status.rb +0 -52
  94. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/inventory/external_inventory_items.rb +0 -91
  95. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/inventory/unstock_inventory.rb +0 -188
  96. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_inventory.rb +0 -79
  97. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_item_availability.rb +0 -354
  98. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_locations.rb +0 -103
  99. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_nationality_pricing.rb +0 -93
  100. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_product.rb +0 -70
  101. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_route_stops.rb +0 -121
  102. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_routes.rb +0 -128
  103. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_seat_layout.rb +0 -412
  104. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_service_calendars.rb +0 -59
  105. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_trip_stop.rb +0 -224
  106. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_trips.rb +0 -769
  107. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_variant.rb +0 -69
  108. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/sync_vehicle_types.rb +0 -92
  109. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/polling/time_parser.rb +0 -19
  110. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/base.rb +0 -40
  111. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/inventory_item_status.rb +0 -148
  112. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/location.rb +0 -55
  113. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/reservation_cart.rb +0 -85
  114. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/seat.rb +0 -128
  115. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/seat_layout.rb +0 -386
  116. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/stop.rb +0 -84
  117. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/trip.rb +0 -237
  118. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/resources/wallet_payment.rb +0 -48
  119. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/sync_manager.rb +0 -22
  120. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/sync_strategies/full_sync_strategy.rb +0 -116
  121. data/app/services/spree_cm_commissioner/integrations/book_me_bus_v1/sync_strategies/incremental_sync_strategy.rb +0 -63
  122. data/app/services/spree_cm_commissioner/integrations/larryta/external_client/client.rb +0 -314
  123. data/app/services/spree_cm_commissioner/integrations/larryta/external_client/connection.rb +0 -74
  124. data/app/services/spree_cm_commissioner/integrations/larryta/inventory/external_inventory_item_status.rb +0 -53
  125. data/app/services/spree_cm_commissioner/integrations/larryta/inventory/external_inventory_items.rb +0 -106
  126. data/app/services/spree_cm_commissioner/integrations/larryta/inventory/hold_seats.rb +0 -143
  127. data/app/services/spree_cm_commissioner/integrations/larryta/inventory/release_seats.rb +0 -90
  128. data/app/services/spree_cm_commissioner/integrations/larryta/inventory/unstock_inventory.rb +0 -143
  129. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_item_availability.rb +0 -325
  130. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_product.rb +0 -72
  131. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_routes.rb +0 -142
  132. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_seat_layout.rb +0 -255
  133. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_stock_item.rb +0 -55
  134. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_trip_stop.rb +0 -171
  135. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_trips.rb +0 -397
  136. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_variant.rb +0 -63
  137. data/app/services/spree_cm_commissioner/integrations/larryta/polling/sync_vehicle_type.rb +0 -79
  138. data/app/services/spree_cm_commissioner/integrations/larryta/resources/base.rb +0 -39
  139. data/app/services/spree_cm_commissioner/integrations/larryta/resources/booking.rb +0 -113
  140. data/app/services/spree_cm_commissioner/integrations/larryta/resources/booking_session.rb +0 -43
  141. data/app/services/spree_cm_commissioner/integrations/larryta/resources/booking_transaction.rb +0 -236
  142. data/app/services/spree_cm_commissioner/integrations/larryta/resources/direction.rb +0 -71
  143. data/app/services/spree_cm_commissioner/integrations/larryta/resources/passenger.rb +0 -48
  144. data/app/services/spree_cm_commissioner/integrations/larryta/resources/schedule.rb +0 -150
  145. data/app/services/spree_cm_commissioner/integrations/larryta/resources/seat.rb +0 -31
  146. data/app/services/spree_cm_commissioner/integrations/larryta/resources/seat_availability.rb +0 -49
  147. data/app/services/spree_cm_commissioner/integrations/larryta/resources/seat_layout.rb +0 -211
  148. data/app/services/spree_cm_commissioner/integrations/larryta/sync_manager.rb +0 -17
  149. data/app/services/spree_cm_commissioner/integrations/larryta/sync_strategies/full_sync_strategy.rb +0 -79
  150. data/app/services/spree_cm_commissioner/integrations/larryta/sync_strategies/incremental_sync_strategy.rb +0 -58
  151. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/accept_push.rb +0 -103
  152. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/accommodation_lock.rb +0 -43
  153. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/apply_updates.rb +0 -121
  154. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/availability_snapshot.rb +0 -88
  155. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/inventory_update.rb +0 -26
  156. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/pushed_nights.rb +0 -81
  157. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/unseen_room_nights.rb +0 -41
  158. data/app/services/spree_cm_commissioner/integrations/switch_cm/inventory/validate_updates.rb +0 -138
  159. data/app/services/spree_cm_commissioner/integrations/switch_cm/ota/availability_parser.rb +0 -60
  160. data/app/services/spree_cm_commissioner/integrations/switch_cm/ota/base_parser.rb +0 -60
  161. data/app/services/spree_cm_commissioner/integrations/switch_cm/ota/price_parser.rb +0 -46
  162. data/app/services/spree_cm_commissioner/integrations/switch_cm/ota/push_response.rb +0 -38
  163. data/app/services/spree_cm_commissioner/integrations/switch_cm/ota/reservation_serializer.rb +0 -99
  164. data/app/services/spree_cm_commissioner/integrations/switch_cm/ota/response_builder.rb +0 -52
  165. data/app/services/spree_cm_commissioner/integrations/switch_cm/reservations/acknowledge.rb +0 -45
  166. data/app/services/spree_cm_commissioner/integrations/switch_cm/reservations/feed.rb +0 -145
  167. data/app/services/spree_cm_commissioner/integrations/switch_cm/reservations/mark_seen.rb +0 -55
  168. data/app/services/spree_cm_commissioner/integrations/switch_cm/reservations/reservation.rb +0 -120
  169. data/app/services/spree_cm_commissioner/integrations/switch_cm/room_catalog.rb +0 -56
  170. data/app/services/spree_cm_commissioner/integrations/switch_cm/sync_manager.rb +0 -16
  171. data/app/services/spree_cm_commissioner/integrations/switch_cm/sync_strategies/full_sync_strategy.rb +0 -39
  172. data/app/services/spree_cm_commissioner/integrations/switch_cm/sync_strategies/incremental_sync_strategy.rb +0 -51
  173. data/app/services/spree_cm_commissioner/integrations/switch_cm/xml/availability_parser.rb +0 -103
  174. data/app/services/spree_cm_commissioner/integrations/switch_cm/xml/push_response.rb +0 -45
  175. data/app/services/spree_cm_commissioner/integrations/switch_cm/xml/reservation_serializer.rb +0 -74
  176. data/app/services/spree_cm_commissioner/integrations/switch_cm/xml/response_builder.rb +0 -19
  177. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/external_client/client.rb +0 -170
  178. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/external_client/connection.rb +0 -59
  179. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/inventory/external_inventory_item_status.rb +0 -48
  180. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/inventory/external_inventory_items.rb +0 -92
  181. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/inventory/unstock_inventory.rb +0 -230
  182. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_item_availability.rb +0 -270
  183. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_locations.rb +0 -96
  184. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_nationality_pricing.rb +0 -76
  185. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_product.rb +0 -69
  186. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_routes.rb +0 -110
  187. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_seat_layout.rb +0 -207
  188. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_stock_item.rb +0 -43
  189. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_trip_stop.rb +0 -192
  190. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_trips.rb +0 -377
  191. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_variant.rb +0 -56
  192. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/polling/sync_vehicle_type.rb +0 -51
  193. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/base.rb +0 -32
  194. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/booking.rb +0 -48
  195. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/booking_transaction.rb +0 -46
  196. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/cell.rb +0 -53
  197. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/confirm_booking_request.rb +0 -43
  198. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/location.rb +0 -37
  199. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/schedule.rb +0 -138
  200. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/seat.rb +0 -48
  201. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/resources/seat_layout.rb +0 -79
  202. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/sync_manager.rb +0 -17
  203. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/sync_strategies/full_sync_strategy.rb +0 -87
  204. data/app/services/spree_cm_commissioner/integrations/vireak_buntham/sync_strategies/incremental_sync_strategy.rb +0 -53
  205. data/app/services/spree_cm_commissioner/inventory_items/generate_permanent_item.rb +0 -48
  206. data/app/services/spree_cm_commissioner/place_resolver.rb +0 -95
  207. data/app/views/spree/admin/integrations/_book_me_bus_v1_fields.html.erb +0 -47
  208. data/app/views/spree/admin/integrations/_larryta_fields.html.erb +0 -58
  209. data/app/views/spree/admin/integrations/_switch_cm_fields.html.erb +0 -53
  210. data/app/views/spree/admin/integrations/_vireak_buntham_fields.html.erb +0 -75
  211. data/db/migrate/20260327143200_create_cm_audit_events.rb +0 -21
  212. data/db/migrate/20260410045815_create_cm_currency_rates.rb +0 -23
  213. data/db/migrate/20260411102139_add_metadata_to_cm_inventory_items.rb +0 -6
  214. data/db/migrate/20260928000000_add_oauth_application_id_to_cm_integrations.rb +0 -5
  215. data/db/migrate/20260928000001_add_closed_to_cm_inventory_items.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2ffd7af989f00931883cac1fc7aa3ff4173458f57a42abd9294ecba2687c2bb
4
- data.tar.gz: d2ee7a2a5d558f018075eded5ef178d294a61afc6e53b5d77018c3ef3a239c04
3
+ metadata.gz: f8c022ba33110958bd0da63395b5e814fb1c5d82469b4801a134b5697dde8a7b
4
+ data.tar.gz: 30f528c86e5b3cd05e22c4ad44fa85d68a0446065c25b1d30b790897afd73f5f
5
5
  SHA512:
6
- metadata.gz: db45749501e065ded53bef1baa37ebbbca96badd6384ac47505f72ed08dd45c0040e6ea22f50dfa4454ea32a3059d63aa7f9ce3e80fe4b97f99d3dca06e1f1ea
7
- data.tar.gz: fc0b52d82222015696750733ecc702ef57e425256ca4e460644f21fe48369251e01e41adee33848e9d78be225e3342d845db8c4df93e973c70a9a360c21e72cb
6
+ metadata.gz: fdb920f19e40a0634796748e15283642dcec8bbcc5d75ff4140628b2c4146e424a987f88c89c14e211e16f0646cae97964af025620aecc69457e518df5cbf1c7
7
+ data.tar.gz: '09ce9911bf7008a80d729b93890f06f24b2deb98e00be9f811550c5803daa49fcb57e94c40decdfdc88e90e8e0a908964984ad7d8c3b146a10e331c93573da15'
data/.env.example CHANGED
@@ -87,4 +87,3 @@ PAYMENT_INCOMPLETE_NOTIFICATION_DELAY_IN_MINUTES=5 # Delay before notifying a c
87
87
 
88
88
  # See: app/jobs/spree_cm_commissioner/telegram_alerts/order_integrity_check_job.rb
89
89
  ORDER_INTEGRITY_TELEGRAM_ALERT_ENABLED="no" # Set to yes to enable the order integrity Telegram alert job (off by default to avoid flooding Telegram rate limits during traffic spikes)
90
-
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.13.3.pre.pre3)
37
+ spree_cm_commissioner (2.13.3)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -47,7 +47,6 @@ module Spree
47
47
  :full_sync_interval_hours,
48
48
  :tenant_id,
49
49
  :vendor_id,
50
- :oauth_application_id,
51
50
  public_metadata: {},
52
51
  private_metadata: {}
53
52
  )
@@ -63,7 +62,6 @@ module Spree
63
62
  @conflict_strategy_options ||= enum_to_options(SpreeCmCommissioner::Integration.conflict_strategies)
64
63
  @tenants ||= SpreeCmCommissioner::Tenant.select(:id, :name).order(:name)
65
64
  @vendors ||= Spree::Vendor.select(:id, :name).order(:name)
66
- @oauth_applications ||= Spree::OauthApplication.select(:id, :name).order(:name)
67
65
  end
68
66
 
69
67
  def enum_to_options(enum_hash)
@@ -71,10 +69,14 @@ module Spree
71
69
  end
72
70
 
73
71
  def integration_type_options
74
- types = SpreeCmCommissioner::Integration.types
75
- return [[Spree.t(:type), 'SpreeCmCommissioner::Integration']] if types.blank?
72
+ files = Dir[SpreeCmCommissioner::Engine.root.join('app/models/spree_cm_commissioner/integrations/*.rb')]
76
73
 
77
- types.map { |class_name| [class_name, class_name] }
74
+ return [[Spree.t(:type), 'SpreeCmCommissioner::Integration']] if files.blank?
75
+
76
+ files.map do |path|
77
+ class_name = "SpreeCmCommissioner::Integrations::#{File.basename(path, '.rb').camelize}"
78
+ [class_name, class_name]
79
+ end.sort_by(&:first)
78
80
  end
79
81
  end
80
82
  end
@@ -2,7 +2,6 @@ module Spree
2
2
  module Admin
3
3
  class InventoryItemsController < StockManagementsController
4
4
  before_action :load_parent
5
- before_action :reject_external_inventory_edits, only: %i[bulk_update_prices bulk_update_stocks]
6
5
 
7
6
  # GET /products/:slug/inventory_items/prices?inventory_item_ids=1,2,3
8
7
  def prices
@@ -79,17 +78,6 @@ module Spree
79
78
 
80
79
  redirect_back fallback_location: admin_product_stock_managements_path(@product)
81
80
  end
82
-
83
- private
84
-
85
- # The partner owns these per-night stocks and prices; its next update would silently overwrite
86
- # an edit made here.
87
- def reject_external_inventory_edits
88
- return unless @product.variants.includes(vendor: :integration).any?(&:inventory_external_wins?)
89
-
90
- flash[:error] = Spree.t('admin.inventory_external_wins', name: @product.vendor.integration.name)
91
- redirect_back fallback_location: admin_product_stock_managements_path(@product)
92
- end
93
81
  end
94
82
  end
95
83
  end
@@ -5,9 +5,6 @@ module SpreeCmCommissioner
5
5
  module CheckoutControllerDecorator
6
6
  def self.prepended(base)
7
7
  base.include SpreeCmCommissioner::OrderConcern
8
- base.include SpreeCmCommissioner::TurnstileProtectable
9
-
10
- base.before_action -> { verify_turnstile! }, only: %i[create_payment]
11
8
  # Sets Current.load_test_bypass from the X-Request-Verify secret so
12
9
  # InventoryHolds::ValidateLimits can skip anti-abuse checks for trusted load tests.
13
10
  base.include SpreeCmCommissioner::LoadTestBypassable
@@ -200,14 +200,10 @@ module SpreeCmCommissioner
200
200
  grouped.map { |nationality_group, guests| customer_type_summary(nationality_group, guests) }.join(', ')
201
201
  end
202
202
 
203
- # e.g. "Local (Adult x1, Child x1)". `cm_saved_guests.age_group` is declared `null: false` in
204
- # the migration, but a dev/staging DB whose column predates that migration (added via
205
- # `add_column ... if_not_exists: true`, which silently skips the constraint if the column
206
- # already exists) can still carry real NULL rows - group those under "Unknown" rather than
207
- # crashing the whole order-completion Telegram notification on nil.humanize.
203
+ # e.g. "Local (Adult x1, Child x1)". age_group is NOT NULL, so it is always present.
208
204
  def customer_type_summary(nationality_group, guests)
209
205
  age_breakdown = guests
210
- .group_by { |sg| sg.age_group&.humanize || 'Unknown' }
206
+ .group_by { |sg| sg.age_group.humanize }
211
207
  .map { |age_group, age_guests| "#{age_group} x#{age_guests.count}" }
212
208
  .join(', ')
213
209
 
@@ -0,0 +1,38 @@
1
+ module SpreeCmCommissioner
2
+ # Groups add-on line items (sold via a ProductRelation) under the line item they were bought with.
3
+ #
4
+ # Grouping is display-only: each child keeps its own price, quantity and adjustments, since
5
+ # promotions, tax, service fees, payouts, refunds and open-dated redemption all work per line item.
6
+ # `relation_type` is a snapshot of the ProductRelation type at purchase, so later edits to the
7
+ # relation don't change what the order sold.
8
+ module LineItemBundleable
9
+ extend ActiveSupport::Concern
10
+
11
+ included do
12
+ belongs_to :parent, class_name: 'Spree::LineItem', optional: true, inverse_of: :children
13
+ has_many :children, class_name: 'Spree::LineItem', foreign_key: :parent_id, inverse_of: :parent, dependent: :destroy
14
+
15
+ enum relation_type: SpreeCmCommissioner::ProductRelationType::PRODUCT_RELATION_TYPES.each_with_index.to_h { |type, index| [type, index] },
16
+ _prefix: :relation
17
+
18
+ scope :top_level, -> { where(parent_id: nil) }
19
+
20
+ money_methods :bundle_amount
21
+
22
+ validates :relation_type, presence: true, if: -> { parent_id.present? || parent.present? }
23
+ validates :relation_type, absence: true, if: -> { parent_id.blank? && parent.blank? }
24
+ validate :ensure_valid_parent, if: -> { parent.present? }
25
+ end
26
+
27
+ def bundle_amount
28
+ amount + children.sum(&:amount)
29
+ end
30
+
31
+ private
32
+
33
+ def ensure_valid_parent
34
+ errors.add(:parent, :invalid) if parent.parent_id.present? || parent == self
35
+ errors.add(:parent, :invalid) if parent.order_id.present? && order_id.present? && parent.order_id != order_id
36
+ end
37
+ end
38
+ end
@@ -2,7 +2,7 @@ module SpreeCmCommissioner
2
2
  module VehicleKind
3
3
  extend ActiveSupport::Concern
4
4
 
5
- VEHICLE_KINDS = %i[suv sedan minivan van sleeping_bus luxury_van air_bus bus ferry boat train].freeze
5
+ VEHICLE_KINDS = %i[suv sedan minivan van sleeping_bus luxury_van air_bus bus ferry train].freeze
6
6
 
7
7
  included do
8
8
  enum kind: VEHICLE_KINDS if table_exists? && column_names.include?('kind')
@@ -14,25 +14,10 @@ module SpreeCmCommissioner
14
14
  validates :incremental_sync_interval_seconds, presence: true, numericality: { only_integer: true, greater_than: 0, less_than_or_equal_to: 3600 }
15
15
  validates :full_sync_interval_hours, presence: true, numericality: { only_integer: true, greater_than: 0, less_than_or_equal_to: 168 }
16
16
 
17
- # Listed from the folder rather than `descendants`, which misses subclasses Zeitwerk hasn't
18
- # loaded yet in dev and test.
19
- def self.types
20
- Dir[SpreeCmCommissioner::Engine.root.join('app/models/spree_cm_commissioner/integrations/*.rb')]
21
- .map { |path| "SpreeCmCommissioner::Integrations::#{File.basename(path, '.rb').camelize}" }
22
- .sort
23
- end
24
-
25
17
  def sync_manager
26
18
  raise NotImplementedError, 'Subclasses must implement the sync_manager method'
27
19
  end
28
20
 
29
- # Whether the partner, not BookMe+, sets this variant's per-night stock, prices and closings.
30
- # When true, stock resets and dashboard edits leave its inventory items alone, and new nights
31
- # start closed until the partner opens them (InventoryItem). Off by default.
32
- def inventory_external_wins?(_variant)
33
- false
34
- end
35
-
36
21
  def restock_external_inventory!(_order, _line_items)
37
22
  raise NotImplementedError, 'Subclasses must implement the restock_external_inventory! method'
38
23
  end
@@ -40,36 +25,5 @@ module SpreeCmCommissioner
40
25
  def unstock_external_inventory!(_order, _line_items)
41
26
  raise NotImplementedError, 'Subclasses must implement the unstock_external_inventory! method'
42
27
  end
43
-
44
- def sync_item_availability!(_options = {})
45
- raise NotImplementedError, 'Subclasses must implement the sync_item_availability! method'
46
- end
47
-
48
- def hold_inventory!(_order, _line_items)
49
- raise NotImplementedError, 'Subclasses must implement the hold_inventory! method'
50
- end
51
-
52
- # Integrations that manage external inventory reservations should override this to return true
53
- def supports_external_inventory_holding?
54
- false
55
- end
56
-
57
- # Integrations that support automatically releasing external inventory
58
- # after reservation expiration or order cancellation should override this to return true
59
- def supports_auto_release_inventory?
60
- false
61
- end
62
-
63
- def release_inventory!(_order, _line_items)
64
- raise NotImplementedError, 'Subclasses must implement the release_inventory! method'
65
- end
66
-
67
- def external_inventory_items(_order)
68
- raise NotImplementedError, 'Subclasses must implement the external_inventory_items method'
69
- end
70
-
71
- def external_inventory_item_status(_order, _options)
72
- raise NotImplementedError, 'Subclasses must implement the external_inventory_item_status method'
73
- end
74
28
  end
75
29
  end
@@ -5,7 +5,10 @@ class SpreeCmCommissioner::Integrations::StadiumXV1 < SpreeCmCommissioner::Integ
5
5
 
6
6
  # override
7
7
  def sync_manager
8
- SpreeCmCommissioner::Integrations::StadiumXV1::SyncManager.new(integration: self)
8
+ SpreeCmCommissioner::Integrations::StadiumXV1::SyncManager.new(
9
+ integration: self,
10
+ client: client
11
+ )
9
12
  end
10
13
 
11
14
  # override
@@ -15,6 +18,7 @@ class SpreeCmCommissioner::Integrations::StadiumXV1 < SpreeCmCommissioner::Integ
15
18
  order: order,
16
19
  line_items: line_items
17
20
  )
21
+
18
22
  raise SpreeCmCommissioner::Integrations::SyncError, result.error unless result.success?
19
23
  end
20
24
 
@@ -23,9 +27,11 @@ class SpreeCmCommissioner::Integrations::StadiumXV1 < SpreeCmCommissioner::Integ
23
27
  raise SpreeCmCommissioner::Integrations::SyncError, 'Ticket cannot be cancelled'
24
28
  end
25
29
 
26
- def sync_item_availability!(_options = {}); end
27
-
28
30
  def client
29
- @client ||= SpreeCmCommissioner::Integrations::StadiumXV1::ExternalClient::Client.new(integration: self)
31
+ SpreeCmCommissioner::Integrations::StadiumXV1::ExternalClient::Client.new(
32
+ public_key: public_key,
33
+ private_key: private_key,
34
+ base_url: base_url
35
+ )
30
36
  end
31
37
  end
@@ -2,15 +2,10 @@ module SpreeCmCommissioner
2
2
  class InventoryItem < Base
3
3
  include SpreeCmCommissioner::ProductType
4
4
  include SpreeCmCommissioner::StoreMetadata
5
- include SpreeCmCommissioner::Integrations::IntegrationMappable
6
5
 
7
6
  MAX_DISPLAY_STOCK = 20
8
7
  LOW_STOCK_THRESHOLD = 20
9
8
 
10
- store_public_metadata :last_synced_at, :datetime
11
- store_public_metadata :original_price, :integer
12
- store_public_metadata :currency, :string
13
-
14
9
  # Association
15
10
  belongs_to :variant, class_name: 'Spree::Variant', optional: false
16
11
 
@@ -41,11 +36,6 @@ module SpreeCmCommissioner
41
36
 
42
37
  before_save -> { self.product_type = variant.product_type }, if: -> { product_type.nil? }
43
38
 
44
- # A night whose inventory a partner owns (Integration#inventory_external_wins?) starts closed: its
45
- # count is only our seed from the physical room count, which the partner may already have sold
46
- # elsewhere. The partner's first availability push opens it.
47
- before_create -> { self.closed = true }, if: -> { permanent_stock? && variant&.inventory_external_wins? }
48
-
49
39
  after_commit :schedule_product_cache_invalidation
50
40
  after_commit :publish_live_stock_status_to_firestore
51
41
 
@@ -119,14 +109,6 @@ module SpreeCmCommissioner
119
109
  # This method is only used when admin update stock
120
110
  def adjust_quantity!(quantity)
121
111
  with_lock do
122
- # Warm the Redis cache from the current DB value BEFORE applying the delta below.
123
- # adjust_quantity_in_redis treats a missing key as 0, so a negative delta against a
124
- # never-cached key would compute e.g. 0 - 3 = -3, clamp to 0, and permanently cache the
125
- # wrong value (the read path only self-heals from a genuinely *missing* key, not a wrong
126
- # one). This is the same warm-before-delta pattern already used by
127
- # InventoryItems::AdjustAvailableQuantity for the same reason.
128
- SpreeCmCommissioner::RedisStock::CachedInventoryItemsBuilder.new([self]).call
129
-
130
112
  # IMPORTANT: Apply quantity changes directly without defensive clamping.
131
113
  # The model validation will catch any attempts to go negative, surfacing bugs
132
114
  # in upstream logic rather than silently losing data.
@@ -94,6 +94,7 @@ module SpreeCmCommissioner
94
94
  base.include SpreeCmCommissioner::ProductType
95
95
  base.include SpreeCmCommissioner::ProductDelegation
96
96
  base.include SpreeCmCommissioner::LineItemOpenDatedTrippable
97
+ base.include SpreeCmCommissioner::LineItemBundleable
97
98
  base.include SpreeCmCommissioner::KycBitwise
98
99
  end
99
100
 
@@ -11,7 +11,6 @@ module SpreeCmCommissioner
11
11
  base.include SpreeCmCommissioner::OrderScopes
12
12
  base.include SpreeCmCommissioner::TicketTransferable
13
13
  base.include SpreeCmCommissioner::OrderQrCodeable
14
- base.include SpreeCmCommissioner::Integrations::IntegrationMappable
15
14
 
16
15
  base.before_create :link_by_phone_number
17
16
  base.before_create :associate_customer
@@ -52,7 +51,6 @@ module SpreeCmCommissioner
52
51
  base.has_many :reserved_blocks, through: :guests, class_name: 'SpreeCmCommissioner::ReservedBlock'
53
52
  base.has_many :guest_card_classes, class_name: 'SpreeCmCommissioner::GuestCardClass', through: :variants
54
53
  base.has_many :product_completion_steps, class_name: 'SpreeCmCommissioner::ProductCompletionStep', through: :line_items
55
- base.has_many :audit_events, class_name: 'SpreeCmCommissioner::AuditEvent', as: :auditable
56
54
 
57
55
  base.delegate :customer, to: :user, allow_nil: true
58
56
 
@@ -1,7 +1,5 @@
1
1
  module SpreeCmCommissioner
2
2
  class Place < Base
3
- include SpreeCmCommissioner::Integrations::IntegrationMappable
4
-
5
3
  acts_as_nested_set
6
4
 
7
5
  validates :reference, presence: true, if: :validate_reference?
@@ -49,8 +49,7 @@ module SpreeCmCommissioner
49
49
  quantity_locked_on_hold: cache_inventory(locked_hold_keys[index], item, item.quantity_locked_on_hold, locked_hold[index]),
50
50
  max_capacity: item.max_capacity,
51
51
  inventory_item_id: item.id,
52
- variant_id: item.variant_id,
53
- closed: item.closed
52
+ variant_id: item.variant_id
54
53
  )
55
54
  end
56
55
 
@@ -1,7 +1,6 @@
1
1
  module SpreeCmCommissioner
2
2
  class Route < Base
3
3
  include SpreeCmCommissioner::RouteType
4
- include SpreeCmCommissioner::Integrations::IntegrationMappable
5
4
  include SpreeCmCommissioner::StoreMetadata
6
5
  include SpreeCmCommissioner::ServiceOrigin
7
6
 
@@ -1,6 +1,5 @@
1
1
  module SpreeCmCommissioner
2
2
  class SeatLayout < Base
3
- include SpreeCmCommissioner::Integrations::IntegrationMappable
4
3
  include StoreMetadata
5
4
 
6
5
  # Whole-screen theming for the app's seat-selection scaffold (background / app bar / status
@@ -23,7 +23,7 @@ module SpreeCmCommissioner
23
23
  return true if variant.need_confirmation?
24
24
  return false if cached_inventory_items.empty?
25
25
 
26
- cached_inventory_items.all? { |item| item.sellable? && quantity_in_pool(item, include_locked: include_locked) >= quantity }
26
+ cached_inventory_items.all? { |item| item.active? && quantity_in_pool(item, include_locked: include_locked) >= quantity }
27
27
  end
28
28
 
29
29
  # The cache row carries both pools, so choosing between them is a read, not another Redis trip.
@@ -45,7 +45,7 @@ module SpreeCmCommissioner
45
45
  # stock, i.e. read sold out exactly when its allotment was still sellable.
46
46
  cached_inventory_items.all? do |item|
47
47
  quantity = line_item.locked_stock? ? item.quantity_locked : item.quantity_available
48
- item.sellable? && quantity >= line_item.quantity
48
+ item.active? && quantity >= line_item.quantity
49
49
  end
50
50
  end
51
51
  end
@@ -15,10 +15,6 @@ module SpreeCmCommissioner
15
15
  private
16
16
 
17
17
  def create_inventory_items
18
- # Skip automatic inventory generation when variant has manual_generate_inventory_items set to true
19
- # Use case: For variants where inventory items need to be manually created/managed (e.g., external integrations)
20
- return if variant.manual_generate_inventory_items?
21
-
22
18
  SpreeCmCommissioner::InventoryItems::GenerateInventoryItemsJob.perform_later(variant_id: variant.id)
23
19
  end
24
20
 
@@ -2,7 +2,6 @@ module SpreeCmCommissioner
2
2
  class Trip < Base
3
3
  include SpreeCmCommissioner::StoreMetadata
4
4
  include SpreeCmCommissioner::RouteType
5
- include SpreeCmCommissioner::Integrations::IntegrationMappable
6
5
  include SpreeCmCommissioner::ServiceOrigin
7
6
 
8
7
  attr_accessor :hours, :minutes, :seconds
@@ -39,7 +38,7 @@ module SpreeCmCommissioner
39
38
  after_commit :update_route_price_range, on: %i[create update]
40
39
 
41
40
  belongs_to :vendor, class_name: 'Spree::Vendor', inverse_of: :trips, optional: false
42
- belongs_to :product, class_name: 'Spree::Product', inverse_of: :trip, optional: true
41
+ belongs_to :product, class_name: 'Spree::Product', inverse_of: :trip, optional: false
43
42
 
44
43
  belongs_to :service_origin, class_name: 'Spree::Taxon', optional: true
45
44
 
@@ -1,7 +1,5 @@
1
1
  module SpreeCmCommissioner
2
2
  class TripStop < Base
3
- include SpreeCmCommissioner::Integrations::IntegrationMappable
4
-
5
3
  acts_as_list column: :sequence, scope: :trip_id
6
4
 
7
5
  belongs_to :trip, class_name: 'SpreeCmCommissioner::Trip', optional: false
@@ -6,7 +6,6 @@ module SpreeCmCommissioner
6
6
  base.include SpreeCmCommissioner::VariantOptionsConcern
7
7
  base.include SpreeCmCommissioner::KycBitwise
8
8
  base.include SpreeCmCommissioner::Integrations::IntegrationMappable
9
- base.include SpreeCmCommissioner::VariantMetadata
10
9
 
11
10
  base.after_commit :update_vendor_price
12
11
  base.validate :validate_option_types
@@ -81,10 +80,6 @@ module SpreeCmCommissioner
81
80
  delivery_option == 'delivery'
82
81
  end
83
82
 
84
- def inventory_external_wins?
85
- vendor&.integration&.inventory_external_wins?(self) || false
86
- end
87
-
88
83
  def non_digital_ecommerce?
89
84
  !digital? && ecommerce?
90
85
  end
@@ -1,7 +1,6 @@
1
1
  module SpreeCmCommissioner
2
2
  class Vehicle < Base
3
3
  include SpreeCmCommissioner::VehicleKind
4
- include SpreeCmCommissioner::Integrations::IntegrationMappable
5
4
 
6
5
  belongs_to :vendor, class_name: 'Spree::Vendor'
7
6
  belongs_to :vehicle_type, class_name: 'SpreeCmCommissioner::VehicleType'
@@ -14,8 +13,6 @@ module SpreeCmCommissioner
14
13
  validates :name, presence: true
15
14
  validates :license_plate, uniqueness: true, allow_blank: true
16
15
 
17
- has_one :seat_layout, through: :vehicle_type
18
-
19
16
  self.whitelisted_ransackable_attributes = %w[name license_plate kind]
20
17
 
21
18
  def display_name
@@ -2,7 +2,6 @@ module SpreeCmCommissioner
2
2
  class VehicleType < Base
3
3
  include SpreeCmCommissioner::StoreMetadata
4
4
  include SpreeCmCommissioner::VehicleKind
5
- include SpreeCmCommissioner::Integrations::IntegrationMappable
6
5
 
7
6
  # This model has no seat_layout column (polymorphic association), so we store the preload_seat_layout_id ID in public_metadata.
8
7
  # This lets us check if a seat layout exists without triggering a database query.
@@ -33,7 +33,6 @@ module SpreeCmCommissioner
33
33
  base.has_many :nearby_places, -> { order(position: :asc) }, class_name: 'SpreeCmCommissioner::VendorPlace', dependent: :destroy
34
34
 
35
35
  base.has_many :stock_items, through: :variants, class_name: 'Spree::StockItem'
36
- base.has_many :currency_rates, class_name: 'SpreeCmCommissioner::CurrencyRate', dependent: :destroy
37
36
 
38
37
  base.has_many :taxon_vendors, class_name: 'SpreeCmCommissioner::TaxonVendor'
39
38
  base.has_many :taxons, through: :taxon_vendors
@@ -105,7 +104,6 @@ module SpreeCmCommissioner
105
104
  base.has_many :boarding_trip_stops, through: :trips, class_name: 'SpreeCmCommissioner::TripStop', source: :boarding_trip_stops
106
105
  base.has_many :drop_off_trip_stops, through: :trips, class_name: 'SpreeCmCommissioner::TripStop', source: :drop_off_trip_stops
107
106
  base.has_many :pricing_models, class_name: 'SpreeCmCommissioner::PricingModel', foreign_key: :vendor_id, dependent: :destroy
108
- base.has_many :orders, -> { distinct }, through: :variants, source: :orders
109
107
 
110
108
  base.has_many :agency_categories, -> { where(kind: :agency_category) }, class_name: 'Spree::Taxon', foreign_key: :vendor_id
111
109
 
@@ -250,21 +248,6 @@ module SpreeCmCommissioner
250
248
 
251
249
  delegate :present?, to: :tenant, prefix: true
252
250
 
253
- # Returns the exchange rate between two currencies
254
- # If no direct rate exists, calculates the inverse rate from the reverse pair
255
- # Returns 1.0 for identical currencies, nil if no rate is found
256
- def exchange_rate(from_currency, to_currency)
257
- return 1.0 if from_currency == to_currency
258
-
259
- pair = currency_rates.by_pair(from_currency, to_currency).first
260
- return pair.rate if pair.present?
261
-
262
- reverse_pair = currency_rates.by_pair(to_currency, from_currency).first
263
- return (1.0 / reverse_pair.rate).round(6) if reverse_pair.present?
264
-
265
- nil
266
- end
267
-
268
251
  def validate_sellable_product_types
269
252
  valid_types = SpreeCmCommissioner::ProductType::PRODUCT_TYPES.map(&:to_s)
270
253
  return if sellable_product_types.all? { |type| valid_types.include?(type.to_s) }
@@ -1,7 +1,5 @@
1
1
  module SpreeCmCommissioner
2
2
  class VendorPlace < Base
3
- include SpreeCmCommissioner::Integrations::IntegrationMappable
4
-
5
3
  enum place_type: { venue: 0, branch: 1, stop: 2, location: 3 }
6
4
  acts_as_list scope: :vendor
7
5
 
@@ -10,7 +10,8 @@ module Spree
10
10
  :completion_steps, :available_social_contact_platforms, :allow_anonymous_booking, :discontinue_on,
11
11
  :high_demand, :jwt_token,
12
12
  :direction, :trip_id, :boarding_trip_stop_id, :drop_off_trip_stop_id,
13
- :service_fee_total, :display_service_fee_total
13
+ :service_fee_total, :display_service_fee_total,
14
+ :parent_id, :relation_type, :bundle_amount, :display_bundle_amount
14
15
 
15
16
  base.attribute :required_self_check_in_location, &:required_self_check_in_location?
16
17
  base.attribute :allowed_self_check_in, &:allowed_self_check_in?
@@ -1,7 +1,8 @@
1
1
  module SpreeCmCommissioner::Integrations::Base
2
2
  class SyncManager
3
- def initialize(integration:)
3
+ def initialize(integration:, client:)
4
4
  @integration = integration
5
+ @client = client
5
6
  @sync_session = nil
6
7
  end
7
8
 
@@ -174,17 +174,6 @@ module SpreeCmCommissioner::Integrations::Base
174
174
  @error.nil?
175
175
  end
176
176
 
177
- # Access metrics
178
- # @return [Hash] The metrics hash
179
- attr_reader :metrics
180
-
181
- # Access API calls
182
- # @return [Hash] The API calls hash
183
- attr_reader :api_calls
184
-
185
- # Timestamp of the last synced item (set by SyncItemAvailability)
186
- attr_accessor :last_synced_at
187
-
188
177
  # Serialize to hash for JSONB persistence
189
178
  # @return [Hash] Serialized representation
190
179
  def to_h