feat(project):add sts

This commit is contained in:
shahzeydyfah
2024-03-14 16:50:14 +03:30
parent 84125d2ada
commit 459d9415d1
2 changed files with 18 additions and 0 deletions
+13
View File
@@ -64,6 +64,19 @@ class DesignProgressRepository(BaseRepository[CreateDesignProgress]):
sub_type=design_progress.sub_type
)
return await self.get(get_record)
async def check_complete(self,get_record:GetRecord):
result = False
if get_record.type and get_record.type < 7:
progress = await use_collection(COLLECTION).find_one(
{"project_id": get_record.project_id, "type": int(get_record.type)+1})
if progress:
records = await use_collection('design_progress_record').find_one(
{"design_progress_id": progress["_id"]})
if records:
result=True
return result
class DesignProgressRecordRepository(BaseRepository[RecordModel]):
def __int__(self):
super().__init__(collection='design_progress_record', model=RecordModel)