shopoflex-types 1.0.65 → 1.0.67
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 +353 -0
- package/dist/accounting.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { PaginatedResponse } from "./common";
|
|
2
|
+
export interface SupplierContactInfo {
|
|
3
|
+
email?: string;
|
|
4
|
+
phone?: string;
|
|
5
|
+
address?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SupplierPaymentTerms {
|
|
8
|
+
method: 'cash' | 'credit' | 'check';
|
|
9
|
+
creditDays: number;
|
|
10
|
+
}
|
|
11
|
+
export interface SupplierType {
|
|
12
|
+
_id?: any;
|
|
13
|
+
name: string;
|
|
14
|
+
contactInfo: SupplierContactInfo;
|
|
15
|
+
paymentTerms: SupplierPaymentTerms;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
vendorId: any;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
}
|
|
21
|
+
export interface PurchaseOrderItem {
|
|
22
|
+
productId: any;
|
|
23
|
+
variantId: string;
|
|
24
|
+
quantity: number;
|
|
25
|
+
unitCost: number;
|
|
26
|
+
totalCost: number;
|
|
27
|
+
receivedQuantity: number;
|
|
28
|
+
}
|
|
29
|
+
export interface PurchaseOrderType {
|
|
30
|
+
_id?: any;
|
|
31
|
+
poNumber: string;
|
|
32
|
+
supplierId: any;
|
|
33
|
+
vendorId: any;
|
|
34
|
+
branchId: string;
|
|
35
|
+
items: PurchaseOrderItem[];
|
|
36
|
+
totalAmount: number;
|
|
37
|
+
status: 'draft' | 'sent' | 'confirmed' | 'partial' | 'completed' | 'cancelled';
|
|
38
|
+
expectedDelivery?: Date;
|
|
39
|
+
notes: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
}
|
|
43
|
+
export interface InventoryAdjustmentType {
|
|
44
|
+
_id?: any;
|
|
45
|
+
vendorId: any;
|
|
46
|
+
branchId: string;
|
|
47
|
+
productId: any;
|
|
48
|
+
variantId: string;
|
|
49
|
+
adjustmentType: 'wastage' | 'damage' | 'theft' | 'expired' | 'restock' | 'correction';
|
|
50
|
+
quantityChanged: number;
|
|
51
|
+
unitCost: number;
|
|
52
|
+
totalValue: number;
|
|
53
|
+
reason: string;
|
|
54
|
+
approvedBy?: string;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
}
|
|
58
|
+
export interface ExpenseType {
|
|
59
|
+
_id?: any;
|
|
60
|
+
vendorId: any;
|
|
61
|
+
branchId?: string;
|
|
62
|
+
category: 'utilities' | 'rent' | 'payroll' | 'insurance' | 'maintenance' | 'marketing' | 'supplies' | 'fees' | 'transportation' | 'other';
|
|
63
|
+
description: string;
|
|
64
|
+
amount: number;
|
|
65
|
+
expenseDate: Date;
|
|
66
|
+
isRecurring: boolean;
|
|
67
|
+
recurringPeriod?: 'monthly' | 'weekly' | 'yearly';
|
|
68
|
+
receiptUrl?: string;
|
|
69
|
+
isPaid: boolean;
|
|
70
|
+
paidDate?: Date;
|
|
71
|
+
createdAt: Date;
|
|
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;
|
|
91
|
+
createdAt: Date;
|
|
92
|
+
updatedAt: Date;
|
|
93
|
+
}
|
|
94
|
+
export interface FinancialSummaryPeriod {
|
|
95
|
+
type: 'daily' | 'monthly';
|
|
96
|
+
date: Date;
|
|
97
|
+
}
|
|
98
|
+
export interface FinancialSummaryRevenue {
|
|
99
|
+
totalSales: number;
|
|
100
|
+
totalOrders: number;
|
|
101
|
+
averageOrderValue: number;
|
|
102
|
+
}
|
|
103
|
+
export interface FinancialSummaryCosts {
|
|
104
|
+
cogs: number;
|
|
105
|
+
expenses: number;
|
|
106
|
+
wastage: number;
|
|
107
|
+
}
|
|
108
|
+
export interface FinancialSummaryCashFlow {
|
|
109
|
+
cashIn: number;
|
|
110
|
+
cashOut: number;
|
|
111
|
+
netCashFlow: number;
|
|
112
|
+
}
|
|
113
|
+
export interface FinancialSummaryProfit {
|
|
114
|
+
gross: number;
|
|
115
|
+
net: number;
|
|
116
|
+
}
|
|
117
|
+
export interface FinancialSummaryType {
|
|
118
|
+
_id?: any;
|
|
119
|
+
vendorId: any;
|
|
120
|
+
branchId?: string;
|
|
121
|
+
period: FinancialSummaryPeriod;
|
|
122
|
+
revenue: FinancialSummaryRevenue;
|
|
123
|
+
costs: FinancialSummaryCosts;
|
|
124
|
+
cashFlow: FinancialSummaryCashFlow;
|
|
125
|
+
profit: FinancialSummaryProfit;
|
|
126
|
+
createdAt: Date;
|
|
127
|
+
updatedAt: Date;
|
|
128
|
+
}
|
|
129
|
+
export interface CreateSupplierRequest {
|
|
130
|
+
name: string;
|
|
131
|
+
contactInfo: SupplierContactInfo;
|
|
132
|
+
paymentTerms: SupplierPaymentTerms;
|
|
133
|
+
}
|
|
134
|
+
export interface CreatePurchaseOrderRequest {
|
|
135
|
+
supplierId: string;
|
|
136
|
+
branchId: string;
|
|
137
|
+
items: Omit<PurchaseOrderItem, 'receivedQuantity'>[];
|
|
138
|
+
expectedDelivery?: string;
|
|
139
|
+
notes?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface ReceivePurchaseOrderRequest {
|
|
142
|
+
receivedItems: {
|
|
143
|
+
productId: string;
|
|
144
|
+
variantId: string;
|
|
145
|
+
receivedQuantity: number;
|
|
146
|
+
actualCost?: number;
|
|
147
|
+
}[];
|
|
148
|
+
}
|
|
149
|
+
export interface CreateInventoryAdjustmentRequest {
|
|
150
|
+
productId: string;
|
|
151
|
+
variantId: string;
|
|
152
|
+
branchId: string;
|
|
153
|
+
adjustmentType: InventoryAdjustmentType['adjustmentType'];
|
|
154
|
+
quantityChanged: number;
|
|
155
|
+
reason: string;
|
|
156
|
+
approvedBy?: string;
|
|
157
|
+
}
|
|
158
|
+
export interface CreateExpenseRequest {
|
|
159
|
+
branchId?: string;
|
|
160
|
+
category: ExpenseType['category'];
|
|
161
|
+
description: string;
|
|
162
|
+
amount: number;
|
|
163
|
+
expenseDate: string;
|
|
164
|
+
isRecurring?: boolean;
|
|
165
|
+
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;
|
|
181
|
+
}
|
|
182
|
+
export interface SuppliersResponse extends PaginatedResponse<SupplierType> {
|
|
183
|
+
}
|
|
184
|
+
export interface PurchaseOrdersResponse extends PaginatedResponse<PurchaseOrderType> {
|
|
185
|
+
}
|
|
186
|
+
export interface InventoryAdjustmentsResponse extends PaginatedResponse<InventoryAdjustmentType> {
|
|
187
|
+
}
|
|
188
|
+
export interface ExpensesResponse extends PaginatedResponse<ExpenseType> {
|
|
189
|
+
}
|
|
190
|
+
export interface CashTransactionsResponse extends PaginatedResponse<CashTransactionType> {
|
|
191
|
+
}
|
|
192
|
+
export interface ExpensesByCategory {
|
|
193
|
+
category: string;
|
|
194
|
+
totalAmount: number;
|
|
195
|
+
count: number;
|
|
196
|
+
avgAmount: number;
|
|
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;
|
|
212
|
+
}
|
|
213
|
+
export interface WastageReportItem {
|
|
214
|
+
type: string;
|
|
215
|
+
totalQuantity: number;
|
|
216
|
+
totalValue: number;
|
|
217
|
+
count: number;
|
|
218
|
+
}
|
|
219
|
+
export interface FinancialReportRevenue {
|
|
220
|
+
totalRevenue: number;
|
|
221
|
+
totalOrders: number;
|
|
222
|
+
avgOrderValue: number;
|
|
223
|
+
}
|
|
224
|
+
export interface FinancialReportExpenses {
|
|
225
|
+
totalExpenses: number;
|
|
226
|
+
breakdown: ExpensesByCategory[];
|
|
227
|
+
}
|
|
228
|
+
export interface FinancialReportCashFlow {
|
|
229
|
+
cashIn: number;
|
|
230
|
+
cashOut: number;
|
|
231
|
+
netCashFlow: number;
|
|
232
|
+
}
|
|
233
|
+
export interface FinancialReportProfitability {
|
|
234
|
+
grossProfit: number;
|
|
235
|
+
profitMargin: number;
|
|
236
|
+
}
|
|
237
|
+
export interface FinancialReport {
|
|
238
|
+
period?: {
|
|
239
|
+
startDate?: string;
|
|
240
|
+
endDate?: string;
|
|
241
|
+
};
|
|
242
|
+
revenue: FinancialReportRevenue;
|
|
243
|
+
expenses: FinancialReportExpenses;
|
|
244
|
+
cashFlow: FinancialReportCashFlow;
|
|
245
|
+
profitability: FinancialReportProfitability;
|
|
246
|
+
}
|
|
247
|
+
export interface ProfitLossRevenue {
|
|
248
|
+
grossRevenue: number;
|
|
249
|
+
discounts: number;
|
|
250
|
+
netRevenue: number;
|
|
251
|
+
}
|
|
252
|
+
export interface ProfitLossOperatingExpenses {
|
|
253
|
+
total: number;
|
|
254
|
+
breakdown: {
|
|
255
|
+
category: string;
|
|
256
|
+
amount: number;
|
|
257
|
+
}[];
|
|
258
|
+
}
|
|
259
|
+
export interface ProfitLossReport {
|
|
260
|
+
period: {
|
|
261
|
+
start: Date;
|
|
262
|
+
end: Date;
|
|
263
|
+
};
|
|
264
|
+
revenue: ProfitLossRevenue;
|
|
265
|
+
costOfGoodsSold: number;
|
|
266
|
+
grossProfit: number;
|
|
267
|
+
operatingExpenses: ProfitLossOperatingExpenses;
|
|
268
|
+
netProfit: number;
|
|
269
|
+
}
|
|
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
|
+
export interface ExpenseTrend {
|
|
292
|
+
_id: {
|
|
293
|
+
year: number;
|
|
294
|
+
month: number;
|
|
295
|
+
};
|
|
296
|
+
totalExpenses: number;
|
|
297
|
+
categories: {
|
|
298
|
+
category: string;
|
|
299
|
+
amount: number;
|
|
300
|
+
count: number;
|
|
301
|
+
}[];
|
|
302
|
+
}
|
|
303
|
+
export interface RecurringAnalysis {
|
|
304
|
+
type: 'recurring' | 'one-time';
|
|
305
|
+
totalAmount: number;
|
|
306
|
+
count: number;
|
|
307
|
+
avgAmount: number;
|
|
308
|
+
}
|
|
309
|
+
export interface ExpenseAnalyticsReport {
|
|
310
|
+
expenseTrends: ExpenseTrend[];
|
|
311
|
+
topExpenses: Partial<ExpenseType>[];
|
|
312
|
+
recurringAnalysis: RecurringAnalysis[];
|
|
313
|
+
}
|
|
314
|
+
export interface SupplierPerformanceMetric {
|
|
315
|
+
supplierName: string;
|
|
316
|
+
totalOrders: number;
|
|
317
|
+
totalAmount: number;
|
|
318
|
+
completedOrders: number;
|
|
319
|
+
completionRate: number;
|
|
320
|
+
avgOrderValue: number;
|
|
321
|
+
avgDeliveryTime: number;
|
|
322
|
+
}
|
|
323
|
+
export interface SupplierPerformanceReport {
|
|
324
|
+
period: {
|
|
325
|
+
start: Date;
|
|
326
|
+
end: Date;
|
|
327
|
+
};
|
|
328
|
+
supplierPerformance: SupplierPerformanceMetric[];
|
|
329
|
+
}
|
|
330
|
+
export interface BaseQueryParams {
|
|
331
|
+
page?: number;
|
|
332
|
+
limit?: number;
|
|
333
|
+
startDate?: string;
|
|
334
|
+
endDate?: string;
|
|
335
|
+
branchId?: string;
|
|
336
|
+
}
|
|
337
|
+
export interface SuppliersQueryParams extends BaseQueryParams {
|
|
338
|
+
search?: string;
|
|
339
|
+
}
|
|
340
|
+
export interface PurchaseOrdersQueryParams extends BaseQueryParams {
|
|
341
|
+
status?: PurchaseOrderType['status'];
|
|
342
|
+
supplierId?: string;
|
|
343
|
+
}
|
|
344
|
+
export interface InventoryAdjustmentsQueryParams extends BaseQueryParams {
|
|
345
|
+
adjustmentType?: InventoryAdjustmentType['adjustmentType'];
|
|
346
|
+
}
|
|
347
|
+
export interface ExpensesQueryParams extends BaseQueryParams {
|
|
348
|
+
category?: ExpenseType['category'];
|
|
349
|
+
}
|
|
350
|
+
export interface CashTransactionsQueryParams extends BaseQueryParams {
|
|
351
|
+
type?: CashTransactionType['type'];
|
|
352
|
+
category?: CashTransactionType['category'];
|
|
353
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./common"), exports);
|
|
18
18
|
__exportStar(require("./filters"), exports);
|
|
19
|
+
__exportStar(require("./accounting"), exports);
|