comee_core 0.1.59 → 0.1.61

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: bc17265c097efde637f01ce47d802dc358d7c4eee301d3b607a8f7d1ce71796b
4
- data.tar.gz: e74e207006b6aec49ce1d0058331aeb440d200fd430bc9577c02c36fec52e8f2
3
+ metadata.gz: c663809128b4a531924cc39cc2b2acdc2ebcc13bf0a58c7baee7ea495c81baa2
4
+ data.tar.gz: 3d0b2fa555567992df840625f61b774b6b0484325a40692b0c344617a1b0e1db
5
5
  SHA512:
6
- metadata.gz: b62c8b0421cdf260ea4b5fc152cedd7edac43dca8af1f56709a1523be5926dd7a15f7d398ea1b17363a50ef982b30e781d90de7bb807cb29bdad89d30b911dc3
7
- data.tar.gz: aa49013dea68988bb5cb45d582f68238b1226ab00c5cedb8f3bcaaf1560c963cbf74f942d249a99b2b24f0533b6250edda517136e8c2d367b6df01b1204a72fa
6
+ metadata.gz: ca3073726cb726242aad1bc47e0fae40ecfa56ff8fb2c1e3886d5d93ad47bc190dbce1051aa284bfc0410c42c3586b95f0a535e10f33ef80c1688b4e8ad3933a
7
+ data.tar.gz: 27c36425bbf84ecb5b6e3041659a55478737c96f23f2e8039150ce30033d3432b5f8f56131e2ea58b404a4b5aefcbf7911e3c920e268c11897c754f920dcb328
@@ -12,6 +12,7 @@ module Comee
12
12
 
13
13
  def filter
14
14
  @client_prices = Comee::Core::ClientPrice.ransack(params[:q]).result
15
+ @client_prices = @client_prices.then(&paginate)
15
16
  render json: {success: true, data: serialize(@client_prices)}
16
17
  end
17
18
 
@@ -3,6 +3,11 @@ module Comee
3
3
  class ItemStatusesController < ApplicationController
4
4
  include Common
5
5
 
6
+ def filter
7
+ @item_statuses = Comee::Core::ItemStatus.ransack(params[:q]).result
8
+ render json: {success: true, data: serialize(@item_statuses)}
9
+ end
10
+
6
11
  private
7
12
 
8
13
  def model_params
@@ -10,8 +10,9 @@ module Comee
10
10
  end
11
11
 
12
12
  def filter
13
- query = QuotationRequest.ransack(params[:q])
14
- render json: {success: true, data: serialize(query.result.includes(:client))}
13
+ query = QuotationRequest.ransack(params[:q]).result
14
+ query = query.then(&paginate)
15
+ render json: {success: true, data: serialize(query.includes(:client))}
15
16
  end
16
17
 
17
18
  def rfq_products_for_client
@@ -70,7 +71,7 @@ module Comee
70
71
 
71
72
  def rfq_params
72
73
  params.require(:payload).permit(:client_id, :order_number, :order_date, :delivery_address, :invoice_address,
73
- items: %i[product_id unit_id quantity expected_delivery_date])
74
+ items: %i[product_id unit_id customer_item_no quantity expected_delivery_date])
74
75
  end
75
76
  end
76
77
  end
@@ -8,6 +8,10 @@ module Comee
8
8
  belongs_to :sales_order_item
9
9
 
10
10
  validates :hash_code, :status, :status_date, presence: true
11
+
12
+ def self.ransackable_attributes(_auth_object = nil)
13
+ %w[hash_code status status_date sales_order_item_id]
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -1,9 +1,8 @@
1
1
  module Comee
2
2
  module Core
3
3
  class CustomerOrderItemSerializer < ActiveModel::Serializer
4
- attributes :id, :customer_item_no, :quantity, :price, :delivery_date, :canceled
4
+ attributes :id, :customer_item_no, :quantity, :price, :delivery_date, :canceled, :product, :unit
5
5
  belongs_to :product
6
- belongs_to :customer_order
7
6
  belongs_to :unit
8
7
  end
9
8
  end
@@ -1,8 +1,7 @@
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
5
- belongs_to :client
4
+ attributes :id, :order_number, :order_date, :order_terms, :delivery_address, :invoice_address, :status, :file_url, :client
6
5
  has_many :customer_order_items
7
6
  end
8
7
  end
@@ -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, :discount, :valid_from, :valid_to
4
+ attributes :id, :customer_item_no, :price, :discount, :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,8 +2,8 @@ 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
6
- belongs_to :sales_order
5
+ :action_note, :po_reference, :product, :unit
6
+
7
7
  belongs_to :customer_order_item
8
8
  belongs_to :source
9
9
  belongs_to :unit
data/config/routes.rb CHANGED
@@ -92,4 +92,5 @@ Comee::Core::Engine.routes.draw do
92
92
  end
93
93
  resources :customs_details
94
94
  resources :item_statuses
95
+ post "/item_statuses/filter", controller: :item_statuses, action: :filter
95
96
  end
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.1.59".freeze
3
+ VERSION = "0.1.61".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comee_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.59
4
+ version: 0.1.61
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.