comee_core 0.2.6 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96fca3f74e6642e5c3724443f279cdeb58217aa89d6aef57f9a67f6fde3757c4
4
- data.tar.gz: dc819ee771048da328d51512915be23ea2b433432fdaee9fe988109fe2698a14
3
+ metadata.gz: 71f18440aaa5414fe5fb11cf03c38c81b4a58f3c8130d59bd4927ca035479ee9
4
+ data.tar.gz: 3e9392b406f61a347f057aec16a52b81ba53894170fb8c4c8c0dfa24854fa9fd
5
5
  SHA512:
6
- metadata.gz: 38f4ec48d09c65eba8b4e4a7bdb6cede0279ceeac08a97358125860c5cf49ed2564cb03366aaccb8b8c4f47e8df900f2ffeb819e4112e5b1721a2104cffbe143
7
- data.tar.gz: a75a0a0b023ce9971086f81ca4b6f030a008d018abe048bb67cd0efdd25a88f6c2f9d2a0609cc061f9063cb4e994ddcddd1a996ed5d6de5b26fa9b1be9a322c7
6
+ metadata.gz: 53234c4b8a684a64f1cb9e9fd7f45fb0a904854dee645fca3a44ed1ab0b07b82b97fd959464cec8e36736c0a2c4e8f1b921f22d353f2d331365d74dcb50514ea
7
+ data.tar.gz: f664676dd16c43c037aca6340158b7913a51afd9075bd6e63c6fc79b570cb419715aba0c66b59f2f5e05b7bb7f27f2b05db555577e805a3f48ae3594e813db12
@@ -1,6 +1,7 @@
1
1
  module Comee
2
2
  module Core
3
3
  class AdditionalItem < ApplicationRecord
4
+ before_save { self.total_price = unit_price * quantity }
4
5
  belongs_to :invoice
5
6
 
6
7
  validates :quantity, :unit_price, presence: true, numericality: {greater_than: 0}
@@ -0,0 +1,10 @@
1
+ module Comee
2
+ module Core
3
+ class DeliveryNote < ApplicationRecord
4
+ belongs_to :pod
5
+ has_many :shipment_instruction_items
6
+
7
+ validates :reference_no, presence: true
8
+ end
9
+ end
10
+ end
@@ -5,6 +5,7 @@ module Comee
5
5
  belongs_to :shipment_item
6
6
  belongs_to :unit
7
7
  belongs_to :pod, optional: true
8
+ belongs_to :delivery_note, optional: true
8
9
 
9
10
  validates :delivery_note_no, :pallet_no, :goods_issue_date, presence: true
10
11
  validates :length, :width, :height, :weight, :quantity, :price, presence: true, numericality: {greater_than: 0}
@@ -0,0 +1,13 @@
1
+ class CreateComeeCoreDeliveryNotes < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :comee_core_delivery_notes do |t|
4
+ t.references :pod,
5
+ null: false,
6
+ index: {name: "pod_on_ccdn_indx"},
7
+ foreign_key: {to_table: :comee_core_pods}
8
+ t.string :reference_no, null: false
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -26,6 +26,10 @@ class CreateComeeCoreShipmentInstructionItems < ActiveRecord::Migration[7.1]
26
26
  null: true,
27
27
  index: {name: "pod_on_ccsii_indx"},
28
28
  foreign_key: {to_table: :comee_core_pods}
29
+ t.references :delivery_note,
30
+ null: true,
31
+ index: {name: "dn_on_ccsii_indx"},
32
+ foreign_key: {to_table: :comee_core_delivery_notes}
29
33
 
30
34
  t.timestamps
31
35
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.6".freeze
3
+ VERSION = "0.2.8".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,6 @@
1
+ FactoryBot.define do
2
+ factory :delivery_note, class: "Comee::Core::DeliveryNote" do
3
+ pod
4
+ reference_no { Faker::Alphanumeric.alpha(number: 10) }
5
+ end
6
+ end
@@ -3,6 +3,7 @@ FactoryBot.define do
3
3
  shipment_instruction
4
4
  shipment_item
5
5
  pod { nil }
6
+ delivery_note { nil }
6
7
  delivery_note_no { Faker::Alphanumeric.alpha(number: 10) }
7
8
  pallet_no { Faker::Alphanumeric.alpha(number: 10) }
8
9
  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.2.6
4
+ version: 0.2.8
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-25 00:00:00.000000000 Z
11
+ date: 2024-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -313,6 +313,7 @@ files:
313
313
  - app/models/comee/core/customer_order.rb
314
314
  - app/models/comee/core/customer_order_item.rb
315
315
  - app/models/comee/core/customs_detail.rb
316
+ - app/models/comee/core/delivery_note.rb
316
317
  - app/models/comee/core/edi_order.rb
317
318
  - app/models/comee/core/external_rfq.rb
318
319
  - app/models/comee/core/fulfillment_center.rb
@@ -423,8 +424,9 @@ files:
423
424
  - db/migrate/20231207153420_create_comee_core_shipment_items.rb
424
425
  - db/migrate/20231207235542_create_comee_core_item_statuses.rb
425
426
  - db/migrate/20240104074619_create_comee_core_pods.rb
427
+ - db/migrate/20240104124247_create_comee_core_delivery_notes.rb
426
428
  - db/migrate/20240104131607_create_comee_core_shipment_instructions.rb
427
- - db/migrate/20240104143246_create_comee_core_shipment_instruction_items.rb
429
+ - db/migrate/20240104133246_create_comee_core_shipment_instruction_items.rb
428
430
  - db/migrate/20240105205522_create_comee_core_invoices.rb
429
431
  - db/migrate/20240105205648_create_comee_core_invoice_items.rb
430
432
  - db/migrate/20240109185749_create_comee_core_transport_availability.rb
@@ -451,6 +453,7 @@ files:
451
453
  - spec/factories/comee/core/customer_order_items.rb
452
454
  - spec/factories/comee/core/customer_orders.rb
453
455
  - spec/factories/comee/core/customs_details.rb
456
+ - spec/factories/comee/core/delivery_notes.rb
454
457
  - spec/factories/comee/core/edi_orders.rb
455
458
  - spec/factories/comee/core/external_rfqs.rb
456
459
  - spec/factories/comee/core/fulfillment_centers.rb