spree_cm_commissioner 2.0.0.pre.pre → 2.0.0.pre.pre1

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 (267) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +3 -0
  3. data/.github/workflows/test_and_build_gem.yml +2 -16
  4. data/.gitignore +1 -2
  5. data/Gemfile.lock +1 -32
  6. data/Rakefile +4 -33
  7. data/app/assets/images/cm-hangmeas-checkout_image.svg +63 -0
  8. data/app/assets/images/cm-hangmeas-failed.svg +56 -0
  9. data/app/assets/images/cm-hangmeas-loader.svg +50 -0
  10. data/app/assets/images/cm-hangmeas-success.svg +51 -0
  11. data/app/assets/images/mailer/mail.png +0 -0
  12. data/app/assets/images/mailer/tenant_phone.png +0 -0
  13. data/app/assets/images/mailer/tenant_user.png +0 -0
  14. data/app/assets/javascripts/spree_cm_commissioner/backend.js +1 -0
  15. data/app/assets/javascripts/spree_cm_commissioner/tenant_payment_icon_fields.js +65 -0
  16. data/app/assets/stylesheets/spree_cm_commissioner/backend/calendar.scss +11 -8
  17. data/app/assets/stylesheets/spree_cm_commissioner/backend/commissioner_admin.css.scss +1 -0
  18. data/app/assets/stylesheets/spree_cm_commissioner/backend/tenant_payment_icon_fields.scss +60 -0
  19. data/app/controllers/concerns/spree_cm_commissioner/content_cachable.rb +2 -1
  20. data/app/controllers/concerns/spree_cm_commissioner/transit/taxon_bitwise.rb +44 -0
  21. data/app/controllers/spree/admin/event_blazer_queries_controller.rb +11 -4
  22. data/app/controllers/spree/admin/stock_managements_controller.rb +1 -63
  23. data/app/controllers/spree/admin/tenants_controller.rb +8 -0
  24. data/app/controllers/spree/admin/trip_blazer_queries_controller.rb +35 -0
  25. data/app/controllers/spree/api/v2/operator/pie_chart_events_controller.rb +46 -0
  26. data/app/controllers/spree/api/v2/organizer/invite_crews_controller.rb +33 -0
  27. data/app/controllers/spree/api/v2/organizer/invite_guests_controller.rb +1 -1
  28. data/app/controllers/spree/api/v2/storefront/accommodations_controller.rb +31 -14
  29. data/app/controllers/spree/api/v2/storefront/dynamic_field_options_controller.rb +5 -1
  30. data/app/controllers/spree/api/v2/storefront/guests_controller.rb +30 -4
  31. data/app/controllers/spree/api/v2/storefront/queue_cart/line_items_controller.rb +2 -2
  32. data/app/controllers/spree/api/v2/tenant/checkout_controller.rb +2 -0
  33. data/app/controllers/spree_cm_commissioner/admin/variants_controller_decorator.rb +1 -1
  34. data/app/controllers/spree_cm_commissioner/api/v2/storefront/checkout_controller_decorator.rb +11 -0
  35. data/app/controllers/spree_cm_commissioner/well_known_controller.rb +31 -17
  36. data/app/factory/spree_cm_commissioner/invite_guest_claimed_telegram_message_factory.rb +24 -81
  37. data/app/finders/spree_cm_commissioner/line_items/find_by_variant_decorator.rb +20 -0
  38. data/app/interactors/spree_cm_commissioner/apple_app_site_association_fetcher.rb +27 -0
  39. data/app/interactors/spree_cm_commissioner/asset_links_fetcher.rb +27 -0
  40. data/app/interactors/spree_cm_commissioner/create_ticket.rb +6 -5
  41. data/app/interactors/spree_cm_commissioner/create_vendor.rb +44 -0
  42. data/app/interactors/spree_cm_commissioner/crew_invite_link_handler.rb +48 -0
  43. data/app/interactors/spree_cm_commissioner/pin_code_sender.rb +0 -1
  44. data/app/interactors/spree_cm_commissioner/sms.rb +1 -1
  45. data/app/interactors/spree_cm_commissioner/telegram_chats_auto_finder.rb +144 -0
  46. data/app/interactors/spree_cm_commissioner/user_id_token_authenticator.rb +7 -3
  47. data/app/interactors/spree_cm_commissioner/user_id_token_checker.rb +11 -3
  48. data/app/interactors/spree_cm_commissioner/user_identity_checker.rb +12 -6
  49. data/app/interactors/spree_cm_commissioner/user_registration_with_id_token.rb +7 -1
  50. data/app/interactors/spree_cm_commissioner/vattanac_bank_initiator.rb +5 -1
  51. data/app/jobs/spree_cm_commissioner/application_job.rb +0 -20
  52. data/app/jobs/spree_cm_commissioner/application_unique_job.rb +0 -20
  53. data/app/jobs/spree_cm_commissioner/sms_pin_code_job.rb +1 -1
  54. data/app/mailers/spree/order_mailer_decorator.rb +18 -3
  55. data/app/models/concerns/spree_cm_commissioner/event_check_in_flowable.rb +30 -0
  56. data/app/models/concerns/spree_cm_commissioner/line_item_durationable.rb +33 -9
  57. data/app/models/concerns/spree_cm_commissioner/option_type_attr_type.rb +13 -1
  58. data/app/models/concerns/spree_cm_commissioner/order_state_machine.rb +0 -39
  59. data/app/models/concerns/spree_cm_commissioner/product_delegation.rb +3 -1
  60. data/app/models/concerns/spree_cm_commissioner/product_type.rb +0 -10
  61. data/app/models/concerns/spree_cm_commissioner/taxon_kind.rb +1 -1
  62. data/app/models/concerns/spree_cm_commissioner/tenant_preference.rb +5 -0
  63. data/app/models/concerns/spree_cm_commissioner/variant_options_concern.rb +4 -2
  64. data/app/models/spree_cm_commissioner/blazer_queryable.rb +8 -0
  65. data/app/models/spree_cm_commissioner/branch.rb +12 -0
  66. data/app/models/spree_cm_commissioner/chart_type.rb +10 -0
  67. data/app/models/spree_cm_commissioner/crew_invite_link.rb +4 -0
  68. data/app/models/spree_cm_commissioner/dynamic_field.rb +37 -3
  69. data/app/models/spree_cm_commissioner/dynamic_field_option.rb +7 -1
  70. data/app/models/spree_cm_commissioner/guest.rb +57 -19
  71. data/app/models/spree_cm_commissioner/guest_dynamic_field.rb +61 -3
  72. data/app/models/spree_cm_commissioner/invite.rb +4 -6
  73. data/app/models/spree_cm_commissioner/invite_team.rb +3 -1
  74. data/app/models/spree_cm_commissioner/line_item_decorator.rb +78 -46
  75. data/app/models/spree_cm_commissioner/line_item_seat.rb +10 -0
  76. data/app/models/spree_cm_commissioner/notification_taxon.rb +1 -1
  77. data/app/models/spree_cm_commissioner/option_type_decorator.rb +11 -1
  78. data/app/models/spree_cm_commissioner/option_value_vehicle_type.rb +8 -0
  79. data/app/models/spree_cm_commissioner/order_decorator.rb +1 -30
  80. data/app/models/spree_cm_commissioner/pin_code.rb +3 -2
  81. data/app/models/spree_cm_commissioner/pin_code_telegram.rb +28 -0
  82. data/app/models/spree_cm_commissioner/place.rb +3 -1
  83. data/app/models/spree_cm_commissioner/product_decorator.rb +26 -10
  84. data/app/models/spree_cm_commissioner/promotion_category_decorator.rb +11 -0
  85. data/app/models/spree_cm_commissioner/service_calendar.rb +2 -0
  86. data/app/models/spree_cm_commissioner/state_decorator.rb +1 -0
  87. data/app/models/spree_cm_commissioner/stock/availability_checker.rb +25 -26
  88. data/app/models/spree_cm_commissioner/stock/availability_validator_decorator.rb +1 -2
  89. data/app/models/spree_cm_commissioner/stock/line_item_availability_checker.rb +3 -3
  90. data/app/models/spree_cm_commissioner/stock_item_decorator.rb +0 -17
  91. data/app/models/spree_cm_commissioner/stop.rb +23 -0
  92. data/app/models/spree_cm_commissioner/taxon_decorator.rb +6 -2
  93. data/app/models/spree_cm_commissioner/taxonomy_decorator.rb +6 -0
  94. data/app/models/spree_cm_commissioner/telegram_chat.rb +6 -0
  95. data/app/models/spree_cm_commissioner/trip.rb +10 -12
  96. data/app/models/spree_cm_commissioner/trip_connection.rb +5 -5
  97. data/app/models/spree_cm_commissioner/trip_stop.rb +3 -2
  98. data/app/models/spree_cm_commissioner/user_decorator.rb +6 -0
  99. data/app/models/spree_cm_commissioner/user_identity_provider.rb +26 -4
  100. data/app/models/spree_cm_commissioner/user_taxon.rb +1 -0
  101. data/app/models/spree_cm_commissioner/variant_decorator.rb +47 -36
  102. data/app/models/spree_cm_commissioner/variant_options.rb +23 -0
  103. data/app/models/spree_cm_commissioner/vehicle.rb +14 -9
  104. data/app/models/spree_cm_commissioner/vehicle_seat.rb +11 -0
  105. data/app/models/spree_cm_commissioner/vehicle_type.rb +76 -0
  106. data/app/models/spree_cm_commissioner/vendor_decorator.rb +13 -7
  107. data/app/models/spree_cm_commissioner/vendor_place.rb +5 -6
  108. data/app/models/spree_cm_commissioner/vendor_stop.rb +2 -1
  109. data/app/overrides/spree/admin/taxons/_form/check_in_flows.html.erb.deface +18 -0
  110. data/app/overrides/spree/admin/variants/_form/kyc_field.html.erb.deface +2 -2
  111. data/app/queries/spree_cm_commissioner/guest_searcher_query.rb +45 -3
  112. data/app/queries/spree_cm_commissioner/pie_chart_event_queries.rb +179 -0
  113. data/app/queries/spree_cm_commissioner/trip_query.rb +26 -23
  114. data/app/queries/spree_cm_commissioner/trip_search_query.rb +76 -0
  115. data/app/queries/spree_cm_commissioner/variant_availability/non_permanent_stock_query.rb +45 -0
  116. data/app/queries/spree_cm_commissioner/variant_availability/permanent_stock_query.rb +55 -0
  117. data/app/request_schemas/spree_cm_commissioner/accommodation_request_schema.rb +0 -3
  118. data/app/request_schemas/spree_cm_commissioner/application_request_schema.rb +1 -1
  119. data/app/serializables/spree_cm_commissioner/pie_chart_event.rb +11 -0
  120. data/app/serializers/spree/v2/organizer/invite_crews_serializer.rb +11 -0
  121. data/app/serializers/spree/v2/storefront/accommodation_serializer.rb +0 -2
  122. data/app/serializers/spree/v2/storefront/line_item_serializer_decorator.rb +0 -1
  123. data/app/serializers/spree/v2/tenant/user_serializer.rb +1 -0
  124. data/app/serializers/spree_cm_commissioner/v2/operator/chart_type_serializer.rb +10 -0
  125. data/app/serializers/spree_cm_commissioner/v2/operator/dashboard_crew_event_serializer.rb +4 -1
  126. data/app/serializers/spree_cm_commissioner/v2/storefront/dynamic_field_option_serializer.rb +1 -3
  127. data/app/serializers/spree_cm_commissioner/v2/storefront/dynamic_field_serializer.rb +1 -3
  128. data/app/serializers/spree_cm_commissioner/v2/storefront/guest_dynamic_field_serializer.rb +2 -1
  129. data/app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb +23 -15
  130. data/app/services/spree_cm_commissioner/user_authenticator.rb +1 -1
  131. data/app/services/spree_cm_commissioner/vehicle_option_value_creator.rb +11 -0
  132. data/app/views/blazer/queries/_content.html.erb +8 -0
  133. data/app/views/spree/admin/stock_managements/_variant_stock_items.html.erb +2 -7
  134. data/app/views/spree/admin/stock_managements/index.html.erb +6 -55
  135. data/app/views/spree/admin/tenant_vendors/index.html.erb +9 -2
  136. data/app/views/spree/admin/tenants/_form.html.erb +118 -42
  137. data/app/views/spree/admin/tenants/edit.html.erb +2 -1
  138. data/app/views/spree/admin/tenants/index.html.erb +7 -1
  139. data/app/views/spree/admin/vendors/_form.html.erb +14 -0
  140. data/app/views/spree/order_mailer/confirm_email.html.erb +27 -16
  141. data/app/views/spree_cm_commissioner/layouts/order_mailer.html.erb +5 -1
  142. data/app/views/spree_cm_commissioner/order_mailer/_mailer_stylesheets.html.erb +41 -4
  143. data/app/views/spree_cm_commissioner/order_mailer/tenant/_customer_info.html.erb +42 -0
  144. data/app/views/spree_cm_commissioner/order_mailer/tenant/_footer.html.erb +25 -0
  145. data/app/views/spree_cm_commissioner/order_mailer/tenant/_greeting.html.erb +19 -0
  146. data/app/views/spree_cm_commissioner/order_mailer/tenant/_support_contact.html.erb +33 -0
  147. data/config/initializers/spree_permitted_attributes.rb +2 -5
  148. data/config/locales/en.yml +10 -1
  149. data/config/routes.rb +7 -22
  150. data/db/migrate/20240202080634_update_counter_cache_of_vehicle_type.rb +1 -3
  151. data/db/migrate/20250616084219_add_description_to_cm_vendor_place.rb +5 -0
  152. data/db/migrate/20250630103536_create_cm_telegram_chats.rb +13 -0
  153. data/db/migrate/20250701093203_add_configurations_to_cm_dynamic_field.rb +6 -0
  154. data/db/migrate/20250702091305_add_dynamic_field_option_to_guest_dynamic_field.rb +5 -0
  155. data/db/migrate/20250702091935_add_status_to_dynamic_field_option.rb +5 -0
  156. data/db/migrate/20250707032008_add_vendor_id_to_spree_category.rb +7 -0
  157. data/db/migrate/20250709073455_add_email_fields_to_spree_vendors.rb +6 -0
  158. data/db/migrate/20250711092937_add_position_to_cm_dynamic_fields.rb +11 -0
  159. data/db/migrate/20250711093045_add_position_to_cm_dynamic_field_options.rb +11 -0
  160. data/db/migrate/20250714121508_rename_cm_taxon_blazer_query_to_blazer_queryables.rb +7 -0
  161. data/db/migrate/20250714124323_make_cm_blazer_queryables_polymorphic.rb +19 -0
  162. data/db/migrate/20250715103333_remove_indexes_from_cm_user_identity_providers.rb +13 -0
  163. data/db/migrate/20250718071620_add_data_fill_stage_to_dynamic_fields.rb +5 -0
  164. data/docker-compose.yml +1 -1
  165. data/lib/cm_app_logger.rb +4 -11
  166. data/lib/generators/spree_cm_commissioner/install/install_generator.rb +11 -14
  167. data/lib/generators/spree_cm_commissioner/install/templates/app/javascript/{spree_dashboard/spree_cm_commissioner → spree_cm_commissioner}/utilities.js +0 -4
  168. data/lib/spree_cm_commissioner/calendar_event.rb +1 -11
  169. data/lib/spree_cm_commissioner/test_helper/factories/branch_factory.rb +12 -0
  170. data/lib/spree_cm_commissioner/test_helper/factories/departure_time_option_type_factory.rb +8 -0
  171. data/lib/spree_cm_commissioner/test_helper/factories/duration_option_type_factory.rb +8 -0
  172. data/lib/spree_cm_commissioner/test_helper/factories/guest_factory.rb +0 -10
  173. data/lib/spree_cm_commissioner/test_helper/factories/homepage_section_relatable_factory.rb +1 -1
  174. data/lib/spree_cm_commissioner/test_helper/factories/line_item_factory.rb +1 -1
  175. data/lib/spree_cm_commissioner/test_helper/factories/line_item_seat_factory.rb +7 -0
  176. data/lib/spree_cm_commissioner/test_helper/factories/option_type_factory.rb +30 -6
  177. data/lib/spree_cm_commissioner/test_helper/factories/order_factory.rb +36 -0
  178. data/lib/spree_cm_commissioner/test_helper/factories/product_factory.rb +34 -18
  179. data/lib/spree_cm_commissioner/test_helper/factories/stock_location_factory.rb +2 -2
  180. data/lib/spree_cm_commissioner/test_helper/factories/stop_factory.rb +14 -0
  181. data/lib/spree_cm_commissioner/test_helper/factories/transit_place_factory.rb +8 -0
  182. data/lib/spree_cm_commissioner/test_helper/factories/trip_factory.rb +3 -10
  183. data/lib/spree_cm_commissioner/test_helper/factories/user_identity_provider_factory.rb +1 -1
  184. data/lib/spree_cm_commissioner/test_helper/factories/variant_factory.rb +19 -41
  185. data/lib/spree_cm_commissioner/test_helper/factories/vehicle_factory.rb +1 -1
  186. data/lib/spree_cm_commissioner/test_helper/factories/vehicle_option_type_factory.rb +8 -0
  187. data/lib/spree_cm_commissioner/test_helper/factories/vehicle_type_factory.rb +96 -0
  188. data/lib/spree_cm_commissioner/test_helper/factories/vendor_factory.rb +1 -1
  189. data/lib/spree_cm_commissioner/trip_seat_layout_result.rb +11 -0
  190. data/lib/spree_cm_commissioner/version.rb +1 -1
  191. data/lib/spree_cm_commissioner.rb +1 -35
  192. data/spree_cm_commissioner.gemspec +0 -7
  193. metadata +70 -133
  194. data/app/controllers/spree/admin/inventory_items_controller.rb +0 -83
  195. data/app/controllers/spree/api/v2/storefront/accommodations/variants_controller.rb +0 -42
  196. data/app/finders/spree_cm_commissioner/accommodations/find.rb +0 -37
  197. data/app/finders/spree_cm_commissioner/accommodations/find_variant.rb +0 -32
  198. data/app/interactors/spree_cm_commissioner/ensure_correct_product_type.rb +0 -40
  199. data/app/interactors/spree_cm_commissioner/inventory_item_syncer.rb +0 -25
  200. data/app/interactors/spree_cm_commissioner/stock/inventory_item_resetter.rb +0 -44
  201. data/app/interactors/spree_cm_commissioner/stock/inventory_items_adjuster.rb +0 -13
  202. data/app/interactors/spree_cm_commissioner/stock/inventory_items_generator.rb +0 -15
  203. data/app/interactors/spree_cm_commissioner/stock/permanent_inventory_items_generator.rb +0 -75
  204. data/app/interactors/spree_cm_commissioner/stock/stock_movement_creator.rb +0 -32
  205. data/app/jobs/spree_cm_commissioner/ensure_correct_product_type_job.rb +0 -7
  206. data/app/jobs/spree_cm_commissioner/inventory_item_syncer_job.rb +0 -7
  207. data/app/jobs/spree_cm_commissioner/stock/inventory_items_adjuster_job.rb +0 -11
  208. data/app/jobs/spree_cm_commissioner/stock/inventory_items_generator_job.rb +0 -11
  209. data/app/jobs/spree_cm_commissioner/stock/permanent_inventory_items_generator_job.rb +0 -9
  210. data/app/models/concerns/spree_cm_commissioner/order_seatable.rb +0 -44
  211. data/app/models/spree_cm_commissioner/block.rb +0 -23
  212. data/app/models/spree_cm_commissioner/inventory.rb +0 -11
  213. data/app/models/spree_cm_commissioner/inventory_item.rb +0 -69
  214. data/app/models/spree_cm_commissioner/price_decorator.rb +0 -9
  215. data/app/models/spree_cm_commissioner/redis_stock/cached_inventory_items_builder.rb +0 -41
  216. data/app/models/spree_cm_commissioner/redis_stock/inventory_updater.rb +0 -126
  217. data/app/models/spree_cm_commissioner/redis_stock/line_items_cached_inventory_items_builder.rb +0 -36
  218. data/app/models/spree_cm_commissioner/redis_stock/variant_cached_inventory_items_builder.rb +0 -25
  219. data/app/models/spree_cm_commissioner/reserved_block.rb +0 -30
  220. data/app/models/spree_cm_commissioner/seat_layout.rb +0 -20
  221. data/app/models/spree_cm_commissioner/seat_section.rb +0 -16
  222. data/app/models/spree_cm_commissioner/seats/blocks_canceler.rb +0 -30
  223. data/app/models/spree_cm_commissioner/seats/blocks_holder.rb +0 -53
  224. data/app/models/spree_cm_commissioner/seats/blocks_reserver.rb +0 -49
  225. data/app/models/spree_cm_commissioner/seats/errors/blocks_are_on_hold_by_other_guest.rb +0 -4
  226. data/app/models/spree_cm_commissioner/seats/errors/blocks_are_reserved_by_other_guest.rb +0 -4
  227. data/app/models/spree_cm_commissioner/seats/errors/blocks_are_reserved_by_same_guest.rb +0 -4
  228. data/app/models/spree_cm_commissioner/seats/errors/unable_to_save_reserved_block_record.rb +0 -4
  229. data/app/models/spree_cm_commissioner/stock/order_availability_checker.rb +0 -44
  230. data/app/models/spree_cm_commissioner/taxon_blazer_query.rb +0 -8
  231. data/app/models/spree_cm_commissioner/variant_block.rb +0 -9
  232. data/app/request_schemas/spree_cm_commissioner/variant_request_schema.rb +0 -19
  233. data/app/views/spree/admin/inventory_items/show.html.erb +0 -72
  234. data/app/views/spree/admin/stock_managements/calendar.html.erb +0 -56
  235. data/config/initializers/paper_trail.rb +0 -1
  236. data/db/migrate/20250304293518_create_cm_inventory_items.rb +0 -21
  237. data/db/migrate/20250429094228_add_lock_version_to_cm_inventory_items.rb +0 -5
  238. data/db/migrate/20250502025848_add_index_to_spree_products.rb +0 -5
  239. data/db/migrate/20250502030001_add_product_type_to_spree_variants.rb +0 -5
  240. data/db/migrate/20250502030002_add_product_type_to_spree_line_items.rb +0 -5
  241. data/db/migrate/20250603035256_add_inventory_item_to_spree_prices.rb +0 -7
  242. data/db/migrate/20250619073724_drop_table_cm_line_item_seats.rb +0 -5
  243. data/db/migrate/20250619073812_drop_table_cm_vehicle_seats.rb +0 -5
  244. data/db/migrate/20250619073844_drop_table_cm_vehicle_types.rb +0 -9
  245. data/db/migrate/20250619073957_drop_table_cm_option_value_vehicle_types.rb +0 -5
  246. data/db/migrate/20250619082354_remove_unnecessary_fields_from_cm_places.rb +0 -9
  247. data/db/migrate/20250619082736_remove_route_type_from_spree_products.rb +0 -5
  248. data/db/migrate/20250619083055_remove_unnecessary_fields_from_spree_taxons.rb +0 -5
  249. data/db/migrate/20250620083055_remove_variant_id_from_cm_trips.rb +0 -5
  250. data/db/migrate/20250620090000_update_cm_trip_connections_to_use_cm_trips.rb +0 -6
  251. data/db/migrate/20250620090001_create_cm_seat_layouts.rb +0 -17
  252. data/db/migrate/20250620090002_create_cm_seat_sections.rb +0 -18
  253. data/db/migrate/20250620090003_create_cm_blocks.rb +0 -18
  254. data/db/migrate/20250624091005_create_cm_reserved_blocks.rb +0 -29
  255. data/db/migrate/20250626083642_create_cm_variant_blocks.rb +0 -24
  256. data/db/migrate/20250627023314_add_block_id_to_cm_guests.rb +0 -13
  257. data/lib/spree_cm_commissioner/cached_inventory_item.rb +0 -23
  258. data/lib/spree_cm_commissioner/test_helper/factories/block_factory.rb +0 -9
  259. data/lib/spree_cm_commissioner/test_helper/factories/inventory_item_factory.rb +0 -9
  260. data/lib/spree_cm_commissioner/test_helper/factories/reserved_block_factory.rb +0 -27
  261. data/lib/spree_cm_commissioner/test_helper/factories/seat_layout_factory.rb +0 -8
  262. data/lib/spree_cm_commissioner/test_helper/factories/seat_section_factory.rb +0 -8
  263. data/lib/spree_cm_commissioner/test_helper/factories/trip_connection_factory.rb +0 -6
  264. data/lib/spree_cm_commissioner/test_helper/factories/variant_block_factory.rb +0 -7
  265. data/lib/tasks/create_default_non_permanent_inventory_items.rake +0 -16
  266. data/lib/tasks/ensure_correct_product_type.rake +0 -7
  267. data/lib/tasks/generate_inventory_items.rake +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c84700dfc0c91553426b4c3957ab2e2906f4327f9b968efe1d88ce590d69a63
