dscf-core 0.3.2 → 0.3.3

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: 99924a8190ed67a7540dd59d895d83d1925acb7ace7b16f8928d22e96a95e3cf
4
- data.tar.gz: 704c08cb732f2fc1a6212bf4270afea4bbeed5e637ee0fb5950f63852c7eb893
3
+ metadata.gz: 442564f7e8acce4f8eae9f074f58b03f8f026189660334c5c58cb2f67cce461c
4
+ data.tar.gz: 1c283579ec50ad95225bf1f6f9fd76d71decedf6387289ce99c314fefdae5d8f
5
5
  SHA512:
6
- metadata.gz: f54ec142983b8d836d20f2342b2d858abcf8c4cbc3588329a164e5363eb96ef6b5a5c474582b9ca19e7eabfdcc9cab999606b19e78159662c18d8099d16dc0ce
7
- data.tar.gz: 4ece59364b2199d9d99511b412306d9b177c6ba412975be439e5a6b0cb62e63fb0596f4842951eaea7809f42fe5a6b84676c7028fe5414706d4be148be7e5439
6
+ metadata.gz: 8d13fd5bb155bc6b292bcbe46c28e35d5e3be4b070cb95183b30cc7da0abaef0f955b000af3a2282138b5272f98a181569e45ae322c047e695cf229daba194ec
7
+ data.tar.gz: 56540f927754630b63a813a573e81f7c84cc2d94f462851536dc04b59cf6ecb1c85ee32e3156d43263e0de6256cd986dedc160d7d13da0f123cf8818a3b6df7e
@@ -1,11 +1,24 @@
1
1
  module Dscf
2
2
  module Core
3
3
  class Address < ApplicationRecord
4
- belongs_to :user, class_name: "Dscf::Core::User"
4
+ belongs_to :user, class_name: "Dscf::Core::User", optional: true
5
+ belongs_to :supplier, class_name: "Dscf::Marketplace::Supplier", optional: true
5
6
 
6
- enum :address_type, {shipping: 0, residence: 1, current: 2, branch: 3}
7
+ enum :address_type, {
8
+ shipping: 0,
9
+ residence: 1,
10
+ current: 2,
11
+ branch: 3,
12
+ warehouse: 4,
13
+ business_hq: 5,
14
+ pickup_point: 6
15
+ }
7
16
 
8
17
  validates :country, presence: true
18
+
19
+ def self.ransackable_attributes(_auth_object = nil)
20
+ %w[id user_id supplier_id address_type country city sub_city woreda kebele house_numbers po_box created_at updated_at]
21
+ end
9
22
  end
10
23
  end
11
24
  end
@@ -20,7 +20,7 @@ module Dscf
20
20
 
21
21
  def self.ransackable_attributes(_auth_object = nil)
22
22
  %w[business_type_id contact_email contact_phone created_at description id id_value name tin_number
23
- updated_at user_id]
23
+ updated_at user_id is_system]
24
24
  end
25
25
 
26
26
  def self.ransackable_associations(_auth_object = nil)
@@ -1,7 +1,7 @@
1
1
  module Dscf
2
2
  module Core
3
3
  class BusinessSerializer < ActiveModel::Serializer
4
- attributes :id, :name, :description, :contact_email, :contact_phone, :tin_number, :created_at, :updated_at
4
+ attributes :id, :name, :description, :contact_email, :contact_phone, :tin_number, :created_at, :updated_at, :is_system
5
5
 
6
6
  belongs_to :user, serializer: Dscf::Core::UserSerializer
7
7
  belongs_to :business_type, serializer: Dscf::Core::BusinessTypeSerializer
@@ -0,0 +1,5 @@
1
+ class AddIsSystemToDscfCoreBusinesses < ActiveRecord::Migration[8.0]
2
+ def change
3
+ add_column :dscf_core_businesses, :is_system, :boolean, null: false, default: false
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Dscf
2
2
  module Core
3
- VERSION = "0.3.2".freeze
3
+ VERSION = "0.3.3".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dscf-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Asrat
@@ -515,6 +515,7 @@ files:
515
515
  - db/migrate/20260128000000_create_dscf_core_file_attachments.rb
516
516
  - db/migrate/20260304000001_create_dscf_core_permissions.rb
517
517
  - db/migrate/20260304000002_create_dscf_core_role_permissions.rb
518
+ - db/migrate/20260501000001_add_is_system_to_dscf_core_businesses.rb
518
519
  - lib/dscf/core.rb
519
520
  - lib/dscf/core/engine.rb
520
521
  - lib/dscf/core/permission_registry.rb