comee_core 0.1.86 → 0.1.88
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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/{proof_of_delivery.rb → pod.rb} +1 -1
- data/app/models/comee/core/shipment_instruction_item.rb +1 -0
- data/app/models/comee/core/transport_availability.rb +9 -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 -5
- data/db/migrate/20240110074619_create_comee_core_proof_of_deliveries.rb +0 -13
- data/spec/factories/comee/core/proof_of_deliveries.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01c398f40ebb3c1eacff4a3566d4707168d4e121b95442e0f59361c2e5a6520a
|
4
|
+
data.tar.gz: 3059c69cb31e958457aadaf294cf2f9925862d08890633e0d9451240c221614d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fab7383b8a87484ea330c21efe291089625d6c1cf4271200bfff9451e0ab29d8d041332f31575ac2bfa92bb387df97bbf4e6f1512203f8c4ac3f4afb36b89f85
|
7
|
+
data.tar.gz: 613a9df5c11b6f9ad4fae560d8e87fbe9bbc01ff2397741cd79c061235fc060d9571c46a8b78df3b0d613c79d77dfb0ff7b1ab0bac3494086ffb87c9353519c1
|
@@ -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}
|
@@ -1,8 +1,16 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class TransportAvailability < ApplicationRecord
|
4
|
+
before_save :compute_weekday
|
5
|
+
|
6
|
+
has_many :time_slots
|
7
|
+
|
4
8
|
validates :availability_date, presence: true, uniqueness: true
|
5
|
-
|
9
|
+
|
10
|
+
def compute_weekday
|
11
|
+
self.weekday = availability_date.strftime("%A")
|
12
|
+
self.weekday_short = availability_date.strftime("%a")
|
13
|
+
end
|
6
14
|
end
|
7
15
|
end
|
8
16
|
end
|
@@ -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.88
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -331,10 +331,11 @@ 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
|
337
|
-
- app/models/comee/core/proof_of_delivery.rb
|
338
339
|
- app/models/comee/core/purchase_order.rb
|
339
340
|
- app/models/comee/core/purchase_order_item.rb
|
340
341
|
- app/models/comee/core/quotation_request.rb
|
@@ -428,11 +429,12 @@ files:
|
|
428
429
|
- db/migrate/20231206082503_create_comee_core_unit_conversions.rb
|
429
430
|
- db/migrate/20231207153420_create_comee_core_shipment_items.rb
|
430
431
|
- db/migrate/20231207235542_create_comee_core_item_statuses.rb
|
432
|
+
- db/migrate/20240103074619_create_comee_core_pods.rb
|
431
433
|
- db/migrate/20240104131607_create_comee_core_shipment_instructions.rb
|
432
434
|
- db/migrate/20240104143246_create_comee_core_shipment_instruction_items.rb
|
433
435
|
- db/migrate/20240109185749_create_comee_core_transport_availability.rb
|
434
436
|
- db/migrate/20240109185931_create_comee_core_time_slots.rb
|
435
|
-
- db/migrate/
|
437
|
+
- db/migrate/20240111112140_create_comee_core_pickup_schedules.rb
|
436
438
|
- lib/comee/core.rb
|
437
439
|
- lib/comee/core/engine.rb
|
438
440
|
- lib/comee/core/version.rb
|
@@ -458,9 +460,10 @@ files:
|
|
458
460
|
- spec/factories/comee/core/master_prices.rb
|
459
461
|
- spec/factories/comee/core/notifications.rb
|
460
462
|
- spec/factories/comee/core/order_sources.rb
|
463
|
+
- spec/factories/comee/core/pickup_schedules.rb
|
464
|
+
- spec/factories/comee/core/pods.rb
|
461
465
|
- spec/factories/comee/core/product_lookups.rb
|
462
466
|
- spec/factories/comee/core/products.rb
|
463
|
-
- spec/factories/comee/core/proof_of_deliveries.rb
|
464
467
|
- spec/factories/comee/core/purchase_order_items.rb
|
465
468
|
- spec/factories/comee/core/purchase_orders.rb
|
466
469
|
- spec/factories/comee/core/quotation_request_items.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class CreateComeeCoreProofOfDeliveries < ActiveRecord::Migration[7.1]
|
2
|
-
def change
|
3
|
-
create_table :comee_core_proof_of_deliveries do |t|
|
4
|
-
t.string :reference_no, null: false
|
5
|
-
t.string :status, null: false, default: 0
|
6
|
-
t.string :driver
|
7
|
-
t.string :truck
|
8
|
-
t.string :plate_no
|
9
|
-
|
10
|
-
t.timestamps
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :proof_of_delivery, class: "Comee::Core::ProofOfDelivery" do
|
3
|
-
reference_no { Faker::Alphanumeric.alpha(number: 10) }
|
4
|
-
status { Comee::Core::ProofOfDelivery.statuses[:draft] }
|
5
|
-
driver { Faker::Name.name }
|
6
|
-
truck { Faker::Alphanumeric.alpha(number: 6) }
|
7
|
-
plate_no { Faker::Alphanumeric.alpha(number: 8) }
|
8
|
-
end
|
9
|
-
end
|