4
- data.tar.gz: c98479e1dd2ff5f4def2b7799ff2ffc894812dd737e52a6e2488839318ca514b
3
+ metadata.gz: b85b4b7a446688bc4aed2974e7150a9155a2d919b998188fc7e575ccea0d2714
4
+ data.tar.gz: 134a3e165301c382a7e48016e768755420d32003a31cf3b3dac79f33b7a0d5a6
5
5
  SHA512:
6
- metadata.gz: ddc75d3e7e17ad18de9c620336c8233191f268bd2c18911455b6169f4a6a379b2d8d537e1a7cc6c2d8f280842772b787d19d3215263cf3a6856309f263712512
7
- data.tar.gz: 551e01c90befa48ad8fa44adc40e9be2af4bda32319f05e562d66d099a0d729477f9ade32aee9c9256728481756e35ccec863782d033962756daba9720e868e8
6
+ metadata.gz: fd91cb46cb05faec83d0978df8312e272265ad03d1d14c1319ea0303081521dac9468a4e9e6fd4e72698e61c175fcddfc3bed53527e7f0ebe1a23f81062bf9c3
7
+ data.tar.gz: 1d04b75c972c6cff71fa6e95ca3882411a8a54b6b0b226183369a97b1360fa00c2c334e728203f647405313da8deec7298e4662dedfb068cc51540e4caf548d7
data/.env.example CHANGED
@@ -24,3 +24,6 @@ WAITING_ROOM_DISABLED=no
24
24
  # Vattanac Bank
