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



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

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



53
54
55
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 53

def app_enrollment_id
  @app_enrollment_id
end

#createdDate-time



73
74
75
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 73

def created
  @created
end

#created_user_idUuid



77
78
79
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 77

def created_user_id
  @created_user_id
end

#end_dateDate



69
70
71
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 69

def end_date
  @end_date
end

#financial_year_setting_idUuid



45
46
47
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 45

def financial_year_setting_id
  @financial_year_setting_id
end

#group_keyUuid



49
50
51
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 49

def group_key
  @group_key
end

#modifiedDate-time



81
82
83
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 81

def modified
  @modified
end

#modified_user_idUuid



85
86
87
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 85

def modified_user_id
  @modified_user_id
end

#start_dateDate



65
66
67
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 65

def start_date
  @start_date
end

#total_periodsInt32



61
62
63
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 61

def total_periods
  @total_periods
end

#year_typeString



57
58
59
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 57

def year_type
  @year_type
end

Instance Method Details

#as_json(options = {}) ⇒ object



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

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



107
108
109
# File 'lib/lockstep_sdk/models/financial_year_setting_model.rb', line 107

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