comee_core 0.1.74 → 0.1.76

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: f2186d3622f2ec54668695b7e4f9b72a2fa2e8803457719e47ec808a681fb9a0
4
- data.tar.gz: 4f6d0e55625b309271ae845972da99774e0eeca64ada41f53b98e733822b99a8
3
+ metadata.gz: 864537115c595bfaceea9814dc384e7222a3abeb31fa45259fc599825b1b1b01
4
+ data.tar.gz: 7c303f30a308cf6f60d385c433f317f46b2a84705aab0a45d78e56a8077aa423
5
5
  SHA512:
6
- metadata.gz: 2e5883953674469a3aca2e14e2e00a5837198198999d32619ac9a866aa2f29b49aefc6ea1d7ef0374294e7156dacc59a9395781925157abfc2fd0a5c3e532673
7
- data.tar.gz: 6b15d9c4eeaa6e509a03cd2aeba69f369344a6067302bd8ad46c250d3c2c8e097c1a350309fb7bd058234d481c269198affbc8ace31769074e13da8e5cc33782
6
+ metadata.gz: e34e1bab5800f33773575c65a42ad62d199f9beb0ff9e775f73f625289556c3626cf49da9f803d4c00d85cf3c1738212ff7693838afdf3e8d72475a3f9a83c77
7
+ data.tar.gz: 427c919bc1cab30097969d5260e4d18a5693bffce33e57c76d911d1ec4a7bdad88f793a327e16f6a34828e9dd5575e57ab35d9a35dc7a71ec4b6ad2745c117cb
@@ -0,0 +1,13 @@
1
+ module Comee
2
+ module Core
3
+ class ShipmentInstruction < ApplicationRecord
4
+ enum :status, {draft: 0, confirmed: 1}
5
+
6
+ belongs_to :client
7
+ has_many :shipment_instruction_items
8
+
9
+ validates :reference_no, presence: true, uniqueness: true
10
+ validates :status, presence: true
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ module Comee
2
+ module Core
3
+ class ShipmentInstructionItem < ApplicationRecord
4
+ belongs_to :shipment_instruction
5
+ belongs_to :shipment_item
6
+ belongs_to :unit
7
+
8
+ validates :delivery_note_no, :pallet_no, :goods_issue_date, presence: true
9
+ validates :length, :width, :height, :weight, :quantity, :price, presence: true, numericality: {greater_than: 0}
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ class CreateComeeCoreShipmentInstructions < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :comee_core_shipment_instructions do |t|
4
+ t.string :reference_no, null: false
5
+ t.references :client,
6
+ null: false,
7
+ index: {name: "client_on_ccsi_indx"},
8
+ foreign_key: {to_table: :comee_core_clients}
9
+ t.integer :status, null: false, default: 0
10
+ t.string :remark
11
+
12
+ t.timestamps
13
+ end
14
+ add_index :comee_core_shipment_instructions, :reference_no, unique: true
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ class CreateComeeCoreShipmentInstructionItems < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :comee_core_shipment_instruction_items do |t|
4
+ t.references :shipment_instruction,
5
+ null: false,
6
+ index: {name: "si_on_ccsii_indx"},
7
+ foreign_key: {to_table: :comee_core_shipment_instructions}
8
+ t.references :shipment_item,
9
+ null: false,
10
+ index: {name: "shi_on_ccsii_indx"},
11
+ foreign_key: {to_table: :comee_core_shipment_items}
12
+ t.string :delivery_note_no, null: false
13
+ t.string :pallet_no, null: false
14
+ t.date :goods_issue_date, null: false
15
+ t.float :length, null: false
16
+ t.float :width, null: false
17
+ t.float :height, null: false
18
+ t.float :weight, null: false
19
+ t.float :quantity, null: false
20
+ t.references :unit,
21
+ null: false,
22
+ index: {name: "unit_on_ccsii_indx"},
23
+ foreign_key: {to_table: :comee_core_units}
24
+ t.float :price, null: false
25
+
26
+ t.timestamps
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.74".freeze
3
+ VERSION = "0.1.76".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,16 @@
1
+ FactoryBot.define do
2
+ factory :shipment_instruction_item, class: "Comee::Core::ShipmentInstructionItem" do
3
+ shipment_instruction
4
+ shipment_item
5
+ delivery_note_no { Faker::Alphanumeric.alpha(number: 10) }
6
+ pallet_no { Faker::Alphanumeric.alpha(number: 10) }
7
+ goods_issue_date { Date.current.advance(days: 3) }
8
+ length { 5.0 }
9
+ width { 3.0 }
10
+ height { 1.5 }
11
+ weight { 10.0 }
12
+ quantity { 5.0 }
13
+ unit
14
+ price { 100 }
15
+ end
16
+ end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :shipment_instruction, class: "Comee::Core::ShipmentInstruction" do
3
+ reference_no { Faker::Alphanumeric.alpha(number: 10) }
4
+ client
5
+ status { 0 }
6
+ remark { Faker::Lorem.sentence }
7
+ end
8
+ end
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.74
4
+ version: 0.1.76
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-03 00:00:00.000000000 Z
11
+ date: 2024-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -339,6 +339,8 @@ files:
339
339
  - app/models/comee/core/quotation_request_item.rb
340
340
  - app/models/comee/core/sales_order.rb
341
341
  - app/models/comee/core/sales_order_item.rb
342
+ - app/models/comee/core/shipment_instruction.rb
343
+ - app/models/comee/core/shipment_instruction_item.rb
342
344
  - app/models/comee/core/shipment_item.rb
343
345
  - app/models/comee/core/supplier.rb
344
346
  - app/models/comee/core/unit.rb
@@ -421,6 +423,8 @@ files:
421
423
  - db/migrate/20231206082503_create_comee_core_unit_conversions.rb
422
424
  - db/migrate/20231207153420_create_comee_core_shipment_items.rb
423
425
  - db/migrate/20231207235542_create_comee_core_item_statuses.rb
426
+ - db/migrate/20240104131607_create_comee_core_shipment_instructions.rb
427
+ - db/migrate/20240104143246_create_comee_core_shipment_instruction_items.rb
424
428
  - lib/comee/core.rb
425
429
  - lib/comee/core/engine.rb
426
430
  - lib/comee/core/version.rb
@@ -454,6 +458,8 @@ files:
454
458
  - spec/factories/comee/core/quotation_requests.rb
455
459
  - spec/factories/comee/core/sales_order_items.rb
456
460
  - spec/factories/comee/core/sales_orders.rb
461
+ - spec/factories/comee/core/shipment_instruction_items.rb
462
+ - spec/factories/comee/core/shipment_instructions.rb
457
463
  - spec/factories/comee/core/shipment_items.rb
458
464
  - spec/factories/comee/core/suppliers.rb
459
465
  - spec/factories/comee/core/unit_conversions.rb