25
25
  VATTANAC_AES_SECRET_KEY= ""
26
26
  VATTANAC_PUBLIC_KEY=""
27
+
28
+ # Organizer URL
29
+ ORGANIZER_URL=http://127.0.0.1:4000/organizer
@@ -10,7 +10,6 @@ on:
10
10
  - reopened
11
11
  branches:
12
12
  - develop
13
- - milestone-77-scalable-design
14
13
  push:
15
14
  tags:
16
15
  - "*"
@@ -38,8 +37,7 @@ jobs:
38
37
  console.log("PR title format is correct.");
39
38
  }
40
39
  - name: Check commit messages format
41
- # skip validation if the PR is from the milestone-77-scalable-design branch for temporary
42
- if: github.event_name == 'pull_request' && github.head_ref != 'milestone-77-scalable-design'
40
+ if: github.event_name == 'pull_request'
43
41
  uses: actions/github-script@v7
44
42
  with:
45
43
  script: |
@@ -138,17 +136,6 @@ jobs:
138
136
  --health-timeout 5s
139
137
  --health-retries 5
140
138
 
141
- redis:
142
- image: redis
143
- # Set health checks to wait until redis has started
144
- options: >-
145
- --health-cmd "redis-cli ping"
146
- --health-interval 10s
147
- --health-timeout 5s
148
- --health-retries 5
149
- ports:
150
- - 6379:6379 # Maps port 6379 on service container to the host
151
-
152
139
  steps:
