[@acaldas/document-model-libs](../README.md) / [Exports](../modules.md) / BudgetStatement

# Namespace: BudgetStatement

The BudgetStatement module provides functionality for managing budget statements.

**`Remarks`**

This module exports the following:
- All the actions available of the BudgetStatement model, as well as those from the base document.
- The reducer which implements the business logic for each action.
- BudgetStatement: A class representing a budget statement object, to manage a budget statement in an imperative way.
- Utility functions to create Budget Statements and load/save to file.

## Namespaces

- [actions](BudgetStatement.actions.md)
- [utils](BudgetStatement.utils.md)

## Classes

- [BudgetStatement](../classes/BudgetStatement.BudgetStatement.md)

## Type Aliases

### Account

Ƭ **Account**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"Account"`` |
| `address` | `Scalars`[``"String"``] |
| `lineItems` | [`LineItem`](BudgetStatement.md#lineitem)[] |
| `name` | `Scalars`[``"String"``] |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:29

___

### AccountInput

Ƭ **AccountInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `address` | `Scalars`[``"String"``] |
| `lineItems?` | `InputMaybe`<[`LineItemInput`](BudgetStatement.md#lineiteminput)[]\> |
| `name?` | `InputMaybe`<`Scalars`[``"String"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:35

___

### AuditReport

Ƭ **AuditReport**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"AuditReport"`` |
| `report` | `Scalars`[``"String"``] |
| `status` | [`AuditReportStatus`](BudgetStatement.md#auditreportstatus) \| \`${AuditReportStatus}\` |
| `timestamp` | `Scalars`[``"DateTime"``] |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:81

___

### AuditReportInput

Ƭ **AuditReportInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `report` | `DocumentFileInput` |
| `status` | [`AuditReportStatus`](BudgetStatement.md#auditreportstatus) \| \`${AuditReportStatus}\` |
| `timestamp?` | `InputMaybe`<`Scalars`[``"DateTime"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:87

___

### AuditReportStatus

Ƭ **AuditReportStatus**: ``"Approved"`` \| ``"ApprovedWithComments"`` \| ``"Escalated"`` \| ``"NeedsAction"``

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:92

___

### BudgetStatementAction

Ƭ **BudgetStatementAction**: `AddAccountAction` \| `AddAuditReportAction` \| `AddCommentAction` \| `AddLineItemAction` \| `AddVestingAction` \| `DeleteAccountAction` \| `DeleteAuditReportAction` \| `DeleteCommentAction` \| `DeleteLineItemAction` \| `DeleteVestingAction` \| `SetFtesAction` \| `SetMonthAction` \| `SetOwnerAction` \| `SetQuoteCurrencyAction` \| `SortAccountsAction` \| `SortLineItemsAction` \| `UpdateAccountAction` \| `UpdateCommentAction` \| `UpdateLineItemAction` \| `UpdateVestingAction`

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:104

___

### BudgetStatementDocument

Ƭ **BudgetStatementDocument**: `Document`<[`State`](BudgetStatement.md#state), [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction)\>

Represents a budget statement document, which extends the base Document type.

#### Defined in

[src/budget-statement/custom/types.ts:53](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/types.ts#L53)

___

### BudgetStatus

Ƭ **BudgetStatus**: ``"Draft"`` \| ``"Escalated"`` \| ``"Final"`` \| ``"Review"``

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:134

___

### Comment

Ƭ **Comment**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"Comment"`` |
| `author` | `CommentAuthor` |
| `comment` | `Scalars`[``"String"``] |
| `key` | `Scalars`[``"String"``] |
| `status` | [`BudgetStatus`](BudgetStatement.md#budgetstatus) \| \`${BudgetStatus}\` |
| `timestamp` | `Scalars`[``"DateTime"``] |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:135

___

### CommentInput

Ƭ **CommentInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `author?` | `InputMaybe`<`CommentAuthorInput`\> |
| `comment` | `Scalars`[``"String"``] |
| `key?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `status?` | `InputMaybe`<[`BudgetStatus`](BudgetStatement.md#budgetstatus) \| \`${BudgetStatus}\`\> |
| `timestamp?` | `InputMaybe`<`Scalars`[``"DateTime"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:156

___

### Ftes

Ƭ **Ftes**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"Ftes"`` |
| `forecast` | `FtesForecast`[] |
| `value` | `Scalars`[``"Float"``] |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:217

___

### FtesInput

Ƭ **FtesInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `forecast` | `FtesForecastInput`[] |
| `value` | `Scalars`[``"Float"``] |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:231

___

### LineItem

Ƭ **LineItem**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"LineItem"`` |
| `actual` | `Maybe`<`Scalars`[``"Float"``]\> |
| `budgetCap` | `Maybe`<`Scalars`[``"Float"``]\> |
| `category` | `Maybe`<`LineItemCategory`\> |
| `comment` | `Maybe`<`Scalars`[``"String"``]\> |
| `forecast` | `LineItemForecast`[] |
| `group` | `Maybe`<`LineItemGroup`\> |
| `headcountExpense` | `Scalars`[``"Boolean"``] |
| `payment` | `Maybe`<`Scalars`[``"Float"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:250

___

### LineItemInput

Ƭ **LineItemInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `actual?` | `InputMaybe`<`Scalars`[``"Float"``]\> |
| `budgetCap?` | `InputMaybe`<`Scalars`[``"Float"``]\> |
| `category?` | `InputMaybe`<`LineItemCategory`\> |
| `comment?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `forecast?` | `InputMaybe`<`LineItemForecast`[]\> |
| `group?` | `InputMaybe`<`LineItemGroup`\> |
| `headcountExpense?` | `InputMaybe`<`Scalars`[``"Boolean"``]\> |
| `payment?` | `InputMaybe`<`Scalars`[``"Float"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:283

___

### Owner

Ƭ **Owner**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"Owner"`` |
| `id` | `Maybe`<`Scalars`[``"String"``]\> |
| `ref` | `Maybe`<`Scalars`[``"String"``]\> |
| `title` | `Maybe`<`Scalars`[``"String"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:421

___

### OwnerInput

Ƭ **OwnerInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `id?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `ref?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `title?` | `InputMaybe`<`Scalars`[``"String"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:427

___

### State

Ƭ **State**: `BudgetStatementData`

Represents the state of a budget statement.

#### Defined in

[src/budget-statement/custom/types.ts:48](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/types.ts#L48)

___

### Vesting

Ƭ **Vesting**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `__typename?` | ``"Vesting"`` |
| `amount` | `Scalars`[``"String"``] |
| `amountOld` | `Scalars`[``"String"``] |
| `comment` | `Scalars`[``"String"``] |
| `currency` | `Scalars`[``"String"``] |
| `date` | `Scalars`[``"String"``] |
| `key` | `Scalars`[``"String"``] |
| `vested` | `Scalars`[``"Boolean"``] |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:539

___

### VestingInput

Ƭ **VestingInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `amount?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `amountOld?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `comment?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `currency?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `date?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `key?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `vested?` | `InputMaybe`<`Scalars`[``"Boolean"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:549

___

### VestingUpdateInput

Ƭ **VestingUpdateInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `amount?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `amountOld?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `comment?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `currency?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `date?` | `InputMaybe`<`Scalars`[``"String"``]\> |
| `key` | `Scalars`[``"String"``] |
| `vested?` | `InputMaybe`<`Scalars`[``"Boolean"``]\> |

#### Defined in

node_modules/@acaldas/document-model-graphql/dist/budget-statement/types.d.ts:558

## Functions

### reducer

▸ **reducer**(`state`, `action`): `Document`<`BudgetStatementData`, [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction)\>

Reducer for the BudgetStatement module, which handles operations related to budget statements.

**`Remarks`**

This reducer handles the following actions:
- `INIT`: initializes the state of the module.
- `ADD_ACCOUNT`: adds an account to the state.
- `UPDATE_ACCOUNT`: updates an account in the state.
- `DELETE_ACCOUNT`: removes an account from the state.
- `ADD_LINE_ITEM`: adds a line item to an account in the state.
- `UPDATE_LINE_ITEM`: updates a line item in an account in the state.
- `DELETE_LINE_ITEM`: removes a line item from an account in the state.
- `SUBMIT_FOR_REVIEW`: updates the status of the budget statement to "Under Review".
- `ESCALATE`: escalates the budget statement to a higher authority.
- `APPROVE`: approves the budget statement.
- `REOPEN_TO_DRAFT`: changes the status of the budget statement to "Draft".
- `REOPEN_TO_REVIEW`: changes the status of the budget statement to "Under Review".
- `ADD_AUDIT_REPORT`: adds an audit report to an account in the state.
- `DELETE_AUDIT_REPORT`: removes an audit report from an account in the state.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `state` | `Document`<`BudgetStatementData`, `BaseAction` \| [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction)\> | The current state of the module. |
| `action` | `BaseAction` \| [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction) | The action to be performed on the state. |

#### Returns

`Document`<`BudgetStatementData`, [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction)\>

The new state after applying the action.

#### Defined in

[src/document/utils/base.ts:64](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/document/utils/base.ts#L64)
