hvp-shared 6.5.0 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/contracts/index.js
CHANGED
|
@@ -20,3 +20,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
__exportStar(require("./collaborator"), exports);
|
|
22
22
|
__exportStar(require("./catalog-item"), exports);
|
|
23
|
+
__exportStar(require("./qvet"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* QVET API Contracts
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QVET API Response Types
|
|
3
|
+
*
|
|
4
|
+
* Response interfaces for QVET data endpoints.
|
|
5
|
+
* Used by frontend to consume synced QVET data.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Single sale record from QVET
|
|
9
|
+
* Represents one line item in a sale transaction
|
|
10
|
+
*/
|
|
11
|
+
export interface QvetSaleResponse {
|
|
12
|
+
_id: string;
|
|
13
|
+
date: string;
|
|
14
|
+
warehouse: string;
|
|
15
|
+
subtotal: number;
|
|
16
|
+
paidAmount: number;
|
|
17
|
+
total: number;
|
|
18
|
+
quantity: number;
|
|
19
|
+
discount: number;
|
|
20
|
+
debt: number;
|
|
21
|
+
taxAmount: number;
|
|
22
|
+
taxRate: number;
|
|
23
|
+
paymentMethod: string;
|
|
24
|
+
priceList: string;
|
|
25
|
+
qvetCode: number;
|
|
26
|
+
productName: string;
|
|
27
|
+
section: string;
|
|
28
|
+
family: string;
|
|
29
|
+
subfamily: string;
|
|
30
|
+
isActive: boolean;
|
|
31
|
+
hasStockControl: boolean;
|
|
32
|
+
customerName: string;
|
|
33
|
+
qvetCustomerId?: number;
|
|
34
|
+
petName?: string;
|
|
35
|
+
qvetPetId?: number;
|
|
36
|
+
sellerName: string;
|
|
37
|
+
sellerInitials?: string;
|
|
38
|
+
branch: string;
|
|
39
|
+
syncedAt: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Paginated list of sales
|
|
43
|
+
*/
|
|
44
|
+
export interface QvetSalesListResponse {
|
|
45
|
+
ok: boolean;
|
|
46
|
+
data: QvetSaleResponse[];
|
|
47
|
+
pagination: {
|
|
48
|
+
total: number;
|
|
49
|
+
limit: number;
|
|
50
|
+
skip: number;
|
|
51
|
+
hasMore: boolean;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sales summary statistics for a period
|
|
56
|
+
*/
|
|
57
|
+
export interface QvetSalesSummaryResponse {
|
|
58
|
+
ok: boolean;
|
|
59
|
+
data: {
|
|
60
|
+
totalRecords: number;
|
|
61
|
+
totalSales: number;
|
|
62
|
+
totalSubtotal: number;
|
|
63
|
+
totalTax: number;
|
|
64
|
+
totalDiscount: number;
|
|
65
|
+
totalQuantity: number;
|
|
66
|
+
avgTicket: number;
|
|
67
|
+
uniqueCustomers: number;
|
|
68
|
+
uniqueProducts: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Sales by section aggregation
|
|
73
|
+
*/
|
|
74
|
+
export interface QvetSalesBySectionItem {
|
|
75
|
+
section: string;
|
|
76
|
+
totalSales: number;
|
|
77
|
+
totalQuantity: number;
|
|
78
|
+
recordCount: number;
|
|
79
|
+
}
|
|
80
|
+
export interface QvetSalesBySectionResponse {
|
|
81
|
+
ok: boolean;
|
|
82
|
+
data: QvetSalesBySectionItem[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Query parameters for sales endpoint
|
|
86
|
+
*/
|
|
87
|
+
export interface QvetSalesQueryParams {
|
|
88
|
+
startDate?: string;
|
|
89
|
+
endDate?: string;
|
|
90
|
+
year?: number;
|
|
91
|
+
month?: number;
|
|
92
|
+
halfMonth?: 1 | 2;
|
|
93
|
+
warehouse?: string;
|
|
94
|
+
section?: string;
|
|
95
|
+
family?: string;
|
|
96
|
+
qvetCode?: number;
|
|
97
|
+
customerName?: string;
|
|
98
|
+
limit?: number;
|
|
99
|
+
skip?: number;
|
|
100
|
+
sort?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Single purchase record from QVET
|
|
104
|
+
* Represents one line item in a purchase transaction
|
|
105
|
+
*/
|
|
106
|
+
export interface QvetPurchaseResponse {
|
|
107
|
+
_id: string;
|
|
108
|
+
qvetCode: number;
|
|
109
|
+
productName: string;
|
|
110
|
+
barcode: string;
|
|
111
|
+
section: string;
|
|
112
|
+
family: string;
|
|
113
|
+
subfamily: string;
|
|
114
|
+
purchaseDate: string;
|
|
115
|
+
invoiceSeries: string;
|
|
116
|
+
invoiceNumber: number;
|
|
117
|
+
supplierInvoice: string;
|
|
118
|
+
quantity: number;
|
|
119
|
+
unitPrice: number;
|
|
120
|
+
subtotal: number;
|
|
121
|
+
taxAmount: number;
|
|
122
|
+
discount: number;
|
|
123
|
+
total: number;
|
|
124
|
+
conversionFactor: number;
|
|
125
|
+
branch: string;
|
|
126
|
+
warehouse: string;
|
|
127
|
+
supplier: string;
|
|
128
|
+
orderDate: string | null;
|
|
129
|
+
orderNumber: number | null;
|
|
130
|
+
invoiceDate: string | null;
|
|
131
|
+
reference: string;
|
|
132
|
+
syncedAt: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Paginated list of purchases
|
|
136
|
+
*/
|
|
137
|
+
export interface QvetPurchasesListResponse {
|
|
138
|
+
ok: boolean;
|
|
139
|
+
data: QvetPurchaseResponse[];
|
|
140
|
+
pagination: {
|
|
141
|
+
total: number;
|
|
142
|
+
limit: number;
|
|
143
|
+
skip: number;
|
|
144
|
+
hasMore: boolean;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Purchases summary statistics for a period
|
|
149
|
+
*/
|
|
150
|
+
export interface QvetPurchasesSummaryResponse {
|
|
151
|
+
ok: boolean;
|
|
152
|
+
data: {
|
|
153
|
+
totalRecords: number;
|
|
154
|
+
totalPurchases: number;
|
|
155
|
+
totalSubtotal: number;
|
|
156
|
+
totalTax: number;
|
|
157
|
+
totalDiscount: number;
|
|
158
|
+
totalQuantity: number;
|
|
159
|
+
avgPurchase: number;
|
|
160
|
+
uniqueSuppliers: number;
|
|
161
|
+
uniqueProducts: number;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Purchases by supplier aggregation
|
|
166
|
+
*/
|
|
167
|
+
export interface QvetPurchasesBySupplierItem {
|
|
168
|
+
supplier: string;
|
|
169
|
+
totalPurchases: number;
|
|
170
|
+
totalQuantity: number;
|
|
171
|
+
recordCount: number;
|
|
172
|
+
}
|
|
173
|
+
export interface QvetPurchasesBySupplierResponse {
|
|
174
|
+
ok: boolean;
|
|
175
|
+
data: QvetPurchasesBySupplierItem[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Query parameters for purchases endpoint
|
|
179
|
+
*/
|
|
180
|
+
export interface QvetPurchasesQueryParams {
|
|
181
|
+
startDate?: string;
|
|
182
|
+
endDate?: string;
|
|
183
|
+
year?: number;
|
|
184
|
+
month?: number;
|
|
185
|
+
halfMonth?: 1 | 2;
|
|
186
|
+
warehouse?: string;
|
|
187
|
+
section?: string;
|
|
188
|
+
family?: string;
|
|
189
|
+
supplier?: string;
|
|
190
|
+
qvetCode?: number;
|
|
191
|
+
limit?: number;
|
|
192
|
+
skip?: number;
|
|
193
|
+
sort?: string;
|
|
194
|
+
}
|