cats_core 1.2.36 → 1.2.40

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: 496524a19290b62ba488dca18f3d4f33c650e6af6702381e698cde2dbd6d9497
4
- data.tar.gz: e1ca7c19c73a9eb79aec8a25b4ea833501285dac8d715a4779e618f10e0bd519
3
+ metadata.gz: 382ef1926550e0ed8be588d452dcff996812626947d487c1c56fd243d4c3934a
4
+ data.tar.gz: c8344bcba271da309de8c7485946ad63a1996fb950a5abc71c7895299f06b6ec
5
5
  SHA512:
6
- metadata.gz: e600dd3870ed29dc8762c214335c71435761ef87f62370a8408d60aba84a7128355bcf818a94cd24d70f1f727646341d735ecc4b2520c1cdae0ab94b216ac070
7
- data.tar.gz: 5028a95e9fd176960f12ebcfab91731737b5928d97f4bcd5a7649325e830d4e1c95817d45351f7e16a61266f1a6eefbdd03977c57393d2ad0c25cb5d34bf54d1
6
+ metadata.gz: 55184af4f9611c41b1ea47cf8807987f2a0913bad1c06d284751d480faa26d62edca5d77963b6d89e8fb6f08a63f06d83dd7081bbe18c11de4b97729725c276d
7
+ data.tar.gz: 076f9dfba08a35ea3b670dc72231bb0fc4f5cd43e2441225262c0e5be5f047c6d1448830db4b95e7d63f979b3919ec2a328605b1b9c694b433eb67289f3ea136
@@ -0,0 +1,10 @@
1
+ module Cats
2
+ module Core
3
+ class Tenderer < ApplicationRecord
4
+ belongs_to :transport_bid
5
+ belongs_to :transporter
6
+
7
+ validates :purchased_by, :phone_no, presence: true
8
+ end
9
+ end
10
+ end
@@ -7,11 +7,14 @@ module Cats
7
7
  PLAN_TYPES = [REGIONAL, NON_REGIONAL].freeze
8
8
 
9
9
  belongs_to :region, class_name: 'Cats::Core::Location', optional: true
10
+ has_many :transport_plan_items
10
11
 
11
12
  validates :reference_no, presence: true, uniqueness: true
12
13
  validates :plan_type, presence: true, inclusion: { in: PLAN_TYPES }
13
14
  validate :validate_region
14
15
 
16
+ delegate(:name, to: :region, prefix: true)
17
+
15
18
  def validate_region
16
19
  return unless plan_type
17
20
 
@@ -9,6 +9,7 @@ module Cats
9
9
 
10
10
  delegate(:name, to: :route, prefix: true)
11
11
  delegate(:name, to: :unit, prefix: true)
12
+ delegate(:reference_no, to: :transport_plan)
12
13
  end
13
14
  end
14
15
  end
@@ -0,0 +1,18 @@
1
+ class CreateCatsCoreTenderers < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :cats_core_tenderers do |t|
4
+ t.references :transport_bid,
5
+ null: false,
6
+ index: { name: 'tb_on_tenderer_indx' },
7
+ foreign_key: { to_table: :cats_core_transport_bids }
8
+ t.references :transporter,
9
+ null: false,
10
+ index: { name: 'transporter_on_tenderer_indx' },
11
+ foreign_key: { to_table: :cats_core_transporters }
12
+ t.string :purchased_by, null: false
13
+ t.string :phone_no, null: false
14
+
15
+ t.timestamps
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Cats
2
2
  module Core
3
- VERSION = '1.2.36'.freeze
3
+ VERSION = '1.2.40'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :tenderer, class: 'Cats::Core::Tenderer' do
3
+ transport_bid
4
+ transporter
5
+ purchased_by { FFaker::Name.name }
6
+ phone_no { FFaker::Name.name }
7
+ end
8
+ 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.2.36
4
+ version: 1.2.40
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-01-02 00:00:00.000000000 Z
11
+ date: 2022-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_model_serializers
@@ -291,6 +291,7 @@ files:
291
291
  - app/models/cats/core/stacking_rule.rb
292
292
  - app/models/cats/core/store.rb
293
293
  - app/models/cats/core/supplier.rb
294
+ - app/models/cats/core/tenderer.rb
294
295
  - app/models/cats/core/transaction.rb
295
296
  - app/models/cats/core/transport_bid.rb
296
297
  - app/models/cats/core/transport_bid_item.rb
@@ -378,6 +379,7 @@ files:
378
379
  - db/migrate/20211229160127_create_cats_core_transport_contracts.rb
379
380
  - db/migrate/20211229160128_create_cats_core_contract_items.rb
380
381
  - db/migrate/20211229160129_create_cats_core_commodity_substitutions.rb
382
+ - db/migrate/20220103152802_create_cats_core_tenderers.rb
381
383
  - lib/cats/core.rb
382
384
  - lib/cats/core/engine.rb
383
385
  - lib/cats/core/version.rb
@@ -423,6 +425,7 @@ files:
423
425
  - spec/factories/cats/core/stacks.rb
424
426
  - spec/factories/cats/core/stores.rb
425
427
  - spec/factories/cats/core/suppliers.rb
428
+ - spec/factories/cats/core/tenderers.rb
426
429
  - spec/factories/cats/core/transport_bid_items.rb
427
430
  - spec/factories/cats/core/transport_bids.rb
428
431
  - spec/factories/cats/core/transport_contracts.rb