mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
add server to monorepo.
This commit is contained in:
128
packages/server/src/interfaces/CashflowService.ts
Normal file
128
packages/server/src/interfaces/CashflowService.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import { Knex } from 'knex';
|
||||
import { IAccount } from './Account';
|
||||
|
||||
export interface ICashflowAccountTransactionsFilter {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export interface ICashflowAccountsFilter {
|
||||
inactiveMode: boolean;
|
||||
stringifiedFilterRoles?: string;
|
||||
sortOrder: string;
|
||||
columnSortBy: string;
|
||||
}
|
||||
|
||||
export interface ICashflowAccount {
|
||||
id: number;
|
||||
name: string;
|
||||
balance: number;
|
||||
formattedBalance: string;
|
||||
accountType: string;
|
||||
}
|
||||
|
||||
interface ICashflowCommandLineDTO {
|
||||
creditAccountId: number;
|
||||
cashflowAccountId: number;
|
||||
amount: number;
|
||||
index: number;
|
||||
}
|
||||
|
||||
export interface ICashflowCommandDTO {
|
||||
date: Date;
|
||||
|
||||
transactionNumber: string;
|
||||
referenceNo: string;
|
||||
transactionType: string;
|
||||
description: string;
|
||||
|
||||
amount: number;
|
||||
exchangeRate: number;
|
||||
currencyCode: string;
|
||||
|
||||
creditAccountId: number;
|
||||
cashflowAccountId: number;
|
||||
|
||||
publish: boolean;
|
||||
branchId?: number;
|
||||
}
|
||||
|
||||
export interface ICashflowNewCommandDTO extends ICashflowCommandDTO {}
|
||||
|
||||
export interface ICashflowTransaction {
|
||||
id?: number;
|
||||
date: Date;
|
||||
|
||||
referenceNo: string;
|
||||
description: string;
|
||||
|
||||
transactionType: string;
|
||||
transactionNumber: string;
|
||||
|
||||
amount: number;
|
||||
localAmount?: number;
|
||||
currencyCode: string;
|
||||
exchangeRate: number;
|
||||
|
||||
publishedAt?: Date | null;
|
||||
userId: number;
|
||||
entries: ICashflowTransactionLine[];
|
||||
|
||||
creditAccountId: number;
|
||||
cashflowAccountId: number;
|
||||
|
||||
creditAccount?: IAccount;
|
||||
cashflowAccount?: IAccount;
|
||||
|
||||
branchId?: number;
|
||||
isPublished: boolean;
|
||||
|
||||
isCashDebit?: boolean;
|
||||
isCashCredit?: boolean;
|
||||
}
|
||||
|
||||
export interface ICashflowTransactionLine {
|
||||
creditAccountId: number;
|
||||
cashflowAccountId: number;
|
||||
amount: number;
|
||||
index: number;
|
||||
|
||||
creditAccount?: IAccount;
|
||||
}
|
||||
|
||||
export enum CashflowDirection {
|
||||
IN = 'in',
|
||||
OUT = 'out',
|
||||
}
|
||||
|
||||
export interface ICommandCashflowCreatingPayload {
|
||||
tenantId: number;
|
||||
trx: Knex.Transaction;
|
||||
newTransactionDTO: ICashflowNewCommandDTO;
|
||||
}
|
||||
|
||||
export interface ICommandCashflowCreatedPayload {
|
||||
tenantId: number;
|
||||
newTransactionDTO: ICashflowNewCommandDTO;
|
||||
cashflowTransaction: ICashflowTransaction;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ICommandCashflowDeletingPayload {
|
||||
tenantId: number;
|
||||
oldCashflowTransaction: ICashflowTransaction;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export interface ICommandCashflowDeletedPayload {
|
||||
tenantId: number;
|
||||
cashflowTransactionId: number;
|
||||
oldCashflowTransaction: ICashflowTransaction;
|
||||
trx: Knex.Transaction;
|
||||
}
|
||||
|
||||
export enum CashflowAction {
|
||||
Create = 'Create',
|
||||
Delete = 'Delete',
|
||||
View = 'View',
|
||||
}
|
||||
Reference in New Issue
Block a user