cats_core 1.3.35 → 1.3.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cats/core/lost_commodities_controller.rb +16 -0
- data/app/models/cats/core/lost_commodity.rb +10 -0
- data/app/serializers/cats/core/lost_commodity_serializer.rb +7 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20220221041505_create_cats_core_lost_commodities.rb +15 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/lost_commodities.rb +8 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7d2738616bb04e122c03cb503fe91bb1d8cb818c2ef909516d2e506efcad01c
|
4
|
+
data.tar.gz: 7363415368111fa228b7d552f030bdce90009940c62365a27b9408d29745a21b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04a0d21b349fe67c2367204df7dc876bd0ec250753124873583b387f035fe1290a7bb503f8aad9184dd8df6fddd787aaa785fd0f1e281e12c4b0f2a6320871f
|
7
|
+
data.tar.gz: d0104ee1c25f2fa50e196c0daa671c30fbed484cb370116919bc01403e68d736595a0ab17c83f2b2f0921bff87d319840035f99ee6cfd3d20c55d93817a29595
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Cats
|
2
|
+
module Core
|
3
|
+
class LostCommoditiesController < ApplicationController
|
4
|
+
include Common
|
5
|
+
|
6
|
+
def index
|
7
|
+
data = LostCommodity.where(receipt_id: params[:id])
|
8
|
+
render json: { success: true, data: serialize(data) }
|
9
|
+
end
|
10
|
+
|
11
|
+
def model_params
|
12
|
+
params.require(:payload).permit(:receipt_id, :quantity, :commodity_status, :remark)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/config/routes.rb
CHANGED
@@ -103,9 +103,11 @@ Cats::Core::Engine.routes.draw do
|
|
103
103
|
resources :receipts, except: %i[index new edit destroy] do
|
104
104
|
member do
|
105
105
|
get 'transactions', controller: :receipt_transactions, action: :index
|
106
|
+
get 'lost', controller: :lost_commodities, action: :index
|
106
107
|
post 'start_stacking'
|
107
108
|
post 'finish_stacking'
|
108
109
|
end
|
109
110
|
end
|
110
111
|
resources :receipt_transactions, except: %i[index new edit destroy]
|
112
|
+
resources :lost_commodities, except: %i[index destroy]
|
111
113
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateCatsCoreLostCommodities < ActiveRecord::Migration[7.0]
|
2
|
+
def change
|
3
|
+
create_table :cats_core_lost_commodities do |t|
|
4
|
+
t.references :receipt,
|
5
|
+
null: false,
|
6
|
+
index: { name: 'lc_on_receipt_indx' },
|
7
|
+
foreign_key: { to_table: :cats_core_receipts }
|
8
|
+
t.float :quantity, null: false
|
9
|
+
t.string :commodity_status, null: false
|
10
|
+
t.string :remark
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/cats/core/version.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.3.
|
4
|
+
version: 1.3.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- app/controllers/cats/core/dispatch_transactions_controller.rb
|
240
240
|
- app/controllers/cats/core/dispatches_controller.rb
|
241
241
|
- app/controllers/cats/core/locations_controller.rb
|
242
|
+
- app/controllers/cats/core/lost_commodities_controller.rb
|
242
243
|
- app/controllers/cats/core/menus_controller.rb
|
243
244
|
- app/controllers/cats/core/notifications_controller.rb
|
244
245
|
- app/controllers/cats/core/receipt_transactions_controller.rb
|
@@ -269,6 +270,7 @@ files:
|
|
269
270
|
- app/models/cats/core/gift_certificate.rb
|
270
271
|
- app/models/cats/core/hub_authorization.rb
|
271
272
|
- app/models/cats/core/location.rb
|
273
|
+
- app/models/cats/core/lost_commodity.rb
|
272
274
|
- app/models/cats/core/menu.rb
|
273
275
|
- app/models/cats/core/menu_item.rb
|
274
276
|
- app/models/cats/core/monthly_plan.rb
|
@@ -320,6 +322,7 @@ files:
|
|
320
322
|
- app/serializers/cats/core/dispatch_serializer.rb
|
321
323
|
- app/serializers/cats/core/dispatch_transaction_serializer.rb
|
322
324
|
- app/serializers/cats/core/location_serializer.rb
|
325
|
+
- app/serializers/cats/core/lost_commodity_serializer.rb
|
323
326
|
- app/serializers/cats/core/receipt_serializer.rb
|
324
327
|
- app/serializers/cats/core/receipt_transaction_serializer.rb
|
325
328
|
- app/serializers/cats/core/role_menu_serializer.rb
|
@@ -393,6 +396,7 @@ files:
|
|
393
396
|
- db/migrate/20220107125025_create_cats_core_monthly_plan_items.rb
|
394
397
|
- db/migrate/20220107132433_create_cats_core_monthly_plan_item_details.rb
|
395
398
|
- db/migrate/20220209083928_create_cats_core_hub_authorizations.rb
|
399
|
+
- db/migrate/20220221041505_create_cats_core_lost_commodities.rb
|
396
400
|
- lib/cats/core.rb
|
397
401
|
- lib/cats/core/engine.rb
|
398
402
|
- lib/cats/core/version.rb
|
@@ -415,6 +419,7 @@ files:
|
|
415
419
|
- spec/factories/cats/core/gift_certificates.rb
|
416
420
|
- spec/factories/cats/core/hub_authorizations.rb
|
417
421
|
- spec/factories/cats/core/locations.rb
|
422
|
+
- spec/factories/cats/core/lost_commodities.rb
|
418
423
|
- spec/factories/cats/core/menu_items.rb
|
419
424
|
- spec/factories/cats/core/menus.rb
|
420
425
|
- spec/factories/cats/core/monthly_plan_item_details.rb
|