153
140
  - uses: actions/checkout@v3
154
141
 
@@ -184,9 +171,8 @@ jobs:
184
171
  - name: Run test
185
172
  env:
186
173
  DATABASE_URL: postgres://myuser:mypassword@localhost:5432/test_db
187
- REDIS_URL: redis://localhost:6379/0
188
174
 
189
- if: github.event_name == 'pull_request'
175
+ if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'develop'
190
176
  run: |
191
177
  bundle exec rake
192
178
 
data/.gitignore CHANGED
@@ -28,5 +28,4 @@ node_modules
28
28
  # VScode
29
29
  .vscode
30
30
  !.vscode/.settings.json
31
- .env
32
- vendor/bundle/
31
+ .env
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.0.0.pre.pre)
37
+ spree_cm_commissioner (2.0.0.pre.pre1)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -42,7 +42,6 @@ PATH
42
42
  aws-sdk-s3
43
43
  blazer (~> 3.0.4)
44
44
  byebug
45
- connection_pool
46
45
  counter_culture (~> 3.2)
47
46
  dry-validation (~> 1.10)
48
47
  elasticsearch (~> 8.5)
@@ -55,12 +54,9 @@ PATH
55
54
  interactor (~> 3.1)
56
55
  jwt (>= 2.5.0)
57
56
  noticed (~> 1.6)
58
- paper_trail (~> 16.0)
59
57
  phonelib
60
58
  premailer-rails
61
59
  rails (~> 7.0.4)
