import Logger from '../../utils/Logger';
export type ICourseLogs =
// courses
| 'CREATE_COURSE_SUCCESS'
| 'UPDATE_COURSE_SUCCESS'
| 'DELETE_COURSE_SUCCESS'
| 'COURSE_ERROR_GENERIC'
| 'COURSE_ERROR_INVALID_INPUT'
| 'COURSE_ERROR_NOT_FOUND'
| 'GET_COURSE_SUCCESS'
| 'GET_COURSES_SUCCESS'
| 'COURSE_NOT_ACTIVE'
// chapters
| 'CREATE_CHAPTER_SUCCESS'
| 'CREATE_CHAPTERS_SUCCESS'
| 'UPDATE_CHAPTER_SUCCESS'
| 'UPDATE_CHAPTERS_SUCCESS'
| 'DELETE_CHAPTERS_SUCCESS'
| 'CHAPTER_ERROR_GENERIC'
| 'CHAPTER_ERROR_NOT_FOUND'
// videos
| 'INSERT_VIDEOS_SUCCESS'
| 'UPDATE_VIDEO_SUCCESS'
| 'UPDATE_VIDEOS_SUCCESS'
| 'DELETE_VIDEOS_SUCCESS'
| 'VIDEO_ERROR_GENERIC'
| 'VIDEO_ERROR_NOT_FOUND'
// documents
| 'INSERT_DOCUMENTS_SUCCESS'
| 'UPDATE_DOCUMENT_SUCCESS'
| 'UPDATE_DOCUMENTS_SUCCESS'
| 'DELETE_DOCUMENTS_SUCCESS'
| 'DOCUMENT_ERROR_GENERIC'
| 'DOCUMENT_ERROR_NOT_FOUND'
// tags
| 'INSERT_TAGS_SUCCESS'
| 'UPDATE_TAGS_SUCCESS'
| 'DELETE_TAGS_SUCCESS'
| 'TAG_ERROR_GENERIC'
| 'TAG_ERROR_NOT_FOUND'
| 'GET_TAGS_SUCCESS'
// others
| 'GET_VIDEOS_AND_DOCUMENTS_SUCCESS'
| 'GET_VIDEOS_AND_DOCUMENTS_ERROR';
export const courseLogs: IErrors<ICourseLogs> = {
CREATE_COURSE_SUCCESS: {
code: 0,
message: 'Course "{courseId}" has been created successfully.',
type: 'CREATE_COURSE_SUCCESS',
},
UPDATE_COURSE_SUCCESS: {
code: 1,
message: 'Course "{courseId}" has been updated successfully.',
type: 'UPDATE_COURSE_SUCCESS',
},
DELETE_COURSE_SUCCESS: {
code: 2,
message: 'Course "{courseId}" has been deleted successfully.',
type: 'DELETE_COURSE_SUCCESS',
},
COURSE_ERROR_GENERIC: {
code: 3,
message: 'Error occurred while processing course: {error}',
type: 'COURSE_ERROR_GENERIC',
},
COURSE_ERROR_INVALID_INPUT: {
code: 4,
message: 'Invalid input for course: {input}',
type: 'COURSE_ERROR_INVALID_INPUT',
},
COURSE_ERROR_NOT_FOUND: {
code: 5,
message: 'Course not found: {courseId}',
type: 'COURSE_ERROR_NOT_FOUND',
},
GET_COURSE_SUCCESS: {
code: 23,
message: 'Course with id "{courseId}" fetched successfully.',
type: 'GET_COURSE_SUCCESS',
},
GET_COURSES_SUCCESS: {
code: 24,
message: 'Courses fetched successfully.',
type: 'GET_COURSES_SUCCESS',
},
COURSE_NOT_ACTIVE: {
code: 29,
message: 'Course "{courseId}" is not active.',
type: 'COURSE_NOT_ACTIVE',
},
CREATE_CHAPTER_SUCCESS: {
code: 28,
message: 'Chapter "{chapterId}" has been created successfully.',
type: 'CREATE_CHAPTER_SUCCESS',
},
CREATE_CHAPTERS_SUCCESS: {
code: 6,
message: 'Chapters "{chapterIds}" has been created successfully.',
type: 'CREATE_CHAPTERS_SUCCESS',
},
UPDATE_CHAPTER_SUCCESS: {
code: 7,
message: 'Chapter "{chapterId}" has been updated successfully.',
type: 'UPDATE_CHAPTER_SUCCESS',
},
UPDATE_CHAPTERS_SUCCESS: {
code: 25,
message: 'Chapters "{chapterIds}" has been updated successfully.',
type: 'UPDATE_CHAPTERS_SUCCESS',
},
DELETE_CHAPTERS_SUCCESS: {
code: 8,
message: 'Chapters "{chapterIds}" has been deleted successfully.',
type: 'DELETE_CHAPTERS_SUCCESS',
},
CHAPTER_ERROR_GENERIC: {
code: 9,
message: 'Error occurred while processing chapter: {error}',
type: 'CHAPTER_ERROR_GENERIC',
},
CHAPTER_ERROR_NOT_FOUND: {
code: 10,
message: 'Chapter not found: {chapterId}',
type: 'CHAPTER_ERROR_NOT_FOUND',
},
INSERT_VIDEOS_SUCCESS: {
code: 11,
message: 'Videos "{videoIds}" has been inserted successfully.',
type: 'INSERT_VIDEOS_SUCCESS',
},
UPDATE_VIDEO_SUCCESS: {
code: 12,
message: 'Video "{videoId}" has been updated successfully.',
type: 'UPDATE_VIDEO_SUCCESS',
},
UPDATE_VIDEOS_SUCCESS: {
code: 26,
message: 'Videos "{videoIds}" has been updated successfully.',
type: 'UPDATE_VIDEOS_SUCCESS',
},
DELETE_VIDEOS_SUCCESS: {
code: 13,
message: 'Videos "{videoIds}" has been deleted successfully.',
type: 'DELETE_VIDEOS_SUCCESS',
},
VIDEO_ERROR_GENERIC: {
code: 14,
message: 'Error occurred while processing video: {error}',
type: 'VIDEO_ERROR_GENERIC',
},
VIDEO_ERROR_NOT_FOUND: {
code: 15,
message: 'Video not found: {videoId}',
type: 'VIDEO_ERROR_NOT_FOUND',
},
INSERT_DOCUMENTS_SUCCESS: {
code: 16,
message: 'Documents "{documentIds}" has been inserted successfully.',
type: 'INSERT_DOCUMENTS_SUCCESS',
},
UPDATE_DOCUMENT_SUCCESS: {
code: 17,
message: 'Document "{documentId}" has been updated successfully.',
type: 'UPDATE_DOCUMENT_SUCCESS',
},
UPDATE_DOCUMENTS_SUCCESS: {
code: 27,
message: 'Documents "{documentIds}" has been updated successfully.',
type: 'UPDATE_DOCUMENTS_SUCCESS',
},
DELETE_DOCUMENTS_SUCCESS: {
code: 18,
message: 'Documents "{documentIds}" has been deleted successfully.',
type: 'DELETE_DOCUMENTS_SUCCESS',
},
DOCUMENT_ERROR_GENERIC: {
code: 19,
message: 'Error occurred while processing document: {error}',
type: 'DOCUMENT_ERROR_GENERIC',
},
DOCUMENT_ERROR_NOT_FOUND: {
code: 20,
message: 'Document not found: {documentId}',
type: 'DOCUMENT_ERROR_NOT_FOUND',
},
GET_VIDEOS_AND_DOCUMENTS_SUCCESS: {
code: 21,
message: 'Videos and documents fetched successfully.',
type: 'GET_VIDEOS_AND_DOCUMENTS_SUCCESS',
},
GET_VIDEOS_AND_DOCUMENTS_ERROR: {
code: 22,
message: 'Error occurred while fetching videos and documents.',
type: 'GET_VIDEOS_AND_DOCUMENTS_ERROR',
},
INSERT_TAGS_SUCCESS: {
code: 30,
message: 'Tags "{tagIds}" has been inserted successfully.',
type: 'INSERT_TAGS_SUCCESS',
},
UPDATE_TAGS_SUCCESS: {
code: 31,
message: 'Tags "{tagIds}" has been updated successfully.',
type: 'UPDATE_TAGS_SUCCESS',
},
DELETE_TAGS_SUCCESS: {
code: 32,
message: 'Tags "{tagIds}" has been deleted successfully.',
type: 'DELETE_TAGS_SUCCESS',
},
TAG_ERROR_GENERIC: {
code: 33,
message: 'Error occurred while processing tag: {error}',
type: 'TAG_ERROR_GENERIC',
},
TAG_ERROR_NOT_FOUND: {
code: 34,
message: 'Tag not found: {tagId}',
type: 'TAG_ERROR_NOT_FOUND',
},
GET_TAGS_SUCCESS: {
code: 35,
message: 'Tags fetched successfully.',
type: 'GET_TAGS_SUCCESS',
},
};
export default courseLogs;
export const courseLogger = new Logger('course');