package com.rera.mss.service

import com.rera.mss.payload.InverterDto
import com.rera.mss.payload.InverterListDto
import com.rera.mss.security.UserPrincipal

interface InverterService {
    fun addInverter(currentUser: UserPrincipal, dto: InverterDto): InverterServiceOperationResult<InverterDto>
    fun getInverters(currentUser: UserPrincipal): InverterServiceOperationResult<InverterListDto>
    fun updateInverter(currentUser: UserPrincipal, dto: InverterDto): InverterServiceOperationResult<InverterDto>
}

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