| 6 | } |
| 7 | |
| 8 | export class ServiceResponse<T = null> { |
| 9 | success: boolean |
| 10 | message: string |
| 11 | responseObject: T |
| 12 | statusCode: number |
| 13 | |
| 14 | constructor(status: ResponseStatus, message: string, responseObject: T, statusCode: number) { |
| 15 | this.success = status === ResponseStatus.Success |
| 16 | this.message = message |
| 17 | this.responseObject = responseObject |
| 18 | this.statusCode = statusCode |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export const ServiceResponseSchema = <T extends z.ZodTypeAny>(dataSchema: T) => |
| 23 | z.object({ |
nothing calls this directly
no outgoing calls
no test coverage detected