Creates a new daily allowance

Params

Param name Description
draft
optional

If 1, the daily allowance is saved as a draft without validation.

Validations:

  • Must be a Integer

daily_allowance
required

Daily allowance hash

Validations:

  • Must be a Hash

daily_allowance[description]
required

Daily allowance description

Validations:

  • Must be a String

daily_allowance[date]
optional , nil allowed

Daily allowance date

Validations:

  • Must be a String

daily_allowance[cost_center_ids]
optional , nil allowed

Legacy/mobile only: cost center IDs applied to the first (or only) line. Ignored when “lines_attributes” is supplied

Validations:

  • Must be an array of Integer

daily_allowance[lines_attributes]
optional , nil allowed

Cost-center split lines. Each line carries its own cost centers and a percentage share of the cost; percentages must sum to exactly 1.0. Omit to keep legacy single cost-center behavior via “cost_center_ids”.

Validations:

  • Must be an Array of nested elements

daily_allowance[lines_attributes][id]
optional , nil allowed

Line ID (required for update)

Validations:

  • Must be a Integer

daily_allowance[lines_attributes][percentage]
required

Share of the cost as a fraction, e.g. “0.6” for 60%

Validations:

  • Must be a String

daily_allowance[lines_attributes][cost_center_ids]
optional , nil allowed

Cost center IDs for this line

Validations:

  • Must be an array of Integer

daily_allowance[lines_attributes][_destroy]
optional , nil allowed

Set to true to remove this line on update

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[entries_attributes]
required

Daily allowance entries (country + time range)

Validations:

  • Must be an Array of nested elements

daily_allowance[entries_attributes][id]
optional , nil allowed

Entry ID (required for update)

Validations:

  • Must be a Integer

daily_allowance[entries_attributes][country_id]
required

ID of the Allowance country

Validations:

  • Must be a Integer

daily_allowance[entries_attributes][start_time]
required

Entry start time

Validations:

  • Must be a String

daily_allowance[entries_attributes][end_time]
required

Entry end time

Validations:

  • Must be a String

daily_allowance[free_meal_days_attributes]
optional , nil allowed

Free meal days

Validations:

  • Must be an Array of nested elements

daily_allowance[free_meal_days_attributes][id]
optional , nil allowed

Free meal day ID (for updates)

Validations:

  • Must be a Integer

daily_allowance[free_meal_days_attributes][date]
required

Date in YYYY-MM-DD format

Validations:

  • Must be a String

daily_allowance[free_meal_days_attributes][is_full]
optional , nil allowed

Whether the day is a full day

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[free_meal_days_attributes][had_breakfast]
optional , nil allowed

Whether breakfast was provided

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[free_meal_days_attributes][had_lunch]
optional , nil allowed

Whether lunch was provided

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[free_meal_days_attributes][had_dinner]
optional , nil allowed

Whether dinner was provided

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[free_meal_days_attributes][breakfast_is_taxable]
optional , nil allowed

Whether breakfast is taxable (Swedish calculator only)

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[free_meal_days_attributes][lunch_is_taxable]
optional , nil allowed

Whether lunch is taxable (Swedish calculator only)

Validations:

  • Must be one of: true, false, 1, 0.

daily_allowance[free_meal_days_attributes][dinner_is_taxable]
optional , nil allowed

Whether dinner is taxable (Swedish calculator only)

Validations:

  • Must be one of: true, false, 1, 0.