Source code for LOGS.Interfaces.IModificationRecord

from dataclasses import dataclass
from datetime import datetime
from typing import TYPE_CHECKING, List, Optional

from LOGS.Auxiliary import Tools
from LOGS.Auxiliary.MinimalModelGenerator import PersonMinimalFromDict
from LOGS.Interfaces.IEntityInterface import IEntityInterface

if TYPE_CHECKING:
    from LOGS.Entities.PersonMinimal import PersonMinimal


[docs] @dataclass class IModificationRecordRequest: pass
[docs] class IModifiedOnRequest: modifiedFrom: Optional[datetime] = None modifiedTo: Optional[datetime] = None
[docs] class IModifiedByRequest: modifiedByIds: Optional[List[int]]
[docs] class IModifiedOn(IEntityInterface): _modifiedOn: Optional[datetime] = None @property def modifiedOn(self) -> Optional[datetime]: return self._modifiedOn @modifiedOn.setter def modifiedOn(self, value): self._modifiedOn = Tools.checkAndConvert( value, datetime, "modifiedOn", allowNone=True )
[docs] class IModifiedBy(IEntityInterface): _modifiedBy: Optional["PersonMinimal"] = None @property def modifiedBy(self) -> Optional["PersonMinimal"]: return self._modifiedBy @modifiedBy.setter def modifiedBy(self, value): self._modifiedBy = PersonMinimalFromDict( value, "modifiedBy", self._getEntityConnection() )
[docs] class IModificationRecord(IModifiedOn, IModifiedBy): pass