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

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

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

export class DuplicateVehicleRecordException extends BadRequestException {
  constructor(error?: string) {
    super('Duplicate vehicle record', error);
  }
}

export class VehicleRecordExceed8HourException extends BadRequestException {
  constructor(error?: string) {
    super('Record hour > 8', error);
  }
}

export class VehicleRecordDateExceedTodayException extends BadRequestException {
  constructor(error?: string) {
    super('Record date > today', error);
  }
}

export class DuplicateVehicleNameException extends BadRequestException {
  constructor(error?: string) {
    super('Duplicate vehicle name', error);
  }
}