Class: LockstepSdk::FinancialYearSettingSyncModel

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

Overview

The FinancialYearSettingSyncModel represents information coming into Lockstep from an external financial system or other enterprise resource planning system. To import data from an external system, convert your original data into the FinancialYearSettingSyncModel format and call the [Upload Sync File API](developer.lockstep.io/reference/post_api-v1-sync-zip). This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep platform.

Once imported, this record will be available in the Lockstep API as a [FinancialYearSettingModel](developer.lockstep.io/docs/financialyearsettingmodel). Sync is supported for only one FinancialYearSetting per app enrollment and one FinancialYearSetting imported outside of an app enrollment - please submit only one model here. If multiple models are submitted, only the latest one is considered for Sync.

For more information on writing your own connector, see [Connector Data](developer.lockstep.io/docs/connector-data).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ FinancialYearSettingSyncModel

Initialize the FinancialYearSettingSyncModel using the provided prototype



35
36
37
38
39
40
# File 'lib/lockstep_sdk/models/financial_year_setting_sync_model.rb', line 35

def initialize(params = {})
    @year_type = params.dig(:year_type)
    @total_periods = params.dig(:total_periods)
    @start_date = params.dig(:start_date)
    @end_date = params.dig(:end_date)
end

Instance Attribute Details

#end_dateString

Returns The end date of the financial year. Should be entered in MM-DD format.

Returns:

  • (String)

    The end date of the financial year. Should be entered in MM-DD format.



56
57
58
# File 'lib/lockstep_sdk/models/financial_year_setting_sync_model.rb', line 56

def end_date
  @end_date
end

#start_dateString

Returns The start date of the financial year. Should be entered in MM-DD format.

Returns:

  • (String)

    The start date of the financial year. Should be entered in MM-DD format.



52
53
54
# File 'lib/lockstep_sdk/models/financial_year_setting_sync_model.rb', line 52

def start_date
  @start_date
end

#total_periodsInt32

Returns Total number of periods in the year. For Calendar year types this should always be 12. For Fiscal year types this can either be 12 or 13 for a 4 week 13 period year.

Returns:

  • (Int32)

    Total number of periods in the year. For Calendar year types this should always be 12. For Fiscal year types this can either be 12 or 13 for a 4 week 13 period year.



48
49
50
# File 'lib/lockstep_sdk/models/financial_year_setting_sync_model.rb', line 48

def total_periods
  @total_periods
end

#year_typeString

Returns The type of financial year, either Calendar or Fiscal.

Returns:

  • (String)

    The type of financial year, either Calendar or Fiscal.



44
45
46
# File 'lib/lockstep_sdk/models/financial_year_setting_sync_model.rb', line 44

def year_type
  @year_type
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



60
61
62
63
64
65
66
67
# File 'lib/lockstep_sdk/models/financial_year_setting_sync_model.rb', line 60

def as_json(options={})
    {
        'yearType' => @year_type,
        'totalPeriods' => @total_periods,
        'startDate' => @start_date,
        'endDate' => @end_date,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



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

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