comee_core 0.1.85 → 0.1.87
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/comee/core/products_controller.rb +2 -1
- data/app/controllers/comee/core/sales_orders_controller.rb +1 -1
- data/app/controllers/concerns/comee/core/common.rb +1 -5
- data/app/models/comee/core/pickup_schedule.rb +11 -0
- data/app/models/comee/core/pod.rb +9 -0
- data/app/models/comee/core/shipment_instruction_item.rb +1 -0
- data/app/services/comee/core/customer_order_service.rb +6 -1
- data/db/migrate/20240103074619_create_comee_core_pods.rb +10 -0
- data/db/migrate/20240104143246_create_comee_core_shipment_instruction_items.rb +4 -0
- data/db/migrate/20240111112140_create_comee_core_pickup_schedules.rb +20 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/pickup_schedules.rb +10 -0
- data/spec/factories/comee/core/pods.rb +6 -0
- data/spec/factories/comee/core/shipment_instruction_items.rb +1 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcd01686f33365c1ac6f9b6a0263da7df0d5952a4b7aa6a65f330d57fed4d6c3
|
4
|
+
data.tar.gz: eb7d575093c1faf0a60d3a16eff3d00049d23c689ac5701c0a019599b5397fbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5deb9e48f2e06484c6a695d4395cb0b0053925657d92854f9194aafb63ca5c7504871689a6c22a7bf71841eb04901d897a0ab7da0b235ccf4ef655d56f934117
|
7
|
+
data.tar.gz: 0bce465e2462ad3c330a7ca0c80f2bd17166d58373abd6d9552dda3df5101885f787696fa03c9228748403b3220582e7ef0b0f11180e6bd87ddef70309820af4
|
@@ -18,7 +18,8 @@ module Comee
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def master_prices
|
21
|
-
data = MasterPrice.
|
21
|
+
data = MasterPrice.includes(:product_lookup, :supplier, :product)
|
22
|
+
.where(product_id: price_params[:product_ids])
|
22
23
|
render json: {success: true, data: serialize(data)}
|
23
24
|
end
|
24
25
|
|
@@ -8,7 +8,7 @@ module Comee
|
|
8
8
|
super do
|
9
9
|
[
|
10
10
|
Comee::Core::SalesOrder.includes(:customer_order, :fulfillment_center, :sales_order_items).all,
|
11
|
-
include: ["sales_order_items", "sales_order_items.product", "sales_order_items.unit"]
|
11
|
+
include: ["customer_order", "sales_order_items", "sales_order_items.product", "sales_order_items.unit"]
|
12
12
|
]
|
13
13
|
end
|
14
14
|
end
|
@@ -21,11 +21,7 @@ module Comee
|
|
21
21
|
else
|
22
22
|
data = @clazz.all
|
23
23
|
end
|
24
|
-
|
25
|
-
# yield
|
26
|
-
# else
|
27
|
-
# [@clazz.all, {}]
|
28
|
-
# end
|
24
|
+
|
29
25
|
page = params[:page]
|
30
26
|
if page
|
31
27
|
render json: {success: true, data: serialize(data, options), page: page, total: @clazz.count}
|
@@ -4,6 +4,7 @@ module Comee
|
|
4
4
|
belongs_to :shipment_instruction
|
5
5
|
belongs_to :shipment_item
|
6
6
|
belongs_to :unit
|
7
|
+
belongs_to :pod, optional: true
|
7
8
|
|
8
9
|
validates :delivery_note_no, :pallet_no, :goods_issue_date, presence: true
|
9
10
|
validates :length, :width, :height, :weight, :quantity, :price, presence: true, numericality: {greater_than: 0}
|
@@ -138,7 +138,12 @@ module Comee
|
|
138
138
|
status: SalesOrder.statuses[:draft]
|
139
139
|
)
|
140
140
|
order_items = order.customer_order_items.includes(:product, :unit)
|
141
|
-
|
141
|
+
client_id = order.client.parent_id || order.client_id
|
142
|
+
client_prices = ClientPrice.where(
|
143
|
+
client_id: client_id,
|
144
|
+
product_id: order_items.map(&:product_id),
|
145
|
+
status: ClientPrice.statuses[:current]
|
146
|
+
)
|
142
147
|
master_prices = MasterPrice.where(primary: true, status: Price.statuses[:current], product: order_items.map(&:product))
|
143
148
|
items = order_items.each_with_object([]) do |item, res|
|
144
149
|
next if item.canceled?
|
@@ -22,6 +22,10 @@ class CreateComeeCoreShipmentInstructionItems < ActiveRecord::Migration[7.1]
|
|
22
22
|
index: {name: "unit_on_ccsii_indx"},
|
23
23
|
foreign_key: {to_table: :comee_core_units}
|
24
24
|
t.float :price, null: false
|
25
|
+
t.references :pod,
|
26
|
+
null: true,
|
27
|
+
index: {name: "pod_on_ccsii_indx"},
|
28
|
+
foreign_key: {to_table: :comee_core_pods}
|
25
29
|
|
26
30
|
t.timestamps
|
27
31
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateComeeCorePickupSchedules < ActiveRecord::Migration[7.1]
|
2
|
+
def change
|
3
|
+
create_table :comee_core_pickup_schedules do |t|
|
4
|
+
t.references :pod,
|
5
|
+
null: false,
|
6
|
+
index: {name: "pod_on_ccps_indx"},
|
7
|
+
foreign_key: {to_table: :comee_core_pods}
|
8
|
+
t.references :time_slot,
|
9
|
+
null: false,
|
10
|
+
index: {name: "ts_on_ccps_indx"},
|
11
|
+
foreign_key: {to_table: :comee_core_time_slots}
|
12
|
+
t.integer :status, null: false, default: 0
|
13
|
+
t.string :truck_no
|
14
|
+
t.string :driver_license_no
|
15
|
+
t.string :plate_no
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/comee/core/version.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :pickup_schedule, class: "Comee::Core::PickupSchedule" do
|
3
|
+
pod
|
4
|
+
time_slot
|
5
|
+
status { Comee::Core::PickupSchedule.statuses[:draft] }
|
6
|
+
truck_no { Faker::Alphanumeric.alpha(number: 10) }
|
7
|
+
driver_license_no { Faker::Alphanumeric.alpha(number: 10) }
|
8
|
+
plate_no { Faker::Alphanumeric.alpha(number: 10) }
|
9
|
+
end
|
10
|
+
end
|
@@ -2,6 +2,7 @@ FactoryBot.define do
|
|
2
2
|
factory :shipment_instruction_item, class: "Comee::Core::ShipmentInstructionItem" do
|
3
3
|
shipment_instruction
|
4
4
|
shipment_item
|
5
|
+
pod { nil }
|
5
6
|
delivery_note_no { Faker::Alphanumeric.alpha(number: 10) }
|
6
7
|
pallet_no { Faker::Alphanumeric.alpha(number: 10) }
|
7
8
|
goods_issue_date { Date.current.advance(days: 3) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comee_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.87
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -331,6 +331,8 @@ files:
|
|
331
331
|
- app/models/comee/core/master_price.rb
|
332
332
|
- app/models/comee/core/notification.rb
|
333
333
|
- app/models/comee/core/order_source.rb
|
334
|
+
- app/models/comee/core/pickup_schedule.rb
|
335
|
+
- app/models/comee/core/pod.rb
|
334
336
|
- app/models/comee/core/price.rb
|
335
337
|
- app/models/comee/core/product.rb
|
336
338
|
- app/models/comee/core/product_lookup.rb
|
@@ -427,10 +429,12 @@ files:
|
|
427
429
|
- db/migrate/20231206082503_create_comee_core_unit_conversions.rb
|
428
430
|
- db/migrate/20231207153420_create_comee_core_shipment_items.rb
|
429
431
|
- db/migrate/20231207235542_create_comee_core_item_statuses.rb
|
432
|
+
- db/migrate/20240103074619_create_comee_core_pods.rb
|
430
433
|
- db/migrate/20240104131607_create_comee_core_shipment_instructions.rb
|
431
434
|
- db/migrate/20240104143246_create_comee_core_shipment_instruction_items.rb
|
432
435
|
- db/migrate/20240109185749_create_comee_core_transport_availability.rb
|
433
436
|
- db/migrate/20240109185931_create_comee_core_time_slots.rb
|
437
|
+
- db/migrate/20240111112140_create_comee_core_pickup_schedules.rb
|
434
438
|
- lib/comee/core.rb
|
435
439
|
- lib/comee/core/engine.rb
|
436
440
|
- lib/comee/core/version.rb
|
@@ -456,6 +460,8 @@ files:
|
|
456
460
|
- spec/factories/comee/core/master_prices.rb
|
457
461
|
- spec/factories/comee/core/notifications.rb
|
458
462
|
- spec/factories/comee/core/order_sources.rb
|
463
|
+
- spec/factories/comee/core/pickup_schedules.rb
|
464
|
+
- spec/factories/comee/core/pods.rb
|
459
465
|
- spec/factories/comee/core/product_lookups.rb
|
460
466
|
- spec/factories/comee/core/products.rb
|
461
467
|
- spec/factories/comee/core/purchase_order_items.rb
|