16 lines
582 B
Python
16 lines
582 B
Python
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=TaskEnv.CLN_AUDIT_STATUS,model=RegisterStatusModel)
|
|
|
|
async def get_last(self,project_id:uuid.UUID):
|
|
last = await use_collection(TaskEnv.CLN_AUDIT_STATUS).find({"project_id":project_id}).sort('$natural', -1).to_list(1)
|
|
return last
|