[@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.

## Table of contents

### Namespaces

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

### Classes

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

### Type Aliases

- [Account](BudgetStatement.md#account)
- [AccountInput](BudgetStatement.md#accountinput)
- [AddAuditReportInput](BudgetStatement.md#addauditreportinput)
- [AuditReport](BudgetStatement.md#auditreport)
- [AuditReportStatus](BudgetStatement.md#auditreportstatus)
- [BudgetStatementAction](BudgetStatement.md#budgetstatementaction)
- [BudgetStatementDocument](BudgetStatement.md#budgetstatementdocument)
- [BudgetStatementState](BudgetStatement.md#budgetstatementstate)
- [BudgetStatus](BudgetStatement.md#budgetstatus)
- [Comment](BudgetStatement.md#comment)
- [CommentInput](BudgetStatement.md#commentinput)
- [ExtendedBudgetStatementState](BudgetStatement.md#extendedbudgetstatementstate)
- [Ftes](BudgetStatement.md#ftes)
- [FtesInput](BudgetStatement.md#ftesinput)
- [LineItem](BudgetStatement.md#lineitem)
- [LineItemInput](BudgetStatement.md#lineiteminput)
- [Owner](BudgetStatement.md#owner)
- [OwnerInput](BudgetStatement.md#ownerinput)
- [Vesting](BudgetStatement.md#vesting)
- [VestingInput](BudgetStatement.md#vestinginput)
- [VestingUpdateInput](BudgetStatement.md#vestingupdateinput)

### Functions

- [reducer](BudgetStatement.md#reducer)

## 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

___

### AddAuditReportInput

Ƭ **AddAuditReportInput**: `Object`

#### Type declaration

| Name | Type |
| :------ | :------ |
| `reports` | [`AuditReport`](BudgetStatement.md#auditreport)[] |

#### Defined in

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

___

### 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:82

___

### AuditReportStatus

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

#### Defined in

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

___

### 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:99

___

### BudgetStatementDocument

Ƭ **BudgetStatementDocument**: [`Document`](Document.md#document)<[`BudgetStatementState`](BudgetStatement.md#budgetstatementstate), [`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/d48c213/src/budget-statement/custom/types.ts#L53)

___

### BudgetStatementState

Ƭ **BudgetStatementState**: `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/d48c213/src/budget-statement/custom/types.ts#L48)

___

### BudgetStatus

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

#### Defined in

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

___

### 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:130

___

### 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:151

___

### ExtendedBudgetStatementState

Ƭ **ExtendedBudgetStatementState**: [`ExtendedState`](Document.md#extendedstate)<[`BudgetStatementState`](BudgetStatement.md#budgetstatementstate)\>

#### Defined in

[src/budget-statement/custom/types.ts:60](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/types.ts#L60)

___

### 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:213

___

### 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:227

___

### 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:246

___

### 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:280

___

### 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:418

___

### 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:424

___

### 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:536

___

### 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:546

___

### 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:555

## Functions

### reducer

▸ **reducer**(`state`, `action`): [`Document`](Document.md#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`](Document.md#document)<`BudgetStatementData`, [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction)\> | The current state of the module. |
| `action` | [`BaseAction`](Document.md#baseaction) \| [`BudgetStatementAction`](BudgetStatement.md#budgetstatementaction) | The action to be performed on the state. |

#### Returns

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

The new state after applying the action.

#### Defined in

[src/document/types.ts:25](https://github.com/acaldas/document-model-libs/blob/d48c213/src/document/types.ts#L25)
