Spaces:
Runtime error
Runtime error
File size: 1,395 Bytes
7a511fb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | from src.repositories import ProposalEvaluationRepository
from src.models import EvaluationType
class ProposalEvaluationService:
def __init__(self):
self.repo = ProposalEvaluationRepository
async def __aenter__(self):
return self
async def __aexit__(self, exc_type, exc_value, traceback):
pass
async def get_evaluations(
self,
proposal_id: str = None,
id: str = None,
evaluation_type: EvaluationType = None,
):
async with self.repo() as repo:
return await repo.get_evaluations(
proposal_id=proposal_id, id=id, evaluation_type=evaluation_type
)
async def create_evaluations(self, proposal_id: str, evaluations: dict):
async with self.repo() as repo:
return await repo.craete_evaluations(
proposal_id=proposal_id, proposal_evaluations=evaluations
)
async def update_evaluations(self, proposal_id: str, id: str, evaluations: dict):
async with self.repo() as repo:
return await repo.update_evaluations(
proposal_id=proposal_id, id=id, evaluations=evaluations
)
async def delete_evaluations(self, proposal_id: str = None, id: str = None):
async with self.repo() as repo:
return await repo.delete_evaluations(proposal_id=proposal_id, id=id)
|