comee_core 0.1.90 → 0.1.92

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/comee/core/application_controller.rb +1 -1
  3. data/app/controllers/comee/core/client_prices_controller.rb +7 -7
  4. data/app/controllers/comee/core/clients_controller.rb +15 -1
  5. data/app/controllers/comee/core/customer_orders_controller.rb +13 -5
  6. data/app/controllers/comee/core/sales_orders_controller.rb +1 -1
  7. data/app/controllers/comee/core/shipment_items_controller.rb +12 -0
  8. data/app/controllers/comee/core/suppliers_controller.rb +10 -2
  9. data/app/models/comee/core/back_order.rb +1 -1
  10. data/app/models/comee/core/client.rb +1 -0
  11. data/app/models/comee/core/client_price.rb +1 -0
  12. data/app/models/comee/core/customer_order.rb +1 -1
  13. data/app/models/comee/core/customer_order_item.rb +1 -1
  14. data/app/models/comee/core/invoice.rb +1 -0
  15. data/app/models/comee/core/item_status.rb +1 -1
  16. data/app/models/comee/core/master_price.rb +1 -0
  17. data/app/models/comee/core/pickup_schedule.rb +1 -1
  18. data/app/models/comee/core/product.rb +1 -1
  19. data/app/models/comee/core/product_lookup.rb +1 -1
  20. data/app/models/comee/core/purchase_order.rb +1 -0
  21. data/app/models/comee/core/purchase_order_item.rb +1 -0
  22. data/app/models/comee/core/quotation_request.rb +1 -1
  23. data/app/models/comee/core/quotation_request_item.rb +1 -1
  24. data/app/models/comee/core/sales_order.rb +7 -0
  25. data/app/models/comee/core/sales_order_item.rb +5 -0
  26. data/app/models/comee/core/shipment_instruction.rb +1 -1
  27. data/app/models/comee/core/shipment_item.rb +1 -1
  28. data/app/models/comee/core/supplier.rb +1 -1
  29. data/app/models/comee/core/transport_availability.rb +1 -1
  30. data/app/models/comee/core/unit.rb +1 -1
  31. data/app/models/comee/core/warehouse_shipment.rb +1 -1
  32. data/app/serializers/comee/core/client_serializer.rb +2 -1
  33. data/app/serializers/comee/core/customer_order_serializer.rb +5 -1
  34. data/app/serializers/comee/core/sales_order_serializer.rb +2 -1
  35. data/app/services/comee/core/customer_order_service.rb +4 -2
  36. data/config/routes.rb +3 -0
  37. data/db/migrate/20230728123039_create_comee_core_clients.rb +2 -0
  38. data/db/migrate/20230811083239_create_comee_core_customer_orders.rb +6 -0
  39. data/db/migrate/20230812190652_create_comee_core_sales_orders.rb +6 -0
  40. data/lib/comee/core/version.rb +1 -1
  41. data/spec/factories/comee/core/clients.rb +2 -0
  42. data/spec/factories/comee/core/customer_orders.rb +6 -0
  43. data/spec/factories/comee/core/sales_orders.rb +3 -0
  44. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 756042163169e327bbf9e028c6666dbec6f9c52e907cf5d35b210ca37b310533
4
- data.tar.gz: 9c3f9bee0f3b28e6988c490babdb6e56329fe546300920d1d287eb917fca1554
3
+ metadata.gz: 99b4856ac17d221660c2a0af2589f3e26d5f40930097788982e327bf3f9daa1e
4
+ data.tar.gz: e81f18ec5013e7c4aa47a815c2f607d1b6398fc0c616975932c5ed9bad8f7903
5
5
  SHA512:
6
- metadata.gz: 757759703fb6cf5f2dac0e7c9dadb29a7c7317c53f788d9a6993cd2ea49cad72c80727ec7d643c2259f5acc21a90aad0e12ce4d27292209429b202af3dbf23db
7
- data.tar.gz: 95a9135eb3ad74e2a8666cbcbd8c151f2a19dc801f9249110f01bd1137e664a138958bad4038a309130428296742930f2f73efd4b46369fbded65bd7e280f006
6
+ metadata.gz: 40e5ad66e287dde54881d839c4c6d9074c5ef0f7429073615faee3c9a4c2fdfa05eb29b1945747797564a407b253a348f5ce9846414c690ca2d9ca2547b7c21e
7
+ data.tar.gz: ce2a3221e2cd6bd668145a50afc0d765c92846f3447322ab33c2c4bc3475b6c6a5631d48c8f07535b8e7d6c1b0c354c73f96e91dad0ed5f048a61af073fe2d73
@@ -1,7 +1,7 @@
1
1
  module Comee
