falcotura-atv-sdk
Version:
Librería (SDK) de Javascript/NodeJS para acceder al API de Administración Tributaria Virtual (ATV) del Ministerio de Hacienda.
69 lines (68 loc) • 1.98 kB
TypeScript
import { PersonProps } from '@src/ATV/core/Person';
import { Document } from '@src/ATV/core/Document';
import { DocumentNames } from '@src/ATV/core/DocumentType';
import { ReferenceInformationProps } from './ReferenceInformation';
import { ReceptorMessageProps } from './types';
type ReferenceInfoInput = ReferenceInformationProps;
type PersonInput = PersonProps;
type TaxInput = {
code: string;
rateCode: string;
rate: number;
amount?: number;
};
type OrderInput = {
detail: string;
unitaryPrice: number;
lineNumber?: string;
code?: string;
quantity?: number;
measureUnit?: string;
totalAmount?: number;
subTotal?: number;
tax?: TaxInput;
totalOrderLineAmount?: number;
};
type DocumentInputBase = {
emitter: PersonInput;
branch: string;
terminal: string;
documentName: DocumentNames;
providerId: string;
countryCode: string;
securityCode: string;
activityCode: string;
consecutiveIdentifier: string;
ceSituation: string;
orderLines: OrderInput[];
referenceInfo?: ReferenceInfoInput;
conditionSale: string;
paymentMethod: string;
currencyCode?: string;
exchangeRate?: string;
};
type DocumentInputTiquete = DocumentInputBase & {
documentName: 'TiqueteElectronico';
receiver?: PersonInput;
};
export type DocumentInputWithReceiver = DocumentInputBase & {
documentName: Exclude<DocumentNames, 'TiqueteElectronico'>;
receiver: PersonInput;
};
type DocumentInput = DocumentInputTiquete | DocumentInputWithReceiver;
export type CreateDocumentInput = {
document: DocumentInput;
token: string;
receptorMessageProps?: ReceptorMessageProps;
signatureOptions: {
buffer: string;
password: string;
};
};
export declare class CreateDocFactory {
createDocument(document: CreateDocumentInput['document']): Document;
private createOrderLines;
private createFullConsecutive;
private createClave;
}
export {};