Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
(PC-10942) serialization: edit GetOffererVenueResponseModel
Browse files Browse the repository at this point in the history
These attributes are still needed by the frontend
  • Loading branch information
francois-seguin committed Nov 9, 2021
1 parent 7588f9a commit be21960
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pcapi/routes/serialization/offerers_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

class GetOffererVenueResponseModel(BaseModel):
address: Optional[str]
bookingEmail: Optional[str]
city: Optional[str]
comment: Optional[str]
departementCode: Optional[str]
Expand All @@ -28,6 +29,11 @@ class GetOffererVenueResponseModel(BaseModel):
publicName: Optional[str]
venueLabelId: Optional[str]
venueTypeId: Optional[str]
withdrawalDetails: Optional[str]
audioDisabilityCompliant: Optional[bool]
mentalDisabilityCompliant: Optional[bool]
motorDisabilityCompliant: Optional[bool]
visualDisabilityCompliant: Optional[bool]
_humanize_id = humanize_field("id")
_humanize_managing_offerer_id = humanize_field("managingOffererId")
_humanize_venue_label_id = humanize_field("venueLabelId")
Expand Down
6 changes: 6 additions & 0 deletions tests/routes/pro/get_offerer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,25 @@ def test_when_user_has_rights_on_offerer(self, app):
"lastProviderId": offerer.lastProviderId,
"managedVenues": [
{
"audioDisabilityCompliant": False,
"address": offererVenue.address,
"bookingEmail": offererVenue.bookingEmail,
"city": offererVenue.city,
"comment": offererVenue.comment,
"departementCode": offererVenue.departementCode,
"id": humanize(offererVenue.id),
"isValidated": offererVenue.isValidated,
"isVirtual": offererVenue.isVirtual,
"managingOffererId": humanize(offererVenue.managingOffererId),
"mentalDisabilityCompliant": False,
"motorDisabilityCompliant": False,
"name": offererVenue.name,
"postalCode": offererVenue.postalCode,
"publicName": offererVenue.publicName,
"venueLabelId": humanize(offererVenue.venueLabelId),
"venueTypeId": humanize(offererVenue.venueTypeId),
"visualDisabilityCompliant": False,
"withdrawalDetails": offererVenue.withdrawalDetails,
}
for offererVenue in offerer.managedVenues
],
Expand Down

0 comments on commit be21960

Please sign in to comment.