Snai3i-MarketPlace / backend / src / services / meeting / meeting.logs.ts
meeting.logs.ts
Raw
import Logger from '../../utils/Logger';

export type IMeetingLogs =
  | 'CREATE_MEETING_SUCCESS'
  | 'CREATE_MEETING_ERROR'
  | 'UPDATE_MEETING_SUCCESS'
  | 'UPDATE_MEETING_ERROR'
  | 'DELETE_MEETING_SUCCESS'
  | 'DELETE_MEETING_ERROR'
  | 'MEETING_ERROR_GENERIC'
  | 'MEETING_ERROR_INVALID_INPUT'
  | 'MEETING_ERROR_NOT_FOUND'
  | 'GET_MEETING_SUCCESS'
  | 'GET_MEETINGS_SUCCESS'
  | 'GET_MEETINGS_ERROR'
  | 'GET_MEETING_ERROR'
  | 'GET_MEETINGS_BY_STATUS_SUCCESS'
  | 'GET_MEETINGS_BY_STATUS_ERROR'
  | 'GET_MEETINGS_BY_STATUS_ERROR'
  | 'UPDATE_MEETING_STATUS_SUCCESS'
  | 'UPDATE_MEETING_STATUS_ERROR';

export const meetingLogs: IErrors<IMeetingLogs> = {
  CREATE_MEETING_SUCCESS: {
    code: 0,
    message: 'Meeting "{meetingId}" has been created successfully.',
    type: 'CREATE_MEETING_SUCCESS',
  },
  CREATE_MEETING_ERROR: {
    code: 1,
    message: 'Error occurred while creating meeting: {error}',
    type: 'CREATE_MEETING_ERROR',
  },
  UPDATE_MEETING_SUCCESS: {
    code: 2,
    message: 'Meeting "{meetingId}" has been updated successfully.',
    type: 'UPDATE_MEETING_SUCCESS',
  },
  UPDATE_MEETING_ERROR: {
    code: 3,
    message: 'Error occurred while updating meeting: {error}',
    type: 'UPDATE_MEETING_ERROR',
  },
  DELETE_MEETING_SUCCESS: {
    code: 4,
    message: 'Meeting "{meetingId}" has been deleted successfully.',
    type: 'DELETE_MEETING_SUCCESS',
  },
  DELETE_MEETING_ERROR: {
    code: 5,
    message: 'Error occurred while deleting meeting: {error}',
    type: 'DELETE_MEETING_ERROR',
  },
  MEETING_ERROR_GENERIC: {
    code: 6,
    message: 'Generic error happened while loading meetings.',
    type: 'MEETING_ERROR_GENERIC',
  },
  MEETING_ERROR_INVALID_INPUT: {
    code: 7,
    message: 'Invalid input for Meeting : {input}',
    type: 'MEETING_ERROR_INVALID_INPUT',
  },
  MEETING_ERROR_NOT_FOUND: {
    code: 8,
    message: 'Meeting {meetingId} not found',
    type: 'MEETING_ERROR_NOT_FOUND',
  },
  GET_MEETING_SUCCESS: {
    code: 9,
    message: 'Meeting "{meetingId}" has been fetched successfully.',
    type: 'GET_MEETING_SUCCESS',
  },
  GET_MEETINGS_SUCCESS: {
    code: 10,
    message: 'Meetings has been fetched successfully.',
    type: 'GET_MEETINGS_SUCCESS',
  },
  GET_MEETINGS_ERROR: {
    code: 11,
    message: 'Error occurred while fetching meetings: {error}',
    type: 'GET_MEETINGS_ERROR',
  },
  GET_MEETING_ERROR: {
    code: 12,
    message: 'Error occurred while fetching meeting: {error}',
    type: 'GET_MEETING_ERROR',
  },
  GET_MEETINGS_BY_STATUS_SUCCESS: {
    code: 13,
    message: 'Meetings has been fetched successfully by status.',
    type: 'GET_MEETINGS_BY_STATUS_SUCCESS',
  },
  GET_MEETINGS_BY_STATUS_ERROR: {
    code: 14,
    message: 'Error occurred while fetching meetings by status: {error}',
    type: 'GET_MEETINGS_BY_STATUS_ERROR',
  },
  UPDATE_MEETING_STATUS_SUCCESS: {
    code: 15,
    message: 'Meeting "{meetingId}" status has been updated successfully.',
    type: 'UPDATE_MEETING_STATUS_SUCCESS',
  },
  UPDATE_MEETING_STATUS_ERROR: {
    code: 16,
    message: 'Error occurred while updating meeting status: {error}',
    type: 'UPDATE_MEETING_STATUS_ERROR',
  },
} as const;

export default meetingLogs;
export const meetingLogger = new Logger('meeting');