feat: add AFIP Factura C issuance support to ArcaCredentials and update cash flow model
This commit is contained in:
@@ -12,14 +12,26 @@ export enum INVOICE_STATUS {
|
||||
FAILED = "FAILED",
|
||||
}
|
||||
|
||||
export enum INVOICE_PAYMENT_METHOD {
|
||||
CASH = "cash",
|
||||
BANK_TRANSFER = "bank_transfer",
|
||||
CREDIT_CARD = "credit_card",
|
||||
DEBIT_CARD = "debit_card",
|
||||
OTHER = "other",
|
||||
}
|
||||
|
||||
export type CreateInvoiceFromCashMovementParams = {
|
||||
cashMovementId: string;
|
||||
billingDate: Date | string;
|
||||
paymentMethod: INVOICE_PAYMENT_METHOD | string;
|
||||
description: string;
|
||||
sessionUser: string;
|
||||
};
|
||||
|
||||
export type FindInvoicesParams = {
|
||||
id?: string;
|
||||
cashMovementId?: string;
|
||||
cashMovementIds?: string[];
|
||||
companyId?: string;
|
||||
status?: INVOICE_STATUS;
|
||||
sessionUser?: string;
|
||||
@@ -35,6 +47,9 @@ export type CreateInvoiceParams = {
|
||||
amount: number;
|
||||
type: INVOICE_TYPE;
|
||||
status: INVOICE_STATUS;
|
||||
billingDate: Date;
|
||||
paymentMethod: INVOICE_PAYMENT_METHOD | string;
|
||||
description: string;
|
||||
cae?: string;
|
||||
caeExpiresAt?: Date;
|
||||
pointOfSale?: number;
|
||||
@@ -46,6 +61,8 @@ export type CreateInvoiceParams = {
|
||||
updatedAt: Date;
|
||||
};
|
||||
|
||||
export type UpdateInvoiceParams = FindInvoicesParams & Partial<CreateInvoiceParams>;
|
||||
|
||||
export interface IInvoice {
|
||||
id?: string;
|
||||
cashMovementId: string;
|
||||
@@ -57,6 +74,9 @@ export interface IInvoice {
|
||||
amount: number;
|
||||
type: INVOICE_TYPE;
|
||||
status: INVOICE_STATUS;
|
||||
billingDate: Date;
|
||||
paymentMethod: INVOICE_PAYMENT_METHOD | string;
|
||||
description: string;
|
||||
cae?: string;
|
||||
caeExpiresAt?: Date;
|
||||
pointOfSale?: number;
|
||||
@@ -72,6 +92,7 @@ export interface IInvoicesAdapter {
|
||||
create(data: CreateInvoiceParams): Promise<IInvoice>;
|
||||
find(filters: FindInvoicesParams): Promise<IInvoice[]>;
|
||||
findOne(filters: FindInvoicesParams): Promise<IInvoiceDocument | null>;
|
||||
update(data: UpdateInvoiceParams): Promise<IInvoiceDocument | null>;
|
||||
}
|
||||
|
||||
export interface IInvoicesManager {
|
||||
|
||||
Reference in New Issue
Block a user