package dev.inmo.postssystem.features.roles.common.keyvalue

import dev.inmo.postssystem.features.roles.common.*
import kotlinx.serialization.KSerializer
import kotlinx.serialization.StringFormat

open class KeyValueRolesStorage<T : Role>(
    private val keyValuesRepo: KeyValuesRolesOriginalRepo,
    private val serializer: KSerializer<T>,
    private val format: StringFormat = ReadKeyValueRolesStorage.defaultJson
) : RolesStorage<T>,
    ReadRolesStorage<T> by ReadKeyValueRolesStorage(keyValuesRepo, serializer, format),
    WriteRolesStorage<T> by WriteKeyValueRolesStorage(keyValuesRepo, serializer, format)
