package com.rera.mss.service

import com.rera.mss.payload.InstrumentDto
import com.rera.mss.payload.InstrumentListDto
import com.rera.mss.security.UserPrincipal

interface InstrumentService {
    fun addInstrument(currentUser: UserPrincipal, dto: InstrumentDto): InstrumentServiceOperationResult<InstrumentDto>
    fun getInstruments(currentUser: UserPrincipal): InstrumentServiceOperationResult<InstrumentListDto>
    fun updateInstrument(currentUser: UserPrincipal, dto: InstrumentDto): InstrumentServiceOperationResult<InstrumentDto>
}

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