feat: add Service api with interface

This commit is contained in:
Luis Felipe Cadavid 2024-09-30 15:19:20 -05:00
parent ab7a02bcca
commit a440f954ad
35 changed files with 1027 additions and 23 deletions

View file

@ -0,0 +1,19 @@
export interface GetCustomerOutputInterface {
id?: string;
idCompany?: string;
idSubsidiary?: number;
name?: string;
lastname?: string;
idTypeCustomer?: string;
dni?: string;
idGender?: string;
idMaritalStatus?: string;
address?: string;
mail?: string;
phone?: string;
idUser?: string;
status?: any;
validateOnline?: boolean;
size?: number;
page?: number;
}

View file

@ -0,0 +1,13 @@
export interface GetTypeDNIOutputInterface {
id?: string;
name?: string;
alias?: string;
longitude?: string;
status?: any;
idMethodValidation?: string;
nameMethodValidation?: string;
idUser?: string;
dataType?: string;
size?: number;
page?: number;
}

View file

@ -0,0 +1,10 @@
export interface GetTypeValidationOutputInrerface {
id?: string;
idCountry?: string;
name?: string;
alias?: string;
status?: string | null;
idUser?: string;
page?: number;
size?: number;
}

View file

@ -0,0 +1,18 @@
export interface SaveCustomerOutputInteface {
id?: string;
idCompany?: string;
idSubsidiary?: string;
name?: string;
secondName?: string;
firstSurname?: string;
secondSurname?: string;
idTypeCustomer?: string;
dni?: string;
idGender?: string;
idMaritalStatus?: string;
address?: string;
mail?: string;
phone?: string;
idUser?: string;
status?: any;
}

View file

@ -0,0 +1,10 @@
export interface SaveTypeDniOutputInterface {
id?: string;
name?: string;
alias?: string;
longitude?: number;
status?: any;
idMethodValidation?: string;
idUser?: string;
dataType?: string;
}

View file

@ -0,0 +1,8 @@
export interface SaveTypeValidationOutputInterface {
id?: string;
idCountry?: string;
name?: string;
alias?: string;
status?: any;
idUser?: string;
}

View file

@ -0,0 +1,15 @@
interface Product {
sku: string;
value: number;
}
export interface AddProductsOutputInterface {
idTransaction?: string;
storeNumber?: string;
idSubsidiary?: number;
clientNit?: string;
idUser?: string;
localDate?: Date;
pos?: string;
products: Product[];
}

View file

@ -0,0 +1,30 @@
export interface Payment {
type: string;
approvalCode: string;
receiptNumber: string;
value: number;
cardNumber: string;
cardType: string;
comment: string;
}
export interface InfoPos {
addressPos: string;
codeMunPos: string;
nameMunPos: string;
codeDepPos: string;
nameDepPos: string;
pos: string;
}
export interface EndSaleOutputInterface {
idTransaction: string;
storeNumber: string;
idSubsidiary: number;
idUser: string;
localDate: string;
pos: string;
comment: string;
payment: Payment[];
infoPos: InfoPos;
}

View file

@ -0,0 +1,7 @@
export interface GetSaleOutputInterface {
idTransaction?: string;
storeNumber?: number;
idSubsidiary?: string;
idUser?: string;
pos?: string;
}

View file

@ -0,0 +1,15 @@
export interface Product {
sku: string;
value: number;
}
export interface Transaction {
idTransaction: string;
storeNumber: string;
idSubsidiary: number;
clientNit: string;
idUser: string;
localDate: string;
pos: string;
products: Product[];
}

View file

@ -0,0 +1,17 @@
export interface StartSaleOutputInterface {
storeNumber?: string;
idSubsidiary?: number;
idClient?: string;
clientDni?: string;
idType?: string;
idGroup?: string;
invoiceName?: string;
invoiceTypeNit?: string;
invoiceNit?: string;
invoiceDirection?: string;
invoiceCellPhone?: string;
invoiceEmail?: string;
idUser?: string;
localDate?: string;
pos?: string;
}

View file

@ -0,0 +1,23 @@
export interface UserResposeInterface {
id: string;
idSubsidiary: number;
subsidiaryName: string;
idCompany: string;
companyName: string;
name: string;
lastName: string;
email: string;
cellphone: string;
idTypeUser: string;
typeName: string;
isActive: boolean;
isAdmin: boolean;
}
export interface LoginResponse {
correct?: boolean;
message: string;
errorCode?: number;
object: UserResposeInterface | null;
}

View file

@ -0,0 +1,47 @@
export interface CustomerResponseInterface {
correct: boolean;
message: string;
errorCode: number;
object: CustomerObjectInterface;
}
export interface CustomerObjectInterface {
page: number;
size: number;
totalPage: number;
list: CustomerInterface[];
}
export interface CustomerInterface {
id?: string;
idCompany?: string;
companyName?: string;
idSubsidiary?: number;
nameSubsidiary?: string;
externalClientId?: string | null;
name?: string;
secondName?: string;
firstSurname?: string;
secondSurname?: string;
idTypeCustomer: string;
nameTypeCustomer?: string;
dni: string;
idGender?: string;
nameGender?: string;
idMaritalStatus?: string | null;
nameMaritalStatus?: string | null;
address: string;
idCity?: string | null;
nameCity?: string | null;
idCountry?: string | null;
nameCountry?: string | null;
mail: string;
phone: string;
idUser?: string;
nameUser?: string;
status: boolean;
birthdate?: string | null;
group: any[];
NameSurname?: string;
SurnameName?: string;
}

View file

