comee_core 0.1.65 → 0.1.67
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/client_prices_controller.rb +1 -1
- data/app/controllers/comee/core/clients_controller.rb +1 -1
- data/app/controllers/comee/core/item_statuses_controller.rb +1 -1
- data/app/controllers/comee/core/product_lookups_controller.rb +24 -0
- data/app/controllers/comee/core/quotation_request_items_controller.rb +2 -1
- data/app/controllers/comee/core/sales_order_items_controller.rb +26 -26
- data/app/controllers/comee/core/shipment_items_controller.rb +40 -0
- data/app/models/comee/core/client.rb +1 -1
- data/app/models/comee/core/client_price.rb +3 -2
- data/app/models/comee/core/item_status.rb +5 -1
- data/app/models/comee/core/product_lookup.rb +5 -1
- data/app/models/comee/core/quotation_request_item.rb +5 -2
- data/app/models/comee/core/sales_order_item.rb +2 -2
- data/app/models/comee/core/shipment_item.rb +18 -0
- data/app/serializers/comee/core/client_price_serializer.rb +1 -1
- data/app/serializers/comee/core/client_serializer.rb +1 -1
- data/app/serializers/comee/core/item_status_serializer.rb +1 -1
- data/app/serializers/comee/core/product_lookup_serializer.rb +8 -0
- data/app/serializers/comee/core/quotation_request_item_serializer.rb +1 -1
- data/app/serializers/comee/core/sales_order_item_serializer.rb +1 -1
- data/app/serializers/comee/core/shipment_item_serializer.rb +8 -0
- data/app/services/comee/core/product_lookup_service.rb +2 -3
- data/app/services/comee/core/quotation_request_service.rb +4 -2
- data/config/routes.rb +8 -0
- data/db/migrate/20230728123039_create_comee_core_clients.rb +4 -1
- data/db/migrate/20230812212844_create_comee_core_sales_order_items.rb +0 -1
- data/db/migrate/20230813235946_create_comee_core_master_prices.rb +1 -1
- data/db/migrate/20230814151601_create_comee_core_client_prices.rb +2 -1
- data/db/migrate/{20230914041307_create_comee_core_external_products.rb → 20230914041307_create_comee_core_product_lookups.rb} +2 -1
- data/db/migrate/20231121132709_create_comee_core_quotation_request_items.rb +2 -1
- data/db/migrate/20231207153420_create_comee_core_shipment_items.rb +17 -0
- data/db/migrate/20231207235542_create_comee_core_item_statuses.rb +2 -2
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/client_prices.rb +2 -1
- data/spec/factories/comee/core/clients.rb +1 -1
- data/spec/factories/comee/core/item_statuses.rb +1 -1
- data/spec/factories/comee/core/product_lookups.rb +1 -0
- data/spec/factories/comee/core/quotation_request_items.rb +2 -1
- data/spec/factories/comee/core/sales_order_items.rb +0 -1
- data/spec/factories/comee/core/shipment_items.rb +10 -0
- metadata +10 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8f7ff9ee03c4082238dd29c879529437ae713513aa1bd046e64ceecea1c53d0
|
4
|
+
data.tar.gz: 85e177e6799ab61d4f78390390765ade9b80a4dca42fc14cd4169d747f3e2180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128d85dc812325aa125f0853ab44e98e5e02df194d17fc8b37528e9c8e4a4d8faf5858245a5e5c79657fcbde6b023f0414b6b1730b48418fdc2b75ed6cf498d0
|
7
|
+
data.tar.gz: 83a9953071d1334a20bd32dc9ea5a964e2b39ab219df0fa108144490d74038df661f7bb2632daf71daf51afcdfa9045134ad0781a094ca9bd59a617f613f4806
|
@@ -19,7 +19,7 @@ module Comee
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def model_params
|
22
|
-
params.require(:payload).permit(:valid_from, :valid_to, :price, :product_id, :
|
22
|
+
params.require(:payload).permit(:valid_from, :valid_to, :price, :product_id, :margin, :margin_type, :client_id, :previous_price,
|
23
23
|
:unit_id)
|
24
24
|
end
|
25
25
|
end
|
@@ -11,7 +11,7 @@ module Comee
|
|
11
11
|
private
|
12
12
|
|
13
13
|
def model_params
|
14
|
-
params.require(:payload).permit(:hash_code, :status, :status_date, :remark, :
|
14
|
+
params.require(:payload).permit(:hash_code, :status, :status_date, :remark, :shipment_item_id, :details)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Comee
|
2
|
+
module Core
|
3
|
+
class ProductLookupsController < ApplicationController
|
4
|
+
include Common
|
5
|
+
|
6
|
+
def index
|
7
|
+
super do
|
8
|
+
ProductLookup.includes(:product).all
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def filter
|
13
|
+
lookups = ProductLookup.ransack(params[:q]).result
|
14
|
+
render json: {success: true, data: serialize(lookups)}
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def model_params
|
20
|
+
params.required(:payload).permit(:code, :itemable_id, :itemable_type, :item_description, :product_id)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -25,32 +25,32 @@ module Comee
|
|
25
25
|
render json: {success: true}
|
26
26
|
end
|
27
27
|
|
28
|
-
def filter_with_status
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
28
|
+
# def filter_with_status
|
29
|
+
# items = SalesOrderItem.includes(:sales_order, :product, :unit)
|
30
|
+
# .ransack(params[:q]).result
|
31
|
+
# statuses = ItemStatus.where(sales_order_item_id: items.map(&:id))
|
32
|
+
# .select("MAX(id) AS max_id, sales_order_item_id")
|
33
|
+
# .group(:sales_order_item_id)
|
34
|
+
# .all
|
35
|
+
# ids = statuses.map(&:max_id)
|
36
|
+
# statuses = ItemStatus.where(id: ids).each_with_object({}) { |status, res| res[status.sales_order_item_id] = status }
|
37
|
+
# result = items.each_with_object([]) do |item, res|
|
38
|
+
# status = statuses[item.id]
|
39
|
+
# data = {
|
40
|
+
# sales_order_no: item.sales_order.order_number,
|
41
|
+
# customer_item_no: item.customer_item_no,
|
42
|
+
# product_code: item.product.code,
|
43
|
+
# unit: item.unit.code,
|
44
|
+
# quantity: item.quantity,
|
45
|
+
# delivery_date: item.delivery_date,
|
46
|
+
# handover_date: item.sales_order.handover_date,
|
47
|
+
# po_reference: item.po_reference,
|
48
|
+
# status: status&.status
|
49
|
+
# }
|
50
|
+
# res << data.merge(status&.details)
|
51
|
+
# end
|
52
|
+
# render json: {success: true, data: result}
|
53
|
+
# end
|
54
54
|
|
55
55
|
private
|
56
56
|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Comee
|
2
|
+
module Core
|
3
|
+
class ShipmentItemsController < ApplicationController
|
4
|
+
include Common
|
5
|
+
|
6
|
+
def filter_with_status
|
7
|
+
items = ShipmentItem.includes(sales_order_item: %i[sales_order product unit])
|
8
|
+
.ransack(params[:q]).result
|
9
|
+
statuses = ItemStatus.where(shipment_item_id: items.map(&:id))
|
10
|
+
.select("MAX(id) AS max_id, shipment_item_id")
|
11
|
+
.group(:shipment_item_id)
|
12
|
+
.all
|
13
|
+
ids = statuses.map(&:max_id)
|
14
|
+
statuses = ItemStatus.where(id: ids).each_with_object({}) { |status, res| res[status.shipment_item_id] = status }
|
15
|
+
result = items.each_with_object([]) do |item, res|
|
16
|
+
status = statuses[item.id]
|
17
|
+
data = {
|
18
|
+
sales_order_no: item.sales_order_item.sales_order.order_number,
|
19
|
+
customer_item_no: item.sales_order_item.customer_item_no,
|
20
|
+
product_code: item.sales_order_item.product.code,
|
21
|
+
unit: item.sales_order_item.unit.code,
|
22
|
+
quantity: item.sales_order_item.quantity,
|
23
|
+
delivery_date: item.sales_order_item.delivery_date,
|
24
|
+
handover_date: item.sales_order_item.sales_order.handover_date,
|
25
|
+
po_reference: item.sales_order_item.po_reference,
|
26
|
+
status: status&.status
|
27
|
+
}
|
28
|
+
res << data.merge(status&.details)
|
29
|
+
end
|
30
|
+
render json: {success: true, data: result}
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def model_params
|
36
|
+
params.require(:payload).permit(:sales_order_item_id, :quantity, :shipment_status, :handover_date, :delivery_date, :pallet_no)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -2,6 +2,7 @@ module Comee
|
|
2
2
|
module Core
|
3
3
|
class Client < ApplicationRecord
|
4
4
|
belongs_to :user, optional: true
|
5
|
+
belongs_to :parent, class_name: "Comee::Core::Client", optional: true
|
5
6
|
has_many :warehouse_shipments
|
6
7
|
|
7
8
|
validates :code, :name, :address, :locale, presence: true
|
@@ -15,7 +16,6 @@ module Comee
|
|
15
16
|
address
|
16
17
|
code
|
17
18
|
name
|
18
|
-
discount
|
19
19
|
locale
|
20
20
|
]
|
21
21
|
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class ClientPrice < Price
|
4
|
+
enum :margin_type, {increase: 0, discount: 1}
|
4
5
|
belongs_to :client
|
5
6
|
belongs_to :previous_price, class_name: "Comee::Core::ClientPrice", optional: true
|
6
7
|
belongs_to :next_price, class_name: "Comee::Core::ClientPrice", optional: true
|
7
8
|
|
8
|
-
validates :price, presence: true
|
9
|
+
validates :price, :margin_type, presence: true
|
9
10
|
validates :price, numericality: {greater_than: 0}
|
10
|
-
validates :
|
11
|
+
validates :margin, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100}
|
11
12
|
validates :product_id, uniqueness: {scope: %i[client_id previous_price_id next_price_id status]}
|
12
13
|
|
13
14
|
def self.ransackable_attributes(_auth_object = nil)
|
@@ -5,13 +5,17 @@ module Comee
|
|
5
5
|
COMPLETELY_PICKED_AND_PACKED = "Completely Picked & Packed".freeze
|
6
6
|
PARTIALLY_PICKED_AND_PACKED = "Partially Picked & Packed".freeze
|
7
7
|
|
8
|
-
belongs_to :
|
8
|
+
belongs_to :shipment_item
|
9
9
|
|
10
10
|
validates :hash_code, :status, :status_date, presence: true
|
11
11
|
|
12
12
|
def self.ransackable_attributes(_auth_object = nil)
|
13
13
|
%w[hash_code status status_date sales_order_item_id]
|
14
14
|
end
|
15
|
+
|
16
|
+
def self.ransackable_associations(_auth_object = nil)
|
17
|
+
["shipment_item"]
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
@@ -4,7 +4,11 @@ module Comee
|
|
4
4
|
belongs_to :product
|
5
5
|
belongs_to :itemable, polymorphic: true
|
6
6
|
|
7
|
-
validates :code, presence: true
|
7
|
+
validates :code, :item_description, presence: true
|
8
|
+
|
9
|
+
def self.ransackable_attributes(_auth_object = nil)
|
10
|
+
%w[code item_description itemable_id itemable_type product_id]
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
10
14
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class QuotationRequestItem < ApplicationRecord
|
4
|
+
enum :margin_type, {increase: 0, discount: 1}
|
4
5
|
belongs_to :product
|
5
6
|
belongs_to :quotation_request
|
6
7
|
belongs_to :unit
|
7
8
|
|
8
|
-
validates :
|
9
|
+
validates :margin_type, :expected_delivery_date, presence: true
|
10
|
+
validates :quantity, :price, presence: true, numericality: {greater_than_or_equal_to: 0}
|
11
|
+
validates :margin, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100}
|
9
12
|
|
10
13
|
def self.ransackable_attributes(_auth_object = nil)
|
11
|
-
%w[quotation_request_id product_id unit_id quantity price
|
14
|
+
%w[quotation_request_id product_id unit_id quantity price margin margin_type expected_delivery_date]
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
@@ -6,8 +6,8 @@ module Comee
|
|
6
6
|
belongs_to :product
|
7
7
|
belongs_to :unit
|
8
8
|
belongs_to :source, class_name: "Comee::Core::FulfillmentCenter", optional: true
|
9
|
-
has_many :warehouse_shipment_items
|
10
|
-
has_many :
|
9
|
+
# has_many :warehouse_shipment_items
|
10
|
+
has_many :shipment_items
|
11
11
|
|
12
12
|
validates :customer_item_no, :delivery_date, presence: true
|
13
13
|
validates :quantity, :price, presence: true, numericality: {greater_than: 0}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Comee
|
2
|
+
module Core
|
3
|
+
class ShipmentItem < ApplicationRecord
|
4
|
+
belongs_to :sales_order_item
|
5
|
+
|
6
|
+
validates :handover_date, :delivery_date, presence: true
|
7
|
+
validates :quantity, presence: true, numericality: {greater_than: 0}
|
8
|
+
|
9
|
+
def self.ransackable_attributes(_auth_object = nil)
|
10
|
+
%w[delivery_date handover_date pallet_no quantity sales_order_item_id shipment_status]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.ransackable_associations(_auth_object = nil)
|
14
|
+
["sales_order_item"]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class ClientPriceSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :valid_from, :valid_to, :price, :status, :previous_price
|
4
|
+
attributes :id, :valid_from, :valid_to, :price, :status, :previous_price, :margin, :margin_type
|
5
5
|
belongs_to :product
|
6
6
|
belongs_to :client
|
7
7
|
belongs_to :unit
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class QuotationRequestItemSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :customer_item_no, :price, :
|
4
|
+
attributes :id, :customer_item_no, :price, :margin, :margin_type, :valid_from, :valid_to, :quantity, :expected_delivery_date
|
5
5
|
belongs_to :product
|
6
6
|
belongs_to :quotation_request
|
7
7
|
belongs_to :unit
|
@@ -2,7 +2,7 @@ module Comee
|
|
2
2
|
module Core
|
3
3
|
class SalesOrderItemSerializer < ActiveModel::Serializer
|
4
4
|
attributes :id, :customer_item_no, :quantity, :quantity_delivered, :price, :delivery_date, :eb_number, :lead_time, :comment,
|
5
|
-
:action_note, :po_reference
|
5
|
+
:action_note, :po_reference
|
6
6
|
|
7
7
|
belongs_to :sales_order
|
8
8
|
belongs_to :customer_order_item
|
@@ -21,7 +21,7 @@ module Comee
|
|
21
21
|
|
22
22
|
if from == ORGANIZATION
|
23
23
|
query = ProductLookup.joins(:product).find_by(product: {code: code}, **to)
|
24
|
-
return query
|
24
|
+
return query
|
25
25
|
end
|
26
26
|
|
27
27
|
if to == ORGANIZATION
|
@@ -30,8 +30,7 @@ module Comee
|
|
30
30
|
end
|
31
31
|
|
32
32
|
product = ProductLookup.find_by(code: code, **from).product
|
33
|
-
|
34
|
-
query.code
|
33
|
+
ProductLookup.find_by(product: product, **to)
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
@@ -16,7 +16,8 @@ module Comee
|
|
16
16
|
items.each do |item|
|
17
17
|
item[:price] = 0
|
18
18
|
item[:quotation_request_id] = request.id
|
19
|
-
item[:
|
19
|
+
item[:margin] = 0
|
20
|
+
item[:margin_type] = QuotationRequestItem.margin_types[:increase]
|
20
21
|
end
|
21
22
|
QuotationRequestItem.insert_all!(items)
|
22
23
|
end
|
@@ -73,7 +74,8 @@ module Comee
|
|
73
74
|
product_id: item.product_id,
|
74
75
|
unit_id: item.unit_id,
|
75
76
|
price: item.price,
|
76
|
-
|
77
|
+
margin: 0,
|
78
|
+
margin_type: QuotationRequestItem.margin_types[:increase],
|
77
79
|
valid_from: item.valid_from,
|
78
80
|
valid_to: item.valid_to,
|
79
81
|
status: ClientPrice.statuses[:current]
|
data/config/routes.rb
CHANGED
@@ -15,6 +15,12 @@ Comee::Core::Engine.routes.draw do
|
|
15
15
|
post "client_prices"
|
16
16
|
end
|
17
17
|
end
|
18
|
+
resources :product_lookups do
|
19
|
+
collection do
|
20
|
+
post "filter"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
18
24
|
resources :lookups
|
19
25
|
resources :quotation_requests do
|
20
26
|
collection do
|
@@ -77,7 +83,9 @@ Comee::Core::Engine.routes.draw do
|
|
77
83
|
member do
|
78
84
|
get "suggest", controller: :sales_order_items, action: :suggest_values
|
79
85
|
end
|
86
|
+
end
|
80
87
|
|
88
|
+
resources :shipment_items do
|
81
89
|
collection do
|
82
90
|
post "filter_with_status"
|
83
91
|
end
|
@@ -9,7 +9,10 @@ class CreateComeeCoreClients < ActiveRecord::Migration[7.0]
|
|
9
9
|
t.string :name, null: false
|
10
10
|
t.string :address, null: false
|
11
11
|
t.string :locale, null: false, default: "en"
|
12
|
-
t.
|
12
|
+
t.references :parent,
|
13
|
+
null: true,
|
14
|
+
index: {name: "so_on_ccc_indx"},
|
15
|
+
foreign_key: {to_table: :comee_core_clients}
|
13
16
|
|
14
17
|
t.timestamps
|
15
18
|
end
|
@@ -7,7 +7,7 @@ class CreateComeeCoreMasterPrices < ActiveRecord::Migration[7.0]
|
|
7
7
|
t.date :valid_to, null: false
|
8
8
|
t.float :status, null: false, default: 0
|
9
9
|
t.boolean :primary, null: false, default: false
|
10
|
-
t.
|
10
|
+
t.float :margin, null: false, default: 0
|
11
11
|
t.integer :lead_time
|
12
12
|
t.references :product,
|
13
13
|
null: false,
|
@@ -5,7 +5,8 @@ class CreateComeeCoreClientPrices < ActiveRecord::Migration[7.0]
|
|
5
5
|
t.date :valid_to, null: false
|
6
6
|
t.float :price, null: false
|
7
7
|
t.float :status, null: false, default: 0
|
8
|
-
t.
|
8
|
+
t.float :margin, null: false, default: 0
|
9
|
+
t.integer :margin_type, null: false, default: 0
|
9
10
|
t.references :product,
|
10
11
|
null: false,
|
11
12
|
index: {name: "product_on_cccp_indx"},
|
@@ -1,8 +1,9 @@
|
|
1
|
-
class
|
1
|
+
class CreateComeeCoreProductLookups < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
3
|
create_table :comee_core_product_lookups do |t|
|
4
4
|
t.string :code, null: false
|
5
5
|
t.references :itemable, polymorphic: true, null: false
|
6
|
+
t.string :item_description, null: false
|
6
7
|
t.references :product,
|
7
8
|
null: false,
|
8
9
|
index: {name: "product_on_ccep_indx"},
|
@@ -12,7 +12,8 @@ class CreateComeeCoreQuotationRequestItems < ActiveRecord::Migration[7.1]
|
|
12
12
|
t.string :customer_item_no
|
13
13
|
t.float :quantity, null: false
|
14
14
|
t.float :price, null: false, default: 0
|
15
|
-
t.float :
|
15
|
+
t.float :margin, null: false, default: 0
|
16
|
+
t.integer :margin_type, null: false, default: 0
|
16
17
|
t.date :expected_delivery_date, null: false
|
17
18
|
t.boolean :canceled, null: false, default: false
|
18
19
|
t.references :unit,
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateComeeCoreShipmentItems < ActiveRecord::Migration[7.1]
|
2
|
+
def change
|
3
|
+
create_table :comee_core_shipment_items do |t|
|
4
|
+
t.references :sales_order_item,
|
5
|
+
index: {name: "soi_on_ccsi_indx"},
|
6
|
+
null: false,
|
7
|
+
foreign_key: {to_table: :comee_core_sales_order_items}
|
8
|
+
t.float :quantity, null: false
|
9
|
+
t.string :shipment_status, null: false
|
10
|
+
t.date :handover_date, null: false
|
11
|
+
t.date :delivery_date, null: false
|
12
|
+
t.string :pallet_no
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -2,10 +2,10 @@ class CreateComeeCoreItemStatuses < ActiveRecord::Migration[7.1]
|
|
2
2
|
def change
|
3
3
|
create_table :comee_core_item_statuses do |t|
|
4
4
|
t.bigint :hash_code, null: false
|
5
|
-
t.references :
|
5
|
+
t.references :shipment_item,
|
6
6
|
null: false,
|
7
7
|
index: {name: "so_on_ccis_indx"},
|
8
|
-
foreign_key: {to_table: :
|
8
|
+
foreign_key: {to_table: :comee_core_shipment_items}
|
9
9
|
t.string :status, null: false
|
10
10
|
t.date :status_date, null: false
|
11
11
|
t.jsonb :details
|
data/lib/comee/core/version.rb
CHANGED
@@ -6,7 +6,8 @@ FactoryBot.define do
|
|
6
6
|
customer_item_no { Faker::Alphanumeric.alpha(number: 10) }
|
7
7
|
quantity { 10 }
|
8
8
|
price { 0 }
|
9
|
-
|
9
|
+
margin { 0 }
|
10
|
+
margin_type { Comee::Core::QuotationRequestItem.margin_types[:increase] }
|
10
11
|
expected_delivery_date { Date.current.advance(days: 15) }
|
11
12
|
canceled { false }
|
12
13
|
valid_from { nil }
|
@@ -0,0 +1,10 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :shipment_item, class: "Comee::Core::ShipmentItem" do
|
3
|
+
sales_order_item
|
4
|
+
quantity { 50 }
|
5
|
+
shipment_status { Faker::Lorem.word }
|
6
|
+
handover_date { Date.current.advance(days: 3) }
|
7
|
+
delivery_date { Date.current.advance(days: 6) }
|
8
|
+
pallet_no { Faker::Alphanumeric.alpha(number: 10) }
|
9
|
+
end
|
10
|
+
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.
|
4
|
+
version: 0.1.67
|
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-
|
11
|
+
date: 2023-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -291,6 +291,7 @@ files:
|
|
291
291
|
- app/controllers/comee/core/item_statuses_controller.rb
|
292
292
|
- app/controllers/comee/core/lookups_controller.rb
|
293
293
|
- app/controllers/comee/core/notifications_controller.rb
|
294
|
+
- app/controllers/comee/core/product_lookups_controller.rb
|
294
295
|
- app/controllers/comee/core/products_controller.rb
|
295
296
|
- app/controllers/comee/core/purchase_order_items_controller.rb
|
296
297
|
- app/controllers/comee/core/purchase_orders_controller.rb
|
@@ -298,6 +299,7 @@ files:
|
|
298
299
|
- app/controllers/comee/core/quotation_requests_controller.rb
|
299
300
|
- app/controllers/comee/core/sales_order_items_controller.rb
|
300
301
|
- app/controllers/comee/core/sales_orders_controller.rb
|
302
|
+
- app/controllers/comee/core/shipment_items_controller.rb
|
301
303
|
- app/controllers/comee/core/suppliers_controller.rb
|
302
304
|
- app/controllers/comee/core/unit_conversions_controller.rb
|
303
305
|
- app/controllers/comee/core/units_controller.rb
|
@@ -337,6 +339,7 @@ files:
|
|
337
339
|
- app/models/comee/core/quotation_request_item.rb
|
338
340
|
- app/models/comee/core/sales_order.rb
|
339
341
|
- app/models/comee/core/sales_order_item.rb
|
342
|
+
- app/models/comee/core/shipment_item.rb
|
340
343
|
- app/models/comee/core/supplier.rb
|
341
344
|
- app/models/comee/core/unit.rb
|
342
345
|
- app/models/comee/core/unit_conversion.rb
|
@@ -354,6 +357,7 @@ files:
|
|
354
357
|
- app/serializers/comee/core/item_status_serializer.rb
|
355
358
|
- app/serializers/comee/core/lookup_serializer.rb
|
356
359
|
- app/serializers/comee/core/master_price_serializer.rb
|
360
|
+
- app/serializers/comee/core/product_lookup_serializer.rb
|
357
361
|
- app/serializers/comee/core/product_serializer.rb
|
358
362
|
- app/serializers/comee/core/product_type_serializer.rb
|
359
363
|
- app/serializers/comee/core/purchase_order_item_serializer.rb
|
@@ -362,6 +366,7 @@ files:
|
|
362
366
|
- app/serializers/comee/core/quotation_request_serializer.rb
|
363
367
|
- app/serializers/comee/core/sales_order_item_serializer.rb
|
364
368
|
- app/serializers/comee/core/sales_order_serializer.rb
|
369
|
+
- app/serializers/comee/core/shipment_item_serializer.rb
|
365
370
|
- app/serializers/comee/core/supplier_serializer.rb
|
366
371
|
- app/serializers/comee/core/unit_conversion_serializer.rb
|
367
372
|
- app/serializers/comee/core/unit_serializer.rb
|
@@ -396,7 +401,7 @@ files:
|
|
396
401
|
- db/migrate/20230812212844_create_comee_core_sales_order_items.rb
|
397
402
|
- db/migrate/20230813235946_create_comee_core_master_prices.rb
|
398
403
|
- db/migrate/20230814151601_create_comee_core_client_prices.rb
|
399
|
-
- db/migrate/
|
404
|
+
- db/migrate/20230914041307_create_comee_core_product_lookups.rb
|
400
405
|
- db/migrate/20230915205522_create_comee_core_invoices.rb
|
401
406
|
- db/migrate/20230915205648_create_comee_core_invoice_items.rb
|
402
407
|
- db/migrate/20230929115336_create_comee_core_order_sources.rb
|
@@ -414,6 +419,7 @@ files:
|
|
414
419
|
- db/migrate/20231125122723_create_comee_core_purchase_orders.rb
|
415
420
|
- db/migrate/20231126082907_create_comee_core_purchase_order_items.rb
|
416
421
|
- db/migrate/20231206082503_create_comee_core_unit_conversions.rb
|
422
|
+
- db/migrate/20231207153420_create_comee_core_shipment_items.rb
|
417
423
|
- db/migrate/20231207235542_create_comee_core_item_statuses.rb
|
418
424
|
- lib/comee/core.rb
|
419
425
|
- lib/comee/core/engine.rb
|
@@ -448,6 +454,7 @@ files:
|
|
448
454
|
- spec/factories/comee/core/quotation_requests.rb
|
449
455
|
- spec/factories/comee/core/sales_order_items.rb
|
450
456
|
- spec/factories/comee/core/sales_orders.rb
|
457
|
+
- spec/factories/comee/core/shipment_items.rb
|
451
458
|
- spec/factories/comee/core/suppliers.rb
|
452
459
|
- spec/factories/comee/core/unit_conversions.rb
|
453
460
|
- spec/factories/comee/core/units.rb
|