Module: Unit::Application
- Defined in:
- lib/unit/models/application/application.rb,
lib/unit/models/application/list_application_params.rb,
lib/unit/models/application/upload_document_request.rb,
lib/unit/models/application/patch_application_request.rb,
lib/unit/models/application/create_business_application_request.rb,
lib/unit/models/application/create_individual_application_request.rb,
lib/unit/models/application/create_sole_proprietor_application_request.rb
Defined Under Namespace
Classes: CreateBusinessApplicationRequest, CreateIndividualApplicationRequest, CreateSoleProprietorApplicationRequest, ListApplicationParams, PatchApplicationRequest, UploadDocumentRequest
Constant Summary collapse
- APPLICATION_LIST_OFFSET =
0
- APPLICATION_LIST_LIMIT =
100
Class Method Summary collapse
-
.create_business_application(name:, address:, phone:, state_of_incorporation:, ein:, contact:, officer:, beneficial_owners:, entity_type:, industry: nil, dba: nil, ip: nil, website: nil, tags: nil, idempotency_key: nil, device_fingerprints: nil, annual_revenue: nil, number_of_employees: nil, cash_flow: nil, year_of_incorporation: nil, countries_of_operation: nil, stock_symbol: nil, business_vertical: nil) ⇒ Object
Create a new business application by calling Unit’s API.
-
.create_individual_application(ssn:, full_name:, date_of_birth:, address:, email:, phone:, ip: nil, ein: nil, industry: nil, dba: nil, sole_proprietorship: nil, passport: nil, nationality: nil, device_fingerprints: nil, idempotency_key: nil, tags: nil, jwt_subject: nil, power_of_attorney_agent: nil, evaluation_params: nil, occupation: nil, annual_income: nil, source_of_income: nil) ⇒ UnitResponse, UnitError
Create a new individual application by calling Unit’s API.
-
.create_sole_proprietor_application(nationality:, full_name:, date_of_birth:, address:, phone:, email:, ssn: nil, passport: nil, ein: nil, dba: nil, power_of_attorney_agent: nil, evaluation_params: nil, annual_revenue: nil, number_of_employees: nil, business_vertical: nil, website: nil, ip: nil, tags: nil, idempotency_key: nil, device_fingerprints: nil, jwt_subject: nil, sole_proprietorship: true) ⇒ UnitResponse, UnitError
Create a new sole proprietor application by calling Unit’s API.
-
.get_application(application_id) ⇒ UnitResponse, UnitError
Get an application by calling Unit’s API.
-
.list_applications(offset: APPLICATION_LIST_OFFSET, limit: APPLICATION_LIST_LIMIT, email: nil, tags: nil, query: nil, status: nil, sort: nil) ⇒ UnitResponse, UnitError
List applications by calling Unit’s API.
-
.update_application(application_id:, type:, tags: nil) ⇒ UnitResponse, UnitError
Update an application by calling Unit’s API.
-
.upload_document(application_id:, document_id:, file:, file_type:, is_back_side: false) ⇒ UnitResponse, UnitError
Upload an application document by calling Unit’s API.
Class Method Details
.create_business_application(name:, address:, phone:, state_of_incorporation:, ein:, contact:, officer:, beneficial_owners:, entity_type:, industry: nil, dba: nil, ip: nil, website: nil, tags: nil, idempotency_key: nil, device_fingerprints: nil, annual_revenue: nil, number_of_employees: nil, cash_flow: nil, year_of_incorporation: nil, countries_of_operation: nil, stock_symbol: nil, business_vertical: nil) ⇒ Object
Create a new business application by calling Unit’s API
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/unit/models/application/application.rb', line 40 def create_business_application(name:, address:, phone:, state_of_incorporation:, ein:, contact:, officer:, beneficial_owners:, entity_type:, industry: nil, dba: nil, ip: nil, website: nil, tags: nil, idempotency_key: nil, device_fingerprints: nil, annual_revenue: nil, number_of_employees: nil, cash_flow: nil, year_of_incorporation: nil, countries_of_operation: nil, stock_symbol: nil, business_vertical: nil) request = CreateBusinessApplicationRequest.new( name, address, phone, state_of_incorporation, ein, contact, officer, beneficial_owners, entity_type, industry, dba, ip, website, , idempotency_key, device_fingerprints, annual_revenue, number_of_employees, cash_flow, year_of_incorporation, countries_of_operation, stock_symbol, business_vertical ) Unit::Resource::ApplicationResource.create_application(request) end |
.create_individual_application(ssn:, full_name:, date_of_birth:, address:, email:, phone:, ip: nil, ein: nil, industry: nil, dba: nil, sole_proprietorship: nil, passport: nil, nationality: nil, device_fingerprints: nil, idempotency_key: nil, tags: nil, jwt_subject: nil, power_of_attorney_agent: nil, evaluation_params: nil, occupation: nil, annual_income: nil, source_of_income: nil) ⇒ UnitResponse, UnitError
Create a new individual application by calling Unit’s API
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/unit/models/application/application.rb', line 79 def create_individual_application(ssn:, full_name:, date_of_birth:, address:, email:, phone:, ip: nil, ein: nil, industry: nil, dba: nil, sole_proprietorship: nil, passport: nil, nationality: nil, device_fingerprints: nil, idempotency_key: nil, tags: nil, jwt_subject: nil, power_of_attorney_agent: nil, evaluation_params: nil, occupation: nil, annual_income: nil, source_of_income: nil) request = CreateIndividualApplicationRequest.new( ssn, full_name, date_of_birth, address, email, phone, ip, ein, industry, dba, sole_proprietorship, passport, nationality, device_fingerprints, idempotency_key, , jwt_subject, power_of_attorney_agent, evaluation_params, occupation, annual_income, source_of_income ) Unit::Resource::ApplicationResource.create_application(request) end |
.create_sole_proprietor_application(nationality:, full_name:, date_of_birth:, address:, phone:, email:, ssn: nil, passport: nil, ein: nil, dba: nil, power_of_attorney_agent: nil, evaluation_params: nil, annual_revenue: nil, number_of_employees: nil, business_vertical: nil, website: nil, ip: nil, tags: nil, idempotency_key: nil, device_fingerprints: nil, jwt_subject: nil, sole_proprietorship: true) ⇒ UnitResponse, UnitError
Create a new sole proprietor application by calling Unit’s API
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/unit/models/application/application.rb', line 117 def create_sole_proprietor_application(nationality:, full_name:, date_of_birth:, address:, phone:, email:, ssn: nil, passport: nil, ein: nil, dba: nil, power_of_attorney_agent: nil, evaluation_params: nil, annual_revenue: nil, number_of_employees: nil, business_vertical: nil, website: nil, ip: nil, tags: nil, idempotency_key: nil, device_fingerprints: nil, jwt_subject: nil, sole_proprietorship: true) request = CreateSoleProprietorApplicationRequest.new(nationality, full_name, date_of_birth, address, phone, email, ssn, passport, ein, dba, power_of_attorney_agent, evaluation_params, annual_revenue, number_of_employees, business_vertical, website, ip, , idempotency_key, device_fingerprints, jwt_subject, sole_proprietorship: sole_proprietorship) Unit::Resource::ApplicationResource.create_application(request) end |
.get_application(application_id) ⇒ UnitResponse, UnitError
Get an application by calling Unit’s API
161 162 163 |
# File 'lib/unit/models/application/application.rb', line 161 def get_application(application_id) Unit::Resource::ApplicationResource.get_application(application_id) end |
.list_applications(offset: APPLICATION_LIST_OFFSET, limit: APPLICATION_LIST_LIMIT, email: nil, tags: nil, query: nil, status: nil, sort: nil) ⇒ UnitResponse, UnitError
List applications by calling Unit’s API
152 153 154 155 |
# File 'lib/unit/models/application/application.rb', line 152 def list_applications(offset: APPLICATION_LIST_OFFSET, limit: APPLICATION_LIST_LIMIT, email: nil, tags: nil, query: nil, status: nil, sort: nil) request = Unit::Application::ListApplicationParams.new(offset, limit, email, , query, status, sort) Unit::Resource::ApplicationResource.list_applications(request) end |
.update_application(application_id:, type:, tags: nil) ⇒ UnitResponse, UnitError
Update an application by calling Unit’s API
135 136 137 138 |
# File 'lib/unit/models/application/application.rb', line 135 def update_application(application_id:, type:, tags: nil) request = PatchApplicationRequest.new(application_id, type, ) Unit::Resource::ApplicationResource.update(request) end |
.upload_document(application_id:, document_id:, file:, file_type:, is_back_side: false) ⇒ UnitResponse, UnitError
Upload an application document by calling Unit’s API
173 174 175 176 |
# File 'lib/unit/models/application/application.rb', line 173 def upload_document(application_id:, document_id:, file:, file_type:, is_back_side: false) request = UploadDocumentRequest.new(application_id, document_id, file, file_type, is_back_side: is_back_side) Unit::Resource::ApplicationResource.upload(request) end |