operation-logger.interface.ts 566 B

12345678910111213141516171819
  1. import type { FastifyRequest } from 'fastify';
  2. import type { OperationLogOptions } from '../decorators/operation-log.decorator';
  3. import type { ApiResponse } from './api-response.interface';
  4. /**
  5. * Abstract interface for operation logging
  6. * Implementations should be provided at the app level
  7. */
  8. export interface IOperationLogger {
  9. createLog(
  10. req: FastifyRequest,
  11. options: OperationLogOptions,
  12. data: ApiResponse<unknown>,
  13. callMethod: string,
  14. status: boolean,
  15. ): Promise<void>;
  16. }
  17. export const OPERATION_LOGGER = Symbol('OPERATION_LOGGER');