comee_core 0.2.8 → 0.2.10

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: 71f18440aaa5414fe5fb11cf03c38c81b4a58f3c8130d59bd4927ca035479ee9
4
- data.tar.gz: 3e9392b406f61a347f057aec16a52b81ba53894170fb8c4c8c0dfa24854fa9fd
3
+ metadata.gz: 275dd64cebdedf362d37f4693eaeb8ced27c3569cdb3c90dbc37f0ae6d47e726
4
+ data.tar.gz: 16518da0b9c9bc06440d511b3aca1faca8e2bb820b919b9446ebfa66c89bc870
5
5
  SHA512:
6
- metadata.gz: 53234c4b8a684a64f1cb9e9fd7f45fb0a904854dee645fca3a44ed1ab0b07b82b97fd959464cec8e36736c0a2c4e8f1b921f22d353f2d331365d74dcb50514ea
7
- data.tar.gz: f664676dd16c43c037aca6340158b7913a51afd9075bd6e63c6fc79b570cb419715aba0c66b59f2f5e05b7bb7f27f2b05db555577e805a3f48ae3594e813db12
6
+ metadata.gz: 00ddf02a0dba120f9d9d406002cdf20f1fbb81b2810b0e25bb67a6bec4dce6826c72fefec945980e098bde0c0ea7f5a51d8955d0756d01dfea959af9fd31c199
7
+ data.tar.gz: 25dcc78f332c7946e8271e71ae44c6c89f7900522a6ce45fc1695f78ceab2e832d69ff0908c60a0fcb45a7a16d298632f2deeb8fe9ae4b5bcc5970bf3717928e
@@ -63,6 +63,12 @@ module Comee
63
63
  render_content(prices)
64
64
  end
65
65
 
66
+ def fetch_one
67
+ price = ClientPrice.includes(:client, :product, :unit, :product_lookup)
68
+ .find_by(client_id: params[:id], product_id: fetch_one_params[:product_id])
69
+ render_content(price)
70
+ end
71
+
66
72
  def approve
67
73
  price = ClientPrice.find(params[:id])
68
74
  price = price.approve
@@ -84,6 +90,10 @@ module Comee
84
90
  :unit_id)
85
91
  end
86
92
 
93
+ def fetch_one_params
94
+ params.permit(:product_id)
95
+ end
96
+
87
97
  def extend_params
88
98
  params.require(:payload).permit(:valid_to)
89
99
  end
@@ -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, :consignees, :shipment_addresses, :currency
4
+ attributes :id, :code, :name, :address, :locale, :user_id, :user_name, :parent_id, :consignees, :shipment_addresses,
5
+ :currency
5
6
  belongs_to :parent
6
7
  has_many :agents
7
8
  has_many :contacts
@@ -1,9 +1,10 @@
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, :product, :unit
4
+ attributes :id, :customer_item_no, :quantity, :price, :total_price, :delivery_date, :canceled
5
5
  belongs_to :product
6
6
  belongs_to :unit
7
+ belongs_to :customer_order
7
8
  end
8
9
  end
9
10
  end
data/config/routes.rb CHANGED
@@ -87,6 +87,7 @@ Comee::Core::Engine.routes.draw do
87
87
  get "shipment_items", controller: :shipment_items, action: :filter_for_client
88
88
  post "create_agent"
89
89
  post "create_contact"
90
+ post "price", controller: :client_prices, action: :fetch_one
90
91
  end
91
92
  collection do
92
93
  post "filter"
@@ -1,5 +1,5 @@
1
1
  module Comee
2
2
  module Core
3
- VERSION = "0.2.8".freeze
3
+ VERSION = "0.2.10".freeze
4
4
  end
5
5
  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.2.8
4
+ version: 0.2.10
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-26 00:00:00.000000000 Z
11
+ date: 2024-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers