first commit

This commit is contained in:
2026-07-16 20:48:43 -03:00
commit 5696cee264
1111 changed files with 322270 additions and 0 deletions
@@ -0,0 +1,67 @@
import {
CreateCashFlowParams,
DeleteByClientAccountMovementParams,
DeleteMovementByPaymentParams,
DeleteMovementParams,
} from "../CashFlow/CashFlow.Interface";
import { ICashFlowBalanceDocument } from "./CashFlowBalance.Adapter.Mongoose";
export type FindCashFlowBalanceParams = {
companyId: string;
year: number;
month: number;
sessionUser: string;
};
export type CreateCashFlowBalanceParams = {
companyId: string;
amount: number;
year: number;
month: number;
updatedAt: Date;
};
export type CalculateCashFlowBalanceParams = {
companyId: string;
year: number;
month: number;
sessionUser: string;
};
export interface ICashFlowBalance {
id?: string;
companyId: string;
amount: number;
year: number;
month: number;
updatedAt: Date;
}
export interface CashFlowHistoryItem {
amount: number;
month: number;
year: number;
}
export interface CashFlowHistoryView {
companyId: string;
data: CashFlowHistoryItem[];
total: number;
}
export interface ICashFlowBalanceAdapter {
create(data: CreateCashFlowBalanceParams): Promise<ICashFlowBalance>;
delete(id: string): Promise<void>;
find(filters: FindCashFlowBalanceParams): Promise<ICashFlowBalance[]>;
findOne(filters: FindCashFlowBalanceParams): Promise<ICashFlowBalanceDocument | null>;
}
export interface ICashFlowBalanceManager {
balance: ICashFlowBalanceAdapter;
createCashFlowMovement(data: CreateCashFlowParams): Promise<void>;
calculateBalance(data: CalculateCashFlowBalanceParams): Promise<ICashFlowBalance>;
delete(data: DeleteMovementParams): Promise<void>;
deleteByPayment(data: DeleteMovementByPaymentParams): Promise<void>;
deleteByClientAccountMovement(data: DeleteByClientAccountMovementParams): Promise<void>;
history(data: FindCashFlowBalanceParams): Promise<CashFlowHistoryView>;
}