62
- redis
63
- redis-rails
64
60
  rqrcode (~> 2.0)
65
61
  searchkick (~> 5.1)
66
62
  simple_calendar (~> 2.4)
@@ -576,10 +572,6 @@ GEM
576
572
  nokogiri (1.15.4)
577
573
  mini_portile2 (~> 2.8.2)
578
574
  racc (~> 1.4)
579
- nokogiri (1.15.4-x86_64-darwin)
580
- racc (~> 1.4)
581
- nokogiri (1.15.4-x86_64-linux)
582
- racc (~> 1.4)
583
575
  noticed (1.6.3)
584
576
  http (>= 4.0.0)
585
577
  rails (>= 5.2.0)
@@ -588,9 +580,6 @@ GEM
588
580
  sawyer (~> 0.9)
589
581
  orm_adapter (0.5.0)
590
582
  os (1.1.4)
591
- paper_trail (16.0.0)
592
- activerecord (>= 6.1)
593
- request_store (~> 1.4)
594
583
  parallel (1.23.0)
595
584
  paranoia (2.6.3)
596
585
  activerecord (>= 5.1, < 7.2)
@@ -626,8 +615,6 @@ GEM
626
615
  activesupport (>= 2.3.14)
627
616
  racc (1.7.1)
628
617
  rack (2.2.8)
629
- rack-session (1.0.2)
630
- rack (< 3)
631
618
  rack-test (2.1.0)
632
619
  rack (>= 1.3)
633
620
  rails (7.0.8)
@@ -671,31 +658,13 @@ GEM
671
658
  rbtree (0.4.6)
672
659
  redis (5.0.7)
673
660
  redis-client (>= 0.9.0)
674
- redis-actionpack (5.5.0)
675
- actionpack (>= 5)
676
- redis-rack (>= 2.1.0, < 4)
677
- redis-store (>= 1.1.0, < 2)
678
- redis-activesupport (5.3.0)
679
- activesupport (>= 3, < 8)
680
- redis-store (>= 1.3, < 2)
681
661
  redis-client (0.17.0)
682
662
  connection_pool
683
- redis-rack (3.0.0)
684
- rack-session (>= 0.2.0)
685
- redis-store (>= 1.2, < 2)
686
- redis-rails (5.0.2)
687
- redis-actionpack (>= 5.0, < 6)
688
- redis-activesupport (>= 5.0, < 6)
689
- redis-store (>= 1.2, < 2)
690
- redis-store (1.11.0)
691
- redis (>= 4, < 6)
692
663
  regexp_parser (2.8.2)
693
664
  representable (3.2.0)
694
665
  declarative (< 0.1.0)
695
666
  trailblazer-option (>= 0.1.1, < 0.2.0)
696
667
  uber (< 0.2.0)
697
- request_store (1.7.0)
698
- rack (>= 1.4)
699
668
  responders (3.1.1)
700
669
  actionpack (>= 5.2)
701
670
  railties (>= 5.2)
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
4
  require 'rspec/core/rake_task'
5
- require 'spree/testing_support/common_rake'
5
+ require 'spree/testing_support/extension_rake'
6
6
 
7
7
  RSpec::Core::RakeTask.new
8
8
 
@@ -14,37 +14,8 @@ task :default do
14
14
  Rake::Task[:spec].invoke
15
15
  end
16
16
 
17
- # Copied from:
18
- # spree_core:lib/spree/testing_support/common_rake.rb
19
- # But refactored to skip frontend & backend setup.
20
17
  desc 'Generates a dummy app for testing'
21
- task :test_app do |_t, args|
22
- require 'spree_cm_commissioner'
23
- require "generators/spree_cm_commissioner/install/install_generator"
24
-
25
- Rails.env = ENV['RAILS_ENV'] = 'test'
26
-
27
- Spree::DummyGeneratorHelper.inject_extension_requirements = true
28
- Spree::DummyGenerator.start ["--lib_name=spree_cm_commissioner", '--quiet']
29
- Spree::InstallGenerator.start [
30
- "--lib_name=spree_cm_commissioner",
31
- '--auto-accept',
32
- '--migrate=false',
33
- '--seed=false',
34
- '--sample=false',
35
- '--quiet',
36
- '--copy_storefront=false',
37
- "--install_storefront=false",
38
- "--install_admin=false",
39
- "--user_class=Spree::User"
40
- ]
41
-
42
- puts 'Setting up dummy database...'
43
- system('bin/rails db:environment:set RAILS_ENV=test')
44
- system('bundle exec rake db:drop db:create')
45
- Spree::DummyModelGenerator.start
46
- system('bundle exec rake db:migrate')
47
-
48
- puts 'Running extension installation generator...'
49
- SpreeCmCommissioner::Generators::InstallGenerator.start(['--auto-run-migrations'])
18
+ task :test_app do
19
+ ENV['LIB_NAME'] = 'spree_cm_commissioner'
20
+ Rake::Task['extension:test_app'].invoke
50
21
  end
