feat:add monitor sts project

This commit is contained in:
shahzeydyfah
2024-06-08 00:01:04 +03:30
parent eb454bf52c
commit 6cf466f649
9 changed files with 126 additions and 25 deletions
@@ -4,6 +4,8 @@ from app.config import TaskEnv
from app.models.monito_physical_progress import PhysicalProgressModel
from core.repositories.base import BaseRepository
from core.service.mongo_db import use_collection
from core.utils.crudify import mongo_inserter
from app.repositories.project import ProjectRepository
COLLECTION = TaskEnv.CLN_MONITOR_PYSICAL
MODEL = PhysicalProgressModel
@@ -16,4 +18,9 @@ class PhysicalProgressRepository(BaseRepository):
if last:
return last[0]
else:
return {}
return {}
async def create(self,_inp:MODEL):
create = await mongo_inserter(_inp,COLLECTION,getter=self.get)
await ProjectRepository().set_sts_two_for_monitor(_inp.project_id)
return create