门店账户多账号

This commit is contained in:
2026-07-12 12:24:34 +08:00
parent 06b1cb22e0
commit 54a15d6da7
39 changed files with 1962 additions and 311 deletions
@@ -13,7 +13,7 @@ export type TrackEventInput = {
export type TrackStoreEventInput = TrackEventInput & {
storeAccountId?: bigint;
storeId: bigint;
storeId?: bigint;
};
export type TrackPartnerEventInput = TrackEventInput & {
@@ -54,12 +54,14 @@ export class AnalyticsService {
}
async trackStoreOne(storeAccountId: bigint | undefined, clientApp: ClientApp | string, event: TrackStoreEventInput) {
if (event.storeId == null) return;
await this.prisma.logStoreAnalytics.create({
data: this.toStoreRow(storeAccountId, clientApp, event),
});
}
trackStoreOneSafe(storeAccountId: bigint | undefined, clientApp: ClientApp | string, event: TrackStoreEventInput) {
if (event.storeId == null) return;
void this.trackStoreOne(storeAccountId, clientApp, event).catch(() => {});
}
@@ -100,7 +102,7 @@ export class AnalyticsService {
) {
return {
storeAccountId,
storeId: event.storeId,
storeId: event.storeId!,
eventName: event.eventName,
clientApp: clientApp as ClientApp,
refType: event.refType,