Module: UU::Fairpay2::BusinessCase::ClientAccountBusinessCase

Extended by:
ClientAccountBusinessCase
Included in:
ClientAccountBusinessCase
Defined in:
lib/uu/fairpay2/client_account_business_case.rb

Overview

Module Client Account Business Case. This service allows managing Client Account Business Case(CABC).

Constant Summary

PATH =

Service path

'uu/fairpay2/businesscase/ClientAccountBusinessCase'

Instance Method Summary (collapse)

Instance Method Details

- (UU::OS::UESURI) create(location_uri, business_case = nil)

Creates a new Client Account Business Case. The command creates a new Client Account Business Case in a specified location with passed DTO parameters.

Required attributes:

name, meta_artifact_uri, user_universe_id, client_uuee_universe_id, client_account_number, available_balance, current_balance, authorized_persons, authorized_accounts, daily_limit, weekly_limit, monthly_limit, overdraft_limit, currency_code

Examples:

# Prepare folder or Organization Unit URI, where we want to create Client Account Business Case.
location_uri = UU::OS::UESURI.new('ues:TERRITORY:ARTIFACT_FOLDER_OR_OU');

# Create personal CABC
  UU::Fairpay2::BusinessCase::ClientAccountBusinessCase.create(location_uri,
  :name => "1000000",
  :meta_artifact_uri => UU::OS::UESURI.new('ues:TERRITORY:META_ARTIFACT_CLIENT_ACCOUNT_BUSINESS_CASE'),
  :user_universe_id => "123-4",
  :client_uuee_universe_id => "436-1",
  :client_account_number => "123456/0100",
  :available_balance => "1000000",
  :current_balance => "1000000",
  :authorized_persons => "436-1",
  :authorized_accounts => "123456/0100",
  :daily_limit => "10000",
  :weekly_limit => "100000",
  :monthly_limit => "1000000",
  :overdraft_limit => "1000000",
  :currency_code => "CZK");

Parameters:

  • location_uri (UU::OS::UESURI)

    UESURI of the folder or organizational unit where Client Account Business Case will be created.

  • business_case (UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseCreate) (defaults to: nil)

    DTO containing attributes of the new Client Account Business Case

Options Hash (business_case):

  • :name (String)

    Cannot be null nor empty string nor longer than 250 characters and can contain only allowed characters.

  • :code (String)

    The code must be unique in target territory. It cannot be empty string nor longer than 250 characters and can contain only allowed characters.

  • :description (String)

    Description of created client account business case. Must not be empty string, must not contain whitespace characters only and must not be longer than 4000 characters.

  • :meta_artifact_uri (String, UU::OS::UESURI)

    UESURI of meta artifact of created Client Account. Required attribute, cannot be null and must be valid UESURI.

  • :competent_role_uri (String, UU::OS::UESURI)

    UESURI of the role competent for created client account business case. Required attribute, cannot be null and must be valid UESURI.

  • :security_level (String, UU::OS::Artifact::SecurityLevel)

    Security level.

  • :user_universe_id (String)

    User universe id of client. Required attribute, cannot be null, empty, whitespace only or longer than 250 characters.

  • :daily_limit (Fixnum)

    Daily withdrawal limit of the related Account. Required attribute, cannot be null or invalid Fixnum.

  • :weekly_limit (Fixnum)

    Weekly withdrawal limit of the related Account. Required attribute, cannot be null or invalid Fixnum.

  • :monthly_limit (Fixnum)

    Monthly withdrawal limit of the related Account. Required attribute, cannot be null or invalid Fixnum.

  • :overdraft_limit (Fixnum)

    Overdraft limit of the related Account. Required attribute, cannot be null or invalid Fixnum.

  • :client_account_number (String)

    Account number of the client. Required attribute, cannot be null, empty, whitespace only or longer than 250 characters.

  • :client_uuee_universe_id (String)

    Client uuEE universe id on Client Account Business Case. Required attribute, cannot be null, empty, whitespace only or longer than 4000 characters.

  • :available_balance (Fixnum)

    Available balance on Client Account Business Case. Required attribute, cannot be null or invalid Fixnum.

  • :current_balance (Fixnum)

    Current balance on Client Account Business Case. Required attribute, cannot be null or invalid Fixnum.

  • :authorized_persons (String)

    Authorized Persons on Client Account Business Case. Required attribute, cannot be null, empty, whitespace only or longer than 4000 characters.

  • :authorized_accounts (String)

    Authorized Accounts on Client Account Business Case. Required attribute, cannot be null, empty, whitespace only or longer than 4000 characters.

  • :currency_code (String)

    Currency code on Client Account Business Case. Required attribute, cannot be null, empty, whitespace only or longer than 250 characters.

  • :dry_run (TrueClass, FalseClass)

    Specifies whether this is only a test run to verify that the object can be created. The default value is false.