@@ -0,0 +1,63 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="payment_proccessing" data-name="payment proccessing" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 334 200">
3
+ <defs>
4
+ <clipPath id="clippath">
5
+ <path d="m332.72,16.62v166.75c0,8.27-6.28,15.08-14.33,15.92-.55.05-1.11.08-1.67.08H16c-.48,0-.96-.02-1.43-.06-8.17-.73-14.57-7.59-14.57-15.94V16.62C0,7.78,7.16.62,16,.62h300.72c8.84,0,16,7.16,16,16Z" style="fill: none;"/>
6
+ </clipPath>
7
+ </defs>
8
+ <g style="clip-path: url(#clippath);">
9
+ <path d="m332.72,16.62v166.75c0,8.27-6.28,15.08-14.33,15.92-.55.05-1.11.08-1.67.08H16c-.48,0-.96-.02-1.43-.06-8.17-.73-14.57-7.59-14.57-15.94V16.62C0,7.78,7.16.62,16,.62h300.72c8.84,0,16,7.16,16,16Z" style="fill: #130d07;"/>
10
+ <path d="m160.11,89.69c1.41-5.81-3.61-9.74-10.21-9.27-6.6.47-26.31,10.68-28.51,12.26-2.2,1.57-29.54,6.6-34.25,3.77-4.71-2.83-12.46-7.49-12.46-7.49,0,0-23.81-23.81-40.47,2.86-16.67,26.66-13.99,61.42-13.99,61.42l-24.1,29.05s-10.95,10,3.81,19.05,22.11,18.14,31.15,21.3c9.04,3.16,14.46-7,14.46-7.68,0-.68,19.43-30.27,19.43-30.27,10.27-.69,20.53-1.41,30.79-2.17,10.81-.8,24.65.44,31.99-9.08,3.2-4.15,1.59-8.37-.02-12.85.06.18,3.68-1,4-1.13,1.81-.72,3.12-1.91,3.94-3.7,1.55-3.36,2.03-8.12.07-11.41-2.91-4.88-3.85-5.31-3.85-5.31.93.42,4.7-2.76,5.32-3.27,2.69-2.21,4.81-5.03,5.27-8.57,1.31-10.16-10.01-17.26-18.56-19.27,5.59,1.31,10.8,2.15,16.21-.39,3.01-1.41,5.69-3.43,8.35-5.44,4.02-3.03,10.38-7.18,11.65-12.41" style="fill: #e89875;"/>
11
+ <path d="m138.73,45.68c-1.83-.91-5.84-1.99-7.86-2.27-3.17-.44-12.78-.68-12.78-.68l-1.24,3.76-31.45-1.3c-4.73-.2-8.98,2.88-10.27,7.44l-27.87,101.59c-1.74,6.14,2.5,12.35,8.85,12.97l49.44,1.78c4.98.49,9.59-2.69,10.89-7.53l27.25-101.35c.17-.64.26-1.28.31-1.92,0-.02.01-.05.02-.07,1.59-7.52-1.35-10.47-5.29-12.43Z" style="fill: #302b31;"/>
12
+ <path d="m51.51,163.26l49.44,1.78c4.98.49,9.59-2.69,10.89-7.53l27.25-101.35c1.7-6.33-2.91-12.61-9.46-12.88l-48.82-2.02c-4.73-.2-8.98,2.88-10.27,7.44l-27.87,101.59c-1.74,6.14,2.5,12.35,8.85,12.97Z" style="fill: #212028;"/>
13
+ <path d="m108.45,126.85c-1.64.07-3.43-.23-5.08-.3-4.13-.18-8.26-.36-12.39-.54l-22.43-.98-.81-.04c-2.87-.41-4.61-1.99-3.7-4.96l.84-3.54c.55-2.49,2.89-4.15,5.42-3.86,13.54.41,27.15.41,40.66,1.23,2,.12,4.17.45,4.34,2.96.15,2.13-1.09,4.94-1.91,6.87-1.02,2.41-2.87,3.07-4.95,3.16Z" style="fill: #f59b1d;"/>
14
+ <path d="m117.78,96.1l-48.7-1.94c-2.03-.08-3.25-1.77-2.74-3.76l8.36-32.34c.52-2,2.58-3.55,4.61-3.47l48.7,1.94c2.03.08,3.25,1.77,2.74,3.76l-8.36,32.34c-.52,2-2.58,3.55-4.61,3.47Z" style="fill: #fffaf8;"/>
15
+ <path d="m85.83,77.72l-8.87-.35c-.88-.04-1.41-.77-1.19-1.63l1.23-4.78c.22-.87,1.12-1.54,2-1.51l8.87.35c.88.04,1.41.77,1.19,1.63l-1.23,4.78c-.22.87-1.12,1.54-2,1.51Z" style="fill: #d6d6d6;"/>
16
+ <path d="m124.55,64.16l-9.8-.39c-.62-.02-1-.54-.84-1.15l.45-1.74c.16-.61.79-1.09,1.41-1.06l9.8.39c.62.02,1,.54.84,1.15l-.45,1.74c-.16.61-.79,1.09-1.41,1.06Z" style="fill: #d6d6d6;"/>
17
+ <path d="m84.05,81.98l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
18
+ <path d="m99.83,91.71l-27.44-1.09c-.25-.01-.41-.22-.34-.47l.42-1.62c.06-.25.32-.44.57-.43l27.44,1.09c.25.01.41.22.34.47l-.42,1.62c-.06.25-.32.44-.57.43Z" style="fill: #d6d6d6;"/>
19
+ <path d="m95.54,82.43l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
20
+ <path d="m107.03,82.89l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
21
+ <path d="m118.52,83.35l-8.95-.36c-.47-.02-.75-.41-.63-.87l.22-.86c.12-.46.59-.82,1.06-.8l8.95.36c.47.02.75.41.63.87l-.22.86c-.12.46-.59.82-1.06.8Z" style="fill: #d6d6d6;"/>
22
+ <path d="m111.65,93.7c-.49.15-.94.45-1.44.61-2.03.64-4.12-.62-4.15-2.53-.02-1.28.45-2.44,1.6-3.42.84-.72,1.78-1.08,2.78-1.14.88-.05,1.65.12,2.24.65.12.11.29.16.44.24-.17.19.02.23.08.32.37.57.57,1.21.45,1.96-.2,1.22-.73,2.32-1.89,3.17-.05.03-.08.09-.11.14Z" style="fill: #d6d6d6;"/>
23
+ <path d="m111.65,93.7s.07-.11.11-.14c1.16-.85,1.69-1.95,1.89-3.17.12-.75-.08-1.39-.45-1.96-.06-.09-.25-.14-.08-.32.59-.27,1.16-.59,1.79-.67,2.25-.26,3.6.86,3.66,2.68.06,1.96-1.32,3.73-3.42,4.37-1.29.39-2.36.14-3.23-.58-.09-.07-.18-.15-.26-.22Z" style="fill: #5e5e5e;"/>
24
+ <path d="m53.69,110.12s1.51-5.75,5.56,2.51c4.05,8.27,15.38,11.23,20.41,6.86s-.79-23.41-15.54-36.21c-14.75-12.8-30.48,5.41-37.12,19.9-6.65,14.49-6.78,50.07-6.78,50.07l48.9,21.12s8.3-15.25.02-34.98c-4.68-11.15-9.08-16.86-12.8-21.88-3.73-5.02-2.64-7.37-2.64-7.37Z" style="fill: #e89875;"/>
25
+ <g>
26
+ <rect x="222.73" y="98.72" width="8.27" height="27.35" style="fill: #fbc01a;"/>
27
+ <polygon points="231 100.13 222.73 100.13 221.53 95.4 232.39 95.4 231 100.13" style="fill: #fbc01a;"/>
28
+ <line x1="223.67" y1="100.13" x2="231" y2="100.13" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
29
+ <polygon points="222.73 126.08 231 126.08 232.2 130.8 221.33 130.8 222.73 126.08" style="fill: #fbc01a;"/>
30
+ <line x1="231" y1="126.08" x2="222.73" y2="126.08" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
31
+ </g>
32
+ <g>
33
+ <rect x="240.34" y="98.72" width="8.27" height="27.35" style="fill: #f4b200;"/>
34
+ <polygon points="248.61 100.13 240.34 100.13 239.15 95.4 250.01 95.4 248.61 100.13" style="fill: #f4b200;"/>
35
+ <polygon points="240.35 126.08 248.62 126.08 249.81 130.8 238.95 130.8 240.35 126.08" style="fill: #f4b200;"/>
36
+ </g>
37
+ <g>
38
+ <rect x="257.95" y="98.72" width="8.27" height="27.35" style="fill: #fbc01a;"/>
39
+ <polygon points="266.22 100.13 257.95 100.13 256.76 95.4 267.62 95.4 266.22 100.13" style="fill: #fbc01a;"/>
40
+ <line x1="258.9" y1="100.13" x2="266.22" y2="100.13" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
41
+ <polygon points="257.96 126.08 266.23 126.08 267.42 130.8 256.56 130.8 257.96 126.08" style="fill: #fbc01a;"/>
42
+ <line x1="266.22" y1="126.08" x2="257.96" y2="126.08" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
43
+ </g>
44
+ <g>
45
+ <rect x="275.56" y="98.72" width="8.27" height="27.35" style="fill: #fbc01a;"/>
46
+ <polygon points="283.84 100.13 275.56 100.13 274.37 95.4 285.23 95.4 283.84 100.13" style="fill: #fbc01a;"/>
47
+ <line x1="276.51" y1="100.13" x2="283.84" y2="100.13" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
48
+ <polygon points="275.57 126.08 283.84 126.08 285.04 130.8 274.17 130.8 275.57 126.08" style="fill: #fbc01a;"/>
49
+ <line x1="283.84" y1="126.08" x2="275.57" y2="126.08" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
50
+ </g>
51
+ <rect x="218.79" y="91.42" width="69.46" height="3.98" style="fill: #f9b500;"/>
52
+ <rect x="218.79" y="130.8" width="69.46" height="3.98" style="fill: #fbc01a;"/>
53
+ <rect x="209.25" y="134.79" width="88.53" height="4.09" style="fill: #f4b200;"/>
54
+ <path d="m216.67,88.29l34.23-15.08c2.1-.93,4.5-.93,6.6,0l34.23,15.08c1.62.71,1.11,3.13-.66,3.13h-73.75c-1.77,0-2.28-2.42-.66-3.13Z" style="fill: #fbc01a;"/>
55
+ <path d="m230.81,86.16l21.33-9.4c1.31-.58,2.8-.58,4.11,0l21.33,9.4c1.01.44.69,1.95-.41,1.95h-45.96c-1.1,0-1.42-1.51-.41-1.95Z" style="fill: #f4b200;"/>
56
+ <path d="m256.72,83.21c0-1.39-1.13-2.51-2.51-2.51s-2.51,1.13-2.51,2.51,1.13,2.51,2.51,2.51,2.51-1.13,2.51-2.51Z" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
57
+ <line x1="218.8" y1="131.54" x2="288.24" y2="131.54" style="fill: none; stroke: #f9b500; stroke-miterlimit: 10; stroke-width: .5px;"/>
58
+ <path d="m143.42,43.43l2.99-1.92c34.81-22.3,81.11-12.16,103.41,22.65h0" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 4px;"/>
59
+ <polyline points="242.93 64.16 250.34 64.16 250.34 56.12" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 3px;"/>
60
+ <path d="m253.66,141.68l-3.52,4.34c-28.53,29.92-75.91,31.04-105.83,2.5h0" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 4px;"/>
61
+ <polyline points="151 146.9 143.8 148.65 145.77 156.76" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 3px;"/>
62
+ </g>
63
+ </svg>
@@ -0,0 +1,56 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 52 52"
5
+ width="100"
6
+ height="100"
7
+ >
8
+ <style>
9
+ .svg-failed {
10
+ stroke: white;
11
+ stroke-width: 5;
12
+ stroke-miterlimit: 10;
13
+ stroke-linecap: round;
14
+ stroke-linejoin: round;
15
+ fill: none;
16
+ animation: svg-failed-scale 0.3s ease-in-out 0.9s both;
17
+ }
18
+
19
+ .svg-failed-circle {
20
+ stroke: none;
21
+ fill: #FF5A5F;
22
+ }
23
+
24
+ .svg-failed-x {
25
+ stroke-dasharray: 48;
26
+ stroke-dashoffset: 48;
27
+ animation: svg-failed-draw 0.5s ease forwards 0.6s;
28
+ }
29
+
30
+ @keyframes svg-failed-draw {
31
+ to {
32
+ stroke-dashoffset: 0;
33
+ }
34
+ }
35
+
36
+ @keyframes svg-failed-scale {
37
+ 0%, 100% {
38
+ transform: scale(1);
39
+ }
40
+ 50% {
41
+ transform: scale(1.1);
42
+ }
43
+ }
44
+ </style>
45
+
46
+ <circle class="svg-failed-circle" cx="26" cy="26" r="25" />
47
+ <!-- X mark: two lines crossing -->
48
+ <path
49
+ class="svg-failed svg-failed-x"
50
+ d="M16 16 L36 36"
51
+ />
52
+ <path
53
+ class="svg-failed svg-failed-x"
54
+ d="M36 16 L16 36"
55
+ />
56
+ </svg>
@@ -0,0 +1,50 @@
1
+ <svg class="pl" width="300" height="300" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <style>
3
+ .pl__ring { animation: ringA 3s linear infinite; }
4
+ .pl__ring--a { stroke: #F79E1B; }
5
+ .pl__ring--b { animation-name: ringB; stroke: #F79E1B; }
6
+ .pl__ring--c { animation-name: ringC; stroke: #F79E1B; }
7
+ .pl__ring--d { animation-name: ringD; stroke: #F79E1B; }
8
+
9
+ @keyframes ringA {
10
+ from, 4% { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -330; }
11
+ 12% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -335; }
12
+ 32% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -595; }
13
+ 40%, 54% { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -660; }
14
+ 62% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -665; }
15
+ 82% { stroke-dasharray: 60 600; stroke-width: 30; stroke-dashoffset: -925; }
16
+ 90%, to { stroke-dasharray: 0 660; stroke-width: 20; stroke-dashoffset: -990; }
17
+ }
18
+ @keyframes ringB {
19
+ from, 12% { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -110; }
20
+ 20% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -115; }
21
+ 40% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -195; }
22
+ 48%, 62% { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -220; }
23
+ 70% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -225; }
24
+ 90% { stroke-dasharray: 20 200; stroke-width: 30; stroke-dashoffset: -305; }
25
+ 98%, to { stroke-dasharray: 0 220; stroke-width: 20; stroke-dashoffset: -330; }
26
+ }
27
+ @keyframes ringC {
28
+ from { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: 0; }
29
+ 8% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -5; }
30
+ 28% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -175; }
31
+ 36%, 58% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -220; }
32
+ 66% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -225; }
33
+ 86% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -395; }
34
+ 94%, to { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -440; }
35
+ }
36
+ @keyframes ringD {
37
+ from, 8% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: 0; }
38
+ 16% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -5; }
39
+ 36% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -175; }
40
+ 44%, 50% { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -220; }
41
+ 58% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -225; }
42
+ 78% { stroke-dasharray: 40 400; stroke-width: 30; stroke-dashoffset: -395; }
43
+ 86%, to { stroke-dasharray: 0 440; stroke-width: 20; stroke-dashoffset: -440; }
44
+ }
45
+ </style>
46
+ <circle class="pl__ring pl__ring--a" cx="150" cy="150" r="105" fill="none" stroke-width="20" stroke-dasharray="0 660" stroke-dashoffset="-330" stroke-linecap="round"/>
47
+ <circle class="pl__ring pl__ring--b" cx="150" cy="150" r="35" fill="none" stroke-width="20" stroke-dasharray="0 220" stroke-dashoffset="-110" stroke-linecap="round"/>
48
+ <circle class="pl__ring pl__ring--c" cx="115" cy="150" r="70" fill="none" stroke-width="20" stroke-dasharray="0 440" stroke-linecap="round"/>
49
+ <circle class="pl__ring pl__ring--d" cx="185" cy="150" r="70" fill="none" stroke-width="20" stroke-dasharray="0 440" stroke-linecap="round"/>
50
+ </svg>
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ viewBox="0 0 52 52"
5
+ width="100"
6
+ height="100"
7
+ >
8
+ <style>
9
+ .svg-checkmark {
10
+ stroke: white;
11
+ stroke-width: 5;
12
+ stroke-miterlimit: 10;
13
+ stroke-linecap: round;
14
+ stroke-linejoin: round;
15
+ fill: none;
16
+ animation: svg-success-scale 0.3s ease-in-out 0.9s both;
17
+ }
18
+
19
+ .svg-checkmark-circle {
20
+ stroke: none;
21
+ fill: #00D290;
22
+ }
23
+
24
+ .svg-checkmark-check {
25
+ stroke-dasharray: 48;
26
+ stroke-dashoffset: 48;
27
+ animation: svg-success-draw 0.5s ease forwards 0.6s;
28
+ }
29
+
30
+ @keyframes svg-success-draw {
31
+ to {
32
+ stroke-dashoffset: 0;
33
+ }
34
+ }
35
+
36
+ @keyframes svg-success-scale {
37
+ 0%, 100% {
38
+ transform: scale(1);
39
+ }
40
+ 50% {
41
+ transform: scale(1.1);
42
+ }
43
+ }
44
+ </style>
45
+
46
+ <circle class="svg-checkmark-circle" cx="26" cy="26" r="25" />
47
+ <path
48
+ class="svg-checkmark svg-checkmark-check"
49
+ d="M14.1 27.2l7.1 7.2 16.7-16.8"
50
+ />
51
+ </svg>
Binary file
@@ -11,3 +11,4 @@
11
11
  //= require spree_cm_commissioner/selected_field_filter_origin_destination
