Skip to content

Commit

Permalink
(PC-31316)[API] feat: add dateCreated in VenueProvider serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoudray-pass committed Aug 29, 2024
1 parent 2a2492a commit 6cc50e0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class VenueProviderResponse(BaseModel):
isDuo: bool | None
isFromAllocineProvider: bool
lastSyncDate: datetime | None
dateCreated: datetime
price: float | None
provider: ProviderResponse
quantity: int | None
Expand Down
2 changes: 2 additions & 0 deletions api/tests/routes/pro/get_venue_providers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_get_list_with_valid_venue_id(self, client):
venue__managingOfferer=user_offerer.offerer,
provider=titelive_things_provider,
lastSyncDate=datetime(2021, 8, 16),
dateCreated=datetime(2021, 8, 15),
)

# when
Expand All @@ -30,6 +31,7 @@ def test_get_list_with_valid_venue_id(self, client):
assert response.json["venue_providers"][0].get("id") == venue_provider.id
assert response.json["venue_providers"][0].get("venueId") == venue_provider.venue.id
assert response.json["venue_providers"][0].get("lastSyncDate") == "2021-08-16T00:00:00Z"
assert response.json["venue_providers"][0].get("dateCreated") == "2021-08-15T00:00:00Z"

@pytest.mark.usefixtures("db_session")
def test_get_list_that_include_allocine_with_valid_venue_id(self, client):
Expand Down
1 change: 1 addition & 0 deletions api/tests/routes/pro/post_venue_provider_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def test_when_no_regression_on_format(
# Then
assert response.status_code == 201
assert set(response.json.keys()) == {
"dateCreated",
"id",
"isActive",
"isDuo",
Expand Down
1 change: 1 addition & 0 deletions pro/src/apiClient/v1/models/VenueProviderResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/* eslint-disable */
import type { ProviderResponse } from './ProviderResponse';
export type VenueProviderResponse = {
dateCreated: string;
id: number;
isActive: boolean;
isDuo?: boolean | null;
Expand Down
1 change: 1 addition & 0 deletions pro/src/utils/individualApiFactories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ export const defaultVenueProvider: VenueProviderResponse = {
isFromAllocineProvider: false,
lastSyncDate: undefined,
venueId: 2,
dateCreated: '2021-08-15T00:00:00Z',
venueIdAtOfferProvider: 'cdsdemorc1',
provider: {
name: 'Ciné Office',
Expand Down

0 comments on commit 6cc50e0

Please sign in to comment.