Class BudgetStatement. BudgetStatement
source · [−]Expand description
This is an abstract class representing a document and provides methods for creating and manipulating documents.
@typeparam
T - The type of data stored in the document.
@typeparam
A - The type of action the document can take.
Constructors
source
constructor
constructor
source
new (initialState?: Partial<Omit<BudgetStatementDocument, "data"> & {
data: Partial<BudgetStatementData>;
}>): BudgetStatement
new (initialState?: Partial<Omit<BudgetStatementDocument, "data"> & {
data: Partial<BudgetStatementData>;
}>): BudgetStatement
Creates a new BudgetStatement instance.
Properties
source
state
state
source
state: Document<BudgetStatementData, BudgetStatementAction>
state: Document<BudgetStatementData, BudgetStatementAction>
Account
source
addAccount
addAccount
source
(accounts: AccountInput[]): BudgetStatement
(accounts: AccountInput[]): BudgetStatement
Adds one or more accounts to the budget statement.
source
deleteAccount
deleteAccount
source
(accounts: string[]): BudgetStatement
(accounts: string[]): BudgetStatement
Deletes one or more accounts from the budget statement.
source
sortAccounts
sortAccounts
source
(accounts: string[]): BudgetStatement
(accounts: string[]): BudgetStatement
Sorts the accounts inthe budget statement.
source
updateAccount
updateAccount
source
(accounts: AccountUpdateInput[]): BudgetStatement
(accounts: AccountUpdateInput[]): BudgetStatement
Updates one or more existing accounts in the budget statement.
Budget Statement
Other
Audit
source
addAuditReport
addAuditReport
source
(reports: {
report: DocumentFile;
status: AuditReportStatus;
timestamp?: string;
}[]): BudgetStatement
(reports: {
report: DocumentFile;
status: AuditReportStatus;
timestamp?: string;
}[]): BudgetStatement
Adds audit reports to the budget statement.
source
deleteAuditReport
deleteAuditReport
source
(reports: string[]): BudgetStatement
(reports: string[]): BudgetStatement
Deletes audit reports from the budget statement.
source
getAuditReport
getAuditReport
source
(report: string): undefined | AuditReport
(report: string): undefined | AuditReport
Retrieves a specific audit report from the budget statement.
@returns
The audit report object if it exists, or undefined if not.
source
getAuditReports
getAuditReports
source
(): AuditReport[]
(): AuditReport[]
Retrieves all audit reports from the budget statement.
@returns
An array of audit report objects.
Methods
source
addComment
addComment
source
(comments: CommentInput[]): BudgetStatement
(comments: CommentInput[]): BudgetStatement
source
addVesting
addVesting
source
(vesting: VestingInput[]): BudgetStatement
(vesting: VestingInput[]): BudgetStatement
source
deleteComment
deleteComment
source
(comments: string[]): BudgetStatement
(comments: string[]): BudgetStatement
source
deleteVesting
deleteVesting
source
(vesting: string[]): BudgetStatement
(vesting: string[]): BudgetStatement
source
dispatch
dispatch
source
(action: BaseAction | BudgetStatementAction): BudgetStatement
(action: BaseAction | BudgetStatementAction): BudgetStatement
Dispatches an action to update the state of the document.
@returns
The Document instance.
source
loadState
loadState
source
(state: Pick<Document<BudgetStatementData, BudgetStatementAction>, "name" | "data">, operations: number): void
(state: Pick<Document<BudgetStatementData, BudgetStatementAction>, "name" | "data">, operations: number): void
Loads a document state and a set of operations.
source
setFtes
setFtes
source
(ftes: FtesInput): BudgetStatement
(ftes: FtesInput): BudgetStatement
source
setMonth
setMonth
source
(month: string): BudgetStatement
(month: string): BudgetStatement
source
setOwner
setOwner
source
(owner: OwnerInput): BudgetStatement
(owner: OwnerInput): BudgetStatement
source
setQuoteCurrency
setQuoteCurrency
source
(currency: string): BudgetStatement
(currency: string): BudgetStatement
source
updateComment
updateComment
source
(comments: CommentUpdateInput[]): BudgetStatement
(comments: CommentUpdateInput[]): BudgetStatement
source
updateVesting
updateVesting
source
(vesting: VestingUpdateInput[]): BudgetStatement
(vesting: VestingUpdateInput[]): BudgetStatement
source
fromFile
fromFile
source
(path: string): Promise<BudgetStatement>
(path: string): Promise<BudgetStatement>
Creates a new BudgetStatement
instance from a file.
@returns
A promise that resolves with the loaded BudgetStatement
instance.
Line Item
source
addLineItem
addLineItem
source
(account: string, lineItems: (Partial<LineItem> & Pick<LineItem, "category" | "group">)[]): BudgetStatement
(account: string, lineItems: (Partial<LineItem> & Pick<LineItem, "category" | "group">)[]): BudgetStatement
Adds a line item to the specified account.
source
deleteLineItem
deleteLineItem
source
(account: string, lineItems: LineItemDeleteInput[]): BudgetStatement
(account: string, lineItems: LineItemDeleteInput[]): BudgetStatement
Deletes line items for the specified account.
source
sortLineItems
sortLineItems
source
(account: string, lineItems: LineItemsSortInput[]): BudgetStatement
(account: string, lineItems: LineItemsSortInput[]): BudgetStatement
Sorts the line items of an account.
source
updateLineItem
updateLineItem
source
(account: string, lineItems: LineItemUpdateInput[]): BudgetStatement
(account: string, lineItems: LineItemUpdateInput[]): BudgetStatement
Updates line items for the specified account.
comments