package dev.inmo.postssystem.features.users.client

import dev.inmo.postssystem.features.users.common.*
import dev.inmo.micro_utils.ktor.client.UnifiedRequester
import dev.inmo.micro_utils.ktor.common.buildStandardUrl
import dev.inmo.micro_utils.repos.ReadCRUDRepo
import dev.inmo.micro_utils.repos.ktor.client.crud.KtorReadStandardCrudRepo
import kotlinx.serialization.builtins.nullable

class UsersStorageKtorClient(
    baseUrl: String,
    unifiedRequester: UnifiedRequester
) : ReadUsersStorage, ReadCRUDRepo<User, UserId> by KtorReadStandardCrudRepo(
    buildStandardUrl(baseUrl, usersServerPathPart),
    unifiedRequester,
    User.serializer(),
    User.serializer().nullable,
    UserId.serializer()
)