@ -0,0 +1,27 @@
export interface CustomerDniTypeResponseInterface {
correct: boolean;
message: string;
errorCode: number;
object: CustomerDniTypeObjectInterface;
}
export interface CustomerDniTypeObjectInterface {
page: number;
size: number;
totalPage: number;
list: CustomerDniTypeInterface[];
}
export interface CustomerDniTypeInterface {
id: string;
name: string;
alias: string;
longitude: string;
status: boolean;
idMethodValidation: string;
nameMethodValidation: string;
dataType: string | null;
idUser: string;
nameUser: string;
}

View file

@ -0,0 +1,25 @@
export interface CustomerTypeValidationResponseInterface {
correct: boolean;
message: string;
errorCode: number;
object: CustomerTypeValidationObjectInterface;
}
export interface CustomerTypeValidationObjectInterface {
page: number;
size: number;
totalPage: number;
list: CustomerTypeValidationInterface[];
}
export interface CustomerTypeValidationInterface {
id: string;
idCountry: string;
nameCountry: string;
name: string;
alias: string;
status: boolean;
idUser: string;
nameUser: string;
}

View file

@ -0,0 +1,39 @@
export interface Tax {
id: string;
idSaleDetail: string;
idProduct: string;
idTax: string;
name: string;
alias: string;
percent: number;
totalPriceBeforeTaxes: number;
taxValue: number;
taxUnitValue: number | null;
taxIncluded: boolean;
}
export interface ItemObject {
id: string;
itemIdentifier: string;
regularUnitPrice: number;
totalTaxes: number;
extendedPrice: number;
name: string;
idDepartment: string | null;
departmentNumber: string | null;
description: string;
longDescription: string;
quantity: number;
restrictedAge: number;
taxableFlag: boolean;
weight: number | null;
taxes: Tax[];
weighable: boolean;
}
export interface AddProductsResponseInterface {
correct: boolean;
message: string | null;
errorCode: number;
object: ItemObject;
}

View file

@ -0,0 +1,15 @@
export interface TransactionObject {
StatusCV: boolean;
QRCode: string;
description: string;
numFac: string;
status: string;
cufe: string;
}
export interface EndSaleResponseInterface {
correct: boolean;
message: string;
errorCode: number;
object: TransactionObject;
}

View file

@ -0,0 +1,107 @@
export interface Tax {
id: string;
idSaleDetail: string;
idProduct: string;
idTax: string;
name: string;
alias: string;
percent: number;
totalPriceBeforeTaxes: number;
taxValue: number;
taxUnitValue: number | null;
taxIncluded: boolean;
}
export interface SaleDetail {
idDetail: string;
idTransaction: string;
id: string;
itemIdentifier: string;
name: string;
unitMeasurement: string;
idDepartment: string | null;
departmentNumber: string | null;
description: string;
quantity: number;
weight: number | null;
regularUnitPrice: number;
originalUnitPrice: number;
discount: number;
totalTaxes: number;
taxableFlag: boolean;
restrictedAge: number;
idSaleState: number;
idUser: string;
creation: string;
lastUpdate: string;
taxes: Tax[];
active: boolean;
weighable: boolean;
extendedPrice: number;
}
export interface CustomerPromotion {
groupId: string;
customerId: string;
percentageDiscount: number | null;
}
export interface ItemPromotion {
index: number;
code: string;
quantity: number;
unitPrice: number;
attribute: string | null;
promotionTrace: string | null;
resultPercentDiscount: number | null;
weighable: boolean;
}
export interface Promotions {
customer: CustomerPromotion;
items: ItemPromotion[];
total: number;
listPromotion: any[]; // Assuming this is an empty array, can adjust if more data is provided
}
export interface SaleTransactionObject {
id: string;
idCompany: string;
idSubsidiary: number;
transactionNumber: string;
idClient: string;
clientName: string;
clientDni: string;
idType: string;
totalSale: number;
totalTaxes: number;
totalWithPromotion: number;
idGroup: string;
group: string;
invoiceCode: string | null;
invoiceName: string;
invoiceTypeDni: string;
invoiceDni: string;
invoiceDirection: string;
invoiceCellPhone: string;
invoiceEmail: string;
idUser: string;
idSaleState: number;
numberStore: string;
pos: string;
posLocalTimeStart: string;
posLocalTimeEnd: string | null;
localDateTime: string | null;
creation: string;
lastUpdate: string;
list: SaleDetail[];
promotions: Promotions;
}
export interface GetSaleResponseInterface {
correct: boolean;
message: string | null;
errorCode: number;
object: SaleTransactionObject;
}

View file

@ -0,0 +1,41 @@
// interfaces/ProductDetails.ts
export interface Tax {
id: string;
idSaleDetail: string;
idProduct: string;
idTax: string;
name: string;
alias: string;
percent: number;
totalPriceBeforeTaxes: number;
taxValue: number;
taxUnitValue: number | null;
taxIncluded: boolean;
}
export interface ProductObject {
id: string;
itemIdentifier: string;
regularUnitPrice: number;
totalTaxes: number;
extendedPrice: number;
name: string;
idDepartment: string | null;
departmentNumber: string | null;
description: string;
longDescription: string;
quantity: number;
restrictedAge: number;
taxableFlag: boolean;
weight: number | null;
taxes: Tax[];
weighable: boolean;
}
export interface RemoveProductsResponseInterface {
correct: boolean;
message: string | null;
errorCode: number;
object: ProductObject;
}

View file

@ -0,0 +1,11 @@
export interface TransactionObject {
id: string;
transactionNumber: string;
}
export interface StartSaleResponseInterface {
correct: boolean;
message: string;
errorCode: number;
object: TransactionObject;
}