Module: UU::Finman::BusinessCase
- Extended by:
- BusinessCase
- Included in:
- BusinessCase
- Defined in:
- lib/uu/finman/business_case.rb,
lib/uu/finman/businesscase/transaction_side.rb,
lib/uu/finman/businesscase/business_case_type.rb,
lib/uu/finman/businesscase/business_case_state.rb,
lib/uu/finman/businesscase/business_case_create.rb,
lib/uu/finman/businesscase/business_case_set_state.rb,
lib/uu/finman/businesscase/business_case_categories.rb,
lib/uu/finman/businesscase/business_case_attributes.rb,
lib/uu/finman/businesscase/business_case_get_categories.rb,
lib/uu/finman/businesscase/business_case_set_attributes.rb,
lib/uu/finman/businesscase/business_case_generate_report.rb,
lib/uu/finman/businesscase/business_case_attachment_report_type.rb
Overview
Module of finman Business case
Defined Under Namespace
Classes: BusinessCaseAttachmentReportType, BusinessCaseAttributes, BusinessCaseCategories, BusinessCaseCreate, BusinessCaseGenerateReport, BusinessCaseGetCategories, BusinessCaseSetAttributes, BusinessCaseSetState, BusinessCaseState, BusinessCaseType, TransactionSide
Constant Summary
- PATH =
Service path
'uu/finman/businesscase/BusinessCase'
Instance Method Summary (collapse)
-
- (UU::OS::UESURI) create(location_uri, business_case)
Creates a new Business Case.
-
- (UU::OS::UESURI) generate_report(business_case_uri, attributes)
Generate report of Business Case.
-
- (UU::Finman::BusinessCase::BusinessCaseAttributes) get_attributes(business_case_uri)
Obtains Business Case attributes from service and returns them.
-
- (UU::Finman::BusinessCaseCategories) get_categories(business_case_uri, business_case_get_categories)
Get transaction types and cost or income items.
-
- (UU::OS::UESURI) set_attributes(business_case_uri, business_case_attributes)
Sets attributes of Business Case.
-
- (Object) set_default(business_case_uri)
Sets default business case for organizational unit..
-
- (Object) set_state(business_case_uri, state)
Sets state of business case artifact.
-
- (Object) update_structure(control_panel_uri)
Request update of BC structure on SSDB.
Instance Method Details
- (UU::OS::UESURI) create(location_uri, business_case)
Creates a new Business Case. The command creates a new Business Case in a
specified location with passed DTO parameters.
Required attributes:
meta_artifact_uri or business_case_type, name, business_case_company_uri, location_uri, currency
Attributes default_account_uri
and
default_account_number
cannot be set simultaneously.
Attriburte currency
must be one from allowed reporting
currencies
55 56 57 58 59 60 61 62 63 |
# File 'lib/uu/finman/business_case.rb', line 55 def create(location_uri, business_case) svc = UU::OS::REST::RemoteClient.new(BusinessCase) bcase_create = UU::Finman::BusinessCase::BusinessCaseCreate.new(business_case).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('create', location_uri, bcase_create) return UU::OS::UESURI.new(res) end end |
- (UU::OS::UESURI) generate_report(business_case_uri, attributes)
Generate report of Business Case.
If reportTypeAttachment and bcWithoutSubs and bcWithSubs is set to true, returns UESURI of created report attachment with subs.
);
178 179 180 181 182 183 184 185 186 |
# File 'lib/uu/finman/business_case.rb', line 178 def generate_report(business_case_uri, attributes) svc = UU::OS::REST::RemoteClient.new(BusinessCase) bc_attrs = UU::Finman::BusinessCase::BusinessCaseGenerateReport.new(attributes).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('generateReport', business_case_uri, bc_attrs) return UU::OS::UESURI.new(res) end end |
- (UU::Finman::BusinessCase::BusinessCaseAttributes) get_attributes(business_case_uri)
Obtains Business Case attributes from service and returns them
78 79 80 81 82 83 84 |
# File 'lib/uu/finman/business_case.rb', line 78 def get_attributes(business_case_uri) svc = UU::OS::REST::RemoteClient.new(BusinessCase) UU::OS::QoS::QoSHandler.auto_retry do attrs = svc.get('getAttributes', business_case_uri) return UU::Finman::BusinessCase::BusinessCaseAttributes.new(attrs) end end |
- (UU::Finman::BusinessCaseCategories) get_categories(business_case_uri, business_case_get_categories)
Get transaction types and cost or income items.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/uu/finman/business_case.rb', line 231 def get_categories(business_case_uri, business_case_get_categories) svc = UU::OS::REST::RemoteClient.new(BusinessCase) dto_in = UU::Finman::BusinessCase::BusinessCaseGetCategories.new(business_case_get_categories).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('getCategories', business_case_uri, dto_in) cats = UU::Finman::BusinessCase::BusinessCaseCategories.new(res) return cats end end |
- (UU::OS::UESURI) set_attributes(business_case_uri, business_case_attributes)
Sets attributes of Business Case.
101 102 103 104 105 106 107 108 109 |
# File 'lib/uu/finman/business_case.rb', line 101 def set_attributes(business_case_uri, business_case_attributes) svc = UU::OS::REST::RemoteClient.new(BusinessCase) bc_attrs = UU::Finman::BusinessCase::BusinessCaseSetAttributes.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 |
- (Object) set_default(business_case_uri)
Sets default business case for organizational unit..
This command sets new default business case (main entity) for OU where the BC is. Former default BC becomes regular BC that is subordinate of the new default BC. Updates befault attribute on primary satellite module and secondary satellite module. Recomputes assignments of payments (each payment is assigned to all superior default BCases) to properly reflect the new default BC.
147 148 149 150 151 152 153 |
# File 'lib/uu/finman/business_case.rb', line 147 def set_default(business_case_uri) svc = UU::OS::REST::RemoteClient.new(BusinessCase) UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setDefault', business_case_uri) return UU::OS::UESURI.new(res) end end |
- (Object) set_state(business_case_uri, state)
Sets state of business case artifact.
123 124 125 126 127 128 129 |
# File 'lib/uu/finman/business_case.rb', line 123 def set_state(business_case_uri, state) svc = UU::OS::REST::RemoteClient.new(BusinessCase) payload = UU::Finman::BusinessCase::BusinessCaseSetState.new(state).to_json UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('setState', business_case_uri, payload) end end |
- (Object) update_structure(control_panel_uri)
Request update of BC structure on SSDB.
This command sends request to PSM to update BC structure table. PSM then computes BC structure and sends request to SSM, where the structure will be stored.
202 203 204 205 206 207 208 |
# File 'lib/uu/finman/business_case.rb', line 202 def update_structure(control_panel_uri) svc = UU::OS::REST::RemoteClient.new(BusinessCase) UU::OS::QoS::QoSHandler.auto_retry do res = svc.post('updateStructure', control_panel_uri) return UU::OS::UESURI.new(res) end end |