cats_core 1.0.44 → 1.0.45

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13bc9433b974cded9d6145d8bffc52e7669f3688b70ee861e5ad2c74110c3d2c
4
- data.tar.gz: b8cdd5dae74d00d59ae9a75bf63aed63a8873dbd3a578b14c953ea2c52235a3a
3
+ metadata.gz: 296c1ea2692ccbfda9597044d6dd6f92a26dae42d008448d492a38b746906bc5
4
+ data.tar.gz: 37594e0dff5425a1f6e037cf427793b1ca6af54b6fe1b2a04e00b139a96b5417
5
5
  SHA512:
6
- metadata.gz: 2ae137b536163fbf766211a80ef278eebd5b4ab45023076b9c429594dd08cc5a976ad07bf3a063b11a3d601968112cd274385a54f1578cc10f9126589bfdb7a4
7
- data.tar.gz: 1433945abdd51c8a3f367920cb7ebe63d291d71448f7d617324352c9bc958a16abfe3ae888f4237e42274db0dcc9f59e4fb4a626ebc13e0a6dc8a09373f9058f
6
+ metadata.gz: af90696c4bfd02c65eb3b5d37a0be9a446d4a627e75c10ab2925d42038ff7113dfd2f56b8fd47403ffabeb106066e0644202f64cca49611956819eaf898989d3
7
+ data.tar.gz: '007480b8cb6ded9688d94736634593e3004e6a1dc874a9e34d05674b9580c937046922d6dffd9a1d812501d09c2a188f4929ad9f23371ac82d43664a14653c55'
@@ -1,11 +1,18 @@
1
1
  module Cats
2
2
  module Core
3
3
  class Dispatch < ApplicationRecord
4
+ DRAFT = 'Draft'.freeze
5
+ APPROVED = 'Approved'.freeze
6
+ STARTED = 'Started'.freeze
7
+
8
+ DISPATCH_STATUSES = [DRAFT, APPROVED, STARTED].freeze
9
+
4
10
  belongs_to :prepared_by, class_name: 'Cats::Core::User'
5
11
  belongs_to :transporter
6
12
  belongs_to :allocation_item
7
13
 
8
14
  validates :reference_no, :plate_no, :driver_name, :driver_phone, :quantity, :commodity_status, presence: true
15
+ validates :dispatch_status, presence: true, inclusion: { in: DISPATCH_STATUSES }
9
16
  validates :reference_no, uniqueness: true
10
17
  validates :quantity, numericality: { greater_than: 0 }
11
18
  validates :commodity_status, inclusion: { in: Cats::Core::Commodity::COMMODITY_STATUSES }
@@ -20,6 +20,7 @@ class CreateCatsCoreDispatches < ActiveRecord::Migration[6.1]
20
20
  null: false,
21
21
  index: { name: 'pb_on_dispatches_indx' },
22
22
  foreign_key: { to_table: :cats_core_users }
23
+ t.string :dispatch_status, null: false
23
24
 
24
25
  t.timestamps
25
26
  end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.0.44'.freeze
3
+ VERSION = '1.0.45'.freeze
4
4
  end
5
5
  end
@@ -9,5 +9,6 @@ FactoryBot.define do
9
9
  quantity { 50 }
10
10
  remark { FFaker::Name.name }
11
11
  prepared_by factory: :user
12
+ dispatch_status { Cats::Core::Dispatch::DRAFT }
12
13
  end
13
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cats_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.44
4
+ version: 1.0.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henock L.