comee_core 0.1.46 → 0.1.48

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: b627b9c57084edd4b480f661502a765f0988cfca86b25c42691b19d650d5dc5b
4
- data.tar.gz: 9f3f4164affa01dc56b3d2f13b8ec9ac2efca5e0a99d58d935bc33360baacfa5
3
+ metadata.gz: e4dbbe8c8a9b605e180c997b14476dc4bd72f45d461d0c8c3e7d3c7b023aa1ed
4
+ data.tar.gz: c0a69b00c5c198db04590dcf825d700750147f6179de44c3e3d0986ff0523f01
5
5
  SHA512:
6
- metadata.gz: 43c210add4f2c3d2f87535b251ba52e22d0b477439dde17116b95e2c5f12133e800c09cd628967497b5d42a20970ffc753ebb0826ff6361838d15406df601e82
7
- data.tar.gz: d1a70bed42a7c03cf4473cda58ad8776566c696713ded246742e044ce8b2aeb27f76b37d7a23e509628bcb9b4d0e522bcc5828d18ad4ad1e22c32148fe40af13
6
+ metadata.gz: 37bece99a80c1ebb5af969095e22f6db6ecc9f3a5cb60a41eb05d400420d5ff50466a1dabdd7672440867e356819ee0124ba0f53c75d5fffa999de858f70f743
7
+ data.tar.gz: 63a792ebf8e7a58dc0d83c84cb200e9a98c058ecea0aaae545469d917ee7ae53eb5b9ae4b5e6ec8036e84ef78acd897135f18607fc7836cec233321e9d51bcb3
@@ -0,0 +1,13 @@
1
+ module Comee
2
+ module Core
3
+ class ItemStatusesController < ApplicationController
4
+ include Common
5
+
6
+ private
7
+
8
+ def model_params
9
+ params.require(:payload).permit(:hash_code, :status, :status_date, :remark, :sales_order_item_id, :details)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -24,7 +24,7 @@ module Comee
24
24
 
25
25
  def model_params
26
26
  params.require(:payload).permit(:sales_order_id, :customer_order_item_id, :product_id, :unit_id, :quantity, :quantity_delivered,
27
- :price, :delivery_date, :eb_number)
27
+ :customer_item_no, :price, :delivery_date, :eb_number, :comment, :action_note, :po_reference)
28
28
  end
29
29
  end
30
30
  end
@@ -0,0 +1,9 @@
1
+ module Comee
2
+ module Core
3
+ class ItemStatus < ApplicationRecord
4
+ belongs_to :sales_order_item
5
+
6
+ validates :hash_code, :status, :status_date, presence: true
7
+ end
8
+ end
9
+ end
@@ -7,7 +7,7 @@ module Comee
7
7
  belongs_to :unit
8
8
  has_many :warehouse_shipment_items
9
9
 
10
- validates :delivery_date, presence: true
10
+ validates :customer_item_no, :delivery_date, presence: true
11
11
  validates :quantity, :price, presence: true, numericality: {greater_than: 0}
12
12
  validates :quantity_delivered, numericality: {greater_than_or_equal_to: 0}
13
13
  end
@@ -0,0 +1,7 @@
1
+ module Comee
2
+ module Core
3
+ class ItemStatusSerializer < ActiveModel::Serializer
4
+ attributes :id, :status, :status_date, :details, :remark, :sales_order_item_id
5
+ end
6
+ end
7
+ end
@@ -1,7 +1,8 @@
1
1
  module Comee
2
2
  module Core
3
3
  class SalesOrderItemSerializer < ActiveModel::Serializer
4
- attributes :id, :quantity, :quantity_delivered, :price, :delivery_date, :eb_number
4
+ attributes :id, :customer_item_no, :quantity, :quantity_delivered, :price, :delivery_date, :eb_number, :comment,
5
+ :action_note, :po_reference
5
6
  belongs_to :sales_order
6
7
  belongs_to :customer_order_item
7
8
  belongs_to :unit
@@ -144,6 +144,7 @@ module Comee
144
144
  customer_order_item_id: item.id,
145
145
  product_id: item.product_id,
146
146
  unit_id: unit_id,
147
+ customer_item_no: item.product.code,
147
148
  quantity: quantity,
148
149
  price: price,
149
150
  delivery_date: item.delivery_date
data/config/routes.rb CHANGED
@@ -85,4 +85,5 @@ Comee::Core::Engine.routes.draw do
85
85
  end
86
86
  end
87
87
  resources :customs_details
88
+ resources :item_statuses
88
89
  end
@@ -17,6 +17,7 @@ class CreateComeeCoreSalesOrderItems < ActiveRecord::Migration[7.0]
17
17
  null: false,
18
18
  index: {name: "coi_on_ccsoi_indx"},
19
19
  foreign_key: {to_table: :comee_core_customer_order_items}
20
+ t.string :customer_item_no, null: false
20
21
  t.float :quantity, null: false