Returns:

  • (UU::OS::UESURI)

    UESURI of the new Client Account Business Case. In case of setting dry_run parameter to true, UU::OS::UESURI::NIL_URI is returned instead.



73
74
75
76
77
78
79
80
81
# File 'lib/uu/fairpay2/client_account_business_case.rb', line 73

def create(location_uri, business_case = nil)
  svc = UU::OS::REST::RemoteClient.new(ClientAccountBusinessCase)
  clibc_create = UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseCreate.new(business_case).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('create', location_uri, clibc_create)
    return UU::OS::UESURI.new(res)
  end
end

- (UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseSums) debit_transaction_sums(business_case_uri)

Obtains Client Account Business Case daily, weekly, monthly sums of outgoing transactions from REST service and returns them

Examples:

# Prepare Client Account Business Case URI, where we want to get outgoing sums.
business_case_uri = UU::OS::UESURI.new('ues:TERRITORY:CLIENT_ACCOUNT_BUSINESS_CASE');

# Get sums from CABC
  UU::Fairpay2::BusinessCase::ClientAccountBusinessCase.debit_transaction_sums(business_case_uri);

Parameters:

  • business_case_uri (String, UU::OS::UESURI)

    UESURI of the Client Account Business Case

Returns:



180
181
182
183
184
185
186
187
# File 'lib/uu/fairpay2/client_account_business_case.rb', line 180

def debit_transaction_sums(business_case_uri)
  svc = UU::OS::REST::RemoteClient.new(ClientAccountBusinessCase)

  UU::OS::QoS::QoSHandler.auto_retry do
    attrs = svc.post('debitTransactionSums', business_case_uri)
    return UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseSums.new(attrs)
  end
end

- (UU::OS::UESURI) find_by_account_number(territory_uri, account_number = nil)

Returns UESURI of client account business case specified by client account number in value object

Required attribute:

Examples:

# Prepare territory URI, where we want to find client account business case.
territory_uri = UU::OS::UESURI.new('ues:TERRITORY:TERRITORY');

# Find Client Account Business Case
  UU::Fairpay2::BusinessCase::ClientAccountBusinessCase.(territory_uri,
  :client_account_number => "1000000");

Parameters:

Returns:

  • (UU::OS::UESURI)

    UESURI of the founded Client Account Business Case



206
207
208
209
210
211
212
213
214
# File 'lib/uu/fairpay2/client_account_business_case.rb', line 206

def (territory_uri,  = nil)
  svc = UU::OS::REST::RemoteClient.new(ClientAccountBusinessCase)
   = UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseAccountNumber.new().to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('findByAccountNumber', territory_uri, )
    return UU::OS::UESURI.new(res)
  end
end

- (UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseAttributes) get_attributes(business_case_uri)

Obtains Client Account Business Case attributes from REST service and returns them

Examples:

# Prepare Client Account Business Case URI, where we want to get attributes.
business_case_uri = UU::OS::UESURI.new('ues:TERRITORY:CLIENT_ACCOUNT_BUSINESS_CASE');

# Get attributes from CABC
  UU::Fairpay2::BusinessCase::ClientAccountBusinessCase.get_attributes(business_case_uri);

Parameters:

  • business_case_uri (String, UU::OS::UESURI)

    UESURI of the Client Account Business Case

Returns:



95
96
97
98
99
100
101
102
# File 'lib/uu/fairpay2/client_account_business_case.rb', line 95

def get_attributes(business_case_uri)
  svc = UU::OS::REST::RemoteClient.new(ClientAccountBusinessCase)

  UU::OS::QoS::QoSHandler.auto_retry do
    attrs = svc.post('getAttributes', business_case_uri)
    return UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseAttributes.new(attrs)
  end
end

- (UU::FairPay2::BusinessCase::ClientAccountBusinessCaseSums) get_sums(business_case_uri)

Deprecated.

Obtains Client Account Business Case daily, weekly, monthly sums of outcomes transactions from REST service and returns them

