Skip to content

Commit

Permalink
added FHLB data for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
saylorsd committed Dec 12, 2024
1 parent 6097183 commit a2ec5f5
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api/housing_data/housing_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,8 @@ class Meta:


class FHLBRentalProperties(HousingDataset):
fhlb_funding_id = models.IntegerField(blank=True, null=True)
fhlb_funding_id = models.TextField(blank=True, null=True)

full_text = models.TextField(db_column='_full_text', blank=True, null=True)
hud_property_name = models.TextField(blank=True, null=True)
application_type_name = models.TextField(blank=True, null=True)
property_street_address = models.TextField(blank=True, null=True)
Expand All @@ -639,13 +638,11 @@ class FHLBRentalProperties(HousingDataset):

class Meta:
managed = False
db_table = 'afba564f-cc68-42f0-b37b-fc8d70e8ef47'
db_table = 'ecdbf89a-bbe7-4e82-b902-d6b774758d3a'


class FHLBRentalProjects(HousingDataset):
fhlb_funding_id = models.IntegerField(blank=True, null=True)

full_text = models.TextField(db_column='_full_text', blank=True, null=True)
fhlb_funding_id = models.TextField(blank=True, null=True)

parcel_count = models.IntegerField(blank=True, null=True)
hud_property_name = models.TextField(blank=True, null=True)
Expand Down Expand Up @@ -674,4 +671,5 @@ class FHLBRentalProjects(HousingDataset):

class Meta:
managed = False
db_table = 'ecdbf89a-bbe7-4e82-b902-d6b774758d3a'
db_table = 'afba564f-cc68-42f0-b37b-fc8d70e8ef47'

100 changes: 100 additions & 0 deletions explorer/parts/ProjectView/housingSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,48 @@ type IgnoredFields =

export type ComplexItems = Omit<ProjectIndexDetails, IgnoredFields>;

interface FHLBProperties {
fhlbFundingId?: string | null;
hudPropertyName?: string | null;
applicationTypeName?: string | null;
propertyStreetAddress?: string | null;
city?: string | null;
county?: string | null;
state?: string | null;
zipCode?: string | null;
assistedUnits?: number | null;
units?: number | null;
retentionExpiration?: number | null;
'50PercentAmiLimit'?: number | null;
'60PercentAmiLimit'?: number | null;
'80PercentAmiLimit'?: number | null;
greaterThan80Ami?: number | null;
latitude?: number | null;
longitude?: number | null;
}

interface FHLBProjects {
fhlbFundingId?: string | null;
parcelCount?: string | null;
hudPropertyName?: string | null;
applicationTypeName?: string | null;
addressLine1List?: string | null;
propertyStreetAddress?: string | null;
city?: string | null;
county?: string | null;
state?: string | null;
zipCode?: string | null;
'50PercentAmiLimit'?: number | null;
'60PercentAmiLimit'?: number | null;
'80PercentAmiLimit'?: number | null;
greaterThan80Ami?: number | null;
assistedUnits?: number | null;
units?: number | null;
retentionExpiration?: string | null;
latitude?: number | null;
longitude?: number | null;
}

export interface HousingSchema
extends Record<keyof ComplexItems, SchemaSection<any>> {
activeHudMultifamilyInsuredMortgages: SchemaSection<ActiveHUDMultifamilyInsuredMortgages>;
Expand All @@ -89,6 +131,8 @@ export interface HousingSchema
lihtcDataFromPhfa: SchemaSection<LIHTCDataFromPHFA>;
demographicsByHousingProjectFromPhfa: SchemaSection<DemographicsByHousingProjectFromPHFA>;
phfaStats: SchemaSection<PHFAStats>;
fhlbProperties: SchemaSection<FHLBProperties>;
fhlbProjects: SchemaSection<FHLBProjects>;
}

export const affordableHousingSchema: HousingSchema = {
Expand Down Expand Up @@ -542,4 +586,60 @@ export const affordableHousingSchema: HousingSchema = {
},
],
},

fhlbProjects: {
title: 'FHLB Projects',
items: [
{ accessor: 'fhlbFundingId', label: 'FHLB Funding ID' },
{ accessor: 'parcelCount', label: 'Number of Parcels' },
{ accessor: 'hudPropertyName', label: 'HUD Property Name' },
{ accessor: 'applicationTypeName', label: 'Application Type' },
{ accessor: 'units', label: '# of Units' },
{ accessor: 'assistedUnits', label: '# of Assisted Units' },
{
accessor: '50PercentAmiLimit',
label: '# occupied by residents with income within 50% AMI Limit',
},
{
accessor: '60PercentAmiLimit',
label: '# occupied by residents with income within 60% AMI Limit',
},
{
accessor: '80PercentAmiLimit',
label: '# occupied by residents with income within 80% AMI Limit',
},
{
accessor: 'greaterThan80Ami',
label: '# occupied by residents with income above 80% AMI Limit',
},
{ accessor: 'retentionExpiration', label: 'Retention Expiration Date' },
],
},
fhlbProperties: {
title: 'FHLB Property Records',
items: [
{ accessor: 'fhlbFundingId', label: 'FHLB Funding ID' },
{ accessor: 'hudPropertyName', label: 'HUD Property Name' },
{ accessor: 'applicationTypeName', label: 'Application Type' },
{ accessor: 'units', label: '# of Units' },
{ accessor: 'assistedUnits', label: '# of Assisted Units' },
{
accessor: '50PercentAmiLimit',
label: '# occupied by residents with income within 50% AMI Limit',
},
{
accessor: '60PercentAmiLimit',
label: '# occupied by residents with income within 60% AMI Limit',
},
{
accessor: '80PercentAmiLimit',
label: '# occupied by residents with income within 80% AMI Limit',
},
{
accessor: 'greaterThan80Ami',
label: '# occupied by residents with income above 80% AMI Limit',
},
{ accessor: 'retentionExpiration', label: 'Retention Expiration Date' },
],
},
};

0 comments on commit a2ec5f5

Please sign in to comment.