门店账户多账号
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user