2
2
  module Core
3
3
  class ApplicationController < ActionController::API
4
- include Comee::Core::Pagination
4
+ include Pagination
5
5
 
6
6
  before_action :authenticate
7
7
 
@@ -1,20 +1,20 @@
1
1
  module Comee
2
2
  module Core
3
3
  class ClientPricesController < ApplicationController
4
- include Comee::Core::Common
4
+ include Common
5
5
 
6
6
  def index
7
7
  super do
8
- client_prices = Comee::Core::ClientPrice.all
8
+ client_prices = ClientPrice.all
9
9
  client_prices.then(&paginate)
10
10
  end
11
11
  end
12
12
 
13
13
  def fetch_for_client
14
- client = Comee::Core::Client.find(params[:id])
14
+ client = Client.find(params[:id])
15
15
  client_id = client.parent_id || client.id
16
- prices = Comee::Core::ClientPrice.includes(:client, :product, :unit, :product_lookup)
17
- .where(client_id: client_id)
16
+ prices = ClientPrice.includes(:client, :product, :unit, :product_lookup)
17
+ .where(client_id: client_id)
18
18
  total = prices.count
19
19
  prices = prices.then(&paginate)
20
20
 
@@ -22,8 +22,8 @@ module Comee
22
22
  end
23
23
 
24
24
  def filter
25
- prices = Comee::Core::ClientPrice.includes(:client, :product, :unit, :product_lookup)
26
- .ransack(params[:q]).result
25
+ prices = ClientPrice.includes(:client, :product, :unit, :product_lookup)
26
+ .ransack(params[:q]).result
27
27
  total = prices.count
28
28
  prices = prices.then(&paginate)
29
29
 
@@ -8,10 +8,24 @@ module Comee
8
8
  render json: {success: true, data: serialize(@clients)}
9
9
  end
10
10
 
11
+ def consignees
12
+ client = Comee::Core::Client.find(params[:id])
13
+ render json: {success: true, data: client.consignees}
14
+ rescue StandardError => e
15
+ render json: {success: false, error: e.message}
16
+ end
17
+
18
+ def shipment_addresses
19
+ client = Comee::Core::Client.find(params[:id])
20
+ render json: {success: true, data: client.shipment_addresses}
21
+ rescue StandardError => e
22
+ render json: {success: false, error: e.message}
23
+ end
24
+
11
25
  private
12
26
 
13
27
  def model_params
14
- params.require(:payload).permit(:code, :name, :address, :locale, :user_id, :parent_id)
28
+ params.require(:payload).permit(:code, :name, :address, :locale, :user_id, :parent_id, consignees: [], shipment_addresses: [])
15
29
  end
16
30
  end
17
31
  end
@@ -25,7 +25,7 @@ module Comee
25
25
  end
26
26
 
27
27
  def accept
28
- order = @service.accept(params[:id])
28
+ order = @service.accept(params[:id], current_user.name)
29
29
  render json: {success: true, data: serialize(order)}
30
30
  rescue StandardError => e
31
31
  render json: {success: false, error: e.message}
@@ -46,13 +46,21 @@ module Comee
46
46
  private
47
47
 
48
48
  def model_params
49
- params.require(:payload).permit(:order_number, :order_date, :order_terms, :delivery_address, :invoice_address, :status, :client_id,
50
- :file)
49
+ params.require(:payload)
50
+ .permit(
51
+ :order_number, :order_date, :order_terms, :consignee, :shipment_address, :final_destination,
52
+ :final_delivery_date, :handover_date, :shipping_date, :delivery_address, :invoice_address, :status,
53
+ :client_id, :file
54
+ )
51
55
  end
52
56
 
53
57
  def create_with_item_params
54
- params.require(:payload).permit(:order_number, :order_date, :order_terms, :delivery_address, :invoice_address, :status, :client_id,
55
- items: %i[customer_item_no product_id quantity price unit_id delivery_date])
58
+ params.require(:payload)
59
+ .permit(
60
+ :order_number, :order_date, :order_terms, :consignee, :shipment_address, :final_destination,
61
+ :final_delivery_date, :handover_date, :shipping_date, :delivery_address, :invoice_address, :status, :client_id,
62
+ items: %i[customer_item_no product_id quantity price unit_id delivery_date]
63
+ )
56
64
  end
57
65
 
