cats_core 1.3.27 → 1.3.28
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/gift_certificate.rb +2 -1
- data/db/migrate/20210717032330_create_cats_core_donations.rb +1 -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 +1 -0
- data/spec/factories/cats/core/gift_certificates.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83f9bfdc22317ca433717055d41463cf8d70aed78994c62a9a924bcead85c561
|
4
|
+
data.tar.gz: ffcb5a3122bd29126aa6902388af57a8979b414fa8378f5bd9f4c364aea6029d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b77e70633822f0dcc6db6caedd36c1f7baecd232b466a1bc975c02b29c32e7129fd6d767e800a5dd1c7b17ff9e2da9250f74d136797591a9c19043b07bddd8d
|
7
|
+
data.tar.gz: 2d29e1087a864c93d57a050f5fa6df3ff993abd63b060604f88bc7d2df282aa94ca5f48e1183b852a2974c1e5c0b36d5fd94082f3517181f1a2023363fb819bb
|
@@ -4,9 +4,10 @@ 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)
|
@@ -4,6 +4,7 @@ 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
|
8
9
|
t.string :agency, null: false
|
9
10
|
t.references :donor,
|
@@ -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
|