shopoflex-types 1.0.67 → 1.0.69
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/accounting.d.ts +34 -87
- package/dist/accounting.js +0 -3
- package/dist/common.d.ts +3 -0
- package/package.json +1 -1
package/dist/accounting.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface PurchaseOrderType {
|
|
|
34
34
|
branchId: string;
|
|
35
35
|
items: PurchaseOrderItem[];
|
|
36
36
|
totalAmount: number;
|
|
37
|
-
status: 'draft' | 'sent' | '
|
|
37
|
+
status: 'draft' | 'sent' | 'partial' | 'received' | 'cancelled';
|
|
38
38
|
expectedDelivery?: Date;
|
|
39
39
|
notes: string;
|
|
40
40
|
createdAt: Date;
|
|
@@ -46,7 +46,7 @@ export interface InventoryAdjustmentType {
|
|
|
46
46
|
branchId: string;
|
|
47
47
|
productId: any;
|
|
48
48
|
variantId: string;
|
|
49
|
-
adjustmentType: '
|
|
49
|
+
adjustmentType: 'increase' | 'decrease' | 'wastage' | 'damage' | 'theft' | 'expired' | 'recount';
|
|
50
50
|
quantityChanged: number;
|
|
51
51
|
unitCost: number;
|
|
52
52
|
totalValue: number;
|
|
@@ -68,26 +68,7 @@ export interface ExpenseType {
|
|
|
68
68
|
receiptUrl?: string;
|
|
69
69
|
isPaid: boolean;
|
|
70
70
|
paidDate?: Date;
|
|
71
|
-
|
|
72
|
-
updatedAt: Date;
|
|
73
|
-
}
|
|
74
|
-
export interface CashTransactionReference {
|
|
75
|
-
type: 'order' | 'purchase_order' | 'expense' | 'manual';
|
|
76
|
-
id?: any;
|
|
77
|
-
}
|
|
78
|
-
export interface CashTransactionType {
|
|
79
|
-
_id?: any;
|
|
80
|
-
vendorId: any;
|
|
81
|
-
branchId?: string;
|
|
82
|
-
type: 'in' | 'out';
|
|
83
|
-
category: 'sales_payment' | 'refund' | 'supplier_payment' | 'expense_payment' | 'loan' | 'investment' | 'withdrawal' | 'bank_fee' | 'other';
|
|
84
|
-
amount: number;
|
|
85
|
-
paymentMethod: 'cash' | 'card' | 'bank_transfer' | 'check' | 'digital_wallet';
|
|
86
|
-
reference?: CashTransactionReference;
|
|
87
|
-
description?: string;
|
|
88
|
-
transactionDate: Date;
|
|
89
|
-
processingFee: number;
|
|
90
|
-
netAmount: number;
|
|
71
|
+
approvalStatus: 'pending' | 'approved' | 'rejected';
|
|
91
72
|
createdAt: Date;
|
|
92
73
|
updatedAt: Date;
|
|
93
74
|
}
|
|
@@ -163,21 +144,7 @@ export interface CreateExpenseRequest {
|
|
|
163
144
|
expenseDate: string;
|
|
164
145
|
isRecurring?: boolean;
|
|
165
146
|
recurringPeriod?: ExpenseType['recurringPeriod'];
|
|
166
|
-
|
|
167
|
-
export interface MarkExpenseAsPaidRequest {
|
|
168
|
-
paymentMethod: CashTransactionType['paymentMethod'];
|
|
169
|
-
transactionDate?: string;
|
|
170
|
-
}
|
|
171
|
-
export interface CreateCashTransactionRequest {
|
|
172
|
-
branchId?: string;
|
|
173
|
-
type: CashTransactionType['type'];
|
|
174
|
-
category: CashTransactionType['category'];
|
|
175
|
-
amount: number;
|
|
176
|
-
paymentMethod: CashTransactionType['paymentMethod'];
|
|
177
|
-
reference?: CashTransactionReference;
|
|
178
|
-
description?: string;
|
|
179
|
-
transactionDate?: string;
|
|
180
|
-
processingFee?: number;
|
|
147
|
+
approvalStatus?: 'pending' | 'approved' | 'rejected';
|
|
181
148
|
}
|
|
182
149
|
export interface SuppliersResponse extends PaginatedResponse<SupplierType> {
|
|
183
150
|
}
|
|
@@ -187,28 +154,11 @@ export interface InventoryAdjustmentsResponse extends PaginatedResponse<Inventor
|
|
|
187
154
|
}
|
|
188
155
|
export interface ExpensesResponse extends PaginatedResponse<ExpenseType> {
|
|
189
156
|
}
|
|
190
|
-
export interface CashTransactionsResponse extends PaginatedResponse<CashTransactionType> {
|
|
191
|
-
}
|
|
192
157
|
export interface ExpensesByCategory {
|
|
193
158
|
category: string;
|
|
194
159
|
totalAmount: number;
|
|
195
160
|
count: number;
|
|
196
|
-
avgAmount
|
|
197
|
-
}
|
|
198
|
-
export interface CashFlowSummary {
|
|
199
|
-
cashIn: number;
|
|
200
|
-
cashOut: number;
|
|
201
|
-
netCashFlow: number;
|
|
202
|
-
}
|
|
203
|
-
export interface CashFlowReport {
|
|
204
|
-
cashFlow: {
|
|
205
|
-
type: string;
|
|
206
|
-
totalAmount: number;
|
|
207
|
-
totalNetAmount: number;
|
|
208
|
-
totalProcessingFees: number;
|
|
209
|
-
count: number;
|
|
210
|
-
}[];
|
|
211
|
-
summary: CashFlowSummary;
|
|
161
|
+
avgAmount?: number;
|
|
212
162
|
}
|
|
213
163
|
export interface WastageReportItem {
|
|
214
164
|
type: string;
|
|
@@ -225,11 +175,6 @@ export interface FinancialReportExpenses {
|
|
|
225
175
|
totalExpenses: number;
|
|
226
176
|
breakdown: ExpensesByCategory[];
|
|
227
177
|
}
|
|
228
|
-
export interface FinancialReportCashFlow {
|
|
229
|
-
cashIn: number;
|
|
230
|
-
cashOut: number;
|
|
231
|
-
netCashFlow: number;
|
|
232
|
-
}
|
|
233
178
|
export interface FinancialReportProfitability {
|
|
234
179
|
grossProfit: number;
|
|
235
180
|
profitMargin: number;
|
|
@@ -241,7 +186,7 @@ export interface FinancialReport {
|
|
|
241
186
|
};
|
|
242
187
|
revenue: FinancialReportRevenue;
|
|
243
188
|
expenses: FinancialReportExpenses;
|
|
244
|
-
|
|
189
|
+
costOfGoodsSold: number;
|
|
245
190
|
profitability: FinancialReportProfitability;
|
|
246
191
|
}
|
|
247
192
|
export interface ProfitLossRevenue {
|
|
@@ -267,27 +212,6 @@ export interface ProfitLossReport {
|
|
|
267
212
|
operatingExpenses: ProfitLossOperatingExpenses;
|
|
268
213
|
netProfit: number;
|
|
269
214
|
}
|
|
270
|
-
export interface DailyCashFlow {
|
|
271
|
-
date: string;
|
|
272
|
-
cashIn: number;
|
|
273
|
-
cashOut: number;
|
|
274
|
-
netFlow: number;
|
|
275
|
-
transactionCount: number;
|
|
276
|
-
}
|
|
277
|
-
export interface CashFlowByCategory {
|
|
278
|
-
category: string;
|
|
279
|
-
type: 'in' | 'out';
|
|
280
|
-
totalAmount: number;
|
|
281
|
-
count: number;
|
|
282
|
-
}
|
|
283
|
-
export interface CashFlowAnalyticsReport {
|
|
284
|
-
period: {
|
|
285
|
-
start: Date;
|
|
286
|
-
end: Date;
|
|
287
|
-
};
|
|
288
|
-
dailyCashFlow: DailyCashFlow[];
|
|
289
|
-
cashFlowByCategory: CashFlowByCategory[];
|
|
290
|
-
}
|
|
291
215
|
export interface ExpenseTrend {
|
|
292
216
|
_id: {
|
|
293
217
|
year: number;
|
|
@@ -310,12 +234,13 @@ export interface ExpenseAnalyticsReport {
|
|
|
310
234
|
expenseTrends: ExpenseTrend[];
|
|
311
235
|
topExpenses: Partial<ExpenseType>[];
|
|
312
236
|
recurringAnalysis: RecurringAnalysis[];
|
|
237
|
+
categoryBreakdown: ExpensesByCategory[];
|
|
313
238
|
}
|
|
314
239
|
export interface SupplierPerformanceMetric {
|
|
315
240
|
supplierName: string;
|
|
316
241
|
totalOrders: number;
|
|
317
242
|
totalAmount: number;
|
|
318
|
-
|
|
243
|
+
receivedOrders: number;
|
|
319
244
|
completionRate: number;
|
|
320
245
|
avgOrderValue: number;
|
|
321
246
|
avgDeliveryTime: number;
|
|
@@ -327,6 +252,31 @@ export interface SupplierPerformanceReport {
|
|
|
327
252
|
};
|
|
328
253
|
supplierPerformance: SupplierPerformanceMetric[];
|
|
329
254
|
}
|
|
255
|
+
export interface InventoryAnalyticsReport {
|
|
256
|
+
wastageReport: WastageReportItem[];
|
|
257
|
+
adjustmentTrends: {
|
|
258
|
+
_id: {
|
|
259
|
+
year: number;
|
|
260
|
+
month: number;
|
|
261
|
+
};
|
|
262
|
+
adjustments: {
|
|
263
|
+
type: string;
|
|
264
|
+
value: number;
|
|
265
|
+
quantity: number;
|
|
266
|
+
count: number;
|
|
267
|
+
}[];
|
|
268
|
+
totalValue: number;
|
|
269
|
+
}[];
|
|
270
|
+
totalWastageValue: number;
|
|
271
|
+
}
|
|
272
|
+
export interface DashboardSummary {
|
|
273
|
+
todaysSales: number;
|
|
274
|
+
pendingExpenses: number;
|
|
275
|
+
totalExpensesThisMonth: number;
|
|
276
|
+
totalWastageThisMonth: number;
|
|
277
|
+
overduePayments: number;
|
|
278
|
+
activeSuppliers: number;
|
|
279
|
+
}
|
|
330
280
|
export interface BaseQueryParams {
|
|
331
281
|
page?: number;
|
|
332
282
|
limit?: number;
|
|
@@ -346,8 +296,5 @@ export interface InventoryAdjustmentsQueryParams extends BaseQueryParams {
|
|
|
346
296
|
}
|
|
347
297
|
export interface ExpensesQueryParams extends BaseQueryParams {
|
|
348
298
|
category?: ExpenseType['category'];
|
|
349
|
-
|
|
350
|
-
export interface CashTransactionsQueryParams extends BaseQueryParams {
|
|
351
|
-
type?: CashTransactionType['type'];
|
|
352
|
-
category?: CashTransactionType['category'];
|
|
299
|
+
approvalStatus?: ExpenseType['approvalStatus'];
|
|
353
300
|
}
|
package/dist/accounting.js
CHANGED
package/dist/common.d.ts
CHANGED
|
@@ -292,6 +292,9 @@ export interface Shipping {
|
|
|
292
292
|
}
|
|
293
293
|
export interface OrderType {
|
|
294
294
|
_id?: string | any;
|
|
295
|
+
orderType: 'instore' | 'pickup' | 'delivery';
|
|
296
|
+
source: 'pos' | 'online';
|
|
297
|
+
tableNumber?: number;
|
|
295
298
|
customer?: Customer;
|
|
296
299
|
vendorId?: string;
|
|
297
300
|
cart?: Cart;
|