58
66
  def set_service
@@ -54,7 +54,7 @@ module Comee
54
54
  def model_params
55
55
  params.require(:payload).permit(:order_number, :customer_order_id, :payment_penalty, :payment_term, :delivery_term, :status,
56
56
  :fulfillment_center_id, :total_price, :amount_paid, :pallete_note, :handover_date, :remark,
57
- files: [])
57
+ :client_id, files: [])
58
58
  end
59
59
 
60
60
  def back_order_params
@@ -8,6 +8,18 @@ module Comee
8
8
  render json: {success: true, data: serialize(@shipment_item)}
9
9
  end
10
10
 
11
+ def filter_for_client
12
+ shipment_items = Comee::Core::ShipmentItem.joins(sales_order_item: :sales_order)
13
+ .where(
14
+ comee_core_sales_order_items: {
15
+ comee_core_sales_orders: {
16
+ client_id: params[:id]
17
+ }
18
+ }
19
+ )
20
+ render json: {success: true, data: serialize(shipment_items)}
21
+ end
22
+
11
23
  def filter_with_status
12
24
  items = ShipmentItem.includes(sales_order_item: %i[sales_order product unit])
13
25
  .ransack(params[:q]).result
@@ -3,9 +3,17 @@ module Comee
3
3
  class SuppliersController < ApplicationController
4
4
  include Common
5
5
 
6
+ def index
7
+ super do
8
+ Supplier.all.then(&paginate)
9
+ end
10
+ end
11
+
6
12
  def filter
7
- @supplier = Comee::Core::Supplier.ransack(params[:q]).result
8
- render json: {success: true, data: serialize(@supplier)}
13
+ suppliers = Comee::Core::Supplier.ransack(params[:q]).result
14
+ total = suppliers.count
15
+ suppliers = suppliers.then(&paginate)
16
+ render json: {success: true, data: serialize(suppliers), page: params[:page], total: total}
9
17
  end
10
18
 
11
19
  private
@@ -14,7 +14,7 @@ module Comee
14
14
  delegate(:name, to: :supplier, prefix: true)
15
15
 
16
16
  def self.ransackable_attributes(_auth_object = nil)
17
- %w[delivery_address delivery_date invoice_address order_date order_number status supplier_id]
17
+ %w[id delivery_address delivery_date invoice_address order_date order_number status supplier_id]
18
18
  end
19
19
 
20
20
  def self.ransackable_associations(_auth_object = nil)
@@ -12,6 +12,7 @@ module Comee
12
12
 
13
13
  def self.ransackable_attributes(_auth_object = nil)