12
12
  //= require spree_cm_commissioner/location_checkbox_manager
13
13
  //= require spree_cm_commissioner/trip_stop_selection
14
+ //= require spree_cm_commissioner/tenant_payment_icon_fields
@@ -0,0 +1,65 @@
1
+ document.addEventListener('DOMContentLoaded', function () {
2
+ // Initialize Select2 for all tenant-payment-icon-select elements
3
+ if (window.$ && $.fn.select2) {
4
+ $('.tenant-payment-icon-select').each(function () {
5
+ $(this).select2({
6
+ width: '100%'
7
+ });
8
+ });
9
+ }
10
+
11
+ // Handle icon selection change
12
+ document.querySelectorAll('.tenant-payment-icon-select').forEach(function (select) {
13
+ select.addEventListener('change', function (e) {
14
+ const field = e.target.name.match(/\[([^\]]*)\]$/)[1]; // Extract field name
15
+ const preview = document.getElementById(`icon-preview-${field}`);
16
+ const removeBtn = document.querySelector(`.remove-icon-btn[data-target="${field}"]`);
17
+ const iconPath = e.target.value;
18
+
19
+ if (!preview || !removeBtn) return;
20
+
21
+ if (!iconPath) {
22
+ preview.innerHTML = '<span class="no-icon-placeholder"></span>';
23
+ removeBtn.classList.add('hidden');
24
+ return;
25
+ }
26
+
27
+ // Fetch SVG for the selected icon
28
+ fetch(`/admin/vector_icons/svg?path=${encodeURIComponent(iconPath)}`)
29
+ .then((response) => {
30
+ if (!response.ok) throw new Error('Failed to fetch SVG');
31
+ return response.text();
32
+ })
33
+ .then((svg) => {
34
+ preview.innerHTML = svg;
35
+ removeBtn.classList.remove('hidden');
36
+ })
37
+ .catch((error) => {
38
+ console.error('Error fetching SVG:', error);
39
+ preview.innerHTML = '<span class="no-icon-placeholder">Error loading icon</span>';
40
+ });
41
+ });
42
+ });
43
+
44
+ document.addEventListener('click', function (e) {
45
+ if (!e.target.classList.contains('remove-icon-btn')) return;
46
+
47
+ const field = e.target.getAttribute('data-target');
48
+ const select = document.querySelector(`.tenant-payment-icon-select[name*="[${field}]"]`);
49
+ const preview = document.getElementById(`icon-preview-${field}`);
50
+ const removeBtn = e.target;
51
+
52
+ if (!select || !preview || !removeBtn) return;
53
+
54
+ // Clear the select input
55
+ select.value = '';
56
+
57
+ if (window.$ && $(select).hasClass('select2-hidden-accessible')) {
58
+ $(select).val('').trigger('change.select2');
59
+ } else {
60
+ select.dispatchEvent(new Event('change', { bubbles: true }));
61
+ }
62
+ preview.innerHTML = '<span class="no-icon-placeholder"></span>';
63
+ removeBtn.classList.add('hidden');
64
+ });
65
+ });
@@ -55,9 +55,8 @@ $day-background: theme-color("light");
55
55
  }
