Allow to Management::Document works with CustomCensusAPI

- Allow receive new fields :date_of_birth and :postal_code
- Send new fields to CensusCaller call method to allow use
  on RemoteCensusAPI
This commit is contained in:
taitus
2019-05-14 12:28:40 +02:00
committed by Javi Martín
parent b9a8e5a254
commit bc36c5a987
3 changed files with 78 additions and 11 deletions

View File

@@ -2,8 +2,7 @@ class Verification::Management::Document
include ActiveModel::Model
include ActiveModel::Dates
attr_accessor :document_type
attr_accessor :document_number
attr_accessor :document_type, :document_number, :date_of_birth, :postal_code
validates :document_type, :document_number, presence: true
@@ -18,7 +17,7 @@ class Verification::Management::Document
end
def in_census?
response = CensusCaller.new.call(document_type, document_number, nil, nil)
response = CensusCaller.new.call(document_type, document_number, date_of_birth, postal_code)
response.valid? && valid_age?(response)
end