cats_core 1.1.28 → 1.1.32

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: 3bb7f4884a8008cb1804e3b27f2dd5794209ea373d7a417a97efba3e4999fd2c
4
- data.tar.gz: d584449483c92b6c6b012de61fbeb89f330544fd1bba69737ff4bbc0fff5acae
3
+ metadata.gz: 38e415ba9c0ae6853fc377ab8cb33fd85c9d483cfda350f7f952f38593a794b6
4
+ data.tar.gz: eb94d3adf63d313fba9956ae5d2e2ab22656dc3d49e6bc2a90944a4998d0ba39
5
5
  SHA512:
6
- metadata.gz: 354676867bc3fa31abb3e368791e70e3ef97af8efe4900e55aa38200b0a3ca5cefb6c0b53ecd937df97eccbf90f86e3611956027505e954f9dd94436356cd382
7
- data.tar.gz: d804eb6c6735fc5179d3a48408a1b25be1b04a3e7fa9f323648a34051f2c1d64ed9f41fe09a7f7e7b9accc1eaf6de544a32f74bfe8f4e768a8cf865d7d144a4e
6
+ metadata.gz: 994251d466ed5b143b5fd138c10d446804f4d0f49bf7156f261cf4a9881f9bd944f38bc7b6ebeb31c07760f969a4345b76ebb3247aa6dce5b6483ccf0a559b72
7
+ data.tar.gz: 83d05eef310b8a97265144aab84e605b54d7164f2bccf110acf2f5ae52fe5d9b5806b4e7c243e0eda7fa2d5aee776ea299cabbb0ad5866df27adde5912c1b1b3
@@ -20,7 +20,7 @@ module Cats
20
20
  jwt = Cats::Core::TokenAuthService.issue(payload)
21
21
  render json: { token: jwt, user: payload }
22
22
  else
23
- rener json: { error: 'Invalid username or password.' }, status: 400
23
+ render json: { error: 'Invalid username or password.' }, status: 400
24
24
  end
25
25
  else
26
26
  render json: { error: 'User does not exist.' }, status: 400
@@ -20,7 +20,7 @@ module Cats
20
20
  validates :commodity_status, inclusion: { in: Cats::Core::Commodity::COMMODITY_STATUSES }
21
21
  validates :stack_status, inclusion: { in: STACK_STATUSES }
22
22
  validate :validate_coordinates, :validate_dimensions, :validate_distance_from_wall, :validate_overlap,
23
- :validate_space_between_stack
23
+ :validate_space_between_stack, unless: -> { store && store.code == 'SUP-STORE' }
24
24
 
25
25
  after_save :update_store_space
26
26
 
@@ -0,0 +1,28 @@
1
+ # To deliver this notification:
2
+ #
3
+ # AllocationNotification.with(post: @post).deliver_later(current_user)
4
+ # AllocationNotification.with(post: @post).deliver(current_user)
5
+
6
+ module Cats
7
+ module Core
8
+ class AllocationNotification < Noticed::Base
9
+ deliver_by :database
10
+
11
+ param :allocation_item
12
+
13
+ def message
14
+ allocation_item = params[:allocation_item]
15
+ title = 'Allocation Notification'
16
+ date = Date.today
17
+ body = <<~BODY
18
+ Commodity with the following specification has been allocated to you:
19
+ Batch No. = #{allocation_item.allocation.commodity.batch_no}
20
+ Commodity = #{allocation_item.allocation.commodity.name}
21
+ Quantity = #{allocation_item.quantity}
22
+ The commodity is expected to be delivered from #{allocation_item.from} to #{allocation_item.to}
23
+ BODY
24
+ { title: title, date: date, body: body }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,8 +1,8 @@
1
1
  module Cats
2
2
  module Core
3
3
  class DispatchTransactionSerializer < ActiveModel::Serializer
4
- attributes :id, :source_id, :source_code, :destination_id, :destination_reference_no, :quantity, :transaction_date,
5
- :status
4
+ attributes :id, :source_id, :source_code, :destination_id, :destination_reference_no, :quantity,
5
+ :transaction_date, :status
6
6
  end
7
7
  end
8
8
  end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.1.28'.freeze
3
+ VERSION = '1.1.32'.freeze
4
4
  end
5
5
  end
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.28
4
+ version: 1.1.32
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-10-10 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -286,6 +286,7 @@ files:
286
286
  - app/models/cats/core/transporter.rb
287
287
  - app/models/cats/core/unit_of_measure.rb
288
288
  - app/models/cats/core/user.rb
289
+ - app/notifications/cats/core/allocation_notification.rb
289
290
  - app/notifications/cats/core/dispatch_notification.rb
290
291
  - app/notifications/cats/core/simple_notification.rb
291
292
  - app/serializers/cats/core/commodity_category_serializer.rb