2024-03-16 06:50:18 +03:30
|
|
|
import uuid
|
|
|
|
|
|
|
|
|
|
from app.config import TaskEnv
|
2024-03-15 23:06:46 +03:30
|
|
|
from app.models.register_status import RegisterStatusModel
|
|
|
|
|
from core.repositories.base import BaseRepository
|
2024-03-16 06:50:18 +03:30
|
|
|
from core.service.mongo_db import use_collection
|
2024-03-15 23:06:46 +03:30
|
|
|
|
|
|
|
|
|
|
|
|
|
class RegisterStatusRepository(BaseRepository[RegisterStatusModel]):
|
|
|
|
|
def __int__(self):
|
2024-03-16 06:50:18 +03:30
|
|
|
super().__init__(collection=TaskEnv.CLN_AUDIT_STATUS,model=RegisterStatusModel)
|
|
|
|
|
|
|
|
|
|
async def get_last(self,project_id:uuid.UUID):
|
2024-03-16 06:55:10 +03:30
|
|
|
last = await use_collection(TaskEnv.CLN_AUDIT_STATUS).find({"project_id":project_id}).sort('$natural', -1).to_list(1)
|
2024-03-16 06:50:18 +03:30
|
|
|
return last
|