feat: Added methods for organization

This commit is contained in:
SauravDhakal
2026-03-11 21:47:35 +05:45
parent 6fc494687a
commit 349196b801
24 changed files with 504 additions and 189 deletions

View File

@@ -2,7 +2,23 @@ import { HttpException, HttpStatus } from '@nestjs/common';
// Base exception
export class BaseException extends HttpException {
protected constructor(code: string, message: string, status: HttpStatus) {
super({ code, message }, status);
protected constructor(
errorCode: string,
errorMessage: string,
status: HttpStatus
) {
super({ code: errorCode, message: errorMessage }, status);
}
}
/*
* Organization Exceptions
* */
export class OrganizationNotFoundException extends BaseException {
}
// export class NotPartOfOrganizationException extends BaseException {
// constructor(code: string, message: string, status: HttpStatus) {
// super();
// }
// }

View File

@@ -0,0 +1,17 @@
import { HttpStatus } from "@nestjs/common";
interface AppError {
errorCode: string,
message: string,
status: HttpStatus
}
type ErrorsType = Record<string, AppError>
export const ORGANIZATION_ERRORS: ErrorsType = {
NOT_FOUND: {
errorCode: 'ORG_001',
message: 'Organization not found',
status: HttpStatus.NOT_FOUND
}
}