Class: LockstepSdk::FinancialYearSettingModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/financial_year_setting_model.rb

Overview

A Financial Year Setting is used to to set the type, beginning, end, and number of periods of a year used to calculate accounting reports. The financial setting can either be for a specific app enrollment id via a sync or, when the financial year setting is manually created, will cover all account data without an app enrollment id.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ FinancialYearSettingModel

Initialize the FinancialYearSettingModel using the provided prototype



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 27

def initialize(params = {})
    @financial_year_setting_id = params.dig(:financial_year_setting_id)
    @group_key = params.dig(:group_key)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @year_type = params.dig(:year_type)
    @total_periods = params.dig(:total_periods)
    @start_date = params.dig(:start_date)
    @end_date = params.dig(:end_date)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
end

Instance Attribute Details

#app_enrollment_idUuid



51
52
53
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 51

def app_enrollment_id
  @app_enrollment_id
end

#createdDate-time



71
72
73
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 71

def created
  @created
end

#created_user_idUuid



75
76
77
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 75

def created_user_id
  @created_user_id
end

#end_dateDate



67
68
69
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 67

def end_date
  @end_date
end

#financial_year_setting_idUuid



43
44
45
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 43

def financial_year_setting_id
  @financial_year_setting_id
end

#group_keyUuid



47
48
49
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 47

def group_key
  @group_key
end

#modifiedDate-time



79
80
81
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 79

def modified
  @modified
end

#modified_user_idUuid



83
84
85
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 83

def modified_user_id
  @modified_user_id
end

#start_dateDate



63
64
65
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 63

def start_date
  @start_date
end

#total_periodsInt32



59
60
61
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 59

def total_periods
  @total_periods
end

#year_typeString



55
56
57
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 55

def year_type
  @year_type
end

Instance Method Details

#as_json(options = {}) ⇒ object



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 87

def as_json(options={})
    {
        'financialYearSettingId' => @financial_year_setting_id,
        'groupKey' => @group_key,
        'appEnrollmentId' => @app_enrollment_id,
        'yearType' => @year_type,
        'totalPeriods' => @total_periods,
        'startDate' => @start_date,
        'endDate' => @end_date,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
    }
end

#to_json(*options) ⇒ String



105
106
107
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 105

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end