@lyxa.ai/core 1.4.316 → 1.4.318

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 (32) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/index.js.map +1 -1
  3. package/dist/libraries/google-location/google-location.client.d.ts +7 -0
  4. package/dist/libraries/google-location/google-location.client.js +44 -0
  5. package/dist/libraries/google-location/google-location.client.js.map +1 -0
  6. package/dist/libraries/google-location/google-location.dto.d.ts +103 -0
  7. package/dist/libraries/google-location/google-location.dto.js +3 -0
  8. package/dist/libraries/google-location/google-location.dto.js.map +1 -0
  9. package/dist/libraries/google-location/google-location.service.d.ts +15 -0
  10. package/dist/libraries/google-location/google-location.service.js +181 -0
  11. package/dist/libraries/google-location/google-location.service.js.map +1 -0
  12. package/dist/libraries/google-location/index.d.ts +1 -0
  13. package/dist/libraries/google-location/index.js +18 -0
  14. package/dist/libraries/google-location/index.js.map +1 -0
  15. package/dist/libraries/index.d.ts +2 -0
  16. package/dist/libraries/index.js +4 -0
  17. package/dist/libraries/index.js.map +1 -1
  18. package/dist/libraries/map/providers/osrm.d.ts +1 -1
  19. package/dist/libraries/map/providers/osrm.js +3 -2
  20. package/dist/libraries/map/providers/osrm.js.map +1 -1
  21. package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +33 -33
  22. package/dist/libraries/socket/events/order-actions.socket.event.d.ts +20 -20
  23. package/dist/libraries/socket/events/rider-location-update.socket.event.d.ts +8 -8
  24. package/dist/libraries/socket/events/ticket-actions.socket.event.d.ts +8 -8
  25. package/dist/libraries/socket/events/ticket-assign.socket.event.d.ts +40 -40
  26. package/dist/libraries/trpc/middlewares/auth.d.ts +2 -2
  27. package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +2 -2
  28. package/dist/libraries/trpc/middlewares/phone-verified.d.ts +2 -2
  29. package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +2 -2
  30. package/dist/types/README.md +1 -1
  31. package/dist/types/package.json +1 -1
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"osrm.js","sourceRoot":"/","sources":["libraries/map/providers/osrm.ts"],"names":[],"mappings":";;;;;;AAOA,+CAAyE;AAEzE,kDAA0B;AAI1B,MAAa,cAAc;IAClB,SAAS,CAA2C;IACpD,kBAAkB,CAA4B;IACrC,kBAAkB,GAAG,CAAC,CAAC;IACvB,IAAI,GAAG,6CAA6C,CAAC;IAEtE;QACC,IAAI,CAAC,SAAS,GAAG,kBAAqD,CAAC;QACvE,IAAI,CAAC,kBAAkB,GAAG,2BAA+C,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAmB,EAAE,WAAwB;QAClE,MAAM,OAAO,GAAG,SAAS,CAAC;QAC1B,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC3D,MAAM,cAAc,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC1E,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,aAAa,OAAO,IAAI,SAAS,IAAI,cAAc,iBAAiB,CAAC;QAE7F,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAEhF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAA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C,MAAM;YAAE,OAAO,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,GAAG,CACjB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAClB,IAAI,CAAC,SAAS;aACZ,OAAO,CAAC;YACR,QAAQ,EAAE;gBACT,cAAc,EAAE;oBACf,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;iBAC5E;aACD;SACD,CAAC;aACD,IAAI,EAAE,CACR,CACD,CAAC;IACH,CAAC;CACD;AAzJD,wCAyJC","sourcesContent":["import {\n\tICoordinate,\n\tIDistanceInfo,\n\tIMapService,\n\tIRouteMatrixDTO,\n\tIWaypointDistanceInfo,\n} from '../interfaces/IMapService';\nimport { Zone, ZoneExtraTimeModel, ZoneModel } from '../../mongo/models';\nimport { SoftDeleteModel } from '../../mongo/plugins/soft-delete-plugin';\nimport dayjs from 'dayjs';\nimport { WeekDay } from '../../../utilities/enum';\nimport { DocumentType } from '@typegoose/typegoose';\n\nexport class OsrmMapService implements IMapService {\n\tprivate zoneModel: typeof ZoneModel & SoftDeleteModel<Zone>;\n\tprivate zoneExtraTimeModel: typeof ZoneExtraTimeModel;\n\tprivate readonly DEFAULT_EXTRA_TIME = 0;\n\tprivate readonly _url = 'https://api-v2-development.lyxa.ai/distance';\n\n\tconstructor() {\n\t\tthis.zoneModel = ZoneModel as typeof ZoneModel & SoftDeleteModel<Zone>;\n\t\tthis.zoneExtraTimeModel = ZoneExtraTimeModel as typeof ZoneExtraTimeModel;\n\t}\n\n\tasync getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst originStr = `${origin.longitude},${origin.latitude}`;\n\t\tconst destinationStr = `${destination.longitude},${destination.latitude}`;\n\t\tconst url = `${this._url}/route/v1/${profile}/${originStr};${destinationStr}?overview=false`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t};\n\t}\n\n\tasync getDistanceMatrix(origins: ICoordinate[], destinations: ICoordinate[]): Promise<IRouteMatrixDTO[]> {\n\t\tconst allCoords = [...origins, ...destinations];\n\t\tconst coordString = allCoords.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst originIndices = origins.map((_, idx) => idx).join(';');\n\t\tconst destIndices = destinations.map((_, idx) => origins.length + idx).join(';');\n\n\t\tconst url = `${this._url}/table/v1/bike/${coordString}?sources=${originIndices}&destinations=${destIndices}&annotations=distance,duration`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM table request failed with status ${resp.status}`);\n\n\t\tconst data = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.durations) throw new Error('OSRM table request failed');\n\n\t\tconst durations: number[][] = data.durations;\n\t\tconst distances: number[][] = data.distances;\n\n\t\tconst zones = await this.findZonesByPoints(origins);\n\t\tconst extraTimes = await this.getExtraTimeForZones(zones);\n\n\t\tconst result: IRouteMatrixDTO[] = [];\n\n\t\torigins.forEach((_, i) => {\n\t\t\tdestinations.forEach((_, j) => {\n\t\t\t\tconst dur = durations[i][j] + (extraTimes[j] || this.DEFAULT_EXTRA_TIME);\n\t\t\t\tconst dist = distances.length ? distances[i][j] : 0;\n\n\t\t\t\tresult.push({\n\t\t\t\t\tdistance: { value: dist, text: distances.length ? `${(dist / 1000).toFixed(2)} km` : 'N/A' },\n\t\t\t\t\tduration: { value: dur, text: `${Math.ceil(dur / 60)} mins` },\n\t\t\t\t\tcondition: 'OK',\n\t\t\t\t\toriginIndex: i,\n\t\t\t\t\tdestinationIndex: j,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tasync getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: ICoordinate[]\n\t): Promise<IWaypointDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst coordsArr = [origin, ...waypoints, destination];\n\t\tconst coordsStr = coordsArr.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst url = `${this._url}/route/v1/${profile}/${coordsStr}?overview=full&steps=true&geometries=geojson`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\tconst overviewPolyline = route.geometry?.coordinates || [];\n\t\tconst legs = (route.legs ?? []).map((leg: any) => ({\n\t\t\tdistance: { value: leg.distance, text: `${(leg.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: leg.duration, text: `${Math.ceil(leg.duration / 60)} mins` },\n\t\t\toverviewPolyline: leg.steps?.flatMap((step: any) => step.geometry?.coordinates || []) || [],\n\t\t}));\n\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t\toverviewPolyline,\n\t\t\tlegs,\n\t\t};\n\t}\n\n\tprivate async getExtraTimeForZones(zones: Array<DocumentType<Zone> | null>): Promise<number[]> {\n\t\tconst now = new Date();\n\t\tconst today = dayjs(now).day() as WeekDay;\n\t\tconst currentTime = dayjs(now).format('HH:mm');\n\n\t\tconst validZones = zones.filter((z): z is DocumentType<Zone> => z !== null);\n\t\tconst zoneIds = validZones.map(zone => zone._id);\n\n\t\tif (zoneIds.length === 0) return zones.map(_ => this.DEFAULT_EXTRA_TIME);\n\n\t\tconst applicableSlots = await this.zoneExtraTimeModel\n\t\t\t.find({\n\t\t\t\tzone: { $in: zoneIds },\n\t\t\t\tday: today,\n\t\t\t\tisActive: true,\n\t\t\t\tstart: { $lte: currentTime },\n\t\t\t\tend: { $gte: currentTime },\n\t\t\t})\n\t\t\t.lean()\n\t\t\t.exec();\n\n\t\tconst extraTimeMap = new Map<string, number>();\n\t\tfor (const slot of applicableSlots) {\n\t\t\textraTimeMap.set(slot.zone.toString(), slot.extraTimeInSeconds);\n\t\t}\n\n\t\treturn zones.map(zone => {\n\t\t\tif (!zone) return this.DEFAULT_EXTRA_TIME;\n\t\t\treturn extraTimeMap.get(zone._id.toString()) ?? this.DEFAULT_EXTRA_TIME;\n\t\t});\n\t}\n\tprivate async findZonesByPoints(points: ICoordinate[]): Promise<(DocumentType<Zone> | null)[]> {\n\t\tif (!points.length) return [];\n\t\treturn Promise.all(\n\t\t\tpoints.map(point =>\n\t\t\t\tthis.zoneModel\n\t\t\t\t\t.findOne({\n\t\t\t\t\t\tgeometry: {\n\t\t\t\t\t\t\t$geoIntersects: {\n\t\t\t\t\t\t\t\t$geometry: { type: 'Point', coordinates: [point.longitude, point.latitude] },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\t.exec()\n\t\t\t)\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"osrm.js","sourceRoot":"/","sources":["libraries/map/providers/osrm.ts"],"names":[],"mappings":";;;;;;AAOA,+CAAyE;AAEzE,kDAA0B;AAI1B,MAAa,cAAc;IAClB,SAAS,CAA2C;IACpD,kBAAkB,CAA4B;IACrC,kBAAkB,GAAG,CAAC,CAAC;IACvB,IAAI,CAAS;IAE9B,YAAY,GAAW;QACtB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,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E;iBAC5E;aACD;SACD,CAAC;aACD,IAAI,EAAE,CACR,CACD,CAAC;IACH,CAAC;CACD;AA1JD,wCA0JC","sourcesContent":["import {\n\tICoordinate,\n\tIDistanceInfo,\n\tIMapService,\n\tIRouteMatrixDTO,\n\tIWaypointDistanceInfo,\n} from '../interfaces/IMapService';\nimport { Zone, ZoneExtraTimeModel, ZoneModel } from '../../mongo/models';\nimport { SoftDeleteModel } from '../../mongo/plugins/soft-delete-plugin';\nimport dayjs from 'dayjs';\nimport { WeekDay } from '../../../utilities/enum';\nimport { DocumentType } from '@typegoose/typegoose';\n\nexport class OsrmMapService implements IMapService {\n\tprivate zoneModel: typeof ZoneModel & SoftDeleteModel<Zone>;\n\tprivate zoneExtraTimeModel: typeof ZoneExtraTimeModel;\n\tprivate readonly DEFAULT_EXTRA_TIME = 0;\n\tprivate readonly _url: string;\n\n\tconstructor(url: string) {\n\t\tthis._url = url;\n\t\tthis.zoneModel = ZoneModel as typeof ZoneModel & SoftDeleteModel<Zone>;\n\t\tthis.zoneExtraTimeModel = ZoneExtraTimeModel as typeof ZoneExtraTimeModel;\n\t}\n\n\tasync getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst originStr = `${origin.longitude},${origin.latitude}`;\n\t\tconst destinationStr = `${destination.longitude},${destination.latitude}`;\n\t\tconst url = `${this._url}/route/v1/${profile}/${originStr};${destinationStr}?overview=false`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t};\n\t}\n\n\tasync getDistanceMatrix(origins: ICoordinate[], destinations: ICoordinate[]): Promise<IRouteMatrixDTO[]> {\n\t\tconst allCoords = [...origins, ...destinations];\n\t\tconst coordString = allCoords.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst originIndices = origins.map((_, idx) => idx).join(';');\n\t\tconst destIndices = destinations.map((_, idx) => origins.length + idx).join(';');\n\n\t\tconst url = `${this._url}/table/v1/bike/${coordString}?sources=${originIndices}&destinations=${destIndices}&annotations=distance,duration`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM table request failed with status ${resp.status}`);\n\n\t\tconst data = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.durations) throw new Error('OSRM table request failed');\n\n\t\tconst durations: number[][] = data.durations;\n\t\tconst distances: number[][] = data.distances;\n\n\t\tconst zones = await this.findZonesByPoints(origins);\n\t\tconst extraTimes = await this.getExtraTimeForZones(zones);\n\n\t\tconst result: IRouteMatrixDTO[] = [];\n\n\t\torigins.forEach((_, i) => {\n\t\t\tdestinations.forEach((_, j) => {\n\t\t\t\tconst dur = durations[i][j] + (extraTimes[j] || this.DEFAULT_EXTRA_TIME);\n\t\t\t\tconst dist = distances.length ? distances[i][j] : 0;\n\n\t\t\t\tresult.push({\n\t\t\t\t\tdistance: { value: dist, text: distances.length ? `${(dist / 1000).toFixed(2)} km` : 'N/A' },\n\t\t\t\t\tduration: { value: dur, text: `${Math.ceil(dur / 60)} mins` },\n\t\t\t\t\tcondition: 'OK',\n\t\t\t\t\toriginIndex: i,\n\t\t\t\t\tdestinationIndex: j,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tasync getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: ICoordinate[]\n\t): Promise<IWaypointDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst coordsArr = [origin, ...waypoints, destination];\n\t\tconst coordsStr = coordsArr.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst url = `${this._url}/route/v1/${profile}/${coordsStr}?overview=full&steps=true&geometries=geojson`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\tconst overviewPolyline = route.geometry?.coordinates || [];\n\t\tconst legs = (route.legs ?? []).map((leg: any) => ({\n\t\t\tdistance: { value: leg.distance, text: `${(leg.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: leg.duration, text: `${Math.ceil(leg.duration / 60)} mins` },\n\t\t\toverviewPolyline: leg.steps?.flatMap((step: any) => step.geometry?.coordinates || []) || [],\n\t\t}));\n\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t\toverviewPolyline,\n\t\t\tlegs,\n\t\t};\n\t}\n\n\tprivate async getExtraTimeForZones(zones: Array<DocumentType<Zone> | null>): Promise<number[]> {\n\t\tconst now = new Date();\n\t\tconst today = dayjs(now).day() as WeekDay;\n\t\tconst currentTime = dayjs(now).format('HH:mm');\n\n\t\tconst validZones = zones.filter((z): z is DocumentType<Zone> => z !== null);\n\t\tconst zoneIds = validZones.map(zone => zone._id);\n\n\t\tif (zoneIds.length === 0) return zones.map(_ => this.DEFAULT_EXTRA_TIME);\n\n\t\tconst applicableSlots = await this.zoneExtraTimeModel\n\t\t\t.find({\n\t\t\t\tzone: { $in: zoneIds },\n\t\t\t\tday: today,\n\t\t\t\tisActive: true,\n\t\t\t\tstart: { $lte: currentTime },\n\t\t\t\tend: { $gte: currentTime },\n\t\t\t})\n\t\t\t.lean()\n\t\t\t.exec();\n\n\t\tconst extraTimeMap = new Map<string, number>();\n\t\tfor (const slot of applicableSlots) {\n\t\t\textraTimeMap.set(slot.zone.toString(), slot.extraTimeInSeconds);\n\t\t}\n\n\t\treturn zones.map(zone => {\n\t\t\tif (!zone) return this.DEFAULT_EXTRA_TIME;\n\t\t\treturn extraTimeMap.get(zone._id.toString()) ?? this.DEFAULT_EXTRA_TIME;\n\t\t});\n\t}\n\tprivate async findZonesByPoints(points: ICoordinate[]): Promise<(DocumentType<Zone> | null)[]> {\n\t\tif (!points.length) return [];\n\t\treturn Promise.all(\n\t\t\tpoints.map(point =>\n\t\t\t\tthis.zoneModel\n\t\t\t\t\t.findOne({\n\t\t\t\t\t\tgeometry: {\n\t\t\t\t\t\t\t$geoIntersects: {\n\t\t\t\t\t\t\t\t$geometry: { type: 'Point', coordinates: [point.longitude, point.latitude] },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\t.exec()\n\t\t\t)\n\t\t);\n\t}\n}\n"]}
@@ -20,13 +20,13 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
20
20
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
21
21
  type: z.ZodNativeEnum<typeof UserRef>;
22
22
  }, "strip", z.ZodTypeAny, {
23
+ type: UserRef;
23
24
  name: string;
24
25
  id: import("mongoose").Types.ObjectId;
25
- type: UserRef;
26
26
  }, {
27
+ type: UserRef;
27
28
  name: string;
28
29
  id: import("mongoose").Types.ObjectId;
29
- type: UserRef;
30
30
  }>;
31
31
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
32
32
  media: z.ZodArray<z.ZodObject<{
@@ -36,14 +36,14 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
36
36
  thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
37
37
  name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- mediaType: MediaType;
40
39
  mediaUrl: string;
40
+ mediaType: MediaType;
41
41
  mimeType: string;
42
42
  name?: string | undefined;
43
43
  thumbnailUrl?: string | undefined;
44
44
  }, {
45
- mediaType: MediaType;
46
45
  mediaUrl: string;
46
+ mediaType: MediaType;
47
47
  mimeType: string;
48
48
  name?: string | undefined;
49
49
  thumbnailUrl?: string | undefined;
@@ -63,17 +63,17 @@ 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
- createdAt: Date;
67
66
  _id: import("mongoose").Types.ObjectId;
68
- senderType: UserRef;
67
+ createdAt: Date;
69
68
  sender: {
69
+ type: UserRef;
70
70
  name: string;
71
71
  id: import("mongoose").Types.ObjectId;
72
- type: UserRef;
73
72
  };
73
+ senderType: UserRef;
74
74
  media: {
75
- mediaType: MediaType;
76
75
  mediaUrl: string;
76
+ mediaType: MediaType;
77
77
  mimeType: string;
78
78
  name?: string | undefined;
79
79
  thumbnailUrl?: string | undefined;
@@ -85,21 +85,21 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
85
85
  longitude?: number | undefined;
86
86
  } | undefined;
87
87
  orderId?: import("mongoose").Types.ObjectId | undefined;
88
- content?: string | undefined;
89
88
  ticketId?: import("mongoose").Types.ObjectId | undefined;
89
+ content?: string | undefined;
90
90
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
91
91
  }, {
92
- createdAt: Date;
93
92
  _id: import("mongoose").Types.ObjectId;
94
- senderType: UserRef;
93
+ createdAt: Date;
95
94
  sender: {
95
+ type: UserRef;
96
96
  name: string;
97
97
  id: import("mongoose").Types.ObjectId;
98
- type: UserRef;
99
98
  };
99
+ senderType: UserRef;
100
100
  media: {
101
- mediaType: MediaType;
102
101
  mediaUrl: string;
102
+ mediaType: MediaType;
103
103
  mimeType: string;
104
104
  name?: string | undefined;
105
105
  thumbnailUrl?: string | undefined;
@@ -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
- content?: string | undefined;
115
114
  ticketId?: import("mongoose").Types.ObjectId | undefined;
115
+ content?: string | 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
- lastMessage?: string | undefined;
128
127
  ticketId?: import("mongoose").Types.ObjectId | undefined;
128
+ lastMessage?: string | undefined;
129
129
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
130
130
  }, {
131
131
  type: ChatroomType;
132
132
  orderId?: import("mongoose").Types.ObjectId | undefined;
133
- lastMessage?: string | undefined;
134
133
  ticketId?: import("mongoose").Types.ObjectId | undefined;
134
+ lastMessage?: string | undefined;
135
135
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
136
136
  }>;
137
137
  export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatroomMessageSendPushOutputSchema>;
@@ -156,13 +156,13 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
156
156
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
157
157
  type: z.ZodNativeEnum<typeof UserRef>;
158
158
  }, "strip", z.ZodTypeAny, {
159
+ type: UserRef;
159
160
  name: string;
160
161
  id: import("mongoose").Types.ObjectId;
161
- type: UserRef;
162
162
  }, {
163
+ type: UserRef;
163
164
  name: string;
164
165
  id: import("mongoose").Types.ObjectId;
165
- type: UserRef;
166
166
  }>;
167
167
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
168
168
  media: z.ZodArray<z.ZodObject<{
@@ -172,14 +172,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
172
172
  thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
173
173
  name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
174
174
  }, "strip", z.ZodTypeAny, {
175
- mediaType: MediaType;
176
175
  mediaUrl: string;
176
+ mediaType: MediaType;
177
177
  mimeType: string;
178
178
  name?: string | undefined;
179
179
  thumbnailUrl?: string | undefined;
180
180
  }, {
181
- mediaType: MediaType;
182
181
  mediaUrl: string;
182
+ mediaType: MediaType;
183
183
  mimeType: string;
184
184
  name?: string | undefined;
185
185
  thumbnailUrl?: string | undefined;
@@ -199,17 +199,17 @@ 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
- createdAt: Date;
203
202
  _id: import("mongoose").Types.ObjectId;
204
- senderType: UserRef;
203
+ createdAt: Date;
205
204
  sender: {
205
+ type: UserRef;
206
206
  name: string;
207
207
  id: import("mongoose").Types.ObjectId;
208
- type: UserRef;
209
208
  };
209
+ senderType: UserRef;
210
210
  media: {
211
- mediaType: MediaType;
212
211
  mediaUrl: string;
212
+ mediaType: MediaType;
213
213
  mimeType: string;
214
214
  name?: string | undefined;
215
215
  thumbnailUrl?: string | undefined;
@@ -221,21 +221,21 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
221
221
  longitude?: number | undefined;
222
222
  } | undefined;
223
223
  orderId?: import("mongoose").Types.ObjectId | undefined;
224
- content?: string | undefined;
225
224
  ticketId?: import("mongoose").Types.ObjectId | undefined;
225
+ content?: string | undefined;
226
226
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
227
227
  }, {
228
- createdAt: Date;
229
228
  _id: import("mongoose").Types.ObjectId;
230
- senderType: UserRef;
229
+ createdAt: Date;
231
230
  sender: {
231
+ type: UserRef;
232
232
  name: string;
233
233
  id: import("mongoose").Types.ObjectId;
234
- type: UserRef;
235
234
  };
235
+ senderType: UserRef;
236
236
  media: {
237
- mediaType: MediaType;
238
237
  mediaUrl: string;
238
+ mediaType: MediaType;
239
239
  mimeType: string;
240
240
  name?: string | undefined;
241
241
  thumbnailUrl?: string | undefined;
@@ -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
- content?: string | undefined;
251
250
  ticketId?: import("mongoose").Types.ObjectId | undefined;
251
+ content?: string | 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
- lastMessage?: string | undefined;
264
263
  ticketId?: import("mongoose").Types.ObjectId | undefined;
264
+ lastMessage?: string | undefined;
265
265
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
266
266
  }, {
267
267
  type: ChatroomType;
268
268
  orderId?: import("mongoose").Types.ObjectId | undefined;
269
- lastMessage?: string | undefined;
270
269
  ticketId?: import("mongoose").Types.ObjectId | undefined;
270
+ lastMessage?: string | 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
- lastMessage?: string | undefined;
282
281
  ticketId?: import("mongoose").Types.ObjectId | undefined;
282
+ lastMessage?: string | undefined;
283
283
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
284
284
  } | undefined;
285
285
  protected getIdentifier(): string;
@@ -39,8 +39,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
39
39
  riderTips: z.ZodNumber;
40
40
  secondaryRiderTips: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
- deliveryFee: number;
43
42
  total: number;
43
+ deliveryFee: number;
44
44
  secondaryDeliveryFee: number;
45
45
  riderTips: number;
46
46
  secondaryRiderTips: number;
@@ -48,8 +48,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
48
48
  paidAmount: number;
49
49
  secondaryPaidAmount: number;
50
50
  }, {
51
- deliveryFee: number;
52
51
  total: number;
52
+ deliveryFee: number;
53
53
  secondaryDeliveryFee: number;
54
54
  riderTips: number;
55
55
  secondaryRiderTips: number;
@@ -60,8 +60,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  paymentMethod: PaymentMethod;
62
62
  pricing: {
63
- deliveryFee: number;
64
63
  total: number;
64
+ deliveryFee: number;
65
65
  secondaryDeliveryFee: number;
66
66
  riderTips: number;
67
67
  secondaryRiderTips: number;
@@ -73,8 +73,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
73
73
  }, {
74
74
  paymentMethod: PaymentMethod;
75
75
  pricing: {
76
- deliveryFee: number;
77
76
  total: number;
77
+ deliveryFee: number;
78
78
  secondaryDeliveryFee: number;
79
79
  riderTips: number;
80
80
  secondaryRiderTips: number;
@@ -88,20 +88,21 @@ 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
- createdAt: Date;
92
91
  _id: import("mongoose").Types.ObjectId;
92
+ createdAt: Date;
93
93
  user: {
94
94
  _id: import("mongoose").Types.ObjectId;
95
95
  name: string;
96
96
  };
97
97
  orderId: string;
98
98
  shopId: import("mongoose").Types.ObjectId;
99
+ paymentMethod: PaymentMethod;
99
100
  triggerAt: Date;
100
101
  adjustedFinance: {
101
102
  paymentMethod: PaymentMethod;
102
103
  pricing: {
103
- deliveryFee: number;
104
104
  total: number;
105
+ deliveryFee: number;
105
106
  secondaryDeliveryFee: number;
106
107
  riderTips: number;
107
108
  secondaryRiderTips: number;
@@ -111,26 +112,26 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
111
112
  };
112
113
  shopProfit: number;
113
114
  };
114
- paymentMethod: PaymentMethod;
115
115
  orderActionType: OrderAction;
116
116
  orderStatus: RegularOrderStatus;
117
117
  orderAction: OrderAction;
118
118
  preparationTimeMinutes: number;
119
119
  }, {
120
- createdAt: Date;
121
120
  _id: string | import("mongoose").Types.ObjectId;
121
+ createdAt: Date;
122
122
  user: {
123
123
  _id: string | import("mongoose").Types.ObjectId;
124
124
  name: string;
125
125
  };
126
126
  orderId: string;
127
127
  shopId: string | import("mongoose").Types.ObjectId;
128
+ paymentMethod: PaymentMethod;
128
129
  triggerAt: Date;
129
130
  adjustedFinance: {
130
131
  paymentMethod: PaymentMethod;
131
132
  pricing: {
132
- deliveryFee: number;
133
133
  total: number;
134
+ deliveryFee: number;
134
135
  secondaryDeliveryFee: number;
135
136
  riderTips: number;
136
137
  secondaryRiderTips: number;
@@ -140,7 +141,6 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
140
141
  };
141
142
  shopProfit: number;
142
143
  };
143
- paymentMethod: PaymentMethod;
144
144
  orderActionType: OrderAction;
145
145
  orderStatus: RegularOrderStatus;
146
146
  orderAction: OrderAction;
@@ -183,8 +183,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
183
183
  riderTips: z.ZodNumber;
184
184
  secondaryRiderTips: z.ZodNumber;
185
185
  }, "strip", z.ZodTypeAny, {
186
- deliveryFee: number;
187
186
  total: number;
187
+ deliveryFee: number;
188
188
  secondaryDeliveryFee: number;
189
189
  riderTips: number;
190
190
  secondaryRiderTips: number;
@@ -192,8 +192,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
192
192
  paidAmount: number;
193
193
  secondaryPaidAmount: number;
194
194
  }, {
195
- deliveryFee: number;
196
195
  total: number;
196
+ deliveryFee: number;
197
197
  secondaryDeliveryFee: number;
198
198
  riderTips: number;
199
199
  secondaryRiderTips: number;
@@ -204,8 +204,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
204
204
  }, "strip", z.ZodTypeAny, {
205
205
  paymentMethod: PaymentMethod;
206
206
  pricing: {
207
- deliveryFee: number;
208
207
  total: number;
208
+ deliveryFee: number;
209
209
  secondaryDeliveryFee: number;
210
210
  riderTips: number;
211
211
  secondaryRiderTips: number;
@@ -217,8 +217,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
217
217
  }, {
218
218
  paymentMethod: PaymentMethod;
219
219
  pricing: {
220
- deliveryFee: number;
221
220
  total: number;
221
+ deliveryFee: number;
222
222
  secondaryDeliveryFee: number;
223
223
  riderTips: number;
224
224
  secondaryRiderTips: number;
@@ -232,20 +232,21 @@ 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
- createdAt: Date;
236
235
  _id: import("mongoose").Types.ObjectId;
236
+ createdAt: Date;
237
237
  user: {
238
238
  _id: import("mongoose").Types.ObjectId;
239
239
  name: string;
240
240
  };
241
241
  orderId: string;
242
242
  shopId: import("mongoose").Types.ObjectId;
243
+ paymentMethod: PaymentMethod;
243
244
  triggerAt: Date;
244
245
  adjustedFinance: {
245
246
  paymentMethod: PaymentMethod;
246
247
  pricing: {
247
- deliveryFee: number;
248
248
  total: number;
249
+ deliveryFee: number;
249
250
  secondaryDeliveryFee: number;
250
251
  riderTips: number;
251
252
  secondaryRiderTips: number;
@@ -255,26 +256,26 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
255
256
  };
256
257
  shopProfit: number;
257
258
  };
258
- paymentMethod: PaymentMethod;
259
259
  orderActionType: OrderAction;
260
260
  orderStatus: RegularOrderStatus;
261
261
  orderAction: OrderAction;
262
262
  preparationTimeMinutes: number;
263
263
  }, {
264
- createdAt: Date;
265
264
  _id: string | import("mongoose").Types.ObjectId;
265
+ createdAt: Date;
266
266
  user: {
267
267
  _id: string | import("mongoose").Types.ObjectId;
268
268
  name: string;
269
269
  };
270
270
  orderId: string;
271
271
  shopId: string | import("mongoose").Types.ObjectId;
272
+ paymentMethod: PaymentMethod;
272
273
  triggerAt: Date;
273
274
  adjustedFinance: {
274
275
  paymentMethod: PaymentMethod;
275
276
  pricing: {
276
- deliveryFee: number;
277
277
  total: number;
278
+ deliveryFee: number;
278
279
  secondaryDeliveryFee: number;
279
280
  riderTips: number;
280
281
  secondaryRiderTips: number;
@@ -284,7 +285,6 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
284
285
  };
285
286
  shopProfit: number;
286
287
  };
287
- paymentMethod: PaymentMethod;
288
288
  orderActionType: OrderAction;
289
289
  orderStatus: RegularOrderStatus;
290
290
  orderAction: OrderAction;
@@ -19,18 +19,18 @@ 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
- updatedAt: Date;
23
22
  _id: import("mongoose").Types.ObjectId;
24
- riderId: import("mongoose").Types.ObjectId;
23
+ updatedAt: Date;
25
24
  latitude: number;
26
25
  longitude: number;
26
+ riderId: import("mongoose").Types.ObjectId;
27
27
  bearing?: number | undefined;
28
28
  }, {
29
- updatedAt: string | Date;
30
29
  _id: string | import("mongoose").Types.ObjectId;
31
- riderId: string | import("mongoose").Types.ObjectId;
30
+ updatedAt: string | Date;
32
31
  latitude: number;
33
32
  longitude: number;
33
+ riderId: string | import("mongoose").Types.ObjectId;
34
34
  bearing?: number | undefined;
35
35
  }>;
36
36
  export type RiderLocationUpdateSocketInputDTO = DTO<typeof RiderLocationUpdateSocketInputSchema>;
@@ -55,18 +55,18 @@ 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
- updatedAt: Date;
59
58
  _id: import("mongoose").Types.ObjectId;
60
- riderId: import("mongoose").Types.ObjectId;
59
+ updatedAt: Date;
61
60
  latitude: number;
62
61
  longitude: number;
62
+ riderId: import("mongoose").Types.ObjectId;
63
63
  bearing?: number | undefined;
64
64
  }, {
65
- updatedAt: string | Date;
66
65
  _id: string | import("mongoose").Types.ObjectId;
67
- riderId: string | import("mongoose").Types.ObjectId;
66
+ updatedAt: string | Date;
68
67
  latitude: number;
69
68
  longitude: number;
69
+ riderId: string | import("mongoose").Types.ObjectId;
70
70
  bearing?: number | undefined;
71
71
  }>;
72
72
  };
@@ -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
- _id: import("mongoose").Types.ObjectId;
16
15
  status: TicketStatus;
17
16
  type: TicketType;
17
+ _id: import("mongoose").Types.ObjectId;
18
+ silent?: boolean | undefined;
18
19
  title?: string | undefined;
19
20
  content?: string | undefined;
20
- silent?: boolean | undefined;
21
21
  }, {
22
- _id: import("mongoose").Types.ObjectId;
23
22
  status: TicketStatus;
24
23
  type: TicketType;
24
+ _id: import("mongoose").Types.ObjectId;
25
+ silent?: boolean | undefined;
25
26
  title?: string | undefined;
26
27
  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>;
@@ -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
- _id: import("mongoose").Types.ObjectId;
63
62
  status: TicketStatus;
64
63
  type: TicketType;
64
+ _id: import("mongoose").Types.ObjectId;
65
+ silent?: boolean | undefined;
65
66
  title?: string | undefined;
66
67
  content?: string | undefined;
67
- silent?: boolean | undefined;
68
68
  }, {
69
- _id: import("mongoose").Types.ObjectId;
70
69
  status: TicketStatus;
71
70
  type: TicketType;
71
+ _id: import("mongoose").Types.ObjectId;
72
+ silent?: boolean | undefined;
72
73
  title?: string | undefined;
73
74
  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>;