Skip to content

Commit 84109bd

Browse files
committed
feat(dummy): Enhance dummy model schemas with new DTOs and pagination support
1 parent 06a261d commit 84109bd

3 files changed

Lines changed: 41 additions & 97 deletions

File tree

app/controller/api/dummy/schema.py

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from pydantic import BaseModel, ConfigDict
1+
from pydantic import BaseModel, ConfigDict, Field
2+
3+
from app.controller.utils.pagination import Pagination
24

35

46
class DummyModelDTO(BaseModel):
@@ -18,3 +20,41 @@ class DummyModelInputDTO(BaseModel):
1820
"""DTO for creating new dummy model."""
1921

2022
name: str
23+
24+
25+
class DummyDataResponse(BaseModel):
26+
"""Model for the data returned by a Dummy API endpoint."""
27+
28+
dummyId: str = Field(..., examples=["a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"])
29+
name: str = Field(..., examples=["John Doe"])
30+
31+
32+
class DummyCreate(BaseModel):
33+
"""Model for creating a new dummy model."""
34+
35+
name: str = Field(..., examples=["John Doe"])
36+
37+
38+
class DummyUpdate(BaseModel):
39+
"""Model for updating a Dummy."""
40+
41+
name: str | None = Field(default=None, examples=["John Doe"])
42+
43+
44+
class CustomerListResponse(BaseModel):
45+
"""Model for the response of a dummy API endpoint.
46+
47+
This class represents the structure of the response returned by an customer API endpoint.
48+
It includes a 'data' attribute, which is a list of `CustomerListData` objects,
49+
and a 'pagination' attribute, which is a `Pagination` object.
50+
51+
Attributes:
52+
data (list[CustomerListData] | None): The data returned by the endpoint.
53+
This is a list of `CustomerListData` objects. If no data is returned,
54+
this is None.
55+
pagination (Pagination | None): The pagination information for the data.
56+
If no pagination information is provided, this is None.
57+
"""
58+
59+
data: list[DummyDataResponse] = Field(default=[])
60+
pagination: Pagination | None = Field(default=None)

app/core/gunicorn_runner.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

app/db/models/jwt_token.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)