@teincfood/core 0.10.15 → 0.10.17
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/adapters/auth.d.ts +3 -0
- package/dist/db/migrations.js +25 -0
- package/dist/db/operations.d.ts +1 -0
- package/dist/db/operations.js +8 -7
- package/dist/domain/orders/service.js +13 -2
- package/dist/hooks/analytics.hooks.d.ts +55 -2
- package/dist/hooks/analytics.hooks.js +95 -13
- package/dist/hooks/delivery.hooks.d.ts +24 -24
- package/dist/hooks/rider.hooks.d.ts +48 -48
- package/dist/hooks/use-infinite-list.d.ts +24 -24
- package/dist/hooks/wallet.hooks.d.ts +24 -24
- package/dist/local-node/service.d.ts +12 -0
- package/dist/local-node/service.js +88 -71
- package/dist/sync/command-queue.service.js +13 -1
- package/dist/sync/use-sync-reconciliation.js +13 -6
- package/dist/test-helpers/memory-driver.js +3 -3
- package/package.json +1 -1
package/dist/adapters/auth.d.ts
CHANGED
package/dist/db/migrations.js
CHANGED
|
@@ -448,4 +448,29 @@ export const MIGRATIONS = [
|
|
|
448
448
|
catch { }
|
|
449
449
|
},
|
|
450
450
|
},
|
|
451
|
+
{
|
|
452
|
+
version: 13,
|
|
453
|
+
up: async (db) => {
|
|
454
|
+
// Online orders need their prepaid/pay-on-delivery mode locally so the
|
|
455
|
+
// analytics payment breakdown mirrors the backend. POS orders keep
|
|
456
|
+
// `pos_payment_method` as the authoritative method.
|
|
457
|
+
await db.execAsync(`
|
|
458
|
+
ALTER TABLE orders ADD COLUMN payment_mode TEXT;
|
|
459
|
+
`);
|
|
460
|
+
// Best-effort backfill: POS rows are prepaid at the order level; online
|
|
461
|
+
// rows without a value are assumed prepaid until the next pull.
|
|
462
|
+
try {
|
|
463
|
+
await db.execAsync(`
|
|
464
|
+
UPDATE orders
|
|
465
|
+
SET payment_mode = CASE
|
|
466
|
+
WHEN is_pos = 1 THEN 'prepaid'
|
|
467
|
+
WHEN pos_payment_method IS NULL THEN 'prepaid'
|
|
468
|
+
ELSE pos_payment_method
|
|
469
|
+
END
|
|
470
|
+
WHERE payment_mode IS NULL;
|
|
471
|
+
`);
|
|
472
|
+
}
|
|
473
|
+
catch { }
|
|
474
|
+
},
|
|
475
|
+
},
|
|
451
476
|
];
|
package/dist/db/operations.d.ts
CHANGED
package/dist/db/operations.js
CHANGED
|
@@ -256,6 +256,7 @@ function orderRowToSellerOrder(row) {
|
|
|
256
256
|
customer_name: row.customer_name,
|
|
257
257
|
customer_phone: row.customer_phone,
|
|
258
258
|
pos_payment_method: row.pos_payment_method,
|
|
259
|
+
payment_mode: row.payment_mode ?? "prepaid",
|
|
259
260
|
delivery_id: row.delivery_id,
|
|
260
261
|
business: row.business ? JSON.parse(row.business) : null,
|
|
261
262
|
delivery_address: null,
|
|
@@ -283,10 +284,10 @@ export async function insertOrder(db, order) {
|
|
|
283
284
|
const paidAt = order.paid_at ??
|
|
284
285
|
order.payment?.paid_at ??
|
|
285
286
|
(isOrderPaid(order) ? updatedAt : null);
|
|
286
|
-
await db.runAsync(`INSERT INTO orders (id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at, customer_name, customer_phone, pos_payment_method, delivery_id, business, user, inserted_at, updated_at, hlc)
|
|
287
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
288
|
-
ON CONFLICT(id) DO UPDATE SET business_id=excluded.business_id, order_number=excluded.order_number, callout_number=excluded.callout_number, status=excluded.status, order_type=excluded.order_type, is_pos=excluded.is_pos, items=excluded.items, subtotal_minor=excluded.subtotal_minor, total_minor=excluded.total_minor, tax_minor=excluded.tax_minor, tax_lines=excluded.tax_lines, payment=excluded.payment, paid_at=COALESCE(excluded.paid_at, orders.paid_at), customer_name=excluded.customer_name, customer_phone=excluded.customer_phone, pos_payment_method=excluded.pos_payment_method, delivery_id=excluded.delivery_id, business=excluded.business, user=excluded.user, updated_at=excluded.updated_at, hlc=excluded.hlc, sync_failed_at=NULL, sync_error=NULL
|
|
289
|
-
WHERE excluded.hlc >= orders.hlc OR orders.hlc IS NULL;`, order.id, order.business_id, order.order_number, order.callout_number, order.status, order.order_type, order.is_pos ? 1 : 0, JSON.stringify(order.items), order.subtotal_minor, order.total_minor, order.tax_minor, JSON.stringify(order.tax_lines), JSON.stringify(order.payment), paidAt, order.customer_name, order.customer_phone, order.pos_payment_method, order.delivery_id, order.business ? JSON.stringify(order.business) : null, order.user ? JSON.stringify(order.user) : null, order.inserted_at, updatedAt, hlc);
|
|
287
|
+
await db.runAsync(`INSERT INTO orders (id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at, customer_name, customer_phone, pos_payment_method, payment_mode, delivery_id, business, user, inserted_at, updated_at, hlc)
|
|
288
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
289
|
+
ON CONFLICT(id) DO UPDATE SET business_id=excluded.business_id, order_number=excluded.order_number, callout_number=excluded.callout_number, status=excluded.status, order_type=excluded.order_type, is_pos=excluded.is_pos, items=excluded.items, subtotal_minor=excluded.subtotal_minor, total_minor=excluded.total_minor, tax_minor=excluded.tax_minor, tax_lines=excluded.tax_lines, payment=excluded.payment, paid_at=COALESCE(excluded.paid_at, orders.paid_at), customer_name=excluded.customer_name, customer_phone=excluded.customer_phone, pos_payment_method=excluded.pos_payment_method, payment_mode=excluded.payment_mode, delivery_id=excluded.delivery_id, business=excluded.business, user=excluded.user, updated_at=excluded.updated_at, hlc=excluded.hlc, sync_failed_at=NULL, sync_error=NULL
|
|
290
|
+
WHERE excluded.hlc >= orders.hlc OR orders.hlc IS NULL;`, order.id, order.business_id, order.order_number, order.callout_number, order.status, order.order_type, order.is_pos ? 1 : 0, JSON.stringify(order.items), order.subtotal_minor, order.total_minor, order.tax_minor, JSON.stringify(order.tax_lines), JSON.stringify(order.payment), paidAt, order.customer_name, order.customer_phone, order.pos_payment_method, order.payment_mode ?? null, order.delivery_id, order.business ? JSON.stringify(order.business) : null, order.user ? JSON.stringify(order.user) : null, order.inserted_at, updatedAt, hlc);
|
|
290
291
|
notifyDbChange(order.business_id, "orders");
|
|
291
292
|
}
|
|
292
293
|
export async function getOrderById(db, businessId, idOrNumber) {
|
|
@@ -371,9 +372,9 @@ export async function upsertServerOrder(db, order, opts = {}) {
|
|
|
371
372
|
order.inserted_at ??
|
|
372
373
|
new Date().toISOString();
|
|
373
374
|
const updatedAt = order.updated_at ?? order.inserted_at;
|
|
374
|
-
await db.runAsync(`INSERT INTO orders (id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at, customer_name, customer_phone, pos_payment_method, delivery_id, business, user, inserted_at, updated_at, hlc)
|
|
375
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
376
|
-
ON CONFLICT(id) DO UPDATE SET business_id=excluded.business_id, order_number=excluded.order_number, callout_number=excluded.callout_number, status=excluded.status, order_type=excluded.order_type, is_pos=excluded.is_pos, items=excluded.items, subtotal_minor=excluded.subtotal_minor, total_minor=excluded.total_minor, tax_minor=excluded.tax_minor, tax_lines=excluded.tax_lines, payment=excluded.payment, paid_at=COALESCE(excluded.paid_at, orders.paid_at), customer_name=excluded.customer_name, customer_phone=excluded.customer_phone, pos_payment_method=excluded.pos_payment_method, delivery_id=excluded.delivery_id, business=excluded.business, user=excluded.user, updated_at=excluded.updated_at, hlc=excluded.hlc, sync_failed_at=NULL, sync_error=NULL;`, order.id, order.business_id, order.order_number, order.callout_number, status, order.order_type, order.is_pos ? 1 : 0, JSON.stringify(order.items ?? []), order.subtotal_minor ?? 0, order.total_minor ?? 0, order.tax_minor ?? 0, JSON.stringify(order.tax_lines ?? []), JSON.stringify(payment), paidAt, order.customer_name, order.customer_phone, order.pos_payment_method, order.delivery_id, order.business ? JSON.stringify(order.business) : null, order.user ? JSON.stringify(order.user) : null, order.inserted_at, updatedAt, hlc);
|
|
375
|
+
await db.runAsync(`INSERT INTO orders (id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at, customer_name, customer_phone, pos_payment_method, payment_mode, delivery_id, business, user, inserted_at, updated_at, hlc)
|
|
376
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
377
|
+
ON CONFLICT(id) DO UPDATE SET business_id=excluded.business_id, order_number=excluded.order_number, callout_number=excluded.callout_number, status=excluded.status, order_type=excluded.order_type, is_pos=excluded.is_pos, items=excluded.items, subtotal_minor=excluded.subtotal_minor, total_minor=excluded.total_minor, tax_minor=excluded.tax_minor, tax_lines=excluded.tax_lines, payment=excluded.payment, paid_at=COALESCE(excluded.paid_at, orders.paid_at), customer_name=excluded.customer_name, customer_phone=excluded.customer_phone, pos_payment_method=excluded.pos_payment_method, payment_mode=excluded.payment_mode, delivery_id=excluded.delivery_id, business=excluded.business, user=excluded.user, updated_at=excluded.updated_at, hlc=excluded.hlc, sync_failed_at=NULL, sync_error=NULL;`, order.id, order.business_id, order.order_number, order.callout_number, status, order.order_type, order.is_pos ? 1 : 0, JSON.stringify(order.items ?? []), order.subtotal_minor ?? 0, order.total_minor ?? 0, order.tax_minor ?? 0, JSON.stringify(order.tax_lines ?? []), JSON.stringify(payment), paidAt, order.customer_name, order.customer_phone, order.pos_payment_method, order.payment_mode ?? (order.is_pos ? "prepaid" : "prepaid"), order.delivery_id, order.business ? JSON.stringify(order.business) : null, order.user ? JSON.stringify(order.user) : null, order.inserted_at, updatedAt, hlc);
|
|
377
378
|
notifyDbChange(order.business_id, "orders");
|
|
378
379
|
}
|
|
379
380
|
/**
|
|
@@ -18,7 +18,7 @@ import { validateOrderCreateInput } from "../../validation/offline";
|
|
|
18
18
|
import { buildItemSnapshots, snapshotsToOrderLines } from "./snapshots";
|
|
19
19
|
import { getBusinessOrderFlowMode, initialPosOrderStatus } from "./order-flow";
|
|
20
20
|
import { drainOne, pullRemoteOrders } from "../../sync/sync-jobs.service";
|
|
21
|
-
import { getAuthToken } from "../../adapters/auth";
|
|
21
|
+
import { getAuthToken, useAuthStore } from "../../adapters/auth";
|
|
22
22
|
import { canBusinessSync } from "../../sync/sync-guard";
|
|
23
23
|
import { syncLogger } from "../../utils/sync-logger";
|
|
24
24
|
import { getItem } from "../../adapters/kv";
|
|
@@ -130,6 +130,16 @@ export async function createLocalOrder(businessId, input) {
|
|
|
130
130
|
const taxMinor = input.tax_minor ?? 0;
|
|
131
131
|
const taxLines = input.tax_lines ?? [];
|
|
132
132
|
const currencyCode = input.currency_code ?? "GHS";
|
|
133
|
+
const authUser = useAuthStore.getState().user;
|
|
134
|
+
const teller = authUser
|
|
135
|
+
? {
|
|
136
|
+
id: authUser.id,
|
|
137
|
+
full_name: authUser.full_name ?? authUser.email ?? "Staff",
|
|
138
|
+
email: authUser.email ?? "",
|
|
139
|
+
phone: authUser.phone ?? "",
|
|
140
|
+
avatar_url: authUser.avatar_url ?? null,
|
|
141
|
+
}
|
|
142
|
+
: null;
|
|
133
143
|
const order = {
|
|
134
144
|
id,
|
|
135
145
|
order_number: orderNumber,
|
|
@@ -161,7 +171,8 @@ export async function createLocalOrder(businessId, input) {
|
|
|
161
171
|
delivery_lng: null,
|
|
162
172
|
delivery_id: null,
|
|
163
173
|
delivery_status: null,
|
|
164
|
-
user:
|
|
174
|
+
user: teller,
|
|
175
|
+
teller,
|
|
165
176
|
items: items,
|
|
166
177
|
inserted_at: insertedAt,
|
|
167
178
|
};
|
|
@@ -21,10 +21,16 @@ interface LocalOrderRow {
|
|
|
21
21
|
status: string;
|
|
22
22
|
total_minor: number;
|
|
23
23
|
subtotal_minor?: number;
|
|
24
|
+
currency?: string;
|
|
24
25
|
inserted_at: string;
|
|
26
|
+
is_pos?: boolean;
|
|
25
27
|
payment_mode?: string;
|
|
26
28
|
pos_payment_method?: string;
|
|
27
29
|
order_type?: string;
|
|
30
|
+
user?: {
|
|
31
|
+
id?: string;
|
|
32
|
+
full_name?: string | null;
|
|
33
|
+
} | null;
|
|
28
34
|
items?: Array<{
|
|
29
35
|
quantity?: number;
|
|
30
36
|
subtotal?: number;
|
|
@@ -52,6 +58,7 @@ interface AggregateOptions {
|
|
|
52
58
|
export declare function filterByPeriod(orders: LocalOrderRow[], period: AnalyticsPeriod, now?: Date, range?: AnalyticsRange): LocalOrderRow[];
|
|
53
59
|
export declare function aggregateLocal(orders: LocalOrderRow[], period: AnalyticsPeriod, opts: AggregateOptions, range?: AnalyticsRange): {
|
|
54
60
|
period: AnalyticsPeriod;
|
|
61
|
+
currency: string;
|
|
55
62
|
total_revenue_minor: number;
|
|
56
63
|
total_orders: number;
|
|
57
64
|
average_order_value_minor: number;
|
|
@@ -71,16 +78,33 @@ export declare function aggregateLocal(orders: LocalOrderRow[], period: Analytic
|
|
|
71
78
|
count: number;
|
|
72
79
|
date: string;
|
|
73
80
|
}[];
|
|
81
|
+
by_channel: {
|
|
82
|
+
revenue_minor: number;
|
|
83
|
+
count: number;
|
|
84
|
+
channel: string;
|
|
85
|
+
percentage: number;
|
|
86
|
+
}[];
|
|
87
|
+
by_teller: {
|
|
88
|
+
user_id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
revenue_minor: number;
|
|
91
|
+
count: number;
|
|
92
|
+
average_order_value_minor: number;
|
|
93
|
+
}[];
|
|
94
|
+
by_hour: {
|
|
95
|
+
hour: number;
|
|
96
|
+
revenue_minor: number;
|
|
97
|
+
count: number;
|
|
98
|
+
}[];
|
|
74
99
|
offline: boolean;
|
|
75
100
|
total_refunds_minor?: undefined;
|
|
76
101
|
top_items?: undefined;
|
|
77
102
|
orders_by_status?: undefined;
|
|
78
103
|
revenue_by_day?: undefined;
|
|
79
104
|
} | {
|
|
80
|
-
by_payment_method?: undefined;
|
|
81
|
-
by_order_type?: undefined;
|
|
82
105
|
by_day?: undefined;
|
|
83
106
|
period: AnalyticsPeriod;
|
|
107
|
+
currency: string;
|
|
84
108
|
total_revenue_minor: number;
|
|
85
109
|
total_orders: number;
|
|
86
110
|
average_order_value_minor: number;
|
|
@@ -99,6 +123,35 @@ export declare function aggregateLocal(orders: LocalOrderRow[], period: Analytic
|
|
|
99
123
|
date: string;
|
|
100
124
|
revenue_minor: number;
|
|
101
125
|
}[];
|
|
126
|
+
by_channel: {
|
|
127
|
+
revenue_minor: number;
|
|
128
|
+
count: number;
|
|
129
|
+
channel: string;
|
|
130
|
+
percentage: number;
|
|
131
|
+
}[];
|
|
132
|
+
by_payment_method: {
|
|
133
|
+
revenue_minor: number;
|
|
134
|
+
count: number;
|
|
135
|
+
method: string;
|
|
136
|
+
percentage: number;
|
|
137
|
+
}[];
|
|
138
|
+
by_order_type: {
|
|
139
|
+
revenue_minor: number;
|
|
140
|
+
count: number;
|
|
141
|
+
type: string;
|
|
142
|
+
}[];
|
|
143
|
+
by_teller: {
|
|
144
|
+
user_id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
revenue_minor: number;
|
|
147
|
+
count: number;
|
|
148
|
+
average_order_value_minor: number;
|
|
149
|
+
}[];
|
|
150
|
+
by_hour: {
|
|
151
|
+
hour: number;
|
|
152
|
+
revenue_minor: number;
|
|
153
|
+
count: number;
|
|
154
|
+
}[];
|
|
102
155
|
offline: boolean;
|
|
103
156
|
};
|
|
104
157
|
interface AnalyticsPayload {
|
|
@@ -98,10 +98,25 @@ export function aggregateLocal(orders, period, opts, range) {
|
|
|
98
98
|
const byMethod = new Map();
|
|
99
99
|
const byType = new Map();
|
|
100
100
|
const byDay = new Map();
|
|
101
|
+
const byChannel = new Map();
|
|
102
|
+
const byTeller = new Map();
|
|
103
|
+
const byHour = new Map();
|
|
101
104
|
const itemQty = new Map();
|
|
102
105
|
const itemRev = new Map();
|
|
103
106
|
for (const o of revenueOrders) {
|
|
104
|
-
|
|
107
|
+
// `is_pos` is the only online/local discriminator — same as backend.
|
|
108
|
+
const channel = o.is_pos ? "local" : "online";
|
|
109
|
+
const ch = byChannel.get(channel) ?? { revenue_minor: 0, count: 0 };
|
|
110
|
+
ch.revenue_minor += o.total_minor ?? 0;
|
|
111
|
+
ch.count += 1;
|
|
112
|
+
byChannel.set(channel, ch);
|
|
113
|
+
// POS uses the tendered method; online orders cannot truthfully be
|
|
114
|
+
// labelled card/MoMo from order data, so prepaid stays "online_prepaid".
|
|
115
|
+
const method = o.is_pos
|
|
116
|
+
? (o.pos_payment_method ?? "cash")
|
|
117
|
+
: o.payment_mode === "pay_on_delivery"
|
|
118
|
+
? "pay_on_delivery"
|
|
119
|
+
: "online_prepaid";
|
|
105
120
|
const m = byMethod.get(method) ?? { revenue_minor: 0, count: 0 };
|
|
106
121
|
m.revenue_minor += o.total_minor ?? 0;
|
|
107
122
|
m.count += 1;
|
|
@@ -116,6 +131,25 @@ export function aggregateLocal(orders, period, opts, range) {
|
|
|
116
131
|
d.revenue_minor += o.total_minor ?? 0;
|
|
117
132
|
d.count += 1;
|
|
118
133
|
byDay.set(day, d);
|
|
134
|
+
if (o.is_pos) {
|
|
135
|
+
const key = o.user?.id ?? "unassigned";
|
|
136
|
+
const teller = byTeller.get(key) ?? {
|
|
137
|
+
name: o.user?.full_name ?? "Unassigned",
|
|
138
|
+
revenue_minor: 0,
|
|
139
|
+
count: 0,
|
|
140
|
+
};
|
|
141
|
+
teller.revenue_minor += o.total_minor ?? 0;
|
|
142
|
+
teller.count += 1;
|
|
143
|
+
byTeller.set(key, teller);
|
|
144
|
+
}
|
|
145
|
+
const hourDate = new Date(o.inserted_at ?? "");
|
|
146
|
+
if (!Number.isNaN(hourDate.getTime())) {
|
|
147
|
+
const hour = String(hourDate.getUTCHours());
|
|
148
|
+
const h = byHour.get(hour) ?? { revenue_minor: 0, count: 0 };
|
|
149
|
+
h.revenue_minor += o.total_minor ?? 0;
|
|
150
|
+
h.count += 1;
|
|
151
|
+
byHour.set(hour, h);
|
|
152
|
+
}
|
|
119
153
|
for (const it of o.items ?? []) {
|
|
120
154
|
const name = it.menu_item?.name ?? "Unknown";
|
|
121
155
|
const qty = it.quantity ?? 0;
|
|
@@ -133,30 +167,63 @@ export function aggregateLocal(orders, period, opts, range) {
|
|
|
133
167
|
cancelled: filtered.filter((o) => o.status === "cancelled").length,
|
|
134
168
|
pending: filtered.filter((o) => o.status === "pending").length,
|
|
135
169
|
};
|
|
170
|
+
const by_channel = [...byChannel.entries()]
|
|
171
|
+
.map(([channel, v]) => ({
|
|
172
|
+
channel,
|
|
173
|
+
...v,
|
|
174
|
+
percentage: pct(v.revenue_minor),
|
|
175
|
+
}))
|
|
176
|
+
.sort((a, b) => b.revenue_minor - a.revenue_minor);
|
|
177
|
+
const by_payment_method = [...byMethod.entries()]
|
|
178
|
+
.map(([method, v]) => ({
|
|
179
|
+
method,
|
|
180
|
+
...v,
|
|
181
|
+
percentage: pct(v.revenue_minor),
|
|
182
|
+
}))
|
|
183
|
+
.sort((a, b) => b.revenue_minor - a.revenue_minor);
|
|
184
|
+
const by_order_type = [...byType.entries()]
|
|
185
|
+
.map(([type, v]) => ({ type, ...v }))
|
|
186
|
+
.sort((a, b) => b.revenue_minor - a.revenue_minor || a.type.localeCompare(b.type));
|
|
187
|
+
const by_teller = [...byTeller.entries()]
|
|
188
|
+
.map(([user_id, v]) => ({
|
|
189
|
+
user_id,
|
|
190
|
+
name: v.name,
|
|
191
|
+
revenue_minor: v.revenue_minor,
|
|
192
|
+
count: v.count,
|
|
193
|
+
average_order_value_minor: v.count
|
|
194
|
+
? Math.floor(v.revenue_minor / v.count)
|
|
195
|
+
: 0,
|
|
196
|
+
}))
|
|
197
|
+
.sort((a, b) => b.revenue_minor - a.revenue_minor);
|
|
198
|
+
const by_hour = [...byHour.entries()]
|
|
199
|
+
.map(([hour, v]) => ({
|
|
200
|
+
hour: Number(hour),
|
|
201
|
+
revenue_minor: v.revenue_minor,
|
|
202
|
+
count: v.count,
|
|
203
|
+
}))
|
|
204
|
+
.sort((a, b) => a.hour - b.hour);
|
|
205
|
+
const currency = revenueOrders[0]?.currency ?? "GHS";
|
|
136
206
|
if (opts.forRevenueSummary) {
|
|
137
207
|
return {
|
|
138
208
|
period,
|
|
209
|
+
currency,
|
|
139
210
|
total_revenue_minor,
|
|
140
211
|
total_orders,
|
|
141
212
|
average_order_value_minor,
|
|
142
|
-
by_payment_method
|
|
143
|
-
|
|
144
|
-
method,
|
|
145
|
-
...v,
|
|
146
|
-
percentage: pct(v.revenue_minor),
|
|
147
|
-
}))
|
|
148
|
-
.sort((a, b) => b.revenue_minor - a.revenue_minor),
|
|
149
|
-
by_order_type: [...byType.entries()]
|
|
150
|
-
.map(([type, v]) => ({ type, ...v }))
|
|
151
|
-
.sort((a, b) => b.revenue_minor - a.revenue_minor),
|
|
213
|
+
by_payment_method,
|
|
214
|
+
by_order_type,
|
|
152
215
|
by_day: [...byDay.entries()]
|
|
153
216
|
.map(([date, v]) => ({ date, ...v }))
|
|
154
217
|
.sort((a, b) => a.date.localeCompare(b.date)),
|
|
218
|
+
by_channel,
|
|
219
|
+
by_teller,
|
|
220
|
+
by_hour,
|
|
155
221
|
offline: true,
|
|
156
222
|
};
|
|
157
223
|
}
|
|
158
224
|
return {
|
|
159
225
|
period,
|
|
226
|
+
currency,
|
|
160
227
|
total_revenue_minor,
|
|
161
228
|
total_orders,
|
|
162
229
|
average_order_value_minor,
|
|
@@ -173,12 +240,27 @@ export function aggregateLocal(orders, period, opts, range) {
|
|
|
173
240
|
revenue_by_day: [...byDay.entries()]
|
|
174
241
|
.map(([date, v]) => ({ date, revenue_minor: v.revenue_minor }))
|
|
175
242
|
.sort((a, b) => a.date.localeCompare(b.date)),
|
|
243
|
+
by_channel,
|
|
244
|
+
by_payment_method,
|
|
245
|
+
by_order_type,
|
|
246
|
+
by_teller,
|
|
247
|
+
by_hour,
|
|
176
248
|
offline: true,
|
|
177
249
|
};
|
|
178
250
|
}
|
|
179
251
|
async function localOrders(businessId) {
|
|
180
|
-
const
|
|
181
|
-
|
|
252
|
+
const pageSize = 500;
|
|
253
|
+
const first = await listLocalOrders(businessId, {}, 1, pageSize);
|
|
254
|
+
const rows = [...(first.data ?? [])];
|
|
255
|
+
const total = first.total ?? rows.length;
|
|
256
|
+
for (let page = 2; rows.length < total; page += 1) {
|
|
257
|
+
const next = await listLocalOrders(businessId, {}, page, pageSize);
|
|
258
|
+
const batch = next.data ?? [];
|
|
259
|
+
if (batch.length === 0)
|
|
260
|
+
break;
|
|
261
|
+
rows.push(...batch);
|
|
262
|
+
}
|
|
263
|
+
return rows;
|
|
182
264
|
}
|
|
183
265
|
function hasCustomRange(period, range) {
|
|
184
266
|
return (period !== "custom" || Boolean(range?.date_from && range?.date_to));
|
|
@@ -36,10 +36,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
36
36
|
isRefetching: boolean;
|
|
37
37
|
isStale: boolean;
|
|
38
38
|
isEnabled: boolean;
|
|
39
|
-
refetch: (options?: import("@tanstack/query
|
|
40
|
-
fetchStatus: import("@tanstack/query
|
|
41
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
42
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
39
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
40
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
41
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
42
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
43
43
|
hasNextPage: boolean;
|
|
44
44
|
hasPreviousPage: boolean;
|
|
45
45
|
isFetchingNextPage: boolean;
|
|
@@ -70,10 +70,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
70
70
|
isRefetching: boolean;
|
|
71
71
|
isStale: boolean;
|
|
72
72
|
isEnabled: boolean;
|
|
73
|
-
refetch: (options?: import("@tanstack/query
|
|
74
|
-
fetchStatus: import("@tanstack/query
|
|
75
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
76
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
73
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
74
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
75
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
76
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
77
77
|
hasNextPage: boolean;
|
|
78
78
|
hasPreviousPage: boolean;
|
|
79
79
|
isFetchingNextPage: boolean;
|
|
@@ -105,10 +105,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
105
105
|
isRefetching: boolean;
|
|
106
106
|
isStale: boolean;
|
|
107
107
|
isEnabled: boolean;
|
|
108
|
-
refetch: (options?: import("@tanstack/query
|
|
109
|
-
fetchStatus: import("@tanstack/query
|
|
110
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
111
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
108
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
109
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
110
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
111
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
112
112
|
hasNextPage: boolean;
|
|
113
113
|
hasPreviousPage: boolean;
|
|
114
114
|
isFetchingNextPage: boolean;
|
|
@@ -138,10 +138,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
138
138
|
isRefetching: boolean;
|
|
139
139
|
isStale: boolean;
|
|
140
140
|
isEnabled: boolean;
|
|
141
|
-
refetch: (options?: import("@tanstack/query
|
|
142
|
-
fetchStatus: import("@tanstack/query
|
|
143
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
144
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
141
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
142
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
143
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
144
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
145
145
|
hasNextPage: boolean;
|
|
146
146
|
hasPreviousPage: boolean;
|
|
147
147
|
isFetchingNextPage: boolean;
|
|
@@ -172,10 +172,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
172
172
|
isRefetching: boolean;
|
|
173
173
|
isStale: boolean;
|
|
174
174
|
isEnabled: boolean;
|
|
175
|
-
refetch: (options?: import("@tanstack/query
|
|
176
|
-
fetchStatus: import("@tanstack/query
|
|
177
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
178
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
175
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
176
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
177
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
178
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
179
179
|
hasNextPage: boolean;
|
|
180
180
|
hasPreviousPage: boolean;
|
|
181
181
|
isFetchNextPageError: boolean;
|
|
@@ -206,10 +206,10 @@ export declare function useBusinessDeliveriesQuery(enabled?: boolean, filters?:
|
|
|
206
206
|
isRefetching: boolean;
|
|
207
207
|
isStale: boolean;
|
|
208
208
|
isEnabled: boolean;
|
|
209
|
-
refetch: (options?: import("@tanstack/query
|
|
210
|
-
fetchStatus: import("@tanstack/query
|
|
211
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
212
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
209
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
210
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
211
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
212
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<BusinessDelivery>, unknown>, Error>>;
|
|
213
213
|
hasNextPage: boolean;
|
|
214
214
|
hasPreviousPage: boolean;
|
|
215
215
|
isFetchingNextPage: boolean;
|
|
@@ -47,10 +47,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
47
47
|
isRefetching: boolean;
|
|
48
48
|
isStale: boolean;
|
|
49
49
|
isEnabled: boolean;
|
|
50
|
-
refetch: (options?: import("@tanstack/query
|
|
51
|
-
fetchStatus: import("@tanstack/query
|
|
52
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
53
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
50
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
51
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
52
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
53
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
54
54
|
hasNextPage: boolean;
|
|
55
55
|
hasPreviousPage: boolean;
|
|
56
56
|
isFetchingNextPage: boolean;
|
|
@@ -81,10 +81,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
81
81
|
isRefetching: boolean;
|
|
82
82
|
isStale: boolean;
|
|
83
83
|
isEnabled: boolean;
|
|
84
|
-
refetch: (options?: import("@tanstack/query
|
|
85
|
-
fetchStatus: import("@tanstack/query
|
|
86
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
87
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
84
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
85
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
86
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
87
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
88
88
|
hasNextPage: boolean;
|
|
89
89
|
hasPreviousPage: boolean;
|
|
90
90
|
isFetchingNextPage: boolean;
|
|
@@ -116,10 +116,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
116
116
|
isRefetching: boolean;
|
|
117
117
|
isStale: boolean;
|
|
118
118
|
isEnabled: boolean;
|
|
119
|
-
refetch: (options?: import("@tanstack/query
|
|
120
|
-
fetchStatus: import("@tanstack/query
|
|
121
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
122
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
119
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
120
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
121
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
122
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
123
123
|
hasNextPage: boolean;
|
|
124
124
|
hasPreviousPage: boolean;
|
|
125
125
|
isFetchingNextPage: boolean;
|
|
@@ -149,10 +149,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
149
149
|
isRefetching: boolean;
|
|
150
150
|
isStale: boolean;
|
|
151
151
|
isEnabled: boolean;
|
|
152
|
-
refetch: (options?: import("@tanstack/query
|
|
153
|
-
fetchStatus: import("@tanstack/query
|
|
154
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
155
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
152
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
153
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
154
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
155
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
156
156
|
hasNextPage: boolean;
|
|
157
157
|
hasPreviousPage: boolean;
|
|
158
158
|
isFetchingNextPage: boolean;
|
|
@@ -183,10 +183,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
183
183
|
isRefetching: boolean;
|
|
184
184
|
isStale: boolean;
|
|
185
185
|
isEnabled: boolean;
|
|
186
|
-
refetch: (options?: import("@tanstack/query
|
|
187
|
-
fetchStatus: import("@tanstack/query
|
|
188
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
189
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
186
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
187
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
188
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
189
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
190
190
|
hasNextPage: boolean;
|
|
191
191
|
hasPreviousPage: boolean;
|
|
192
192
|
isFetchNextPageError: boolean;
|
|
@@ -217,10 +217,10 @@ export declare function useRiderDeliveriesQuery(enabled?: boolean, filters?: {
|
|
|
217
217
|
isRefetching: boolean;
|
|
218
218
|
isStale: boolean;
|
|
219
219
|
isEnabled: boolean;
|
|
220
|
-
refetch: (options?: import("@tanstack/query
|
|
221
|
-
fetchStatus: import("@tanstack/query
|
|
222
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
223
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
220
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
221
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
222
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
223
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<RiderDelivery>, unknown>, Error>>;
|
|
224
224
|
hasNextPage: boolean;
|
|
225
225
|
hasPreviousPage: boolean;
|
|
226
226
|
isFetchingNextPage: boolean;
|
|
@@ -261,10 +261,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
261
261
|
isRefetching: boolean;
|
|
262
262
|
isStale: boolean;
|
|
263
263
|
isEnabled: boolean;
|
|
264
|
-
refetch: (options?: import("@tanstack/query
|
|
265
|
-
fetchStatus: import("@tanstack/query
|
|
266
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
267
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
264
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
265
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
266
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
267
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
268
268
|
hasNextPage: boolean;
|
|
269
269
|
hasPreviousPage: boolean;
|
|
270
270
|
isFetchingNextPage: boolean;
|
|
@@ -295,10 +295,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
295
295
|
isRefetching: boolean;
|
|
296
296
|
isStale: boolean;
|
|
297
297
|
isEnabled: boolean;
|
|
298
|
-
refetch: (options?: import("@tanstack/query
|
|
299
|
-
fetchStatus: import("@tanstack/query
|
|
300
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
301
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
298
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
299
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
300
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
301
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
302
302
|
hasNextPage: boolean;
|
|
303
303
|
hasPreviousPage: boolean;
|
|
304
304
|
isFetchingNextPage: boolean;
|
|
@@ -330,10 +330,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
330
330
|
isRefetching: boolean;
|
|
331
331
|
isStale: boolean;
|
|
332
332
|
isEnabled: boolean;
|
|
333
|
-
refetch: (options?: import("@tanstack/query
|
|
334
|
-
fetchStatus: import("@tanstack/query
|
|
335
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
336
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
333
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
334
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
335
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
336
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
337
337
|
hasNextPage: boolean;
|
|
338
338
|
hasPreviousPage: boolean;
|
|
339
339
|
isFetchingNextPage: boolean;
|
|
@@ -363,10 +363,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
363
363
|
isRefetching: boolean;
|
|
364
364
|
isStale: boolean;
|
|
365
365
|
isEnabled: boolean;
|
|
366
|
-
refetch: (options?: import("@tanstack/query
|
|
367
|
-
fetchStatus: import("@tanstack/query
|
|
368
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
369
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
366
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
367
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
368
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
369
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
370
370
|
hasNextPage: boolean;
|
|
371
371
|
hasPreviousPage: boolean;
|
|
372
372
|
isFetchingNextPage: boolean;
|
|
@@ -397,10 +397,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
397
397
|
isRefetching: boolean;
|
|
398
398
|
isStale: boolean;
|
|
399
399
|
isEnabled: boolean;
|
|
400
|
-
refetch: (options?: import("@tanstack/query
|
|
401
|
-
fetchStatus: import("@tanstack/query
|
|
402
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
403
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
400
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
401
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
402
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
403
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
404
404
|
hasNextPage: boolean;
|
|
405
405
|
hasPreviousPage: boolean;
|
|
406
406
|
isFetchNextPageError: boolean;
|
|
@@ -431,10 +431,10 @@ export declare function useRiderWalletHistoryQuery(enabled?: boolean): {
|
|
|
431
431
|
isRefetching: boolean;
|
|
432
432
|
isStale: boolean;
|
|
433
433
|
isEnabled: boolean;
|
|
434
|
-
refetch: (options?: import("@tanstack/query
|
|
435
|
-
fetchStatus: import("@tanstack/query
|
|
436
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
437
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
434
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
435
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
436
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
437
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<Record<string, unknown>>, unknown>, Error>>;
|
|
438
438
|
hasNextPage: boolean;
|
|
439
439
|
hasPreviousPage: boolean;
|
|
440
440
|
isFetchingNextPage: boolean;
|
|
@@ -50,10 +50,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
50
50
|
isRefetching: boolean;
|
|
51
51
|
isStale: boolean;
|
|
52
52
|
isEnabled: boolean;
|
|
53
|
-
refetch: (options?: import("@tanstack/query
|
|
54
|
-
fetchStatus: import("@tanstack/query
|
|
55
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
56
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
53
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
54
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
55
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
56
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
57
57
|
hasNextPage: boolean;
|
|
58
58
|
hasPreviousPage: boolean;
|
|
59
59
|
isFetchingNextPage: boolean;
|
|
@@ -84,10 +84,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
84
84
|
isRefetching: boolean;
|
|
85
85
|
isStale: boolean;
|
|
86
86
|
isEnabled: boolean;
|
|
87
|
-
refetch: (options?: import("@tanstack/query
|
|
88
|
-
fetchStatus: import("@tanstack/query
|
|
89
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
90
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
87
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
88
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
89
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
90
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
91
91
|
hasNextPage: boolean;
|
|
92
92
|
hasPreviousPage: boolean;
|
|
93
93
|
isFetchingNextPage: boolean;
|
|
@@ -119,10 +119,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
119
119
|
isRefetching: boolean;
|
|
120
120
|
isStale: boolean;
|
|
121
121
|
isEnabled: boolean;
|
|
122
|
-
refetch: (options?: import("@tanstack/query
|
|
123
|
-
fetchStatus: import("@tanstack/query
|
|
124
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
125
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
122
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
123
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
124
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
125
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
126
126
|
hasNextPage: boolean;
|
|
127
127
|
hasPreviousPage: boolean;
|
|
128
128
|
isFetchingNextPage: boolean;
|
|
@@ -152,10 +152,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
152
152
|
isRefetching: boolean;
|
|
153
153
|
isStale: boolean;
|
|
154
154
|
isEnabled: boolean;
|
|
155
|
-
refetch: (options?: import("@tanstack/query
|
|
156
|
-
fetchStatus: import("@tanstack/query
|
|
157
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
158
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
155
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
156
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
157
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
158
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
159
159
|
hasNextPage: boolean;
|
|
160
160
|
hasPreviousPage: boolean;
|
|
161
161
|
isFetchingNextPage: boolean;
|
|
@@ -186,10 +186,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
186
186
|
isRefetching: boolean;
|
|
187
187
|
isStale: boolean;
|
|
188
188
|
isEnabled: boolean;
|
|
189
|
-
refetch: (options?: import("@tanstack/query
|
|
190
|
-
fetchStatus: import("@tanstack/query
|
|
191
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
192
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
189
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
190
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
191
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
192
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
193
193
|
hasNextPage: boolean;
|
|
194
194
|
hasPreviousPage: boolean;
|
|
195
195
|
isFetchNextPageError: boolean;
|
|
@@ -220,10 +220,10 @@ export declare function useInfiniteList<T>(options: InfiniteListOptions<T>): {
|
|
|
220
220
|
isRefetching: boolean;
|
|
221
221
|
isStale: boolean;
|
|
222
222
|
isEnabled: boolean;
|
|
223
|
-
refetch: (options?: import("@tanstack/query
|
|
224
|
-
fetchStatus: import("@tanstack/query
|
|
225
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
226
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
223
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
224
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
225
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
226
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<ListPage<T>, unknown>, Error>>;
|
|
227
227
|
hasNextPage: boolean;
|
|
228
228
|
hasPreviousPage: boolean;
|
|
229
229
|
isFetchingNextPage: boolean;
|
|
@@ -26,10 +26,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
26
26
|
isRefetching: boolean;
|
|
27
27
|
isStale: boolean;
|
|
28
28
|
isEnabled: boolean;
|
|
29
|
-
refetch: (options?: import("@tanstack/query
|
|
30
|
-
fetchStatus: import("@tanstack/query
|
|
31
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
32
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
29
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
30
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
31
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
32
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
33
33
|
hasNextPage: boolean;
|
|
34
34
|
hasPreviousPage: boolean;
|
|
35
35
|
isFetchingNextPage: boolean;
|
|
@@ -60,10 +60,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
60
60
|
isRefetching: boolean;
|
|
61
61
|
isStale: boolean;
|
|
62
62
|
isEnabled: boolean;
|
|
63
|
-
refetch: (options?: import("@tanstack/query
|
|
64
|
-
fetchStatus: import("@tanstack/query
|
|
65
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
66
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
63
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
64
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
65
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
66
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
67
67
|
hasNextPage: boolean;
|
|
68
68
|
hasPreviousPage: boolean;
|
|
69
69
|
isFetchingNextPage: boolean;
|
|
@@ -95,10 +95,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
95
95
|
isRefetching: boolean;
|
|
96
96
|
isStale: boolean;
|
|
97
97
|
isEnabled: boolean;
|
|
98
|
-
refetch: (options?: import("@tanstack/query
|
|
99
|
-
fetchStatus: import("@tanstack/query
|
|
100
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
101
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
98
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
99
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
100
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
101
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
102
102
|
hasNextPage: boolean;
|
|
103
103
|
hasPreviousPage: boolean;
|
|
104
104
|
isFetchingNextPage: boolean;
|
|
@@ -128,10 +128,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
128
128
|
isRefetching: boolean;
|
|
129
129
|
isStale: boolean;
|
|
130
130
|
isEnabled: boolean;
|
|
131
|
-
refetch: (options?: import("@tanstack/query
|
|
132
|
-
fetchStatus: import("@tanstack/query
|
|
133
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
134
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
131
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
132
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
133
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
134
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
135
135
|
hasNextPage: boolean;
|
|
136
136
|
hasPreviousPage: boolean;
|
|
137
137
|
isFetchingNextPage: boolean;
|
|
@@ -162,10 +162,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
162
162
|
isRefetching: boolean;
|
|
163
163
|
isStale: boolean;
|
|
164
164
|
isEnabled: boolean;
|
|
165
|
-
refetch: (options?: import("@tanstack/query
|
|
166
|
-
fetchStatus: import("@tanstack/query
|
|
167
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
168
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
165
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
166
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
167
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
168
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
169
169
|
hasNextPage: boolean;
|
|
170
170
|
hasPreviousPage: boolean;
|
|
171
171
|
isFetchNextPageError: boolean;
|
|
@@ -196,10 +196,10 @@ export declare function useWalletHistoryQuery(enabled?: boolean): {
|
|
|
196
196
|
isRefetching: boolean;
|
|
197
197
|
isStale: boolean;
|
|
198
198
|
isEnabled: boolean;
|
|
199
|
-
refetch: (options?: import("@tanstack/query
|
|
200
|
-
fetchStatus: import("@tanstack/query
|
|
201
|
-
fetchNextPage: (options?: import("@tanstack/query
|
|
202
|
-
fetchPreviousPage: (options?: import("@tanstack/query
|
|
199
|
+
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
200
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
201
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
202
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<import("./use-infinite-list").ListPage<WalletEntry>, unknown>, Error>>;
|
|
203
203
|
hasNextPage: boolean;
|
|
204
204
|
hasPreviousPage: boolean;
|
|
205
205
|
isFetchingNextPage: boolean;
|
|
@@ -60,6 +60,18 @@ declare class LocalNodeServiceCore {
|
|
|
60
60
|
private storeUnsub;
|
|
61
61
|
private setupStoreSubscriptions;
|
|
62
62
|
private teardownStoreSubscriptions;
|
|
63
|
+
/**
|
|
64
|
+
* Apply an event received over the LAN, regardless of whether it arrived on
|
|
65
|
+
* a client socket (`peer`) or was relayed through a node by another terminal
|
|
66
|
+
* (`relay`).
|
|
67
|
+
*
|
|
68
|
+
* Both paths must materialize order rows and invalidate the read model. The
|
|
69
|
+
* relay path previously only applied reference-data events, so an order
|
|
70
|
+
* created on a phone while it had internet (cloud route) was broadcast to
|
|
71
|
+
* the LAN but silently dropped by the peer node — the other terminal never
|
|
72
|
+
* saw it until a later reconciliation.
|
|
73
|
+
*/
|
|
74
|
+
private applyLanEvent;
|
|
63
75
|
private startAsNode;
|
|
64
76
|
/**
|
|
65
77
|
* (Re)publish this node's mDNS advertisement. Isolated from server bring-up
|
|
@@ -422,6 +422,92 @@ class LocalNodeServiceCore {
|
|
|
422
422
|
this.storeUnsub = null;
|
|
423
423
|
this.subscribed = false;
|
|
424
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Apply an event received over the LAN, regardless of whether it arrived on
|
|
427
|
+
* a client socket (`peer`) or was relayed through a node by another terminal
|
|
428
|
+
* (`relay`).
|
|
429
|
+
*
|
|
430
|
+
* Both paths must materialize order rows and invalidate the read model. The
|
|
431
|
+
* relay path previously only applied reference-data events, so an order
|
|
432
|
+
* created on a phone while it had internet (cloud route) was broadcast to
|
|
433
|
+
* the LAN but silently dropped by the peer node — the other terminal never
|
|
434
|
+
* saw it until a later reconciliation.
|
|
435
|
+
*/
|
|
436
|
+
applyLanEvent(event, source) {
|
|
437
|
+
syncLogger.event(event, "received", { origin: "lan", source });
|
|
438
|
+
const deps = this.getDeps();
|
|
439
|
+
const eventType = event.event_type;
|
|
440
|
+
// Materialize LAN order events into the canonical orders table so
|
|
441
|
+
// list queries (POS In Progress, KDS) converge without the backend.
|
|
442
|
+
// Previously only order:sync inserted rows: a cloud/local-shape
|
|
443
|
+
// order.created from a peer fell through to the pending-store apply
|
|
444
|
+
// fns (which never touch the orders table), so the event arrived,
|
|
445
|
+
// every layer reported success, and the row never materialized.
|
|
446
|
+
if (eventType === "order:sync" || eventType === "order.created" || eventType === "order.status_changed") {
|
|
447
|
+
void (async () => {
|
|
448
|
+
try {
|
|
449
|
+
const p = event.payload;
|
|
450
|
+
const bid = deps.getBusiness()?.id;
|
|
451
|
+
const payloadBid = p.business_id;
|
|
452
|
+
if (typeof payloadBid === "string" && bid && payloadBid !== bid) {
|
|
453
|
+
syncLogger.warn("LocalNodeService", "Ignoring LAN order event for another business", {
|
|
454
|
+
event_type: eventType,
|
|
455
|
+
payloadBid,
|
|
456
|
+
bid,
|
|
457
|
+
});
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (p && typeof p.order_number === "string" && p.id) {
|
|
461
|
+
// Full-order payload (order:sync publish or order.created /
|
|
462
|
+
// status_changed echo): upsert the canonical row. HLC guard
|
|
463
|
+
// inside insertOrder keeps this idempotent across mesh + phx
|
|
464
|
+
// double delivery.
|
|
465
|
+
const db = await openSyncDatabase();
|
|
466
|
+
await insertOrder(db, p);
|
|
467
|
+
syncLogger.info("LocalNodeService", "LAN order row materialized", {
|
|
468
|
+
event_type: eventType,
|
|
469
|
+
order_number: p.order_number,
|
|
470
|
+
source,
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
else {
|
|
474
|
+
// Action-shaped payload (order:sync from a LAN command):
|
|
475
|
+
// apply the transition to the local row.
|
|
476
|
+
const action = p.action;
|
|
477
|
+
const orderId = p.orderId ?? p.order_id;
|
|
478
|
+
if (action && orderId && bid) {
|
|
479
|
+
try {
|
|
480
|
+
await transitionLocalOrder(bid, String(orderId), action);
|
|
481
|
+
syncLogger.info("LocalNodeService", "LAN order transition applied", {
|
|
482
|
+
event_type: eventType,
|
|
483
|
+
action,
|
|
484
|
+
orderId: String(orderId),
|
|
485
|
+
source,
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
catch { }
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
syncLogger.warn("LocalNodeService", "LAN order event has no materializable payload", {
|
|
492
|
+
event_type: eventType,
|
|
493
|
+
entity_id: event.entity_id,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
catch (e) {
|
|
499
|
+
syncLogger.warn("LocalNodeService", "LAN order apply failed", { err: String(e), event_type: eventType });
|
|
500
|
+
}
|
|
501
|
+
// The row is in SQLite now — invalidate so lists/detail refetch.
|
|
502
|
+
// (LAN-applied writes bypass the engine pipeline, so no subscriber
|
|
503
|
+
// does this for us.)
|
|
504
|
+
notifyPendingOrdersChanged();
|
|
505
|
+
})();
|
|
506
|
+
}
|
|
507
|
+
applyPendingOrderEvent(event, "lan").catch((e) => syncLogger.error("LocalNodeService", "Failed to apply LAN event", { error: String(e), event_type: event.event_type }));
|
|
508
|
+
applyReferenceChangeEvent(event, "lan").catch((e) => syncLogger.error("LocalNodeService", "Failed to apply LAN reference", { error: String(e), event_type: event.event_type }));
|
|
509
|
+
applyOrderStateChangeEvent(event, "lan").catch((e) => syncLogger.error("LocalNodeService", "Failed to apply LAN order state", { error: String(e), event_type: event.event_type }));
|
|
510
|
+
}
|
|
425
511
|
async startAsNode(port) {
|
|
426
512
|
if (!this.businessId || !this.secret)
|
|
427
513
|
throw new Error("LocalNodeService: business context missing");
|
|
@@ -435,7 +521,7 @@ class LocalNodeServiceCore {
|
|
|
435
521
|
return event ? [event] : [];
|
|
436
522
|
},
|
|
437
523
|
onRelayEvent: (event) => {
|
|
438
|
-
|
|
524
|
+
this.applyLanEvent(event, "relay");
|
|
439
525
|
},
|
|
440
526
|
onClientConnected: (info) => {
|
|
441
527
|
localNodeStore.getState().addConnectedClient({ deviceId: info.deviceId, deviceName: info.deviceName, host: info.host, connectedAt: new Date().toISOString() });
|
|
@@ -609,76 +695,7 @@ class LocalNodeServiceCore {
|
|
|
609
695
|
businessId: this.businessId,
|
|
610
696
|
secret: this.secret,
|
|
611
697
|
onEvent: (event) => {
|
|
612
|
-
|
|
613
|
-
const eventType = event.event_type;
|
|
614
|
-
// Materialize LAN order events into the canonical orders table so
|
|
615
|
-
// list queries (POS In Progress, KDS) converge without the backend.
|
|
616
|
-
// Previously only order:sync inserted rows: a cloud/local-shape
|
|
617
|
-
// order.created from a peer fell through to the pending-store apply
|
|
618
|
-
// fns (which never touch the orders table), so the event arrived,
|
|
619
|
-
// every layer reported success, and the row never materialized.
|
|
620
|
-
if (eventType === "order:sync" || eventType === "order.created" || eventType === "order.status_changed") {
|
|
621
|
-
void (async () => {
|
|
622
|
-
try {
|
|
623
|
-
const p = event.payload;
|
|
624
|
-
const bid = deps.getBusiness()?.id;
|
|
625
|
-
const payloadBid = p.business_id;
|
|
626
|
-
if (typeof payloadBid === "string" && bid && payloadBid !== bid) {
|
|
627
|
-
syncLogger.warn("LocalNodeService", "Ignoring LAN order event for another business", {
|
|
628
|
-
event_type: eventType,
|
|
629
|
-
payloadBid,
|
|
630
|
-
bid,
|
|
631
|
-
});
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
if (p && typeof p.order_number === "string" && p.id) {
|
|
635
|
-
// Full-order payload (order:sync publish or order.created /
|
|
636
|
-
// status_changed echo): upsert the canonical row. HLC guard
|
|
637
|
-
// inside insertOrder keeps this idempotent across mesh + phx
|
|
638
|
-
// double delivery.
|
|
639
|
-
const db = await openSyncDatabase();
|
|
640
|
-
await insertOrder(db, p);
|
|
641
|
-
syncLogger.info("LocalNodeService", "LAN order row materialized", {
|
|
642
|
-
event_type: eventType,
|
|
643
|
-
order_number: p.order_number,
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
else {
|
|
647
|
-
// Action-shaped payload (order:sync from a LAN command):
|
|
648
|
-
// apply the transition to the local row.
|
|
649
|
-
const action = p.action;
|
|
650
|
-
const orderId = p.orderId ?? p.order_id;
|
|
651
|
-
if (action && orderId && bid) {
|
|
652
|
-
try {
|
|
653
|
-
await transitionLocalOrder(bid, String(orderId), action);
|
|
654
|
-
syncLogger.info("LocalNodeService", "LAN order transition applied", {
|
|
655
|
-
event_type: eventType,
|
|
656
|
-
action,
|
|
657
|
-
orderId: String(orderId),
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
catch { }
|
|
661
|
-
}
|
|
662
|
-
else {
|
|
663
|
-
syncLogger.warn("LocalNodeService", "LAN order event has no materializable payload", {
|
|
664
|
-
event_type: eventType,
|
|
665
|
-
entity_id: event.entity_id,
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
catch (e) {
|
|
671
|
-
syncLogger.warn("LocalNodeService", "LAN order apply failed", { err: String(e), event_type: eventType });
|
|
672
|
-
}
|
|
673
|
-
// The row is in SQLite now — invalidate so lists/detail refetch.
|
|
674
|
-
// (LAN-applied writes bypass the engine pipeline, so no
|
|
675
|
-
// subscriber does this for us.)
|
|
676
|
-
notifyPendingOrdersChanged();
|
|
677
|
-
})();
|
|
678
|
-
}
|
|
679
|
-
applyPendingOrderEvent(event, "lan").catch((e) => syncLogger.error("LocalNodeService", "Failed to apply LAN event", { error: String(e), event_type: event.event_type }));
|
|
680
|
-
applyReferenceChangeEvent(event, "lan").catch((e) => syncLogger.error("LocalNodeService", "Failed to apply LAN reference", { error: String(e), event_type: event.event_type }));
|
|
681
|
-
applyOrderStateChangeEvent(event, "lan").catch((e) => syncLogger.error("LocalNodeService", "Failed to apply LAN order state", { error: String(e), event_type: event.event_type }));
|
|
698
|
+
this.applyLanEvent(event, "peer");
|
|
682
699
|
},
|
|
683
700
|
onConnected: () => {
|
|
684
701
|
this.settleDial(node.deviceId);
|
|
@@ -21,6 +21,7 @@ import { buildItemSnapshots, snapshotsToOrderLines } from "../domain/orders/snap
|
|
|
21
21
|
import { DEFAULT_ORDER_FLOW_MODE, getBusinessOrderFlowMode, initialPosOrderStatus, } from "../domain/orders/order-flow";
|
|
22
22
|
import { generateLocalCalloutNumber, generateOrderNumberForBusiness, generateOrderNumber, } from "./order-number";
|
|
23
23
|
import { getConnectivityState, subscribeConnectivity } from "../adapters/connectivity";
|
|
24
|
+
import { useAuthStore } from "../adapters/auth";
|
|
24
25
|
import { canBusinessSync } from "./sync-guard";
|
|
25
26
|
import { backoffDelayMs } from "./backoff";
|
|
26
27
|
import { reportSyncFailure } from "../adapters/sync-failure";
|
|
@@ -121,6 +122,16 @@ function buildOptimisticOrder(command, payload, flowMode) {
|
|
|
121
122
|
const now = new Date().toISOString();
|
|
122
123
|
const method = payload.pos_payment_method ?? "cash";
|
|
123
124
|
const isCash = method === "cash";
|
|
125
|
+
const authUser = useAuthStore.getState().user;
|
|
126
|
+
const teller = authUser
|
|
127
|
+
? {
|
|
128
|
+
id: authUser.id,
|
|
129
|
+
full_name: authUser.full_name ?? authUser.email ?? "Staff",
|
|
130
|
+
email: authUser.email ?? "",
|
|
131
|
+
phone: authUser.phone ?? "",
|
|
132
|
+
avatar_url: authUser.avatar_url ?? null,
|
|
133
|
+
}
|
|
134
|
+
: null;
|
|
124
135
|
const orderNumber = payload.order_number ?? generateOrderNumberForBusiness(command.business_id);
|
|
125
136
|
return {
|
|
126
137
|
id: command.entity_id ?? command.command_id,
|
|
@@ -162,7 +173,8 @@ function buildOptimisticOrder(command, payload, flowMode) {
|
|
|
162
173
|
delivery_address: null,
|
|
163
174
|
delivery_lat: null,
|
|
164
175
|
delivery_lng: null,
|
|
165
|
-
user:
|
|
176
|
+
user: teller,
|
|
177
|
+
teller,
|
|
166
178
|
items: snapshotsToOrderLines(snapshots, command.command_id),
|
|
167
179
|
inserted_at: now,
|
|
168
180
|
};
|
|
@@ -96,15 +96,22 @@ export function useSyncReconciliation() {
|
|
|
96
96
|
// The node relays engine events (e.g. order.created when a queued
|
|
97
97
|
// command is replayed) to LAN clients so they reconcile their pending
|
|
98
98
|
// orders and refresh caches.
|
|
99
|
+
//
|
|
100
|
+
// A terminal that is only a LAN client (its own listener failed to bind,
|
|
101
|
+
// or it is a phone in the background) also has to forward the events it
|
|
102
|
+
// produces locally. Otherwise a sale completed over the cloud while the
|
|
103
|
+
// phone has mobile data — the exact iOS Wi-Fi + LTE case — never reaches
|
|
104
|
+
// the node until a later full sync. Reference events were already
|
|
105
|
+
// forwarded here; order/payment/delivery events need the same path.
|
|
106
|
+
const relayable = event.event_type === REFERENCE_CHANGED_EVENT_TYPE ||
|
|
107
|
+
event.event_type.startsWith("order.") ||
|
|
108
|
+
event.event_type.startsWith("order:") ||
|
|
109
|
+
event.event_type.startsWith("payment.") ||
|
|
110
|
+
event.event_type.startsWith("delivery.");
|
|
99
111
|
if (localNodeService.isLocalNode()) {
|
|
100
112
|
localNodeService.broadcastToClients(event);
|
|
101
113
|
}
|
|
102
|
-
|
|
103
|
-
// node): forward the event to the node so it rebroadcasts it to every
|
|
104
|
-
// other terminal (the node also applies it locally via its onRelayEvent
|
|
105
|
-
// hook). The node does not echo it back to this device.
|
|
106
|
-
if (event.event_type === REFERENCE_CHANGED_EVENT_TYPE &&
|
|
107
|
-
!localNodeService.isLocalNode()) {
|
|
114
|
+
else if (relayable) {
|
|
108
115
|
localNodeService.getClient()?.publishEvent?.(event);
|
|
109
116
|
}
|
|
110
117
|
// Where the event came from: a Phoenix push is "cloud", a LAN relay is
|
|
@@ -189,7 +189,7 @@ export function createMemoryDriver() {
|
|
|
189
189
|
}
|
|
190
190
|
// orders insert (primary DB)
|
|
191
191
|
if (s.includes("INSERT INTO orders")) {
|
|
192
|
-
const [id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at, customer_name, customer_phone, pos_payment_method, delivery_id, business, user, inserted_at, updated_at, hlc] = args;
|
|
192
|
+
const [id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at, customer_name, customer_phone, pos_payment_method, payment_mode, delivery_id, business, user, inserted_at, updated_at, hlc] = args;
|
|
193
193
|
const existing = tables.orders.find((r) => r.id === id);
|
|
194
194
|
// LWW check via hlc (if existing and incoming older, skip) — only for
|
|
195
195
|
// the local/LAN write path. The server write path (`upsertServerOrder`)
|
|
@@ -198,10 +198,10 @@ export function createMemoryDriver() {
|
|
|
198
198
|
if (existing) {
|
|
199
199
|
if (lwwGuarded && hlc && existing.hlc && hlc < existing.hlc)
|
|
200
200
|
return { lastInsertRowId: 0, changes: 0 };
|
|
201
|
-
Object.assign(existing, { business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at: paid_at ?? existing.paid_at ?? null, customer_name, customer_phone, pos_payment_method, delivery_id, business, user, inserted_at, updated_at, hlc });
|
|
201
|
+
Object.assign(existing, { business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at: paid_at ?? existing.paid_at ?? null, customer_name, customer_phone, pos_payment_method, payment_mode, delivery_id, business, user, inserted_at, updated_at, hlc });
|
|
202
202
|
return { lastInsertRowId: 0, changes: 1 };
|
|
203
203
|
}
|
|
204
|
-
tables.orders.push({ id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at: paid_at ?? null, customer_name, customer_phone, pos_payment_method, delivery_id, business, user, inserted_at, updated_at, hlc, deleted_at: null });
|
|
204
|
+
tables.orders.push({ id, business_id, order_number, callout_number, status, order_type, is_pos, items, subtotal_minor, total_minor, tax_minor, tax_lines, payment, paid_at: paid_at ?? null, customer_name, customer_phone, pos_payment_method, payment_mode, delivery_id, business, user, inserted_at, updated_at, hlc, deleted_at: null });
|
|
205
205
|
return { lastInsertRowId: 1, changes: 1 };
|
|
206
206
|
}
|
|
207
207
|
// sync_jobs insert
|
package/package.json
CHANGED