This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72a1156
commit 97a8e84
Showing
8 changed files
with
95 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/check_phat_nguoi/models/context/plate_context/plate_context.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
from pydantic import BaseModel | ||
from pydantic import BaseModel, Field | ||
|
||
from check_phat_nguoi.models.context.plate_context.plate_info import ( | ||
PlateInfoContextModel, | ||
) | ||
|
||
|
||
class PlatesContextModel(BaseModel): | ||
plates: list[PlateInfoContextModel] = [] | ||
plates: list[PlateInfoContextModel] = Field( | ||
description="Danh sách các biển xe", default_factory=list | ||
) | ||
|
||
|
||
__all__ = ["PlatesContextModel"] |
6 changes: 5 additions & 1 deletion
6
src/check_phat_nguoi/models/context/plate_context/plate_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
from pydantic import Field | ||
|
||
from check_phat_nguoi.models.context.plate_context.violation import ( | ||
ViolationContextModel, | ||
) | ||
from check_phat_nguoi.models.plate_info import PlateInfoModel | ||
|
||
|
||
class PlateInfoContextModel(PlateInfoModel): | ||
violation: list[ViolationContextModel] = [] | ||
violation: list[ViolationContextModel] = Field( | ||
description="Danh sách các vi phạm của 1 biển xe", default_factory=list | ||
) | ||
|
||
|
||
__all__ = ["PlateInfoContextModel"] |
19 changes: 11 additions & 8 deletions
19
src/check_phat_nguoi/models/context/plate_context/violation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from pydantic import BaseModel | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class BaseNotifyConfigModel(BaseModel): | ||
enabled: bool = True | ||
enabled: bool = Field(description="Kích hoạt", default=True) | ||
|
||
|
||
__all__ = ["BaseNotifyConfigModel"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
from pydantic import BaseModel | ||
from pydantic import BaseModel, Field | ||
|
||
|
||
class PlateInfoModel(BaseModel): | ||
plate: str | ||
owner: str | None = None | ||
plate: str = Field( | ||
description="Biển số", | ||
title="Biển số", | ||
examples=["60A64685", "98-A-56604", "30-F88251", "59XB-00000"], | ||
) | ||
owner: str | None = Field( | ||
description="Ghi chú chủ sở hữu (phù hợp khi dùng notify ai đó)", | ||
title="Ghi chú chủ sở hữu", | ||
examples=["@kevinnitro", "dad"], | ||
default=None, | ||
) | ||
|
||
|
||
__all__ = ["PlateInfoModel"] |