14
14
  %w[
15
+ id
15
16
  user_id
16
17
  address
17
18
  code
@@ -25,6 +25,7 @@ module Comee
25
25
 
26
26
  def self.ransackable_attributes(_auth_object = nil)
27
27
  %w[
28
+ id
28
29
  valid_from
29
30
  valid_to
30
31
  price
@@ -10,7 +10,7 @@ module Comee
10
10
  validates :order_number, :order_date, :delivery_address, :invoice_address, :status, presence: true
11
11
 
12
12
  def self.ransackable_attributes(_auth_object = nil)
13
- %w[client_id delivery_address invoice_address order_number status]
13
+ %w[id client_id delivery_address invoice_address order_number status]
14
14
  end
15
15
 
16
16
  def self.ransackable_associations(_auth_object = nil)
@@ -8,7 +8,7 @@ module Comee
8
8
  validates :customer_item_no, :quantity, :price, :delivery_date, presence: true
9
9
 
10
10
  def self.ransackable_attributes(_auth_object = nil)
11
- %w[customer_order_id product_id unit_id]
11
+ %w[id customer_order_id product_id unit_id]
12
12
  end
13
13
 
14
14
  def self.ransackable_associations(_auth_object = nil)
@@ -25,6 +25,7 @@ module Comee
25
25
 
26
26
  def self.ransackable_attributes(_auth_object = nil)
27
27
  %w[
28
+ id
28
29
  sales_order_id
29
30
  invoice_no
30
31
  date_issued
@@ -14,7 +14,7 @@ module Comee
14
14
  validates :status, inclusion: {in: STATUSES}
15
15
 
16
16
  def self.ransackable_attributes(_auth_object = nil)
17
- %w[hash_code status status_date sales_order_item_id]
17
+ %w[id hash_code status status_date sales_order_item_id]
18
18
  end
19
19
 
20
20
  def self.ransackable_associations(_auth_object = nil)
@@ -43,6 +43,7 @@ module Comee
43
43
 
44
44
  def self.ransackable_attributes(_auth_object = nil)
45
45
  %w[
46
+ id
46
47
  valid_from
47
48
  valid_to
48
49
  purchase_price
@@ -8,7 +8,7 @@ module Comee
8
8
  validates :status, presence: true
9
9
 
10
10
  def self.ransackable_attributes(_auth_object = nil)
11
- %w[driver_license_no plate_no pod_id status time_slot_id truck_no]
11
+ %w[id driver_license_no plate_no pod_id status time_slot_id truck_no]
12
12
  end
13
13
  end
14
14
  end
@@ -30,7 +30,7 @@ module Comee
30
30
  end
31
31
 
32
32
  def self.ransackable_attributes(_auth_object = nil)
33
- %w[code name description]
33
+ %w[id code name description]
34
34
  end
35
35
 
36
36
  def self.ransackable_associations(_auth_object = nil)
@@ -7,7 +7,7 @@ module Comee
7
7
  validates :code, :item_description, presence: true
8
8
 
9
9
  def self.ransackable_attributes(_auth_object = nil)
10
- %w[code item_description itemable_id itemable_type product_id]
10
+ %w[id code item_description itemable_id itemable_type product_id]
11
11
  end
12
12
 
13
13
  def self.ransackable_associations(_auth_object = nil)
@@ -11,6 +11,7 @@ module Comee
11
11
  }
12
12
  def self.ransackable_attributes(_auth_object = nil)
13
13
  %w[
14
+ id
14
15
  supplier_id
15
16
  order_date
16
17
  status
@@ -18,6 +18,7 @@ module Comee
18
18
 
19
19
  def self.ransackable_attributes(_auth_object = nil)
20
20
  %w[
21
+ id
21
22
  purchase_order_id
22
23
  sales_order_item_id
23
24
  quantity
@@ -11,7 +11,7 @@ module Comee
11
11
  validates :status, presence: true
12
12
 
13
13
  def self.ransackable_attributes(_auth_object = nil)
14
- %w[client_id reference_no status]
14
+ %w[id client_id reference_no status]
15
15
  end
16
16
 
17
17
  private
@@ -11,7 +11,7 @@ module Comee
11
11
  validates :margin, presence: true, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 100}
12
12
 
13
13
  def self.ransackable_attributes(_auth_object = nil)
14
- %w[quotation_request_id product_id unit_id quantity price margin margin_type expected_delivery_date]
14
+ %w[id quotation_request_id product_id unit_id quantity price margin margin_type expected_delivery_date]
15
15
  end
16
16
  end
17
17
  end
@@ -2,9 +2,11 @@ module Comee
2
2
  module Core
3
3
  class SalesOrder < ApplicationRecord
4
4
  before_save :total_price
5
+ before_save :set_parent_client_name
5
6
 
6
7
  belongs_to :customer_order
7
8
  belongs_to :fulfillment_center, optional: true
9
+ belongs_to :client
8
10
  has_many :sales_order_items
9
11
  has_many_attached :files
10
12
  has_one :customs_detail
@@ -28,8 +30,13 @@ module Comee
28
30
  self.total_price = total_price
29
31
  end
30
32
 
33
+ def set_parent_client_name
34
+ self.parent_client_name = client.parent&.name
35
+ end
36
+
31
37
  def self.ransackable_attributes(_auth_object = nil)
32
38
  %w[
39
+ id
33
40
  order_number
34
41
  status
35
42
  customer_order_id
@@ -15,6 +15,7 @@ module Comee
15
15
 
16
16
  def self.ransackable_attributes(_auth_object = nil)
17
17
  %w[
18
+ id
18
19
  customer_item_no
19
20
  customer_order_item_id
20
21
  delivery_date
@@ -28,6 +29,10 @@ module Comee
28
29
  unit_id
29
30
  ]
30
31
  end
32
+
33
+ def self.ransackable_associations(_auth_object = nil)
34
+ %w[customer_order_item product sales_order source unit]
35
+ end
31
36
  end
32
37
  end
33
38
  end
@@ -10,7 +10,7 @@ module Comee
10
10
  validates :status, presence: true
11
11
 
12
12
  def self.ransackable_attributes(_auth_object = nil)
13
- %w[client_id reference_no status]
13
+ %w[id client_id reference_no status]
14
14
  end
15
15
  end
16
16
  end
@@ -10,7 +10,7 @@ module Comee
10
10
  validates :quantity, presence: true, numericality: {greater_than: 0}
11
11
 
12
12
  def self.ransackable_attributes(_auth_object = nil)
13
- %w[delivery_date handover_date pallet_no quantity sales_order_item_id shipment_status]
13
+ %w[id delivery_date handover_date pallet_no quantity sales_order_item_id shipment_status]
14
14
  end
15
15
 
16
16
  def self.ransackable_associations(_auth_object = nil)
@@ -7,7 +7,7 @@ module Comee
7
7
  validates :name, :address, :locale, presence: true
8
8
 
9
9
  def self.ransackable_attributes(_auth_object = nil)
10
- %w[user_id code address locale]
10
+ %w[id user_id code address locale]
11
11
  end
12
12
 
13
13
  def self.ransackable_associations(_auth_object = nil)
@@ -13,7 +13,7 @@ module Comee
13
13
  end
14
14
 
15
15
  def self.ransackable_attributes(_auth_object = nil)
16
- %w[availability_date weekday weekday_short]
16
+ %w[id availability_date weekday weekday_short]
17
17
  end
18
18
  end
19
19
  end
@@ -15,7 +15,7 @@ module Comee
15
15
  end
16
16
 
17
17
  def self.ransackable_attributes(_auth_object = nil)
18
- %w[code name unit_type]
18
+ %w[id code name unit_type]
19
19
  end
20
20
  end
21
21
  end
@@ -10,7 +10,7 @@ module Comee
10
10
  validates :destination, :delivery_date, :status, presence: true
11
11
 
12
12
  def self.ransackable_attributes(_auth_object = nil)
13
- %w[client_id delivery_date destination id reference_number status]
13
+ %w[id client_id delivery_date destination id reference_number status]
14
14
  end
15
15
 
16
16
  def self.ransackable_associations(_auth_object = nil)
@@ -1,7 +1,8 @@
1
1
  module Comee
2
2
  module Core
3
3
  class ClientSerializer < ActiveModel::Serializer
4
- attributes :id, :code, :name, :address, :locale, :user_id, :user_name, :parent_id
4
+ attributes :id, :code, :name, :address, :locale, :user_id, :user_name, :consignees, :shipment_addresses
5
+ belongs_to :parent
5
6
  end
6
7
  end
7
8
  end
@@ -1,7 +1,11 @@
1
1
  module Comee
2
2
  module Core
3
3
  class CustomerOrderSerializer < ActiveModel::Serializer
4
- attributes :id, :order_number, :order_date, :order_terms, :delivery_address, :invoice_address, :status, :file_url, :client
4
+ attributes :id, :order_number, :order_date, :order_terms, :consignee, :shipment_address, :final_destination,
5
+ :final_delivery_date, :handover_date, :shipping_date, :delivery_address, :invoice_address, :status,
6
+ :file_url
7
+
8
+ belongs_to :client
5
9
  has_many :customer_order_items
6
10
  end
7
11
  end
@@ -2,8 +2,9 @@ module Comee
2
2
  module Core
3
3
  class SalesOrderSerializer < ActiveModel::Serializer
4
4
  attributes :id, :order_number, :payment_penalty, :status, :total_price, :payment_term, :delivery_term, :amount_paid, :pallete_note,
5
- :handover_date, :remark, :files_url, :customs_detail
5
+ :handover_date, :remark, :parent_client_name, :created_by, :files_url, :customs_detail
6
6
  belongs_to :customer_order
7
+ belongs_to :client
7
8
  belongs_to :fulfillment_center
8
9
  has_many :sales_order_items
9
10
  end
@@ -112,7 +112,7 @@ module Comee
112
112
  order
113
113
  end
114
114
 
115
- def accept(id)
115
+ def accept(id, accepted_by = nil)
116
116
  order = CustomerOrder.find_by(id: id)
117
117
  raise(StandardError, "Customer order with id `#{id}` not found.") unless order
118
118
 
@@ -135,7 +135,9 @@ module Comee
135
135
  sales_order = SalesOrder.create!(
136
136
  order_number: order.order_number,
137
137
  customer_order: order,
138
- status: SalesOrder.statuses[:draft]
138
+ status: SalesOrder.statuses[:draft],
139
+ client: order.client,
140
+ created_by: accepted_by || ""
139
141
  )
140
142
  order_items = order.customer_order_items.includes(:product, :unit)
141
143
  client_id = order.client.parent_id || order.client_id
data/config/routes.rb CHANGED
@@ -81,6 +81,9 @@ Comee::Core::Engine.routes.draw do
81
81
  member do
82
82
  get "rfq_products", controller: :quotation_requests, action: :rfq_products_for_client
83
83
  get "prices", controller: :client_prices, action: :fetch_for_client
84
+ get "consignees"
85
+ get "shipment_addresses"
86
+ get "shipment_items", controller: :shipment_items, action: :filter_for_client
84
87
  end
85
88
  collection do
86
89
  post "filter"
@@ -13,6 +13,8 @@ class CreateComeeCoreClients < ActiveRecord::Migration[7.0]
13
13
  null: true,
14
14
  index: {name: "so_on_ccc_indx"},
15
15
  foreign_key: {to_table: :comee_core_clients}
16
+ t.string :consignees, array: true, default: []
17
+ t.string :shipment_addresses, array: true, default: []
16
18
 
17
19
  t.timestamps
18
20
  end
@@ -8,6 +8,12 @@ class CreateComeeCoreCustomerOrders < ActiveRecord::Migration[7.1]
8
8
  index: {name: "client_on_cccuo_indx"},
9
9
  foreign_key: {to_table: :comee_core_clients}
10
10
  t.string :order_terms
11
+ t.string :consignee
12
+ t.string :shipment_address
13
+ t.string :final_destination
14
+ t.date :final_delivery_date
15
+ t.date :handover_date
16
+ t.date :shipping_date
11
17
  t.string :delivery_address, null: false
12
18
  t.string :invoice_address, null: false
13
19
  t.integer :status, null: false, default: 0
@@ -10,6 +10,11 @@ class CreateComeeCoreSalesOrders < ActiveRecord::Migration[7.0]
10
10
  null: true,
11
11
  index: {name: "fc_on_ccso_indx"},
12
12
  foreign_key: {to_table: :comee_core_fulfillment_centers}
13
+ t.references :client,
14
+ null: false,
15
+ index: {name: "client_on_ccso_indx"},
16
+ foreign_key: {to_table: :comee_core_clients}
17
+ t.string :parent_client_name
13
18
  t.string :payment_term
14
19
  t.string :delivery_term
15
20
  t.float :payment_penalty, null: false, default: 0.0
@@ -19,6 +24,7 @@ class CreateComeeCoreSalesOrders < ActiveRecord::Migration[7.0]
19
24
  t.string :pallete_note
20
25
  t.date :handover_date
21
26
  t.string :remark
27
+ t.string :created_by
22
28
 
23
29
  t.timestamps
24
30
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.90".freeze
3
+ VERSION = "0.1.92".freeze
4
4
  end
5
5
  end
@@ -6,5 +6,7 @@ FactoryBot.define do
6
6
  address { Faker::Address.full_address }
7
7
  locale { "en" }
8
8
  parent { nil }
9
+ consignees { [] }
10
+ shipment_addresses { [] }
9
11
  end
10
12
  end
@@ -4,6 +4,12 @@ FactoryBot.define do
4
4
  order_date { Date.current }
5
5
  client
6
6
  order_terms { Faker::Lorem.sentence }
7
+ consignee { Faker::Name.name }
8
+ shipment_address { Faker::Address.full_address }
9
+ final_destination { Faker::Address.full_address }
10
+ final_delivery_date { Faker::Date.between(from: Date.current.advance(days: 20), to: Date.current.advance(months: 2)) }
11
+ handover_date { final_delivery_date.advance(days: -10) }
12
+ shipping_date { handover_date.advance(days: 10) }
7
13
  delivery_address { Faker::Address.full_address }
8
14
  invoice_address { Faker::Address.full_address }
9
15
  status { 0 }
@@ -3,6 +3,7 @@ FactoryBot.define do
3
3
  order_number { Faker::Alphanumeric.alpha(number: 10) }
4
4
  customer_order
5
5
  fulfillment_center
6
+ client
6
7
  payment_term { Faker::Lorem.sentence }
7
8
  delivery_term { Faker::Lorem.sentence }
8
9
  payment_penalty { 0 }
@@ -11,5 +12,7 @@ FactoryBot.define do
11
12
  status { Comee::Core::SalesOrder.statuses[:draft] }
12
13
  pallete_note { Faker::Lorem.sentence }
13
14
  remark { Faker::Lorem.sentence }
15
+ parent_client_name { Faker::Name.name }
16
+ created_by { Faker::Name.name }
14
17
  end
15
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.90
4
+ version: 0.1.92
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-14 00:00:00.000000000 Z
11
+ date: 2024-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers