from server.modules.rate.domain import Vote
from server.modules.rate.repository import AVoteRepository, VoteModel


class VotesService:
    __slots__ = ("_repository",)

    def __init__(self, repository: AVoteRepository):
        self._repository = repository

    async def add_vote(self, vote: Vote):
        return await self._repository.add_vote(VoteModel.from_domain(vote))
