mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-27 10:26:26 +00:00
22 lines
493 B
Python
22 lines
493 B
Python
|
from datetime import datetime, timedelta
|
||
|
|
||
|
from pydantic import BaseModel
|
||
|
from simnet.models.zzz.self_help import ZZZSelfHelpActionLog
|
||
|
|
||
|
|
||
|
class ActionLogPair(BaseModel):
|
||
|
start: ZZZSelfHelpActionLog
|
||
|
end: ZZZSelfHelpActionLog
|
||
|
|
||
|
@property
|
||
|
def start_time(self) -> datetime:
|
||
|
return self.start.time
|
||
|
|
||
|
@property
|
||
|
def end_time(self) -> datetime:
|
||
|
return self.end.time
|
||
|
|
||
|
@property
|
||
|
def duration(self) -> timedelta:
|
||
|
return self.end.time - self.start.time
|