feat(register status):add

This commit is contained in:
shahzeydyfah
2024-03-16 06:50:18 +03:30
parent 2a79d3f0c6
commit 855af7e52a
3 changed files with 17 additions and 18 deletions
+9 -1
View File
@@ -1,7 +1,15 @@
import uuid
from app.config import TaskEnv
from app.models.register_status import RegisterStatusModel
from core.repositories.base import BaseRepository
from core.service.mongo_db import use_collection
class RegisterStatusRepository(BaseRepository[RegisterStatusModel]):
def __int__(self):
super().__init__(collection='register_status',model=RegisterStatusModel)
super().__init__(collection=TaskEnv.CLN_AUDIT_STATUS,model=RegisterStatusModel)
async def get_last(self,project_id:uuid.UUID):
last = await use_collection(TaskEnv.CLN_AUDIT_STATUS).find_one({"project_id":project_id}).sort('$natural', -1)
return last