Skip to content

Commit

Permalink
(PC-33946)[API] feat: add publicationDate in offer route
Browse files Browse the repository at this point in the history
  • Loading branch information
bpeyrou-pass committed Jan 27, 2025
1 parent ca3376a commit fafde91
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 17 deletions.
1 change: 1 addition & 0 deletions api/src/pcapi/routes/native/v1/serialization/offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ class BaseOfferResponse(ConfiguredBaseModel):
last30DaysBookings: int | None
metadata: offer_metadata.Metadata
name: str
publicationDate: datetime | None
reactions_count: ReactionCount
stocks: list[OfferStockResponse]
subcategoryId: subcategories.SubcategoryIdEnum
Expand Down
12 changes: 12 additions & 0 deletions api/tests/routes/native/openapi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,12 @@ def test_public_api(client):
"last30DaysBookings": {"nullable": True, "title": "Last30Daysbookings", "type": "integer"},
"metadata": {"title": "Metadata", "type": "object"},
"name": {"title": "Name", "type": "string"},
"publicationDate": {
"title": "Publicationdate",
"type": "string",
"format": "date-time",
"nullable": True,
},
"reactionsCount": {"$ref": "#/components/schemas/ReactionCount"},
"stocks": {
"items": {"$ref": "#/components/schemas/OfferStockResponse"},
Expand Down Expand Up @@ -1579,6 +1585,12 @@ def test_public_api(client):
"last30DaysBookings": {"nullable": True, "title": "Last30Daysbookings", "type": "integer"},
"metadata": {"title": "Metadata", "type": "object"},
"name": {"title": "Name", "type": "string"},
"publicationDate": {
"title": "Publicationdate",
"type": "string",
"format": "date-time",
"nullable": True,
},
"reactionsCount": {"$ref": "#/components/schemas/ReactionCount"},
"stocks": {
"items": {"$ref": "#/components/schemas/OfferStockResponse"},
Expand Down
Loading

0 comments on commit fafde91

Please sign in to comment.