cats_core 1.1.6 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/cats/core/dispatch_transactions_controller.rb +5 -0
- data/app/controllers/cats/core/locations_controller.rb +5 -0
- data/app/controllers/cats/core/receipt_transactions_controller.rb +5 -0
- data/app/controllers/cats/core/receipts_controller.rb +2 -2
- data/app/serializers/cats/core/commodity_serializer.rb +9 -0
- data/app/serializers/cats/core/location_serializer.rb +1 -1
- data/app/services/cats/core/receipt_service.rb +1 -1
- data/config/routes.rb +7 -3
- data/lib/cats/core/version.rb +1 -1
- data/lib/cats_core.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad7b5e46d923da177a938b7b5728a731a9ce0dc5368bd3c9acae0670a713cbab
|
4
|
+
data.tar.gz: 07b751a5a1eb18a7a3f9e4f4893ea1b21a9ac74c99c4e975c6fb132861e322b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca48a9753bfcaabe058712978d76f725502f89b3f4cdff386739dc881e3c737dcda23715b0dbb1cbdb7734c85275c5c0c135bb5a53e844a2eb61b4e3a17757eb
|
7
|
+
data.tar.gz: 2f0626ceca03fd6203818f948b5c98ee94161aa6014df76de98836d1a5d8be6c1939df2b23dc0ae7c8f9a9cd9fc6f59c1e5791f0bc6f776ff35e53494dd547f2
|
@@ -3,6 +3,11 @@ module Cats
|
|
3
3
|
class DispatchTransactionsController < ApplicationController
|
4
4
|
include Common
|
5
5
|
|
6
|
+
def index
|
7
|
+
transactions = Cats::Core::DispatchTransaction.where(destination_id: params[:id])
|
8
|
+
render json: { success: true, data: serialize(transactions) }
|
9
|
+
end
|
10
|
+
|
6
11
|
private
|
7
12
|
|
8
13
|
def model_params
|
@@ -13,6 +13,11 @@ module Cats
|
|
13
13
|
render json: { success: true, data: serialize(parent.children) }
|
14
14
|
end
|
15
15
|
|
16
|
+
def filter
|
17
|
+
query = Cats::Core::Location.ransack(params[:q])
|
18
|
+
render json: { success: true, data: serialize(query.result) }
|
19
|
+
end
|
20
|
+
|
16
21
|
private
|
17
22
|
|
18
23
|
def model_params
|
@@ -3,6 +3,11 @@ module Cats
|
|
3
3
|
class ReceiptTransactionsController < ApplicationController
|
4
4
|
include Common
|
5
5
|
|
6
|
+
def index
|
7
|
+
transactions = Cats::Core::ReceiptTransaction.where(source_id: params[:id])
|
8
|
+
render json: { success: true, data: serialize(transactions) }
|
9
|
+
end
|
10
|
+
|
6
11
|
private
|
7
12
|
|
8
13
|
def model_params
|
@@ -17,10 +17,10 @@ module Cats
|
|
17
17
|
render json: { success: false, error: e.message }
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def finish_stacking
|
21
21
|
receipt = Cats::Core::Receipt.find(params[:id])
|
22
22
|
service = ReceiptService.new
|
23
|
-
result = service.
|
23
|
+
result = service.finish_stacking(receipt)
|
24
24
|
render json: { success: true, data: serialize(result) }
|
25
25
|
rescue StandardError => e
|
26
26
|
render json: { success: false, error: e.message }
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class CommoditySerializer < ActiveModel::Serializer
|
4
|
+
attributes :id, :batch_no, :description, :unit_of_measure_id, :unit_of_measure_abbreviation, :source_id,
|
5
|
+
:source_type, :source_reference_no, :quantity, :best_use_before, :volume_per_metric_ton,
|
6
|
+
:commodity_category_id, :commodity_category_name, :arrival_status, :approved
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
data/config/routes.rb
CHANGED
@@ -23,6 +23,8 @@ Cats::Core::Engine.routes.draw do
|
|
23
23
|
get 'warehouses', controller: :users, action: :warehouses
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
post '/locations/filter', controller: :locations, action: :filter
|
26
28
|
resources :locations, except: %i[destroy] do
|
27
29
|
member do
|
28
30
|
get 'children'
|
@@ -59,6 +61,7 @@ Cats::Core::Engine.routes.draw do
|
|
59
61
|
get '/dispatches/search', controller: :dispatches, action: :search, as: :search_dispatches
|
60
62
|
resources :dispatches, except: %i[index destroy] do
|
61
63
|
member do
|
64
|
+
get 'transactions', controller: :dispatch_transactions, action: :index
|
62
65
|
get 'receipts', controller: :receipts, action: :index
|
63
66
|
get 'commodity'
|
64
67
|
post 'approve'
|
@@ -66,12 +69,13 @@ Cats::Core::Engine.routes.draw do
|
|
66
69
|
post 'confirm'
|
67
70
|
end
|
68
71
|
end
|
69
|
-
resources :dispatch_transactions, except: %i[new edit destroy]
|
72
|
+
resources :dispatch_transactions, except: %i[index new edit destroy]
|
70
73
|
resources :receipts, except: %i[index new edit destroy] do
|
71
74
|
member do
|
75
|
+
get 'transactions', controller: :receipt_transactions, action: :index
|
72
76
|
post 'start_stacking'
|
73
|
-
post '
|
77
|
+
post 'finish_stacking'
|
74
78
|
end
|
75
79
|
end
|
76
|
-
resources :receipt_transactions, except: %i[new edit destroy]
|
80
|
+
resources :receipt_transactions, except: %i[index new edit destroy]
|
77
81
|
end
|
data/lib/cats/core/version.rb
CHANGED
data/lib/cats_core.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cats_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.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: 2021-09-
|
11
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 6.1.4
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: ransack
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.4.2
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.4.2
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rolify
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -273,6 +287,7 @@ files:
|
|
273
287
|
- app/models/cats/core/user.rb
|
274
288
|
- app/notifications/cats/core/simple_notification.rb
|
275
289
|
- app/serializers/cats/core/commodity_category_serializer.rb
|
290
|
+
- app/serializers/cats/core/commodity_serializer.rb
|
276
291
|
- app/serializers/cats/core/currency_serializer.rb
|
277
292
|
- app/serializers/cats/core/dispatch_serializer.rb
|
278
293
|
- app/serializers/cats/core/dispatch_transaction_serializer.rb
|