21
22
  t.float :quantity_delivered, null: false, default: 0
22
23
  t.float :price, null: false
@@ -24,6 +25,9 @@ class CreateComeeCoreSalesOrderItems < ActiveRecord::Migration[7.0]
24
25
  t.boolean :canceled, default: false
25
26
  t.date :handover_date
26
27
  t.string :eb_number
28
+ t.string :comment
29
+ t.string :action_note
30
+ t.string :po_reference
27
31
 
28
32
  t.timestamps
29
33
  end
@@ -0,0 +1,17 @@
1
+ class CreateComeeCoreItemStatuses < ActiveRecord::Migration[7.1]
2
+ def change
3
+ create_table :comee_core_item_statuses do |t|
4
+ t.bigint :hash_code, null: false
5
+ t.references :sales_order_item,
6
+ null: false,
7
+ index: {name: "so_on_ccis_indx"},
8
+ foreign_key: {to_table: :comee_core_sales_order_items}
9
+ t.string :status, null: false
10
+ t.date :status_date, null: false
11
+ t.jsonb :details
12
+ t.string :remark
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.46".freeze
3
+ VERSION = "0.1.48".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,10 @@
1
+ FactoryBot.define do
2
+ factory :item_status, class: "Comee::Core::ItemStatus" do
3
+ hash_code { "abcdefg".hash }
4
+ sales_order_item
5
+ status { Faker::Lorem.word }
6
+ status_date { Date.current }
7
+ details { {} }
8
+ remark { Faker::Lorem.sentence }
9
+ end
10
+ end
@@ -4,11 +4,15 @@ FactoryBot.define do
4
4
  association :customer_order_item, :with_inventory
5
5
  product
6
6
  unit
7
+ customer_item_no { Faker::Alphanumeric.alpha(number: 10) }
7
8
  quantity { 100 }
8
9
  quantity_delivered { 0 }
9
10
  price { 50 }
10
11
  delivery_date { Date.current.advance(months: 1) }
11
12
  handover_date { Date.current }
12
13
  eb_number { Faker::Lorem.word }
14
+ comment { Faker::Lorem.sentence }
15
+ action_note { Faker::Lorem.sentence }
16
+ po_reference { Faker::Alphanumeric.alpha(number: 10) }
13
17
  end
14
18
  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.46
4
+ version: 0.1.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-07 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -288,6 +288,7 @@ files:
288
288
  - app/controllers/comee/core/customer_orders_controller.rb
289
289
  - app/controllers/comee/core/customs_details_controller.rb
290
290
  - app/controllers/comee/core/external_rfqs_controller.rb
291
+ - app/controllers/comee/core/item_statuses_controller.rb
291
292
  - app/controllers/comee/core/lookups_controller.rb
292
293
  - app/controllers/comee/core/notifications_controller.rb
293
294
  - app/controllers/comee/core/products_controller.rb
@@ -322,6 +323,7 @@ files:
322
323
  - app/models/comee/core/inventory.rb
323
324
  - app/models/comee/core/invoice.rb
324
325
  - app/models/comee/core/invoice_item.rb
326
+ - app/models/comee/core/item_status.rb
325
327
  - app/models/comee/core/lookup.rb
326
328
  - app/models/comee/core/master_price.rb
327
329
  - app/models/comee/core/notification.rb
@@ -349,6 +351,7 @@ files:
349
351
  - app/serializers/comee/core/customer_order_serializer.rb
350
352
  - app/serializers/comee/core/customs_detail_serializer.rb
351
353
  - app/serializers/comee/core/external_rfq_serializer.rb
354
+ - app/serializers/comee/core/item_status_serializer.rb
352
355
  - app/serializers/comee/core/lookup_serializer.rb
353
356
  - app/serializers/comee/core/product_serializer.rb
354
357
  - app/serializers/comee/core/product_type_serializer.rb
@@ -408,6 +411,7 @@ files:
408
411
  - db/migrate/20231125122723_create_comee_core_purchase_orders.rb
409
412
  - db/migrate/20231126082907_create_comee_core_purchase_order_items.rb
410
413
  - db/migrate/20231206082503_create_comee_core_unit_conversions.rb
414
+ - db/migrate/20231207235542_create_comee_core_item_statuses.rb
411
415
  - lib/comee/core.rb
412
416
  - lib/comee/core/engine.rb
413
417
  - lib/comee/core/version.rb
@@ -428,6 +432,7 @@ files:
428
432
  - spec/factories/comee/core/inventories.rb
429
433
  - spec/factories/comee/core/invoice_items.rb
430
434
  - spec/factories/comee/core/invoices.rb
435
+ - spec/factories/comee/core/item_statuses.rb
431
436
  - spec/factories/comee/core/lookups.rb
432
437
  - spec/factories/comee/core/master_prices.rb
433
438
  - spec/factories/comee/core/notifications.rb