comee_core 0.2.88 → 0.2.90
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/clients_controller.rb +2 -2
- data/app/models/comee/core/client.rb +1 -1
- data/app/models/comee/core/client_address.rb +11 -0
- data/app/serializers/comee/core/client_address_serializer.rb +2 -1
- data/app/serializers/comee/core/client_serializer.rb +2 -2
- data/db/migrate/20230728014322_create_comee_core_products.rb +1 -0
- data/db/migrate/20230728122618_create_comee_core_suppliers.rb +3 -0
- data/db/migrate/20230728123039_create_comee_core_clients.rb +7 -0
- data/db/migrate/20230728123823_create_comee_core_purchase_orders.rb +1 -0
- data/db/migrate/20230728123827_create_comee_core_purchase_order_items.rb +1 -0
- data/db/migrate/20230811102708_create_comee_core_customer_order_items.rb +1 -0
- data/db/migrate/20230812190652_create_comee_core_sales_orders.rb +1 -0
- data/db/migrate/20230812212844_create_comee_core_sales_order_items.rb +1 -0
- data/db/migrate/20230813235946_create_comee_core_master_prices.rb +5 -0
- data/db/migrate/20231125115522_create_comee_core_customs_details.rb +4 -0
- data/db/migrate/20231207153420_create_comee_core_shipment_items.rb +1 -0
- data/db/migrate/20240314111117_create_comee_core_purchase_requisitions.rb +1 -0
- data/db/migrate/20240503040722_create_comee_core_client_addresses.rb +2 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/client_addresses.rb +1 -0
- data/spec/factories/comee/core/clients.rb +1 -0
- metadata +3 -10
- data/db/migrate/20240425121701_add_purchase_status_to_sales_order_and_purchase_requisition.rb +0 -6
- data/db/migrate/20240515173010_add_serial_no_to_line_items.rb +0 -6
- data/db/migrate/20240601094028_add_additional_fields.rb +0 -32
- data/db/migrate/20240602171355_add_order_reference_to_purchase_order.rb +0 -5
- data/db/migrate/20240604142805_add_serial_no_to_purchase_order_items.rb +0 -5
- data/db/migrate/20240604155157_add_fields_to_customs_details.rb +0 -8
- data/db/migrate/20240608094721_add_package_type_to_shipment_item.rb +0 -5
- /data/db/migrate/{20231125111539_create_comee_core_lookups.rb → 20230728011539_create_comee_core_lookups.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be86161b0b007d2c2ff8209c643a8cf4fc02d449fe5c58122fd5ca27ca0f71e2
|
4
|
+
data.tar.gz: da78f73a1497097efde700f92b1f645556839ac7629fcf90b04fd767e9c46045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807170e1da4cd41bb741553d9e7c08477bc98ecd52ecd2ea0baf02f1bcf855f9d5e57d5345b44be6007947ee9cc548089c1bd589f7a86b016c06a6497b443507
|
7
|
+
data.tar.gz: 3b888a576c3b97d27dcb1473e97db523d1dfc95ee8126f98a64996c236e03be7c96fe7717689741683fc731503c49ba5f84c7eafa7dd084687ddbeb04f4b0864
|
@@ -56,8 +56,8 @@ module Comee
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def model_params
|
59
|
-
params.require(:payload).permit(:code, :name, :address, :locale, :user_id, :parent_id, :currency,
|
60
|
-
:country_id, :tax_code, :vat_number, consignees: [])
|
59
|
+
params.require(:payload).permit(:code, :name, :match_code, :address, :locale, :user_id, :parent_id, :currency,
|
60
|
+
:subsidiary, :country_id, :tax_code, :vat_number, consignees: [])
|
61
61
|
end
|
62
62
|
|
63
63
|
def agent_params
|
@@ -9,7 +9,7 @@ module Comee
|
|
9
9
|
has_and_belongs_to_many :agents, join_table: :comee_core_clients_agents
|
10
10
|
has_many :client_warehouses
|
11
11
|
|
12
|
-
validates :code, :name, :address, :locale, presence: true
|
12
|
+
validates :code, :name, :match_code, :address, :locale, presence: true
|
13
13
|
validates :code, uniqueness: true
|
14
14
|
|
15
15
|
delegate(:name, to: :user, prefix: true, allow_nil: true)
|
@@ -12,6 +12,17 @@ module Comee
|
|
12
12
|
|
13
13
|
validates :name, :address_line1, :address_type, presence: true
|
14
14
|
validates :address_type, inclusion: {in: ADDRESS_TYPES}
|
15
|
+
|
16
|
+
validate :validate_default
|
17
|
+
|
18
|
+
def validate_default
|
19
|
+
return unless client && address_type
|
20
|
+
|
21
|
+
default_count = ClientAddress.where(address_type: address_type, client: client, default: true).count
|
22
|
+
return if default_count.zero?
|
23
|
+
|
24
|
+
errors.add(:default, "cannot be set to true. There is already a default address for this client and address type.")
|
25
|
+
end
|
15
26
|
end
|
16
27
|
end
|
17
28
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module Comee
|
2
2
|
module Core
|
3
3
|
class ClientAddressSerializer < ActiveModel::Serializer
|
4
|
-
attributes :id, :name, :address_line1, :street, :city, :state, :country_id, :postal_code, :address_type,
|
4
|
+
attributes :id, :name, :address_line1, :street, :city, :state, :country_id, :postal_code, :address_type,
|
5
|
+
:client_id, :default
|
5
6
|
|
6
7
|
belongs_to :client
|
7
8
|
belongs_to :country
|
@@ -1,8 +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, :consignees,
|
5
|
-
:tax_code, :vat_number, :currency
|
4
|
+
attributes :id, :code, :name, :match_code, :address, :locale, :user_id, :user_name, :parent_id, :consignees,
|
5
|
+
:shipment_addresses, :tax_code, :vat_number, :currency
|
6
6
|
belongs_to :parent
|
7
7
|
belongs_to :country
|
8
8
|
has_many :agents
|
@@ -4,6 +4,7 @@ class CreateComeeCoreProducts < ActiveRecord::Migration[7.0]
|
|
4
4
|
t.string :code, null: false
|
5
5
|
t.string :name, null: false
|
6
6
|
t.string :description
|
7
|
+
t.string :customs_description, null: false
|
7
8
|
t.boolean :leaf, null: false, default: true
|
8
9
|
t.string :ancestry
|
9
10
|
t.jsonb :preferred_units, null: false, default: []
|
@@ -5,6 +5,9 @@ class CreateComeeCoreSuppliers < ActiveRecord::Migration[7.0]
|
|
5
5
|
t.string :name, null: false
|
6
6
|
t.string :address, null: false
|
7
7
|
t.string :locale, null: false, default: "en"
|
8
|
+
t.string :payment_terms, null: false, default: "30 Days Net"
|
9
|
+
t.string :vat_number
|
10
|
+
t.string :tax_code
|
8
11
|
t.references :currency,
|
9
12
|
null: true,
|
10
13
|
index: {name: "currency_on_ccs_indx"},
|
@@ -7,8 +7,11 @@ class CreateComeeCoreClients < ActiveRecord::Migration[7.0]
|
|
7
7
|
foreign_key: {to_table: :comee_core_users}
|
8
8
|
t.string :code, null: false
|
9
9
|
t.string :name, null: false
|
10
|
+
t.string :match_code, null: false
|
10
11
|
t.string :address, null: false
|
11
12
|
t.string :locale, null: false, default: "en"
|
13
|
+
t.string :tax_code
|
14
|
+
t.string :vat_number
|
12
15
|
t.references :parent,
|
13
16
|
null: true,
|
14
17
|
index: {name: "so_on_ccc_indx"},
|
@@ -19,6 +22,10 @@ class CreateComeeCoreClients < ActiveRecord::Migration[7.0]
|
|
19
22
|
null: true,
|
20
23
|
index: {name: "currency_on_ccc_indx"},
|
21
24
|
foreign_key: {to_table: :comee_core_currencies}
|
25
|
+
t.references :country,
|
26
|
+
null: true,
|
27
|
+
index: {name: "country_on_ccc_indx"},
|
28
|
+
foreign_key: {to_table: :comee_core_lookups}
|
22
29
|
|
23
30
|
t.boolean :subsidiary, default: false
|
24
31
|
t.timestamps
|
@@ -2,6 +2,7 @@ class CreateComeeCorePurchaseOrders < ActiveRecord::Migration[7.1]
|
|
2
2
|
def change
|
3
3
|
create_table :comee_core_purchase_orders do |t|
|
4
4
|
t.string :po_number, null: false
|
5
|
+
t.string :order_reference
|
5
6
|
t.references :supplier,
|
6
7
|
null: false,
|
7
8
|
index: {name: "suppliers_on_ccpo_indx"},
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class CreateComeeCorePurchaseOrderItems < ActiveRecord::Migration[7.1]
|
2
2
|
def change
|
3
3
|
create_table :comee_core_purchase_order_items do |t|
|
4
|
+
t.integer :serial_no, null: false, default: 1
|
4
5
|
t.references :purchase_order,
|
5
6
|
null: false,
|
6
7
|
index: {name: "pos_on_ccpoitm_indx"},
|
@@ -14,6 +14,7 @@ class CreateComeeCoreCustomerOrderItems < ActiveRecord::Migration[7.1]
|
|
14
14
|
index: {name: "unit_on_cccuoi_indx"},
|
15
15
|
foreign_key: {to_table: :comee_core_units}
|
16
16
|
t.string :customer_item_no, null: false
|
17
|
+
t.integer :serial_no, null: false, default: 1
|
17
18
|
t.string :customer_item_description, null: false
|
18
19
|
t.float :quantity, null: false, default: 0
|
19
20
|
t.float :price, null: false, default: 0
|
@@ -29,6 +29,7 @@ class CreateComeeCoreSalesOrders < ActiveRecord::Migration[7.0]
|
|
29
29
|
t.string :delivery_term
|
30
30
|
t.float :payment_penalty, default: 0
|
31
31
|
t.integer :status, null: false, default: 0
|
32
|
+
t.integer :purchase_status, null: false, default: 0
|
32
33
|
t.float :total_price, default: 0.0
|
33
34
|
t.float :amount_paid, default: 0.0
|
34
35
|
t.string :pallete_note
|
@@ -26,6 +26,7 @@ class CreateComeeCoreSalesOrderItems < ActiveRecord::Migration[7.0]
|
|
26
26
|
index: {name: "poi_on_ccsoi_indx"},
|
27
27
|
foreign_key: {to_table: :comee_core_purchase_order_items}
|
28
28
|
t.string :customer_item_no, null: false
|
29
|
+
t.integer :serial_no, null: false, default: 1
|
29
30
|
t.string :customer_item_description, null: false
|
30
31
|
t.float :quantity, null: false
|
31
32
|
t.float :quantity_delivered, null: false, default: 0
|
@@ -10,6 +10,11 @@ class CreateComeeCoreMasterPrices < ActiveRecord::Migration[7.0]
|
|
10
10
|
t.boolean :primary, null: false, default: false
|
11
11
|
t.float :margin, null: false, default: 0
|
12
12
|
t.integer :lead_time
|
13
|
+
t.string :state_of_origin
|
14
|
+
t.references :country_of_origin,
|
15
|
+
null: true,
|
16
|
+
index: {name: "coo_on_ccmp_indx"},
|
17
|
+
foreign_key: {to_table: :comee_core_lookups}
|
13
18
|
t.references :product,
|
14
19
|
null: false,
|
15
20
|
index: {name: "product_on_ccmp_indx"},
|
@@ -27,6 +27,10 @@ class CreateComeeCoreCustomsDetails < ActiveRecord::Migration[7.1]
|
|
27
27
|
t.string :closure_mark4
|
28
28
|
t.string :closure_mark5
|
29
29
|
t.jsonb :transportation_route
|
30
|
+
t.string :mode_of_transport_at_border
|
31
|
+
t.string :mode_of_transport_nationality
|
32
|
+
t.string :type_of_identification
|
33
|
+
t.string :nationality
|
30
34
|
|
31
35
|
t.timestamps
|
32
36
|
end
|
@@ -6,6 +6,7 @@ class CreateComeeCorePurchaseRequisitions < ActiveRecord::Migration[7.1]
|
|
6
6
|
t.date :delivery_date
|
7
7
|
t.string :remark
|
8
8
|
t.integer :status, null: false, default: 0
|
9
|
+
t.integer :purchase_status, null: false, default: 0
|
9
10
|
t.float :total_price, null: false, default: 0
|
10
11
|
|
11
12
|
t.timestamps
|
@@ -5,6 +5,7 @@ class CreateComeeCoreClientAddresses < ActiveRecord::Migration[7.1]
|
|
5
5
|
null: false,
|
6
6
|
index: {name: "cl_on_ccca_indx"},
|
7
7
|
foreign_key: {to_table: :comee_core_clients}
|
8
|
+
t.string :name, null: false
|
8
9
|
t.string :address_line1, null: false
|
9
10
|
t.string :street
|
10
11
|
t.string :city
|
@@ -15,6 +16,7 @@ class CreateComeeCoreClientAddresses < ActiveRecord::Migration[7.1]
|
|
15
16
|
foreign_key: {to_table: :comee_core_lookups}
|
16
17
|
t.string :postal_code
|
17
18
|
t.string :address_type, null: false
|
19
|
+
t.boolean :default, default: false
|
18
20
|
|
19
21
|
t.timestamps
|
20
22
|
end
|
data/lib/comee/core/version.rb
CHANGED
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.
|
4
|
+
version: 0.2.90
|
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-06-
|
11
|
+
date: 2024-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -433,6 +433,7 @@ files:
|
|
433
433
|
- db/migrate/20230727091518_create_comee_core_fulfillment_centers.rb
|
434
434
|
- db/migrate/20230727153013_create_comee_core_units.rb
|
435
435
|
- db/migrate/20230728011037_create_comee_core_currencies.rb
|
436
|
+
- db/migrate/20230728011539_create_comee_core_lookups.rb
|
436
437
|
- db/migrate/20230728014322_create_comee_core_products.rb
|
437
438
|
- db/migrate/20230728122618_create_comee_core_suppliers.rb
|
438
439
|
- db/migrate/20230728123039_create_comee_core_clients.rb
|
@@ -458,7 +459,6 @@ files:
|
|
458
459
|
- db/migrate/20231121132709_create_comee_core_quotation_request_items.rb
|
459
460
|
- db/migrate/20231122094424_create_comee_core_external_rfqs.rb
|
460
461
|
- db/migrate/20231124120907_create_active_storage_tables.active_storage.rb
|
461
|
-
- db/migrate/20231125111539_create_comee_core_lookups.rb
|
462
462
|
- db/migrate/20231125115522_create_comee_core_customs_details.rb
|
463
463
|
- db/migrate/20231206082503_create_comee_core_unit_conversions.rb
|
464
464
|
- db/migrate/20231207153420_create_comee_core_shipment_items.rb
|
@@ -483,14 +483,7 @@ files:
|
|
483
483
|
- db/migrate/20240328132713_create_comee_core_payment_orders.rb
|
484
484
|
- db/migrate/20240328132921_create_comee_core_supplier_payments.rb
|
485
485
|
- db/migrate/20240407083617_create_comee_core_email_settings.rb
|
486
|
-
- db/migrate/20240425121701_add_purchase_status_to_sales_order_and_purchase_requisition.rb
|
487
486
|
- db/migrate/20240503040722_create_comee_core_client_addresses.rb
|
488
|
-
- db/migrate/20240515173010_add_serial_no_to_line_items.rb
|
489
|
-
- db/migrate/20240601094028_add_additional_fields.rb
|
490
|
-
- db/migrate/20240602171355_add_order_reference_to_purchase_order.rb
|
491
|
-
- db/migrate/20240604142805_add_serial_no_to_purchase_order_items.rb
|
492
|
-
- db/migrate/20240604155157_add_fields_to_customs_details.rb
|
493
|
-
- db/migrate/20240608094721_add_package_type_to_shipment_item.rb
|
494
487
|
- lib/comee/core.rb
|
495
488
|
- lib/comee/core/engine.rb
|
496
489
|
- lib/comee/core/version.rb
|
data/db/migrate/20240425121701_add_purchase_status_to_sales_order_and_purchase_requisition.rb
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
class AddPurchaseStatusToSalesOrderAndPurchaseRequisition < ActiveRecord::Migration[7.1]
|
2
|
-
def change
|
3
|
-
add_column :comee_core_sales_orders, :purchase_status, :integer, default: 0
|
4
|
-
add_column :comee_core_purchase_requisitions, :purchase_status, :integer, default: 0
|
5
|
-
end
|
6
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
class AddAdditionalFields < ActiveRecord::Migration[7.1]
|
2
|
-
def change
|
3
|
-
add_column :comee_core_client_addresses, :name, :string, null: false, default: "Default"
|
4
|
-
add_column :comee_core_products, :customs_description, :string, null: true
|
5
|
-
add_column :comee_core_suppliers, :payment_terms, :string, null: false, default: "30 Days Net"
|
6
|
-
add_column :comee_core_suppliers, :vat_number, :string, null: true
|
7
|
-
add_column :comee_core_suppliers, :tax_code, :string, null: true
|
8
|
-
add_column :comee_core_clients, :tax_code, :string, null: true
|
9
|
-
add_column :comee_core_clients, :vat_number, :string, null: true
|
10
|
-
add_column :comee_core_master_prices, :state_of_origin, :string, null: true
|
11
|
-
add_reference :comee_core_master_prices,
|
12
|
-
:country_of_origin,
|
13
|
-
null: true,
|
14
|
-
index: {name: "coo_on_ccmp_indx"},
|
15
|
-
foreign_key: {to_table: :comee_core_lookups}
|
16
|
-
add_reference :comee_core_clients,
|
17
|
-
:country,
|
18
|
-
null: true,
|
19
|
-
index: {name: "country_on_ccc_indx"},
|
20
|
-
foreign_key: {to_table: :comee_core_lookups}
|
21
|
-
reversible do |dir|
|
22
|
-
dir.up do
|
23
|
-
execute <<-SQL
|
24
|
-
UPDATE comee_core_products
|
25
|
-
SET customs_description = description
|
26
|
-
SQL
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
change_column_null :comee_core_products, :customs_description, false
|
31
|
-
end
|
32
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
class AddFieldsToCustomsDetails < ActiveRecord::Migration[7.1]
|
2
|
-
def change
|
3
|
-
add_column :comee_core_customs_details, :mode_of_transport_at_border, :string
|
4
|
-
add_column :comee_core_customs_details, :mode_of_transport_nationality, :string
|
5
|
-
add_column :comee_core_customs_details, :type_of_identification, :string
|
6
|
-
add_column :comee_core_customs_details, :nationality, :string
|
7
|
-
end
|
8
|
-
end
|
File without changes
|