RahalCorporate
BudgetsReference

Budget Fields Reference

Complete reference for all budget configuration fields

Budget Fields Reference

This reference documents all fields used in budget configuration.

Budget Entity

Core Fields

FieldTypeRequiredDescription
namestringYesDisplay name (max 255 chars)
descriptionstringNoDetailed description
costCenterIdstringYesAssociated cost center
isActivebooleanYesWhether budget is active

Allocation Settings

FieldTypeRequiredDefaultDescription
allocationTypeenumYesPER_USERHow budget is distributed
amountnumberYes-Budget amount per period
currencystringYes-Currency code (e.g., USD)

Allocation Types:

  • PER_USER - Each user gets individual allocation
  • SHARED_POOL - All users share one pool

Supported Currencies:

  • USD, EUR, GBP, AED, SAR, IQD

Period Settings

FieldTypeRequiredDefaultDescription
periodTypeenumYes-Period duration
periodStartDaynumberYes-Day of month (1-28)
periodStartMonthnumberNo1Month for quarterly/yearly

Period Types:

  • MONTHLY - 1 month periods
  • QUARTERLY - 3 month periods
  • YEARLY - 12 month periods

Rollover Settings

FieldTypeRequiredDefaultDescription
rolloverPolicyenumNoNONEHow unused budget rolls
rolloverPercentagenumberNo100Percent to roll (1-100)
maxRolloverAmountnumberNonullMaximum rollover cap

Rollover Policies:

  • NONE - No rollover, unused expires
  • PARTIAL - Percentage of unused rolls
  • FULL - All unused rolls

Enforcement Settings

FieldTypeRequiredDefaultDescription
enforcementModeenumNoWARN_WHEN_EXCEEDEDWhat happens when exceeded
notificationThresholdsnumber[]No[50, 75, 90, 100]Alert thresholds (%)

Enforcement Modes:

  • TRACK_ONLY - No restrictions
  • WARN_WHEN_EXCEEDED - Show warning
  • REQUIRE_APPROVAL_WHEN_EXCEEDED - Route to approval
  • BLOCK_WHEN_EXCEEDED - Block booking

System Fields

FieldTypeDescription
idstringUnique identifier
companyIdstringParent company
createdAtdatetimeCreation timestamp
updatedAtdatetimeLast update timestamp
deletedAtdatetimeSoft delete timestamp

Budget Period Entity

FieldTypeDescription
idstringUnique identifier
budgetIdstringParent budget
periodNumbernumberSequential period number
startDatedatetimePeriod start date
endDatedatetimePeriod end date
baseAmountnumberOriginal allocation
rolloverAmountnumberAmount from previous period
totalAllocatednumberbase + rollover
spentAmountnumberConfirmed spending
pendingAmountnumberReserved, not confirmed
remainingAmountnumbertotal - spent - pending
statusenumACTIVE or CLOSED

Period Status:

  • ACTIVE - Current period, accepting transactions
  • CLOSED - Past period, no new transactions

User Budget Period Entity

For PER_USER budgets, each user has:

FieldTypeDescription
idstringUnique identifier
userIdstringUser this belongs to
budgetIdstringParent budget
budgetPeriodIdstringParent period
baseAmountnumberIndividual base allocation
rolloverAmountnumberIndividual rollover
totalAllocatednumberIndividual total
spentAmountnumberIndividual spending
pendingAmountnumberIndividual pending
remainingAmountnumberIndividual remaining

Cost Center Entity

FieldTypeRequiredDescription
idstringAutoUnique identifier
companyIdstringYesParent company
codestringYesUnique code (max 50 chars)
namestringYesDisplay name (max 255 chars)
descriptionstringNoDetailed description
parentIdstringNoParent cost center
isActivebooleanYesWhether active

Role Budget Assignment

FieldTypeDescription
idstringUnique identifier
companyIdstringCompany scope
roleIdstringAssigned role
budgetIdstringAssigned budget

Constraints:

  • One budget per role per company
  • Unique constraint on (companyId, roleId)

User Budget Assignment

FieldTypeRequiredDescription
idstringAutoUnique identifier
userIdstringYesAssigned user
budgetIdstringYesAssigned budget
effectiveFromdatetimeNoStart of assignment
effectiveUntildatetimeNoEnd of assignment

Constraints:

  • One budget per user
  • Unique constraint on userId

Budget Transaction Entity

FieldTypeDescription
idstringUnique identifier
budgetPeriodIdstringParent budget period
userBudgetPeriodIdstring?User period (for PER_USER budgets)
userIdstringUser who made the transaction
transactionTypeenumType of transaction
amountnumberTransaction amount
currencystringCurrency code
referenceTypestringWhat created this (ORDER, BOOKING_REQUEST)
referenceIdstringID of the reference
bookingRequestIdstring?Related booking request
orderIdstring?Related order
notestring?Optional note
metadataobject?Additional data
createdAtdatetimeWhen created

Transaction Types:

  • BOOKING_PENDING - Budget reserved for booking
  • BOOKING_COMPLETED - Booking confirmed
  • BOOKING_CANCELLED - Reservation released
  • REFUND - Amount credited back
  • ROLLOVER_IN - Amount received from previous period
  • ROLLOVER_OUT - Amount transferred to next period

Budget Violation Log Entity

Records when users exceed their budget (for audit and analytics):

FieldTypeDescription
idstringUnique identifier
companyIdstringCompany context
userIdstringUser who exceeded
budgetIdstringBudget that was exceeded
budgetPeriodIdstringPeriod when exceeded
referenceTypestringBOOKING_REQUEST or ORDER
referenceIdstringReference ID
requestedAmountnumberAmount user tried to book
availableAmountnumberAmount available at time
excessAmountnumberHow much over budget
currencystringCurrency code
enforcementModeenumMode in effect
actionstringAction taken (ALLOW, WARN, REQUIRE_APPROVAL, BLOCK)
createdAtdatetimeWhen violation occurred

Validation Rules

Budget Creation

FieldValidation
nameRequired, max 255 chars
amountRequired, > 0
currencyRequired, valid currency code
periodTypeRequired, valid enum
periodStartDayRequired, 1-28
periodStartMonthRequired for QUARTERLY/YEARLY, 1-12
rolloverPercentageIf PARTIAL, 1-100
maxRolloverAmountIf set, > 0

Cost Center Creation

FieldValidation
codeRequired, unique per company, max 50 chars
nameRequired, max 255 chars
parentIdIf set, must exist and be in same company

On this page