comee_core 0.1.29 → 0.1.31
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/application_controller.rb +1 -0
- data/app/controllers/comee/core/client_prices_controller.rb +7 -0
- data/app/models/comee/core/back_order_item.rb +1 -1
- data/app/models/comee/core/edi_order.rb +8 -0
- data/app/models/comee/core/master_price.rb +5 -2
- data/db/migrate/20230728125723_create_comee_core_back_order_items.rb +1 -0
- data/db/migrate/20231101113358_create_comee_core_edi_orders.rb +10 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/back_order_items.rb +1 -0
- data/spec/factories/comee/core/clients.rb +1 -1
- data/spec/factories/comee/core/edi_orders.rb +6 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cd7848381270134d19787687f958edee66f77eaaeb6a04d72d422f0fcdf1ea9
|
4
|
+
data.tar.gz: 32408a7fb537503ec05947ed99b4547bbb2494af12884a1e11c031e6c577d0a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd8973d61ccb97551156b1d51707a07355ba32c8f6bd236052aac2e256af26c1477746f4bd95e71f291d4481d2f205e7de449af90afddc1dd81be336296215f1
|
7
|
+
data.tar.gz: 21f6968a9c21f32473eb09de2c468684c4557ea82510fe36ebe07aa6fcfe5261b93476bd5ddb2c50d9b2553c79b21cd505d03fe03a6f51d26f09227f0dd296ef
|
@@ -3,6 +3,13 @@ module Comee
|
|
3
3
|
class ClientPricesController < ApplicationController
|
4
4
|
include Comee::Core::Common
|
5
5
|
|
6
|
+
def index
|
7
|
+
super do
|
8
|
+
client_prices = Comee::Core::ClientPrice.all
|
9
|
+
client_prices.then(&paginate)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
6
13
|
def filter
|
7
14
|
@client_prices = Comee::Core::ClientPrice.ransack(params[:q]).result
|
8
15
|
render json: {success: true, data: serialize(@client_prices)}
|
@@ -6,7 +6,7 @@ module Comee
|
|
6
6
|
belongs_to :back_order
|
7
7
|
belongs_to :product
|
8
8
|
|
9
|
-
validates :item_status, :from, :to, presence: true
|
9
|
+
validates :item_status, :from, :to, :delivery_date, presence: true
|
10
10
|
validates :requested_quantity, :requested_unit_price, :supplier_quantity, :supplier_unit_price,
|
11
11
|
presence: true, numericality: {greater_than: 0}
|
12
12
|
|
@@ -14,8 +14,11 @@ module Comee
|
|
14
14
|
def validate_primary_price
|
15
15
|
return unless product && primary
|
16
16
|
|
17
|
-
count = MasterPrice.where(product: product, primary: true,
|
18
|
-
|
17
|
+
count = MasterPrice.where(product: product, primary: true, status: MasterPrice.statuses[:current]).count
|
18
|
+
return unless count.positive? && primary && MasterPrice.statuses[status] == MasterPrice.statuses[:current]
|
19
|
+
|
20
|
+
errors.add(:base,
|
21
|
+
"There is already a primary supplier for item '#{product.code}'")
|
19
22
|
end
|
20
23
|
|
21
24
|
def validate_purchase_price_validity_dates
|
@@ -15,6 +15,7 @@ class CreateComeeCoreBackOrderItems < ActiveRecord::Migration[7.0]
|
|
15
15
|
t.float :supplier_unit_price, null: false
|
16
16
|
t.date :from, null: false
|
17
17
|
t.date :to, null: false
|
18
|
+
t.date :delivery_date, null: false
|
18
19
|
t.integer :item_status, null: false, default: 0
|
19
20
|
t.string :remark
|
20
21
|
|
data/lib/comee/core/version.rb
CHANGED
@@ -6,6 +6,7 @@ FactoryBot.define do
|
|
6
6
|
requested_unit_price { 50 }
|
7
7
|
supplier_quantity { 5 }
|
8
8
|
supplier_unit_price { 55 }
|
9
|
+
delivery_date { Date.current.advance(days: 6) }
|
9
10
|
from { Date.current }
|
10
11
|
to { Date.current.advance(months: 1) }
|
11
12
|
item_status { Comee::Core::BackOrderItem.item_statuses[:available] }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
factory :client, class: "Comee::Core::Client" do
|
3
3
|
user
|
4
|
-
code { Faker::Alphanumeric.alpha(number: 8) }
|
4
|
+
code { Faker::Alphanumeric.unique.alpha(number: 8) }
|
5
5
|
name { Faker::Name.name }
|
6
6
|
address { Faker::Address.full_address }
|
7
7
|
locale { "en" }
|
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.31
|
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-11-
|
11
|
+
date: 2023-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop-rspec
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: shoulda-matchers
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,6 +268,7 @@ files:
|
|
254
268
|
- app/models/comee/core/client_order.rb
|
255
269
|
- app/models/comee/core/client_price.rb
|
256
270
|
- app/models/comee/core/currency.rb
|
271
|
+
- app/models/comee/core/edi_order.rb
|
257
272
|
- app/models/comee/core/field_mapping.rb
|
258
273
|
- app/models/comee/core/inventory.rb
|
259
274
|
- app/models/comee/core/invoice.rb
|
@@ -313,6 +328,7 @@ files:
|
|
313
328
|
- db/migrate/20231003073316_create_comee_core_inventories.rb
|
314
329
|
- db/migrate/20231003080017_create_comee_core_warehouse_shipments.rb
|
315
330
|
- db/migrate/20231004105455_create_comee_core_warehouse_shipment_items.rb
|
331
|
+
- db/migrate/20231101113358_create_comee_core_edi_orders.rb
|
316
332
|
- lib/comee/core.rb
|
317
333
|
- lib/comee/core/engine.rb
|
318
334
|
- lib/comee/core/version.rb
|
@@ -324,6 +340,7 @@ files:
|
|
324
340
|
- spec/factories/comee/core/client_prices.rb
|
325
341
|
- spec/factories/comee/core/clients.rb
|
326
342
|
- spec/factories/comee/core/currencies.rb
|
343
|
+
- spec/factories/comee/core/edi_orders.rb
|
327
344
|
- spec/factories/comee/core/field_mappings.rb
|
328
345
|
- spec/factories/comee/core/inventories.rb
|
329
346
|
- spec/factories/comee/core/invoice_items.rb
|