@lyxa.ai/core 1.4.330 → 1.4.332-alpha.0

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.
Files changed (31) hide show
  1. package/dist/libraries/event/events/mongo-stream-changes-batch-process-shops-event.d.ts +2 -2
  2. package/dist/libraries/event/events/punch-marketing/sync-user-shop-punch-marketing-history-event.d.ts +2 -2
  3. package/dist/libraries/event/events/sync-order-again-sections-for-shop-event.d.ts +2 -2
  4. package/dist/libraries/mongo/models/index.d.ts +3 -0
  5. package/dist/libraries/mongo/models/index.js +6 -3
  6. package/dist/libraries/mongo/models/index.js.map +1 -1
  7. package/dist/libraries/mongo/models/providers/global-coupon.model.d.ts +2 -0
  8. package/dist/libraries/mongo/models/providers/global-coupon.model.js +20 -0
  9. package/dist/libraries/mongo/models/providers/global-coupon.model.js.map +1 -1
  10. package/dist/libraries/mongo/models/user-coupon.model.d.ts +11 -0
  11. package/dist/libraries/mongo/models/user-coupon.model.js +52 -0
  12. package/dist/libraries/mongo/models/user-coupon.model.js.map +1 -0
  13. package/dist/libraries/mongo/models/user.model.d.ts +2 -1
  14. package/dist/libraries/mongo/models/user.model.js +6 -1
  15. package/dist/libraries/mongo/models/user.model.js.map +1 -1
  16. package/dist/libraries/redis/index.d.ts +4 -0
  17. package/dist/libraries/redis/index.js +12 -0
  18. package/dist/libraries/redis/index.js.map +1 -1
  19. package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +13 -13
  20. package/dist/libraries/socket/events/order-actions.socket.event.d.ts +44 -44
  21. package/dist/libraries/socket/events/rider-location-update.socket.event.d.ts +8 -8
  22. package/dist/libraries/socket/events/ticket-actions.socket.event.d.ts +13 -13
  23. package/dist/libraries/socket/events/ticket-assign.socket.event.d.ts +16 -16
  24. package/dist/types/README.md +1 -1
  25. package/dist/types/package.json +1 -1
  26. package/dist/types/utilities/validation/common-validation.d.ts +12 -12
  27. package/dist/types/utilities/validation/validation-for-frontend.d.ts +2 -2
  28. package/dist/utilities/pagination.d.ts +3 -3
  29. package/dist/utilities/validation/common-validation.d.ts +12 -12
  30. package/dist/utilities/validation/validation-for-frontend.d.ts +2 -2
  31. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/redis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sDAA4B;AAC5B,mCAAiC;AACjC,mCAAoC;AACpC,kCAAoC;AAQ7B,IAAM,YAAY,GAAlB,MAAM,YAAY;IAChB,YAAY,CAAS;IAE7B,YAAY,QAAgB;QAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,iBAAK,CAAC,QAAQ,EAAE;YACvC,oBAAoB,EAAE,IAAI;SAC1B,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,WAAW;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,eAAe,CAAI,GAAW;QAC1C,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEvD,IAAI,aAAa,IAAI,SAAS,EAAE,CAAC;YAChC,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAM,CAAC;QACvC,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,WAAW,CAAI,GAAW,EAAE,MAAS,EAAE,MAAe;QAClE,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAEjD,IAAI,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAA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AI,EAAE,CAAC;QAC7C,MAAM,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,GAAG,CAAC;QAElD,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,OAAO,OAAO,IAAI,UAAU,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAEnD,IAAI,SAAS,EAAE,CAAC;gBACf,IAAI,CAAC;oBACJ,OAAO,MAAM,QAAQ,EAAE,CAAC;gBACzB,CAAC;wBAAS,CAAC;oBACV,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;gBACxC,CAAC;YACF,CAAC;YAED,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;YAE1E,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,IAAI,gBAAS,CAAC;YACnB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,YAAY,IAAI,oBAAoB;YAC7C,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;SAC1B,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AA1JY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,gBAAO,GAAE;;GACG,YAAY,CA0JxB","sourcesContent":["import Redis from 'ioredis';\nimport { Service } from 'typedi';\nimport { randomUUID } from 'crypto';\nimport { TRPCError } from '../trpc';\n\ninterface LockOptions {\n\tmaxRetries?: number;\n\tretryDelayMs?: number;\n}\n\n@Service()\nexport class RedisService {\n\tprivate _redisClient!: Redis;\n\n\tconstructor(redisURL: string) {\n\t\tthis._redisClient = new Redis(redisURL, {\n\t\t\tmaxRetriesPerRequest: null,\n\t\t});\n\t}\n\n\tget redisClient(): Redis {\n\t\treturn this._redisClient;\n\t}\n\n\tpublic async getCachedObject<T>(key: string): Promise<T | undefined> {\n\t\tconst usageResponse = await this._redisClient.get(key);\n\n\t\tif (usageResponse != undefined) {\n\t\t\treturn JSON.parse(usageResponse) as T;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async cacheObject<T>(key: string, object: T, expiry?: number): Promise<boolean> {\n\t\tconst stringifiedObject = JSON.stringify(object);\n\n\t\tif (expiry) {\n\t\t\tawait this._redisClient.setex(key, expiry, stringifiedObject);\n\t\t} else {\n\t\t\tawait this._redisClient.set(key, stringifiedObject);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic async deleteCachedObject(key: string): Promise<boolean> {\n\t\tawait this._redisClient.del(key);\n\t\treturn true;\n\t}\n\n\tpublic async getCachedObjectByGroup<T>(group: string, key: string): Promise<T | undefined> {\n\t\tconst usageResponse = await this._redisClient.hget(group, key);\n\n\t\tif (usageResponse != undefined) {\n\t\t\treturn JSON.parse(usageResponse) as T;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async setCachedObjectByGroup<T>(group: string, key: string, object: T): Promise<boolean> {\n\t\tconst stringifiedObject = JSON.stringify(object);\n\t\tawait this._redisClient.hset(group, key, stringifiedObject);\n\n\t\treturn true;\n\t}\n\n\tpublic async deleteCachedObjectByGroup<T>(group: string, key: string): Promise<boolean> {\n\t\tawait this._redisClient.hdel(group, key);\n\t\treturn true;\n\t}\n\n\tpublic sanitizeKey(key: string) {\n\t\treturn key\n\t\t\t.replace(/[^\\w\\s]/gi, '')\n\t\t\t.replace(/\\s+/g, '-')\n\t\t\t.toLowerCase();\n\t}\n\n\tpublic async addToSet(group: string, member: string): Promise<boolean> {\n\t\tawait this._redisClient.sadd(group, member);\n\t\treturn true;\n\t}\n\n\tpublic async removeFromSet(group: string, member: string): Promise<boolean> {\n\t\tawait this._redisClient.srem(group, member);\n\t\treturn true;\n\t}\n\n\tpublic async isMemberOfSet(group: string, member: string): Promise<boolean> {\n\t\treturn (await this._redisClient.sismember(group, member)) === 1;\n\t}\n\n\tpublic async getSetMembers(group: string): Promise<string[]> {\n\t\treturn await this._redisClient.smembers(group);\n\t}\n\n\tpublic async acquireLock(\n\t\tkey: string,\n\t\tttl: number = 10000 // default 10s\n\t): Promise<string | null> {\n\t\tconst lockKey = `lock:${key}`;\n\t\tconst lockValue = randomUUID(); // unique value per process\n\n\t\tconst result = await this._redisClient.set(lockKey, lockValue, 'PX', ttl, 'NX');\n\n\t\t// If result === 'OK' → lock acquired\n\t\tif (result === 'OK') {\n\t\t\treturn lockValue;\n\t\t}\n\n\t\treturn null; // lock not acquired\n\t}\n\n\tpublic async releaseLock(key: string, lockValue: string): Promise<boolean> {\n\t\tconst lockKey = `lock:${key}`;\n\n\t\tconst luaScript = `\n\t\tif redis.call(\"get\", KEYS[1]) == ARGV[1] then\n\t\t\treturn redis.call(\"del\", KEYS[1])\n\t\telse\n\t\t\treturn 0\n\t\tend\n\t`;\n\n\t\tconst result = await this._redisClient.eval(luaScript, 1, lockKey, lockValue);\n\n\t\treturn result === 1;\n\t}\n\n\tpublic async executeWithLock<T>(\n\t\tkey: string,\n\t\tttl: number,\n\t\tcallback: () => Promise<T>,\n\t\terrorMessage?: string,\n\t\toptions?: LockOptions\n\t): Promise<T> {\n\t\tconst maxRetries = options?.maxRetries ?? 10;\n\t\tconst retryDelayMs = options?.retryDelayMs ?? 500;\n\n\t\tlet attempt = 0;\n\n\t\twhile (attempt <= maxRetries) {\n\t\t\tconst lockValue = await this.acquireLock(key, ttl);\n\n\t\t\tif (lockValue) {\n\t\t\t\ttry {\n\t\t\t\t\treturn await callback();\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.releaseLock(key, lockValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tawait new Promise(r => setTimeout(r, retryDelayMs + Math.random() * 100));\n\n\t\t\tattempt++;\n\t\t}\n\n\t\tthrow new TRPCError({\n\t\t\tcode: 'CONFLICT',\n\t\t\tmessage: errorMessage || 'Resource is locked',\n\t\t\tcause: { retryable: true },\n\t\t});\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AAa,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;CACD,CAAA;AA1KY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,gBAAO,GAAE;;GACG,YAAY,CA0KxB","sourcesContent":["import Redis from 'ioredis';\nimport { Service } from 'typedi';\nimport { randomUUID } from 'crypto';\nimport { TRPCError } from '../trpc';\nimport { AuthEntityType } from '../auth';\n\ninterface LockOptions {\n\tmaxRetries?: number;\n\tretryDelayMs?: number;\n}\n\n@Service()\nexport class RedisService {\n\tprivate _redisClient!: Redis;\n\n\tconstructor(redisURL: string) {\n\t\tthis._redisClient = new Redis(redisURL, {\n\t\t\tmaxRetriesPerRequest: null,\n\t\t});\n\t}\n\n\tget redisClient(): Redis {\n\t\treturn this._redisClient;\n\t}\n\n\tpublic async getCachedObject<T>(key: string): Promise<T | undefined> {\n\t\tconst usageResponse = await this._redisClient.get(key);\n\n\t\tif (usageResponse != undefined) {\n\t\t\treturn JSON.parse(usageResponse) as T;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async cacheObject<T>(key: string, object: T, expiry?: number): Promise<boolean> {\n\t\tconst stringifiedObject = JSON.stringify(object);\n\n\t\tif (expiry) {\n\t\t\tawait this._redisClient.setex(key, expiry, stringifiedObject);\n\t\t} else {\n\t\t\tawait this._redisClient.set(key, stringifiedObject);\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic async deleteCachedObject(key: string): Promise<boolean> {\n\t\tawait this._redisClient.del(key);\n\t\treturn true;\n\t}\n\n\tpublic async getCachedObjectByGroup<T>(group: string, key: string): Promise<T | undefined> {\n\t\tconst usageResponse = await this._redisClient.hget(group, key);\n\n\t\tif (usageResponse != undefined) {\n\t\t\treturn JSON.parse(usageResponse) as T;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tpublic async setCachedObjectByGroup<T>(group: string, key: string, object: T): Promise<boolean> {\n\t\tconst stringifiedObject = JSON.stringify(object);\n\t\tawait this._redisClient.hset(group, key, stringifiedObject);\n\n\t\treturn true;\n\t}\n\n\tpublic async deleteCachedObjectByGroup<T>(group: string, key: string): Promise<boolean> {\n\t\tawait this._redisClient.hdel(group, key);\n\t\treturn true;\n\t}\n\n\tpublic sanitizeKey(key: string) {\n\t\treturn key\n\t\t\t.replace(/[^\\w\\s]/gi, '')\n\t\t\t.replace(/\\s+/g, '-')\n\t\t\t.toLowerCase();\n\t}\n\n\tpublic async addToSet(group: string, member: string): Promise<boolean> {\n\t\tawait this._redisClient.sadd(group, member);\n\t\treturn true;\n\t}\n\n\tpublic async removeFromSet(group: string, member: string): Promise<boolean> {\n\t\tawait this._redisClient.srem(group, member);\n\t\treturn true;\n\t}\n\n\tpublic async isMemberOfSet(group: string, member: string): Promise<boolean> {\n\t\treturn (await this._redisClient.sismember(group, member)) === 1;\n\t}\n\n\tpublic async getSetMembers(group: string): Promise<string[]> {\n\t\treturn await this._redisClient.smembers(group);\n\t}\n\n\tpublic async acquireLock(\n\t\tkey: string,\n\t\tttl: number = 10000 // default 10s\n\t): Promise<string | null> {\n\t\tconst lockKey = `lock:${key}`;\n\t\tconst lockValue = randomUUID(); // unique value per process\n\n\t\tconst result = await this._redisClient.set(lockKey, lockValue, 'PX', ttl, 'NX');\n\n\t\t// If result === 'OK' → lock acquired\n\t\tif (result === 'OK') {\n\t\t\treturn lockValue;\n\t\t}\n\n\t\treturn null; // lock not acquired\n\t}\n\n\tpublic async releaseLock(key: string, lockValue: string): Promise<boolean> {\n\t\tconst lockKey = `lock:${key}`;\n\n\t\tconst luaScript = `\n\t\tif redis.call(\"get\", KEYS[1]) == ARGV[1] then\n\t\t\treturn redis.call(\"del\", KEYS[1])\n\t\telse\n\t\t\treturn 0\n\t\tend\n\t`;\n\n\t\tconst result = await this._redisClient.eval(luaScript, 1, lockKey, lockValue);\n\n\t\treturn result === 1;\n\t}\n\n\tpublic async executeWithLock<T>(\n\t\tkey: string,\n\t\tttl: number,\n\t\tcallback: () => Promise<T>,\n\t\terrorMessage?: string,\n\t\toptions?: LockOptions\n\t): Promise<T> {\n\t\tconst maxRetries = options?.maxRetries ?? 10;\n\t\tconst retryDelayMs = options?.retryDelayMs ?? 500;\n\n\t\tlet attempt = 0;\n\n\t\twhile (attempt <= maxRetries) {\n\t\t\tconst lockValue = await this.acquireLock(key, ttl);\n\n\t\t\tif (lockValue) {\n\t\t\t\ttry {\n\t\t\t\t\treturn await callback();\n\t\t\t\t} finally {\n\t\t\t\t\tawait this.releaseLock(key, lockValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tawait new Promise(r => setTimeout(r, retryDelayMs + Math.random() * 100));\n\n\t\t\tattempt++;\n\t\t}\n\n\t\tthrow new TRPCError({\n\t\t\tcode: 'CONFLICT',\n\t\t\tmessage: errorMessage || 'Resource is locked',\n\t\t\tcause: { retryable: true },\n\t\t});\n\t}\n\n\tprivate buildLastOnlineKey(entityType: AuthEntityType) {\n\t\treturn `lastOnline:${entityType}`;\n\t}\n\n\tpublic async setLastOnline(entityType: AuthEntityType, entityId: string, timestamp: number = Date.now()) {\n\t\tconst key = this.buildLastOnlineKey(entityType);\n\t\tawait this._redisClient.zadd(key, timestamp, entityId);\n\t}\n\n\tpublic async getOnlineEntities(entityType: AuthEntityType, cutoffTime: Date) {\n\t\tconst key = this.buildLastOnlineKey(entityType);\n\t\tconst cutoffMs = cutoffTime.getTime();\n\n\t\treturn await this._redisClient.zrangebyscore(key, cutoffMs, '+inf');\n\t}\n}\n"]}
@@ -63,8 +63,8 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
63
63
  orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
64
64
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
65
65
  }, "strip", z.ZodTypeAny, {
66
- _id: import("mongoose").Types.ObjectId;
67
66
  createdAt: Date;
67
+ _id: import("mongoose").Types.ObjectId;
68
68
  sender: {
69
69
  type: UserRef;
70
70
  name: string;
@@ -85,12 +85,12 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
85
85
  longitude?: number | undefined;
86
86
  } | undefined;
87
87
  orderId?: import("mongoose").Types.ObjectId | undefined;
88
- ticketId?: import("mongoose").Types.ObjectId | undefined;
89
88
  content?: string | undefined;
89
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
90
90
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
91
91
  }, {
92
- _id: import("mongoose").Types.ObjectId;
93
92
  createdAt: Date;
93
+ _id: import("mongoose").Types.ObjectId;
94
94
  sender: {
95
95
  type: UserRef;
96
96
  name: string;
@@ -111,8 +111,8 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
111
111
  longitude?: number | undefined;
112
112
  } | undefined;
113
113
  orderId?: import("mongoose").Types.ObjectId | undefined;
114
- ticketId?: import("mongoose").Types.ObjectId | undefined;
115
114
  content?: string | undefined;
115
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
116
116
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
117
117
  }>;
118
118
  export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
@@ -124,14 +124,14 @@ export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
124
124
  }, "strip", z.ZodTypeAny, {
125
125
  type: ChatroomType;
126
126
  orderId?: import("mongoose").Types.ObjectId | undefined;
127
- ticketId?: import("mongoose").Types.ObjectId | undefined;
128
127
  lastMessage?: string | undefined;
128
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
129
129
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
130
130
  }, {
131
131
  type: ChatroomType;
132
132
  orderId?: import("mongoose").Types.ObjectId | undefined;
133
- ticketId?: import("mongoose").Types.ObjectId | undefined;
134
133
  lastMessage?: string | undefined;
134
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
135
135
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
136
136
  }>;
137
137
  export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatroomMessageSendPushOutputSchema>;
@@ -199,8 +199,8 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
199
199
  orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
200
200
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
201
201
  }, "strip", z.ZodTypeAny, {
202
- _id: import("mongoose").Types.ObjectId;
203
202
  createdAt: Date;
203
+ _id: import("mongoose").Types.ObjectId;
204
204
  sender: {
205
205
  type: UserRef;
206
206
  name: string;
@@ -221,12 +221,12 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
221
221
  longitude?: number | undefined;
222
222
  } | undefined;
223
223
  orderId?: import("mongoose").Types.ObjectId | undefined;
224
- ticketId?: import("mongoose").Types.ObjectId | undefined;
225
224
  content?: string | undefined;
225
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
226
226
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
227
227
  }, {
228
- _id: import("mongoose").Types.ObjectId;
229
228
  createdAt: Date;
229
+ _id: import("mongoose").Types.ObjectId;
230
230
  sender: {
231
231
  type: UserRef;
232
232
  name: string;
@@ -247,8 +247,8 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
247
247
  longitude?: number | undefined;
248
248
  } | undefined;
249
249
  orderId?: import("mongoose").Types.ObjectId | undefined;
250
- ticketId?: import("mongoose").Types.ObjectId | undefined;
251
250
  content?: string | undefined;
251
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
252
252
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
253
253
  }>;
254
254
  pushNotificationOutput: z.ZodObject<{
@@ -260,14 +260,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
260
260
  }, "strip", z.ZodTypeAny, {
261
261
  type: ChatroomType;
262
262
  orderId?: import("mongoose").Types.ObjectId | undefined;
263
- ticketId?: import("mongoose").Types.ObjectId | undefined;
264
263
  lastMessage?: string | undefined;
264
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
265
265
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
266
266
  }, {
267
267
  type: ChatroomType;
268
268
  orderId?: import("mongoose").Types.ObjectId | undefined;
269
- ticketId?: import("mongoose").Types.ObjectId | undefined;
270
269
  lastMessage?: string | undefined;
270
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
271
271
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
272
272
  }>;
273
273
  };
@@ -278,8 +278,8 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
278
278
  getPushNotificationPayload(): {
279
279
  type: ChatroomType;
280
280
  orderId?: import("mongoose").Types.ObjectId | undefined;
281
- ticketId?: import("mongoose").Types.ObjectId | undefined;
282
281
  lastMessage?: string | undefined;
282
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
283
283
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
284
284
  } | undefined;
285
285
  protected getIdentifier(): string;
@@ -16,11 +16,11 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
16
16
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
17
17
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
18
18
  }, "strip", z.ZodTypeAny, {
19
- _id: import("mongoose").Types.ObjectId;
20
19
  name: string;
20
+ _id: import("mongoose").Types.ObjectId;
21
21
  }, {
22
- _id: string | import("mongoose").Types.ObjectId;
23
22
  name: string;
23
+ _id: string | import("mongoose").Types.ObjectId;
24
24
  }>;
25
25
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
26
26
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -39,19 +39,19 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
39
39
  riderTips: z.ZodNumber;
40
40
  secondaryRiderTips: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
- total: number;
43
42
  deliveryFee: number;
44
- secondaryDeliveryFee: number;
45
43
  riderTips: number;
44
+ total: number;
45
+ secondaryDeliveryFee: number;
46
46
  secondaryRiderTips: number;
47
47
  secondaryTotal: number;
48
48
  paidAmount: number;
49
49
  secondaryPaidAmount: number;
50
50
  }, {
51
- total: number;
52
51
  deliveryFee: number;
53
- secondaryDeliveryFee: number;
54
52
  riderTips: number;
53
+ total: number;
54
+ secondaryDeliveryFee: number;
55
55
  secondaryRiderTips: number;
56
56
  secondaryTotal: number;
57
57
  paidAmount: number;
@@ -60,10 +60,10 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  paymentMethod: PaymentMethod;
62
62
  pricing: {
63
- total: number;
64
63
  deliveryFee: number;
65
- secondaryDeliveryFee: number;
66
64
  riderTips: number;
65
+ total: number;
66
+ secondaryDeliveryFee: number;
67
67
  secondaryRiderTips: number;
68
68
  secondaryTotal: number;
69
69
  paidAmount: number;
@@ -73,10 +73,10 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
73
73
  }, {
74
74
  paymentMethod: PaymentMethod;
75
75
  pricing: {
76
- total: number;
77
76
  deliveryFee: number;
78
- secondaryDeliveryFee: number;
79
77
  riderTips: number;
78
+ total: number;
79
+ secondaryDeliveryFee: number;
80
80
  secondaryRiderTips: number;
81
81
  secondaryTotal: number;
82
82
  paidAmount: number;
@@ -88,23 +88,23 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
88
88
  triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
89
89
  orderActionType: z.ZodNativeEnum<typeof OrderAction>;
90
90
  }, "strip", z.ZodTypeAny, {
91
- _id: import("mongoose").Types.ObjectId;
92
91
  createdAt: Date;
92
+ _id: import("mongoose").Types.ObjectId;
93
+ shopId: import("mongoose").Types.ObjectId;
93
94
  user: {
94
- _id: import("mongoose").Types.ObjectId;
95
95
  name: string;
96
+ _id: import("mongoose").Types.ObjectId;
96
97
  };
97
- orderId: string;
98
- shopId: import("mongoose").Types.ObjectId;
99
98
  paymentMethod: PaymentMethod;
99
+ orderId: string;
100
100
  triggerAt: Date;
101
101
  adjustedFinance: {
102
102
  paymentMethod: PaymentMethod;
103
103
  pricing: {
104
- total: number;
105
104
  deliveryFee: number;
106
- secondaryDeliveryFee: number;
107
105
  riderTips: number;
106
+ total: number;
107
+ secondaryDeliveryFee: number;
108
108
  secondaryRiderTips: number;
109
109
  secondaryTotal: number;
110
110
  paidAmount: number;
@@ -117,23 +117,23 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
117
117
  orderAction: OrderAction;
118
118
  preparationTimeMinutes: number;
119
119
  }, {
120
- _id: string | import("mongoose").Types.ObjectId;
121
120
  createdAt: Date;
121
+ _id: string | import("mongoose").Types.ObjectId;
122
+ shopId: string | import("mongoose").Types.ObjectId;
122
123
  user: {
123
- _id: string | import("mongoose").Types.ObjectId;
124
124
  name: string;
125
+ _id: string | import("mongoose").Types.ObjectId;
125
126
  };
126
- orderId: string;
127
- shopId: string | import("mongoose").Types.ObjectId;
128
127
  paymentMethod: PaymentMethod;
128
+ orderId: string;
129
129
  triggerAt: Date;
130
130
  adjustedFinance: {
131
131
  paymentMethod: PaymentMethod;
132
132
  pricing: {
133
- total: number;
134
133
  deliveryFee: number;
135
- secondaryDeliveryFee: number;
136
134
  riderTips: number;
135
+ total: number;
136
+ secondaryDeliveryFee: number;
137
137
  secondaryRiderTips: number;
138
138
  secondaryTotal: number;
139
139
  paidAmount: number;
@@ -160,11 +160,11 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
160
160
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
161
161
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
162
162
  }, "strip", z.ZodTypeAny, {
163
- _id: import("mongoose").Types.ObjectId;
164
163
  name: string;
164
+ _id: import("mongoose").Types.ObjectId;
165
165
  }, {
166
- _id: string | import("mongoose").Types.ObjectId;
167
166
  name: string;
167
+ _id: string | import("mongoose").Types.ObjectId;
168
168
  }>;
169
169
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
170
170
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -183,19 +183,19 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
183
183
  riderTips: z.ZodNumber;
184
184
  secondaryRiderTips: z.ZodNumber;
185
185
  }, "strip", z.ZodTypeAny, {
186
- total: number;
187
186
  deliveryFee: number;
188
- secondaryDeliveryFee: number;
189
187
  riderTips: number;
188
+ total: number;
189
+ secondaryDeliveryFee: number;
190
190
  secondaryRiderTips: number;
191
191
  secondaryTotal: number;
192
192
  paidAmount: number;
193
193
  secondaryPaidAmount: number;
194
194
  }, {
195
- total: number;
196
195
  deliveryFee: number;
197
- secondaryDeliveryFee: number;
198
196
  riderTips: number;
197
+ total: number;
198
+ secondaryDeliveryFee: number;
199
199
  secondaryRiderTips: number;
200
200
  secondaryTotal: number;
201
201
  paidAmount: number;
@@ -204,10 +204,10 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
204
204
  }, "strip", z.ZodTypeAny, {
205
205
  paymentMethod: PaymentMethod;
206
206
  pricing: {
207
- total: number;
208
207
  deliveryFee: number;
209
- secondaryDeliveryFee: number;
210
208
  riderTips: number;
209
+ total: number;
210
+ secondaryDeliveryFee: number;
211
211
  secondaryRiderTips: number;
212
212
  secondaryTotal: number;
213
213
  paidAmount: number;
@@ -217,10 +217,10 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
217
217
  }, {
218
218
  paymentMethod: PaymentMethod;
219
219
  pricing: {
220
- total: number;
221
220
  deliveryFee: number;
222
- secondaryDeliveryFee: number;
223
221
  riderTips: number;
222
+ total: number;
223
+ secondaryDeliveryFee: number;
224
224
  secondaryRiderTips: number;
225
225
  secondaryTotal: number;
226
226
  paidAmount: number;
@@ -232,23 +232,23 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
232
232
  triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
233
233
  orderActionType: z.ZodNativeEnum<typeof OrderAction>;
234
234
  }, "strip", z.ZodTypeAny, {
235
- _id: import("mongoose").Types.ObjectId;
236
235
  createdAt: Date;
236
+ _id: import("mongoose").Types.ObjectId;
237
+ shopId: import("mongoose").Types.ObjectId;
237
238
  user: {
238
- _id: import("mongoose").Types.ObjectId;
239
239
  name: string;
240
+ _id: import("mongoose").Types.ObjectId;
240
241
  };
241
- orderId: string;
242
- shopId: import("mongoose").Types.ObjectId;
243
242
  paymentMethod: PaymentMethod;
243
+ orderId: string;
244
244
  triggerAt: Date;
245
245
  adjustedFinance: {
246
246
  paymentMethod: PaymentMethod;
247
247
  pricing: {
248
- total: number;
249
248
  deliveryFee: number;
250
- secondaryDeliveryFee: number;
251
249
  riderTips: number;
250
+ total: number;
251
+ secondaryDeliveryFee: number;
252
252
  secondaryRiderTips: number;
253
253
  secondaryTotal: number;
254
254
  paidAmount: number;
@@ -261,23 +261,23 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
261
261
  orderAction: OrderAction;
262
262
  preparationTimeMinutes: number;
263
263
  }, {
264
- _id: string | import("mongoose").Types.ObjectId;
265
264
  createdAt: Date;
265
+ _id: string | import("mongoose").Types.ObjectId;
266
+ shopId: string | import("mongoose").Types.ObjectId;
266
267
  user: {
267
- _id: string | import("mongoose").Types.ObjectId;
268
268
  name: string;
269
+ _id: string | import("mongoose").Types.ObjectId;
269
270
  };
270
- orderId: string;
271
- shopId: string | import("mongoose").Types.ObjectId;
272
271
  paymentMethod: PaymentMethod;
272
+ orderId: string;
273
273
  triggerAt: Date;
274
274
  adjustedFinance: {
275
275
  paymentMethod: PaymentMethod;
276
276
  pricing: {
277
- total: number;
278
277
  deliveryFee: number;
279
- secondaryDeliveryFee: number;
280
278
  riderTips: number;
279
+ total: number;
280
+ secondaryDeliveryFee: number;
281
281
  secondaryRiderTips: number;
282
282
  secondaryTotal: number;
283
283
  paidAmount: number;
@@ -19,17 +19,17 @@ export declare const RiderLocationUpdateSocketOutputSchema: z.ZodObject<{
19
19
  bearing: z.ZodOptional<z.ZodNumber>;
20
20
  updatedAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- _id: import("mongoose").Types.ObjectId;
23
- updatedAt: Date;
24
22
  latitude: number;
25
23
  longitude: number;
24
+ updatedAt: Date;
25
+ _id: import("mongoose").Types.ObjectId;
26
26
  riderId: import("mongoose").Types.ObjectId;
27
27
  bearing?: number | undefined;
28
28
  }, {
29
- _id: string | import("mongoose").Types.ObjectId;
30
- updatedAt: string | Date;
31
29
  latitude: number;
32
30
  longitude: number;
31
+ updatedAt: string | Date;
32
+ _id: string | import("mongoose").Types.ObjectId;
33
33
  riderId: string | import("mongoose").Types.ObjectId;
34
34
  bearing?: number | undefined;
35
35
  }>;
@@ -55,17 +55,17 @@ export declare class RiderLocationUpdateSocketEvent extends BaseSocketEvent<type
55
55
  bearing: z.ZodOptional<z.ZodNumber>;
56
56
  updatedAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
57
57
  }, "strip", z.ZodTypeAny, {
58
- _id: import("mongoose").Types.ObjectId;
59
- updatedAt: Date;
60
58
  latitude: number;
61
59
  longitude: number;
60
+ updatedAt: Date;
61
+ _id: import("mongoose").Types.ObjectId;
62
62
  riderId: import("mongoose").Types.ObjectId;
63
63
  bearing?: number | undefined;
64
64
  }, {
65
- _id: string | import("mongoose").Types.ObjectId;
66
- updatedAt: string | Date;
67
65
  latitude: number;
68
66
  longitude: number;
67
+ updatedAt: string | Date;
68
+ _id: string | import("mongoose").Types.ObjectId;
69
69
  riderId: string | import("mongoose").Types.ObjectId;
70
70
  bearing?: number | undefined;
71
71
  }>;
@@ -12,19 +12,19 @@ export declare const TicketActionsSocketOutputSchema: z.ZodObject<{
12
12
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
13
13
  silent: z.ZodOptional<z.ZodBoolean>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- status: TicketStatus;
16
15
  type: TicketType;
16
+ status: TicketStatus;
17
17
  _id: import("mongoose").Types.ObjectId;
18
- silent?: boolean | undefined;
19
18
  title?: string | undefined;
20
19
  content?: string | undefined;
20
+ silent?: boolean | undefined;
21
21
  }, {
22
- status: TicketStatus;
23
22
  type: TicketType;
23
+ status: TicketStatus;
24
24
  _id: import("mongoose").Types.ObjectId;
25
- silent?: boolean | undefined;
26
25
  title?: string | undefined;
27
26
  content?: string | undefined;
27
+ silent?: boolean | undefined;
28
28
  }>;
29
29
  export declare const TicketActionsPushOutputSchema: z.ZodObject<{
30
30
  ticketId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
@@ -33,14 +33,14 @@ export declare const TicketActionsPushOutputSchema: z.ZodObject<{
33
33
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
34
34
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
35
35
  }, "strip", z.ZodTypeAny, {
36
- status: TicketStatus;
37
36
  type: TicketType;
37
+ status: TicketStatus;
38
38
  ticketId: import("mongoose").Types.ObjectId;
39
39
  title?: string | undefined;
40
40
  content?: string | undefined;
41
41
  }, {
42
- status: TicketStatus;
43
42
  type: TicketType;
43
+ status: TicketStatus;
44
44
  ticketId: import("mongoose").Types.ObjectId;
45
45
  title?: string | undefined;
46
46
  content?: string | undefined;
@@ -59,19 +59,19 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
59
59
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
60
60
  silent: z.ZodOptional<z.ZodBoolean>;
61
61
  }, "strip", z.ZodTypeAny, {
62
- status: TicketStatus;
63
62
  type: TicketType;
63
+ status: TicketStatus;
64
64
  _id: import("mongoose").Types.ObjectId;
65
- silent?: boolean | undefined;
66
65
  title?: string | undefined;
67
66
  content?: string | undefined;
67
+ silent?: boolean | undefined;
68
68
  }, {
69
- status: TicketStatus;
70
69
  type: TicketType;
70
+ status: TicketStatus;
71
71
  _id: import("mongoose").Types.ObjectId;
72
- silent?: boolean | undefined;
73
72
  title?: string | undefined;
74
73
  content?: string | undefined;
74
+ silent?: boolean | undefined;
75
75
  }>;
76
76
  pushNotificationOutput: z.ZodObject<{
77
77
  ticketId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
@@ -80,14 +80,14 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
80
80
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
81
81
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
82
82
  }, "strip", z.ZodTypeAny, {
83
- status: TicketStatus;
84
83
  type: TicketType;
84
+ status: TicketStatus;
85
85
  ticketId: import("mongoose").Types.ObjectId;
86
86
  title?: string | undefined;
87
87
  content?: string | undefined;
88
88
  }, {
89
- status: TicketStatus;
90
89
  type: TicketType;
90
+ status: TicketStatus;
91
91
  ticketId: import("mongoose").Types.ObjectId;
92
92
  title?: string | undefined;
93
93
  content?: string | undefined;
@@ -96,8 +96,8 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
96
96
  get notificationSettings(): NotificationSettings | undefined;
97
97
  constructor(payload: TicketActionsSocketOutputDTO);
98
98
  getPushNotificationPayload(): {
99
- status: TicketStatus;
100
99
  type: TicketType;
100
+ status: TicketStatus;
101
101
  ticketId: import("mongoose").Types.ObjectId;
102
102
  title?: string | undefined;
103
103
  content?: string | undefined;
@@ -14,13 +14,13 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
14
14
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
15
15
  }, "strip", z.ZodTypeAny, {
16
16
  type: UserRef;
17
- _id: import("mongoose").Types.ObjectId;
18
17
  name: string;
18
+ _id: import("mongoose").Types.ObjectId;
19
19
  profilePhoto: string | null;
20
20
  }, {
21
21
  type: UserRef;
22
- _id: string | import("mongoose").Types.ObjectId;
23
22
  name: string;
23
+ _id: string | import("mongoose").Types.ObjectId;
24
24
  profilePhoto: string | null;
25
25
  }>;
26
26
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
@@ -39,11 +39,11 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
39
39
  }>;
40
40
  unreadCount: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
- status: TicketStatus;
43
42
  type: TicketType;
44
- _id: import("mongoose").Types.ObjectId;
43
+ status: TicketStatus;
45
44
  createdAt: Date;
46
45
  updatedAt: Date;
46
+ _id: import("mongoose").Types.ObjectId;
47
47
  lastMessage: {
48
48
  createdAt: Date;
49
49
  content: string;
@@ -51,18 +51,18 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
51
51
  unreadCount: number;
52
52
  client: {
53
53
  type: UserRef;
54
- _id: import("mongoose").Types.ObjectId;
55
54
  name: string;
55
+ _id: import("mongoose").Types.ObjectId;
56
56
  profilePhoto: string | null;
57
57
  };
58
58
  chatroomId: import("mongoose").Types.ObjectId;
59
59
  orderId?: import("mongoose").Types.ObjectId | undefined;
60
60
  }, {
61
- status: TicketStatus;
62
61
  type: TicketType;
63
- _id: string | import("mongoose").Types.ObjectId;
62
+ status: TicketStatus;
64
63
  createdAt: string | Date;
65
64
  updatedAt: string | Date;
65
+ _id: string | import("mongoose").Types.ObjectId;
66
66
  lastMessage: {
67
67
  createdAt: string | Date;
68
68
  content: string;
@@ -70,8 +70,8 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
70
70
  unreadCount: number;
71
71
  client: {
72
72
  type: UserRef;
73
- _id: string | import("mongoose").Types.ObjectId;
74
73
  name: string;
74
+ _id: string | import("mongoose").Types.ObjectId;
75
75
  profilePhoto: string | null;
76
76
  };
77
77
  chatroomId: string | import("mongoose").Types.ObjectId;
@@ -92,13 +92,13 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
92
92
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
93
93
  }, "strip", z.ZodTypeAny, {
94
94
  type: UserRef;
95
- _id: import("mongoose").Types.ObjectId;
96
95
  name: string;
96
+ _id: import("mongoose").Types.ObjectId;
97
97
  profilePhoto: string | null;
98
98
  }, {
99
99
  type: UserRef;
100
- _id: string | import("mongoose").Types.ObjectId;
101
100
  name: string;
101
+ _id: string | import("mongoose").Types.ObjectId;
102
102
  profilePhoto: string | null;
103
103
  }>;
104
104
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
@@ -117,11 +117,11 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
117
117
  }>;
118
118
  unreadCount: z.ZodNumber;
119
119
  }, "strip", z.ZodTypeAny, {
120
- status: TicketStatus;
121
120
  type: TicketType;
122
- _id: import("mongoose").Types.ObjectId;
121
+ status: TicketStatus;
123
122
  createdAt: Date;
124
123
  updatedAt: Date;
124
+ _id: import("mongoose").Types.ObjectId;
125
125
  lastMessage: {
126
126
  createdAt: Date;
127
127
  content: string;
@@ -129,18 +129,18 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
129
129
  unreadCount: number;
130
130
  client: {
131
131
  type: UserRef;
132
- _id: import("mongoose").Types.ObjectId;
133
132
  name: string;
133
+ _id: import("mongoose").Types.ObjectId;
134
134
  profilePhoto: string | null;
135
135
  };
136
136
  chatroomId: import("mongoose").Types.ObjectId;
137
137
  orderId?: import("mongoose").Types.ObjectId | undefined;
138
138
  }, {
139
- status: TicketStatus;
140
139
  type: TicketType;
141
- _id: string | import("mongoose").Types.ObjectId;
140
+ status: TicketStatus;
142
141
  createdAt: string | Date;
143
142
  updatedAt: string | Date;
143
+ _id: string | import("mongoose").Types.ObjectId;
144
144
  lastMessage: {
145
145
  createdAt: string | Date;
146
146
  content: string;
@@ -148,8 +148,8 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
148
148
  unreadCount: number;
149
149
  client: {
150
150
  type: UserRef;
151
- _id: string | import("mongoose").Types.ObjectId;
152
151
  name: string;
152
+ _id: string | import("mongoose").Types.ObjectId;
153
153
  profilePhoto: string | null;
154
154
  };
155
155
  chatroomId: string | import("mongoose").Types.ObjectId;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.330
25
+ Version: 1.4.332-alpha.0
26
26
 
27
27
  ## Dependencies
28
28