spree_cm_commissioner 2.1.4.pre.pre2 → 2.1.5.pre.pre3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/interactors/spree_cm_commissioner/sms.rb +2 -3
- data/app/models/spree_cm_commissioner/guest.rb +9 -4
- data/app/models/spree_cm_commissioner/line_item_decorator.rb +8 -1
- data/app/models/spree_cm_commissioner/sms_log.rb +2 -0
- data/config/initializers/spree_permitted_attributes.rb +4 -2
- data/config/locales/en.yml +35 -30
- data/config/locales/km.yml +24 -19
- data/db/migrate/20250912084944_add_send_type_to_sms_log.rb +9 -0
- data/lib/spree_cm_commissioner/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e22965144e75388dd801148c7d38580aee08856973332edc2c40ad31f6772a
|
4
|
+
data.tar.gz: 1b33b7d645b36c9ccf42444dfa09aa7826a43d9c8e2a3dd0aaaa6d1668f6643d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 781da351e0880acf7f46fbbc060844a31f26b322d781fc17ad1da51ac4a3e7d0a9c991d2fb4921ec1cc1e89a255c2abf9457c3bf7c163108838b199cb9865054
|
7
|
+
data.tar.gz: 6322d9ef0cca35c6d225cb91917cb3e49a6a96221b60025103f09f607658eaf0c797d0d37f6ad44b3c183a5f7c8d6a64afd0326de016047cf005dfb8ae200b4b
|
data/Gemfile.lock
CHANGED
@@ -8,8 +8,7 @@ module SpreeCmCommissioner
|
|
8
8
|
create_sms_log(sms_options)
|
9
9
|
create_message(sms_options)
|
10
10
|
rescue StandardError => e
|
11
|
-
context.sms_log.error
|
12
|
-
context.sms_log.save
|
11
|
+
context.sms_log.update(error: e.message, status: :failed)
|
13
12
|
context.fail!(message: e.message)
|
14
13
|
|
15
14
|
log_error_to_telegram(e.message)
|
@@ -29,7 +28,7 @@ module SpreeCmCommissioner
|
|
29
28
|
# sms adapter can decide whether to update additional sms log fields
|
30
29
|
def update_sms_log(attributes)
|
31
30
|
attributes = attributes.slice(:external_ref)
|
32
|
-
context.sms_log.update(attributes)
|
31
|
+
context.sms_log.update(attributes.merge(status: :sent))
|
33
32
|
end
|
34
33
|
|
35
34
|
def create_sms_log(sms_options)
|
@@ -51,7 +51,8 @@ module SpreeCmCommissioner
|
|
51
51
|
preference :telegram_user_verified_at, :string
|
52
52
|
|
53
53
|
before_validation :set_event_id
|
54
|
-
before_validation :
|
54
|
+
before_validation :assign_seat_number_with_bib, if: -> { bib_number.present? }
|
55
|
+
before_validation :assign_seat_number_with_block, if: -> { will_save_change_to_block_id? }
|
55
56
|
|
56
57
|
before_create :generate_bib, if: -> { line_item.reload && variant.bib_pre_generation_on_create? }
|
57
58
|
|
@@ -147,13 +148,17 @@ module SpreeCmCommissioner
|
|
147
148
|
self.event_id ||= line_item&.event_id
|
148
149
|
end
|
149
150
|
|
150
|
-
def
|
151
|
+
def assign_seat_number_with_block
|
152
|
+
self.seat_number = block.present? ? block.label : nil
|
153
|
+
end
|
154
|
+
|
155
|
+
def assign_seat_number_with_bib
|
151
156
|
return if seat_number.present? # avoid reassign seat to guest
|
152
157
|
|
153
|
-
|
158
|
+
assign_seat_number_with_bib!
|
154
159
|
end
|
155
160
|
|
156
|
-
def
|
161
|
+
def assign_seat_number_with_bib!
|
157
162
|
index = bib_number - 1
|
158
163
|
positions = line_item.variant.seat_number_positions || []
|
159
164
|
|
@@ -29,6 +29,7 @@ module SpreeCmCommissioner
|
|
29
29
|
base.before_create :add_due_date, if: :subscription?
|
30
30
|
|
31
31
|
base.validate :ensure_not_exceed_max_quantity_per_order, if: -> { variant&.max_quantity_per_order.present? }
|
32
|
+
base.validate :ensure_all_guests_have_blocks, if: -> { variant&.blocks&.any? }
|
32
33
|
|
33
34
|
base.whitelisted_ransackable_associations |= %w[guests order]
|
34
35
|
base.whitelisted_ransackable_attributes |= %w[number to_date from_date vendor_id]
|
@@ -217,7 +218,13 @@ module SpreeCmCommissioner
|
|
217
218
|
private
|
218
219
|
|
219
220
|
def ensure_not_exceed_max_quantity_per_order
|
220
|
-
errors.add(:quantity, 'exceeded_max_quantity_per_order') if quantity > variant.max_quantity_per_order
|
221
|
+
errors.add(:quantity, I18n.t('line_item.validation.exceeded_max_quantity_per_order')) if quantity > variant.max_quantity_per_order
|
222
|
+
end
|
223
|
+
|
224
|
+
def ensure_all_guests_have_blocks
|
225
|
+
return if number_of_guests == guests.map(&:block_id).compact.uniq.size
|
226
|
+
|
227
|
+
errors.add(:base, I18n.t('line_item.validation.seats_are_required'))
|
221
228
|
end
|
222
229
|
|
223
230
|
def update_vendor_id
|
@@ -2,11 +2,13 @@ module Spree
|
|
2
2
|
module PermittedAttributes
|
3
3
|
@@vendor_attributes << :logo
|
4
4
|
|
5
|
+
# Permitted all guest attributes for now as permitting only some guest attributes is not working by design
|
6
|
+
# of spree add_item service, if we want to only permit some guest attributes,
|
7
|
+
# we need to override most part of add_item service.
|
5
8
|
@@line_item_attributes += %i[
|
6
9
|
from_date
|
7
10
|
to_date
|
8
|
-
|
9
|
-
date
|
11
|
+
guests_attributes
|
10
12
|
]
|
11
13
|
|
12
14
|
@@user_attributes += %i[
|
data/config/locales/en.yml
CHANGED
@@ -49,16 +49,16 @@ en:
|
|
49
49
|
empty_info: "No vendor information available."
|
50
50
|
|
51
51
|
telegram_bot:
|
52
|
-
|
52
|
+
empty_info: "No <b>Telegram Bot</b> found"
|
53
53
|
|
54
54
|
guest_card_classes:
|
55
55
|
empty_info: "No guest card classes information available."
|
56
56
|
background_image: "Background Image"
|
57
57
|
guest_dynamic_field:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
58
|
+
errors:
|
59
|
+
pre_registration_required: "is required before ticket issuance"
|
60
|
+
post_registration_required: "must be completed after purchase"
|
61
|
+
during_check_in_required: "is required during check-in"
|
62
62
|
google_wallet:
|
63
63
|
note: "Click <b>Create</b> or <b> Update</b> to connect to Google Wallet after filled all information "
|
64
64
|
google_wallet_class_created: "Google Wallet class created successfully."
|
@@ -105,6 +105,12 @@ en:
|
|
105
105
|
out_of_stock: "%{variant_name} is out of stock"
|
106
106
|
product_kind_option_types:
|
107
107
|
empty_info: "<b>Note:</b> Set service option types to service first. To edit, go to <b>Details</b> tab > <b>Option Types</b>"
|
108
|
+
|
109
|
+
line_item:
|
110
|
+
validation:
|
111
|
+
exceeded_max_quantity_per_order: "Exceeded maximum quantity per order"
|
112
|
+
seats_are_required: "Seats are required for all guests"
|
113
|
+
|
108
114
|
vectors:
|
109
115
|
icons:
|
110
116
|
info_rules: 'Only allow <b>%{allow_extensions}</b> files. Icons are stored inside "images/" folder, eg. app/assets/images/backend-adjust.svg.'
|
@@ -152,8 +158,8 @@ en:
|
|
152
158
|
orders:
|
153
159
|
total: "Total: %{orders_count} invoices"
|
154
160
|
update_order_status:
|
155
|
-
success:
|
156
|
-
fail:
|
161
|
+
success: "Order Status update successfully"
|
162
|
+
fail: "Order Status fail to update "
|
157
163
|
|
158
164
|
account_deletion:
|
159
165
|
title:
|
@@ -193,7 +199,7 @@ en:
|
|
193
199
|
send_failed_or_method_not_support: "Send failed or method not support"
|
194
200
|
subscribe: "Use Service"
|
195
201
|
full_name: "name"
|
196
|
-
store_credits:
|
202
|
+
store_credits: "Credits"
|
197
203
|
address: "Address"
|
198
204
|
billing_address: "Billing Address"
|
199
205
|
shipping_address: "Shipping Address"
|
@@ -280,9 +286,9 @@ en:
|
|
280
286
|
match_any: "Some line items must from selected age group"
|
281
287
|
match_all: "All line items must from selected age group"
|
282
288
|
billing:
|
283
|
-
six_month_discount:
|
289
|
+
six_month_discount: "6 Months discount"
|
284
290
|
twelve_month_discount: "12 Months discount"
|
285
|
-
penalty_rate:
|
291
|
+
penalty_rate: "Penalty Rate in %"
|
286
292
|
penalty_label: "Penalty Label"
|
287
293
|
customer_id: "Customer ID"
|
288
294
|
subscription:
|
@@ -343,11 +349,11 @@ en:
|
|
343
349
|
fails: "Invoice for this month is already exist "
|
344
350
|
customers: "Customers"
|
345
351
|
apply_promotion:
|
346
|
-
|
347
|
-
|
352
|
+
success: "Promotion Created"
|
353
|
+
fails: "Promotion Creation Failed"
|
348
354
|
delete_promotion:
|
349
|
-
|
350
|
-
|
355
|
+
success: "Promotion deleted"
|
356
|
+
fails: "Promotion Deletion Failed"
|
351
357
|
service_start_date: "Service Start Date"
|
352
358
|
export: "Export"
|
353
359
|
select_year: "Select Year"
|
@@ -602,30 +608,29 @@ en:
|
|
602
608
|
|
603
609
|
variant_availability:
|
604
610
|
item_available_instock: Only 1 item available in stock.
|
605
|
-
items_available_instock:
|
606
|
-
items_out_of_stock:
|
611
|
+
items_available_instock: Only %{available_quantity} items available in stock.
|
612
|
+
items_out_of_stock: Item out of Stock.
|
607
613
|
|
608
614
|
account_link:
|
609
615
|
failure: "Failed to link your %{identity_type} account: %{reason}"
|
610
616
|
s3:
|
611
617
|
image:
|
612
618
|
upload:
|
613
|
-
fail:
|
614
|
-
not_found:
|
619
|
+
fail: "Failed to fetch the image"
|
620
|
+
not_found: "Image not found"
|
615
621
|
amenity:
|
616
622
|
update_success: Option Type updated successfully.
|
617
623
|
user_roles_assigner:
|
618
|
-
user_not_found:
|
619
|
-
roles_empty:
|
620
|
-
roles_required:
|
621
|
-
user_already_assigned:
|
624
|
+
user_not_found: "User not found"
|
625
|
+
roles_empty: "Roles are empty"
|
626
|
+
roles_required: "Roles are required"
|
627
|
+
user_already_assigned: "User already assigned to this vendor"
|
622
628
|
invite:
|
623
|
-
url_not_found:
|
624
|
-
accept_fail:
|
625
|
-
url_expired:
|
626
|
-
already_invited:
|
627
|
-
update_fail:
|
629
|
+
url_not_found: "Invite link not found or have been expired"
|
630
|
+
accept_fail: "Failed to accept invite"
|
631
|
+
url_expired: "Invitation link is expired"
|
632
|
+
already_invited: "Failed: User already invited to event"
|
633
|
+
update_fail: "Failed: to Update invite user"
|
628
634
|
event_blazer_queries:
|
629
|
-
success:
|
630
|
-
fail:
|
631
|
-
|
635
|
+
success: "Event saved Successfully"
|
636
|
+
fail: "Event already saved"
|
data/config/locales/km.yml
CHANGED
@@ -55,7 +55,7 @@ km:
|
|
55
55
|
empty_info: "មិនមានព័ត៌មានអំពីអ្នកលក់ទេ"
|
56
56
|
|
57
57
|
telegram_bot:
|
58
|
-
|
58
|
+
empty_info: "No <b>Telegram Bot</b> found"
|
59
59
|
|
60
60
|
guest_card_classes:
|
61
61
|
empty_info: "មិនមានព័ត៌មានអំពីកាតភ្ញៀវទេ"
|
@@ -97,6 +97,11 @@ km:
|
|
97
97
|
product_kind_option_types:
|
98
98
|
empty_info: "<b>ចំណាំ:</b> កំណត់ប្រភេទសម្រាប់ផលិតផល. ដើម្បីកែប្រែ, សូមចូលទៅ <b>លម្អិត</b> tab > <b>ប្រភេទ</b>"
|
99
99
|
|
100
|
+
line_item:
|
101
|
+
validation:
|
102
|
+
exceeded_max_quantity_per_order: "លើសពីបរិមាណអតិបរមាក្នុងមួយការបញ្ជាទិញ"
|
103
|
+
seats_are_required: "ត្រូវការលេខកៅអីសម្រាប់ភ្ញៀវទាំងអស់"
|
104
|
+
|
100
105
|
subscription:
|
101
106
|
validation:
|
102
107
|
out_of_range: "Subscription date is out of range."
|
@@ -174,7 +179,7 @@ km:
|
|
174
179
|
send_failed_or_method_not_support: "Send failed or method not support"
|
175
180
|
subscribe: "ប្រើសេវាកម្ម"
|
176
181
|
full_name: "ឈ្មោះពេញ"
|
177
|
-
store_credits:
|
182
|
+
store_credits: "Credits"
|
178
183
|
address: "អាសយដ្ឋាន"
|
179
184
|
billing_address: "អាសយដ្ឋានទូទាត់"
|
180
185
|
shipping_address: "អាសយដ្ឋានប្រើប្រាស់"
|
@@ -252,9 +257,9 @@ km:
|
|
252
257
|
match_any: "Some line items must from selected age group"
|
253
258
|
match_all: "All line items must from selected age group"
|
254
259
|
billing:
|
255
|
-
six_month_discount:
|
260
|
+
six_month_discount: "Six Month discount"
|
256
261
|
twelve_month_discount: "Twelve Month discount"
|
257
|
-
penalty_rate:
|
262
|
+
penalty_rate: "ការផាកពិន័យគិតជាភាគរយ"
|
258
263
|
code: "code"
|
259
264
|
name: "name"
|
260
265
|
logo: "logo"
|
@@ -400,29 +405,29 @@ km:
|
|
400
405
|
|
401
406
|
variant_availability:
|
402
407
|
item_available_instock: ទំនិញក្នុងស្តុកមានតែ 1 ប៉ុណ្ណោះ
|
403
|
-
items_available_instock:
|
404
|
-
items_out_of_stock:
|
408
|
+
items_available_instock: ទំនិញក្នុងស្តុកមានតែ %{available_quantity} ប៉ុណ្ណោះ
|
409
|
+
items_out_of_stock: ទំនិញអស់ពីស្តុក
|
405
410
|
|
406
411
|
account_link:
|
407
412
|
failure: "បរាជ័យក្នុងការភ្ជាប់គណនី %{identity_type}: %{reason}"
|
408
413
|
s3:
|
409
414
|
image:
|
410
415
|
upload:
|
411
|
-
fail:
|
412
|
-
not_found:
|
416
|
+
fail: "បានបរាជ័យក្នុងការទាញយករូបភាព"
|
417
|
+
not_found: "រកមិនឃើញរូបភាព"
|
413
418
|
user_roles_assigner:
|
414
|
-
user_not_found:
|
415
|
-
roles_empty:
|
416
|
-
roles_required:
|
417
|
-
user_already_assigned:
|
419
|
+
user_not_found: "រកមិនឃើញអ្នកប្រើប្រាស់"
|
420
|
+
roles_empty: "តួនាទីគឺទទេ"
|
421
|
+
roles_required: "តួនាទីត្រូវបានទាមទារ"
|
422
|
+
user_already_assigned: "អ្នកប្រើប្រាស់បានបង្កើតតួនាទីរួចហើយ"
|
418
423
|
|
419
424
|
invite:
|
420
|
-
url_not_found:
|
421
|
-
accept_fail:
|
422
|
-
url_expired:
|
423
|
-
already_invited:
|
424
|
-
update_fail:
|
425
|
+
url_not_found: "រកមិនឃើញតំណអញ្ជើញ ឬផុតកំណត់ហើយ"
|
426
|
+
accept_fail: "បរាជ័យក្នុងការទទួលយកការអញ្ជើញ"
|
427
|
+
url_expired: "តំណអញ្ជើញបានផុតកំណត់"
|
428
|
+
already_invited: "បរាជ័យ៖ អ្នកប្រើប្រាស់បានអញ្ជើញចូលរួមព្រឹត្តិការណ៍រួចហើយ"
|
429
|
+
update_fail: "បរាជ័យ៖ ធ្វើបច្ចុប្បន្នភាពអ្នកប្រើប្រាស់អញ្ជើញ"
|
425
430
|
|
426
431
|
event_blazer_queries:
|
427
|
-
success:
|
428
|
-
fail:
|
432
|
+
success: "បានរក្សាទុកព្រឹត្តិការណ៍ដោយជោគជ័យ"
|
433
|
+
fail: "បានរក្សាទុកព្រឹត្តិការណ៍រួចហើយs"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class AddSendTypeToSmsLog < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
add_column :cm_sms_logs, :send_type, :integer, default: 0, null: false, if_not_exists: true
|
4
|
+
add_index :cm_sms_logs, :from_number, if_not_exists: true
|
5
|
+
if column_exists?(:cm_sms_logs, :status)
|
6
|
+
change_column_null :cm_sms_logs, :status, false, 0
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cm_commissioner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5.pre.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- You
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree
|
@@ -2743,6 +2743,7 @@ files:
|
|
2743
2743
|
- db/migrate/20250911100835_add_variant_id_to_cm_blocks.rb
|
2744
2744
|
- db/migrate/20250911174607_add_metadata_columns_to_cm_vehicles.rb
|
2745
2745
|
- db/migrate/20250911174653_add_metadata_columns_to_cm_trips.rb
|
2746
|
+
- db/migrate/20250912084944_add_send_type_to_sms_log.rb
|
2746
2747
|
- docker-compose.yml
|
2747
2748
|
- docs/option_types/attr_types.md
|
2748
2749
|
- docs/private_key.pem
|