You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up ticket for the work done as part of #4523 for "unit groups"
When retrieving listings both via the "listings list" endpoint and the "listings get" endpoint a summarization of the units is calculated and added onto the response. This data is used by the public site to display the unit tables on multiple page. And because unit groups are significantly different than units as well as different data is displayed on the front end we will need to create new functions and DTO data to handle this.
In listing.service.ts the function to get one listing by id findOne retrieves the listing and then calls a function addUnitsSummarized which then in turn calls summarizeUnits. The logic for this is specific to "units" and not "unit groups".
In listing.service.ts the function to get a list of listings list gets all of the filtered listings and then adds the unit summaries via the function summarizeUnitsByTypeAndRent. The logic for this is specific to "units" and not "unit groups".
For the current system this summarization is added to the listing on a field called unitsSummarized. However, in Detroit when the groups are summarized they are added to a field called unitSummaries. When we add this logic to core we will want to use a name that is better suited that indicates it is for unit groups. Potentially unitGroupsSummarized
Note: The long term plan for this is to save the summarization in the DB on listing save so that this calculation does not have to be done for each get request. That is not part of this ticket
Changes need for this ticket:
Update DTOs to accommodate unit group summaries
New DTO called UnitGroupSummary with the following fields
sqFeetRange
unitVacancies
openWaitlist
amiPercentageRange
rentRange
rentAsPercentIncomeRange
unitTypes
New DTO called UnitGroupsSummarized with the following types
unitGroupSummary - type of UnitGroupSummary
householdMaxIncomeSummary - TODO: add details
Add unitGroupsSummarized to listing.dto.ts
Type of UnitGroupsSummarized
Create function to summarize unit groups
The logic between units and unit groups is different enough that we will need separate functions to summaries units vs unit groups. The appropriate function of either summarizing units or unit groups will get called based on if the feature flag created in #4523 so that on the listing there will only be either unitsSummarized or `unitGroupsSummarized.
This new function will take in the unit groups for a specific listing and properly set all of the fields on the unitGroupSummary DTO
The logic for this function can take a lot of inspiration from the current Detroit implementation
Note: there are separate implementations for the listing findOne vs list functions. This separation exists in both Detroit and Core. There are opportunities for consolidations of the logic, but also there could be reasons for it
The text was updated successfully, but these errors were encountered:
This is a follow-up ticket for the work done as part of #4523 for "unit groups"
When retrieving listings both via the "listings list" endpoint and the "listings get" endpoint a summarization of the units is calculated and added onto the response. This data is used by the public site to display the unit tables on multiple page. And because unit groups are significantly different than units as well as different data is displayed on the front end we will need to create new functions and DTO data to handle this.
In
listing.service.ts
the function to get one listing by idfindOne
retrieves the listing and then calls a functionaddUnitsSummarized
which then in turn callssummarizeUnits
. The logic for this is specific to "units" and not "unit groups".In
listing.service.ts
the function to get a list of listingslist
gets all of the filtered listings and then adds the unit summaries via the functionsummarizeUnitsByTypeAndRent
. The logic for this is specific to "units" and not "unit groups".For the current system this summarization is added to the listing on a field called
unitsSummarized
. However, in Detroit when the groups are summarized they are added to a field calledunitSummaries
. When we add this logic to core we will want to use a name that is better suited that indicates it is for unit groups. PotentiallyunitGroupsSummarized
Note: The long term plan for this is to save the summarization in the DB on listing save so that this calculation does not have to be done for each get request. That is not part of this ticket
Changes need for this ticket:
Update DTOs to accommodate unit group summaries
UnitGroupSummary
with the following fieldssqFeetRange
unitVacancies
openWaitlist
amiPercentageRange
rentRange
rentAsPercentIncomeRange
unitTypes
UnitGroupsSummarized
with the following typesunitGroupSummary
- type ofUnitGroupSummary
householdMaxIncomeSummary
- TODO: add detailsunitGroupsSummarized
tolisting.dto.ts
UnitGroupsSummarized
Create function to summarize unit groups
The logic between units and unit groups is different enough that we will need separate functions to summaries units vs unit groups. The appropriate function of either summarizing units or unit groups will get called based on if the feature flag created in #4523 so that on the listing there will only be either
unitsSummarized
or `unitGroupsSummarized.findOne
vslist
functions. This separation exists in both Detroit and Core. There are opportunities for consolidations of the logic, but also there could be reasons for itThe text was updated successfully, but these errors were encountered: