From f9436062a6787f88f4418ff124b4ca0b06ee4d0d Mon Sep 17 00:00:00 2001 From: olegphenomenon Date: Tue, 21 Sep 2021 16:08:40 +0300 Subject: [PATCH] init --- .idea/workspace.xml | 181 ++++++++++++++++++ .../registrant/registry_locks_controller.rb | 2 + .../concerns/domain/registry_lockable.rb | 1 - app/models/registrant_user.rb | 6 +- 4 files changed, 186 insertions(+), 4 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 000000000..a7cd52260 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1623134418422 + + + + + + + + + \ No newline at end of file diff --git a/app/controllers/api/v1/registrant/registry_locks_controller.rb b/app/controllers/api/v1/registrant/registry_locks_controller.rb index a8f420ae5..a97d1c62b 100644 --- a/app/controllers/api/v1/registrant/registry_locks_controller.rb +++ b/app/controllers/api/v1/registrant/registry_locks_controller.rb @@ -8,6 +8,8 @@ module Api before_action :authorized_to_manage_locks? def create + p "============" + if @domain.apply_registry_lock render json: serialized_domain(@domain) else diff --git a/app/models/concerns/domain/registry_lockable.rb b/app/models/concerns/domain/registry_lockable.rb index 240694d8e..7ee9860a8 100644 --- a/app/models/concerns/domain/registry_lockable.rb +++ b/app/models/concerns/domain/registry_lockable.rb @@ -12,7 +12,6 @@ module Domain::RegistryLockable end def apply_registry_lock - # binding.pry return unless registry_lockable? return if locked_by_registrant? diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb index f7e85c5af..c6d80901e 100644 --- a/app/models/registrant_user.rb +++ b/app/models/registrant_user.rb @@ -17,11 +17,11 @@ class RegistrantUser < User Country.new(alpha2_code) end - def companies(company_register = CompanyRegister::Client.new) + def companies(company_register = nil) return [] if ident.include?('-') - company_register.representation_rights(citizen_personal_code: ident, - citizen_country_code: country.alpha3) + [OpenStruct.new(registration_number: '43344412', company_name: 'TestFirma'), + OpenStruct.new(registration_number: '12345678', company_name: 'SuperFirma OU')] end def contacts(representable: true)