package com.rera.mss.exceptions

import org.springframework.http.HttpStatus

enum class ExceptionType(val statusCode: HttpStatus) {
    Unexpected(HttpStatus.INTERNAL_SERVER_ERROR),
    MonitoredAreaWithoutPvAreaException(HttpStatus.BAD_REQUEST),
    PvAreaWithoutPvPanelException(HttpStatus.BAD_REQUEST),
    PvAreaWithZeroAreaException(HttpStatus.BAD_REQUEST),
    BadCredentialsException(HttpStatus.UNAUTHORIZED),
    NoInstrumentWithGivenIdException(HttpStatus.NOT_FOUND),
    WrongMeasurementFormatException(HttpStatus.BAD_REQUEST)
}

class UserNotFoundException(message: String) : RuntimeException()
data class MonitoredAreaWithoutPvAreaException(override val message: String, val monitoredAreaId: Long) : RuntimeException(message)
data class PvAreaWithoutPvPanelException(override val message: String, val monitoredAreaId: Long, val pvAreaId: Long) : RuntimeException(message)
data class PvAreaWithZeroAreaException(override val message: String, val monitoredAreaId: Long, val pvAreaId: Long ): RuntimeException(message)
data class NoInstrumentWithGivenIdException(override val message: String): RuntimeException(message)
data class WrongMeasurementFormatException(override val message: String): RuntimeException(message)


