cats_core 1.3.25 → 1.3.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/cats/core/commodity.rb +12 -2
- data/app/models/cats/core/donation.rb +1 -1
- data/app/models/cats/core/gift_certificate.rb +3 -1
- data/app/models/cats/core/purchase_order.rb +1 -0
- data/db/migrate/20210717032330_create_cats_core_donations.rb +2 -0
- data/db/migrate/20210717032602_create_cats_core_gift_certificates.rb +7 -0
- data/lib/cats/core/version.rb +1 -1
- data/spec/factories/cats/core/donations.rb +2 -0
- data/spec/factories/cats/core/gift_certificates.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80cc6224c33fc3ce6d25d558a188ae7db720f032ae1dd18c39d2f74f67257eab
|
4
|
+
data.tar.gz: d866310b1bc91bc269538f80b9f944e3a2a4e1b6338490c209a74d343d897214
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79355635f4c3fe924a112d88967a39140c47dd864b6ee3bb565093e8ec6768c8d973695dad89c822a69f2ae1bd5ff77e3650a7a05b4073ebeb73cb60ed04065
|
7
|
+
data.tar.gz: 0c66c37c48a2791a5726b107d840dcaddb6012f79d8998839d7995535cde0e5e89ca0b0198e5d0da5431d8a4e6e6fedd238c244e2816ae6f7ad24e897f3e17cc
|
@@ -14,9 +14,19 @@ module Cats
|
|
14
14
|
|
15
15
|
# Arrival Statuses
|
16
16
|
AT_SOURCE = 'At Source'.freeze
|
17
|
-
|
17
|
+
AT_ORIGIN_PORT = 'At Origin Port'.freeze
|
18
|
+
IN_LOCAL_TRANSIT = 'In Local Transit'.freeze
|
19
|
+
IN_INTERNATIONAL_TRANSIT = 'In International Transit'.freeze
|
20
|
+
AT_DESTINATION_PORT = 'At Destination Port'.freeze
|
18
21
|
ARRIVED = 'Arrived'.freeze
|
19
|
-
ARRIVAL_STATUSES = [
|
22
|
+
ARRIVAL_STATUSES = [
|
23
|
+
AT_SOURCE,
|
24
|
+
AT_ORIGIN_PORT,
|
25
|
+
IN_LOCAL_TRANSIT,
|
26
|
+
IN_INTERNATIONAL_TRANSIT,
|
27
|
+
AT_DESTINATION_PORT,
|
28
|
+
ARRIVED
|
29
|
+
].freeze
|
20
30
|
|
21
31
|
belongs_to :unit_of_measure
|
22
32
|
belongs_to :source, polymorphic: true
|
@@ -11,7 +11,7 @@ module Cats
|
|
11
11
|
belongs_to :commodity_category, optional: true
|
12
12
|
belongs_to :unit_of_measure, optional: true
|
13
13
|
|
14
|
-
validates :reference_no, :amount, :donation_type, :donated_on, presence: true
|
14
|
+
validates :reference_no, :amount, :donation_type, :donated_on, :agency, presence: true
|
15
15
|
validates :reference_no, uniqueness: true
|
16
16
|
validates :donation_type, inclusion: { in: DONATION_TYPES }
|
17
17
|
validates :currency, presence: true, if: -> { donation_type == CASH }
|
@@ -4,12 +4,14 @@ module Cats
|
|
4
4
|
belongs_to :donation, optional: true
|
5
5
|
belongs_to :commodity_category
|
6
6
|
belongs_to :unit_of_measure
|
7
|
+
belongs_to :destination_warehouse, class_name: 'Cats::Core::Location'
|
7
8
|
|
8
9
|
validates :reference_no, presence: true, uniqueness: true
|
9
|
-
validates :gift_date, :quantity, presence: true
|
10
|
+
validates :gift_date, :quantity, :requested_by, :request_reference, presence: true
|
10
11
|
validates :quantity, numericality: { greater_than: 0 }
|
11
12
|
|
12
13
|
delegate(:name, to: :commodity_category, prefix: true)
|
14
|
+
delegate(:name, to: :destination_warehouse, prefix: true)
|
13
15
|
delegate(:abbreviation, to: :unit_of_measure, prefix: true)
|
14
16
|
|
15
17
|
before_validation :set_commodity_category
|
@@ -4,7 +4,9 @@ class CreateCatsCoreDonations < ActiveRecord::Migration[6.1]
|
|
4
4
|
t.string :reference_no, unique: true
|
5
5
|
t.string :description
|
6
6
|
t.string :donation_type, null: false
|
7
|
+
t.string :shipping_reference
|
7
8
|
t.date :donated_on, null: false
|
9
|
+
t.string :agency, null: false
|
8
10
|
t.references :donor,
|
9
11
|
null: false,
|
10
12
|
index: { name: 'donor_on_donation_indx' },
|
@@ -24,8 +24,15 @@ class CreateCatsCoreGiftCertificates < ActiveRecord::Migration[6.1]
|
|
24
24
|
null: false,
|
25
25
|
index: { name: 'uom_on_gc_indx' },
|
26
26
|
foreign_key: { to_table: :cats_core_unit_of_measures }
|
27
|
+
t.references :destination_warehouse,
|
28
|
+
null: false,
|
29
|
+
index: { name: 'dw_on_gc_indx' },
|
30
|
+
foreign_key: { to_table: :cats_core_locations }
|
27
31
|
t.float :estimated_price
|
28
32
|
t.float :estimated_tax
|
33
|
+
t.string :registration_no
|
34
|
+
t.string :requested_by, null: false
|
35
|
+
t.string :request_reference, null: false
|
29
36
|
|
30
37
|
t.timestamps
|
31
38
|
end
|
data/lib/cats/core/version.rb
CHANGED
@@ -5,6 +5,7 @@ FactoryBot.define do
|
|
5
5
|
donation
|
6
6
|
commodity_category { donation.commodity_category }
|
7
7
|
unit_of_measure
|
8
|
+
destination_warehouse factory: :warehouse
|
8
9
|
vessel { FFaker::Name.name }
|
9
10
|
port { FFaker::Name.name }
|
10
11
|
customs_declaration_no { FFaker::Name.name }
|
@@ -14,5 +15,8 @@ FactoryBot.define do
|
|
14
15
|
quantity { 1.5 }
|
15
16
|
estimated_price { 1.5 }
|
16
17
|
estimated_tax { 1.5 }
|
18
|
+
registration_no { FFaker::Name.name }
|
19
|
+
requested_by { FFaker::Name.name }
|
20
|
+
request_reference { FFaker::Name.name }
|
17
21
|
end
|
18
22
|
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.3.
|
4
|
+
version: 1.3.29
|
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-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|