penisularhr / src / exceptions / employee.ts
employee.ts
Raw
import { BadRequestException, NotFoundException } from '@nestjs/common';

export class EmployeeNotFoundException extends NotFoundException {
  constructor(error?: string) {
    super('Employee not found', error);
  }
}

export class ReferralByException extends BadRequestException {
  constructor(error?: string) {
    super('Referral by is required', error);
  }
}
export class ReferralFeeHasPaidException extends BadRequestException {
  constructor(error?: string) {
    super('Referral fee has already paid', error);
  }
}

export class DateJoinLaterThanDateResignException extends BadRequestException {
  constructor(error?: string) {
    super('Date join > date resign', error);
  }
}

export class EmployeeNotActiveException extends BadRequestException {
  constructor(error?: string) {
    super('Employee is not active', error);
  }
}

export class EmployeeAlreadyResignedException extends BadRequestException {
  constructor(error?: string) {
    super('Employee has already resigned', error);
  }
}

export class EmployeeReferralByOwnException extends BadRequestException {
  constructor(error?: string) {
    super('Employee referee by himself', error);
  }
}

export class DeductionExceedLeaveException extends BadRequestException {
  constructor(error?: string) {
    super('Deduction exceed leave', error);
  }
}