package com.rera.mss.service

import com.rera.mss.payload.InstrumentDto
import com.rera.mss.payload.InstrumentListDto
import com.rera.mss.payload.MonitoredAreaDto
import com.rera.mss.payload.MonitoredAreaListDto
import com.rera.mss.security.UserPrincipal
import org.springframework.stereotype.Component

interface MonitoredAreaService {
    fun addMonitoredArea(currentUser: UserPrincipal, dto: MonitoredAreaDto): MonitoredAreaServiceOperationResult<MonitoredAreaDto>
    fun getMonitoredAreas(currentUser: UserPrincipal): MonitoredAreaServiceOperationResult<MonitoredAreaListDto>
    fun updateMonitoredArea(currentUser: UserPrincipal, dto: MonitoredAreaDto): MonitoredAreaServiceOperationResult<MonitoredAreaDto>
}

sealed class MonitoredAreaServiceOperationResult<out T> {
    data class Success<out T>(val value: T) : MonitoredAreaServiceOperationResult<T>()
    data class Error(val message: String, val cause: Exception?) : MonitoredAreaServiceOperationResult<Nothing>()
}