56
56
  }
57
57
 
58
- .wday-0 {
59
- background-color: darken($day-background, 5%);
60
- }
58
+ // .wday-0 {
59
+ // }
61
60
 
62
61
  // .wday-1 {
63
62
  // }
@@ -74,9 +73,8 @@ $day-background: theme-color("light");
74
73
  // .wday-5 {
75
74
  // }
76
75
 
77
- .wday-6 {
78
- background-color: darken($day-background, 5%);
79
- }
76
+ // .wday-6 {
77
+ // }
80
78
 
81
79
  // .today {
82
80
  // }
@@ -88,7 +86,9 @@ $day-background: theme-color("light");
88
86
  // }
89
87
 
90
88
  // known as active-date
91
- // .start-date {}
89
+ .start-date {
90
+ background-color: darken($day-background, 5%);
91
+ }
92
92
 
93
93
  // .prev-month {
94
94
  // }
@@ -159,8 +159,11 @@ $day-background: theme-color("light");
159
159
 
160
160
  // .current-month {}
161
161
  .has-events {
162
+ background-color: lighten(theme-color("warning"), 30%);
163
+ color: darken(theme-color("warning"), 50%);
164
+
162
165
  @include hover {
163
- background-color: rgba($dark, 0.1);
166
+ background-color: theme-color("warning");
164
167
  }
165
168
  }
166
169
 
@@ -3,3 +3,4 @@
3
3
  @import "spree_cm_commissioner/backend/service_calendar";
4
4
  @import "spree_cm_commissioner/backend/guest_qr_code";
5
5
  @import "spree_cm_commissioner/backend/vehicle_seat";
6
+ @import "spree_cm_commissioner/backend/tenant_payment_icon_fields";
@@ -0,0 +1,60 @@
1
+ .payment-icon-preview {
2
+ width: 80px;
3
+ height: 80px;
4
+ background: #f8f9fa;
5
+ border: 1px dashed #ccc;
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ cursor: pointer;
10
+ }
11
+
12
+ .payment-icon-preview svg {
13
+ width: 100%;
14
+ height: 100%;
15
+ object-fit: contain;
16
+ }
17
+
18
+
19
+ .no-icon-placeholder {
20
+ width: 40px;
21
+ height: 40px;
22
+ border: 1px dashed #ddd;
23
+ background: #f8f9fa;
24
+ display: inline-block;
25
+ }
26
+
27
+ .icon-preview-container {
28
+ position: relative;
29
+ display: inline-block;
30
+ }
31
+
32
+ .remove-icon-btn {
33
+ position: absolute;
34
+ top: -8px;
35
+ right: -8px;
36
+ width: 24px;
37
+ height: 24px;
38
+ border-radius: 50%;
39
+ background: #dc3545;
40
+ color: white;
41
+ border: 2px solid white;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ cursor: pointer;
46
+ font-size: 12px;
47
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2);
48
+ transition: all 0.2s ease;
49
+ z-index: 10;
50
+ }
51
+
52
+ .remove-icon-btn:hover {
53
+ background: #c82333;
54
+ transform: scale(1.1);
55
+ box-shadow: 0 3px 6px rgba(0,0,0,0.3);
56
+ }
57
+
58
+ .remove-icon-btn.hidden {
59
+ display: none;
60
+ }
@@ -6,8 +6,9 @@ module SpreeCmCommissioner
6
6
  after_action :set_cache_control_for_cdn
7
7
  end
8
8
 
9
+ # Override This Method based on your UseCase
9
10
  def max_age
10
- ENV.fetch('CONTENT_CACHE_MAX_AGE', '180')
11
+ ENV.fetch('CONTENT_CACHE_MAX_AGE', 1.day.to_i).to_i
11
12
  end
12
13
 
13
14
  def set_cache_control_for_cdn