-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 goingtocamp missing sites #293
Open
juftin
wants to merge
4
commits into
main
Choose a base branch
from
fix/going_to_camp_missing_sites
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+164
−82
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
""" | ||
GoingToCamp provider containers | ||
""" | ||
from typing import Any, Dict, List, Optional | ||
|
||
from camply.containers.base_container import CamplyModel | ||
|
||
|
||
class ResourceLocation(CamplyModel): | ||
""" | ||
/api/maps | ||
""" | ||
|
||
id: Optional[int] | ||
rec_area_id: int | ||
park_alerts: Optional[str] | ||
resource_categories: Optional[List[int]] | ||
resource_location_id: Optional[int] | ||
resource_location_name: str | ||
region_name: str | ||
|
||
|
||
class ResourceAvailabilityUnit(CamplyModel): | ||
""" | ||
/api/availability/map: resourceAvailabilities | ||
""" | ||
|
||
availability: int | ||
remainingQuota: Optional[int] | ||
|
||
|
||
class AvailabilityResponse(CamplyModel): | ||
""" | ||
/api/availability/map | ||
""" | ||
|
||
mapId: int | ||
mapAvailabilities: List[int] = [] | ||
resourceAvailabilities: Dict[int, List[ResourceAvailabilityUnit]] = {} | ||
mapLinkAvailabilities: Dict[str, Any] = {} | ||
|
||
|
||
class ParamsBaseModel(CamplyModel): | ||
""" | ||
API and Booking URL Params | ||
""" | ||
|
||
mapId: int | ||
resourceLocationId: int | ||
bookingCategoryId: int | ||
startDate: str | ||
endDate: str | ||
isReserving: bool | ||
partySize: int | ||
|
||
|
||
class SearchFilter(ParamsBaseModel): | ||
""" | ||
/api/availability/map: API Filter | ||
""" | ||
|
||
equipmentCategoryId: Optional[int] = None | ||
filterData: List[Any] = [] | ||
subEquipmentCategoryId: Optional[int] = None | ||
numEquipment: int | ||
getDailyAvailability: bool | ||
|
||
|
||
class BookingUrlParams(ParamsBaseModel): | ||
""" | ||
Booking URL Params | ||
""" | ||
|
||
equipmentId: Optional[int] = None | ||
subEquipmentId: Optional[int] = None |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -175,7 +175,7 @@ def get_all_campsites(self) -> List[AvailableCampsite]: | |
# be viable for camping. Skip all zero-capacity sites. | ||
if ( | ||
not site_details["minCapacity"] | ||
or not site_details["maxCapacity"] | ||
and not site_details["maxCapacity"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's where we allow sites with a maxCapacity, but not a minCapacity, to get selected |
||
): | ||
continue | ||
|
||
|
@@ -193,7 +193,7 @@ def get_all_campsites(self) -> List[AvailableCampsite]: | |
"Service Type", "Unknown" | ||
), | ||
campsite_occupancy=( | ||
site_details["minCapacity"], | ||
site_details["minCapacity"] or 0, | ||
site_details["maxCapacity"], | ||
), | ||
campsite_use_type="N/A", | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's where we only use the
equipmentCategoryId
whensubEquipmentCategoryId
is also used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the bug that "group sites" were ending up in the result set?
Assuming
equipment_type_id
is a non-group equipment type, the addition of theNON_GROUP_EQUIPMENT
filter seems like it should be superfluous here.