Examples:

# Prepare Client Account Business Case URI, where we want to get sums.
business_case_uri = UU::OS::UESURI.new('ues:TERRITORY:CLIENT_ACCOUNT_BUSINESS_CASE');

# Get sums from CABC
  UU::Fairpay2::BusinessCase::ClientAccountBusinessCase.get_sums(business_case_uri);

Parameters:

  • business_case_uri (String, UU::OS::UESURI)

    UESURI of the Client Account Business Case

Returns:

  • (UU::FairPay2::BusinessCase::ClientAccountBusinessCaseSums)

    Client Account Business Case attributes



158
159
160
161
162
163
164
165
# File 'lib/uu/fairpay2/client_account_business_case.rb', line 158

def get_sums(business_case_uri)
  svc = UU::OS::REST::RemoteClient.new(ClientAccountBusinessCase)

  UU::OS::QoS::QoSHandler.auto_retry do
    attrs = svc.post('debitTransactionSums', business_case_uri)
    return UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseSums.new(attrs)
  end
end

- (UU::OS::UESURI) set_attributes(business_case_uri, business_case_attributes = nil)

Sets attributes of Client Account Business Case.

Examples:

# Prepare Client Account Business Case URI, where we want to set attributes.
business_case_uri = UU::OS::UESURI.new('ues:TERRITORY:CLIENT_ACCOUNT_BUSINESS_CASE');

# Set selected attributes to CABC
  UU::Fairpay2::BusinessCase::ClientAccountBusinessCase.set_attributes(business_case_uri,
  :daily_limit => "1000000",
  :name => "new name");

Parameters:

Options Hash (business_case_attributes):

  • :name (String)

    Name of Client Account Business Case. Cannot be longer than 250 characters and can contain only allowed characters.

  • :code (String)

    The code must be unique in target territory. It cannot be empty string nor longer than 250 characters and can contain only allowed characters.

  • :description (String)

    Description of client account business case. Cannot be longer than 4000 characters.

  • :user_universe_id (String)

    User universe id of client. Must not be empty string, must not contain whitespace characters only and must not be longer than 250 characters.

  • :daily_limit (Fixnum)

    Daily withdrawal limit of the related Account. Cannot be empty, whitespace only or invalid Fixnum.

  • :weekly_limit (Fixnum)

    Weekly withdrawal limit of the related Account. Cannot be empty, whitespace only or invalid Fixnum.

  • :monthly_limit (Fixnum)

    Monthly withdrawal limit of the related Account. Cannot be empty, whitespace only or invalid Fixnum.

  • :overdraft_limit (Fixnum)

    Overdraft limit of the related Account. Cannot be empty, whitespace only or invalid Fixnum.

  • :client_account_numberClient (String)

    Account number of the client. Must not be empty string, must not contain whitespace characters only and must not be longer than 250 characters.

  • :client_uuee_universe_id (String)

    Client uuEE universe id on Client Account Business Case. Must not be empty string, must not contain whitespace characters only and must not be longer than 4000 characters.

  • :available_balance (Fixnum)

    Available balance on Client Account Business Case. Cannot be empty, whitespace only or invalid Fixnum.

  • :current_balance (Fixnum)

    Current balance on Client Account Business Case. Cannot be empty, whitespace only or invalid Fixnum.

  • :authorized_persons (String)

    Authorized Persons on Client Account Business Case. Must not be empty string, must not contain whitespace characters only and must not be longer than 4000 characters.

  • :authorized_accounts (String)

    Authorized Accounts on Client Account Business Case. Must not be empty string, must not contain whitespace characters only and must not be longer than 4000 characters.

  • :currency_code (String)

    Currency code on Client Account Business Case. Must not be empty string, must not contain whitespace characters only and must not be longer than 4000 characters.

Returns:

  • (UU::OS::UESURI)

    UESURI of modified Client Account Business Case



135
136
137
138
139
140
141
142
143
# File 'lib/uu/fairpay2/client_account_business_case.rb', line 135

def set_attributes(business_case_uri, business_case_attributes = nil)
  svc = UU::OS::REST::RemoteClient.new(ClientAccountBusinessCase)
  bc_attrs = UU::Fairpay2::BusinessCase::ClientAccountBusinessCaseSetAttributes.new(business_case_attributes).to_json

  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.post('setAttributes', business_case_uri, bc_attrs)
    return UU::OS::UESURI.new(res)
  end
end