Skip to content
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

Release: 2024-01-23 #658

Merged
merged 19 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1bf3fa1
feat: seeds button uptake (#3677)
ludtkemorgan Jan 23, 2024
f08f23f
fix: validate radius geocoding preferences (#3718)
ludtkemorgan Dec 1, 2023
99f6aaa
feat: add address verification for preferences step (#3715)
KrissDrawing Dec 1, 2023
06230e1
fix: update dependencies for backend (#3694)
ludtkemorgan Dec 1, 2023
72cb1e7
feat: core changes for application style alignment (#3662)
ludtkemorgan Jan 23, 2024
9341165
test: fix cypress lat long error (#3746)
emilyjablonski Dec 5, 2023
b405c38
fix: padding issue on address verify (#3745)
emilyjablonski Dec 5, 2023
753321f
feat: add show mandated accounts flag (#3773)
cade-exygy Dec 14, 2023
06a320c
feat: add address holder fields to paper application (#3716)
KrissDrawing Dec 18, 2023
eeca33b
feat: add geocoding preference label (#3765)
KrissDrawing Dec 18, 2023
9047c46
fix: add geocoding fields to csv (#3778)
KrissDrawing Dec 21, 2023
305fb5e
fix: update seeds button (#3793)
ColinBuyck Jan 5, 2024
182a764
fix: add translations for geocoding (#3784)
KrissDrawing Jan 8, 2024
cb171ad
fix: provides additional fields info text overflows (#3809)
KrissDrawing Jan 15, 2024
7797bb8
fix: add links to preference description (#3813)
KrissDrawing Jan 16, 2024
bcbb3ec
fix: seeds button layout fixes for Partners Application sidebar (#3789)
jaredcwhite Jan 16, 2024
ce3629b
feat: geocoding preference set up fixed layers (#3808)
KrissDrawing Jan 19, 2024
2628349
fix: test fixes
ludtkemorgan Jan 23, 2024
1309dfa
fix: add map layer geocoding checks (#3825)
ludtkemorgan Jan 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions backend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@anchan828/nest-sendgrid": "^0.3.25",
"@google-cloud/translate": "^6.2.6",
"@google-cloud/translate": "^7.2.1",
"@nestjs/axios": "1.0.1",
"@nestjs/cli": "^9.5.0",
"@nestjs/common": "^9.4.2",
Expand All @@ -52,9 +52,13 @@
"@nestjs/swagger": "^6.3.0",
"@nestjs/throttler": "^4.0.0",
"@nestjs/typeorm": "^9.0.1",
"@turf/buffer": "6.5.0",
"@turf/helpers": "6.5.0",
"@turf/boolean-point-in-polygon": "6.5.0",
"@turf/points-within-polygon": "6.5.0",
"@types/cache-manager": "^3.4.0",
"async-retry": "^1.3.1",
"axios": "0.21.2",
"axios": "0.21.3",
"cache-manager": "^3.4.0",
"casbin": "5.13.0",
"class-transformer": "0.3.1",
Expand All @@ -72,17 +76,17 @@
"nanoid": "^3.1.12",
"nestjs-twilio": "^4.1.1",
"nestjs-typeorm-paginate": "^4.0.3",
"newrelic": "7.5.1",
"newrelic": "11.4.0",
"node-polyglot": "^2.4.0",
"passport": "^0.6.0",
"passport-custom": "^1.1.1",
"passport-jwt": "^4.0.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"pg": "^8.4.1",
"pg": "^8.11.3",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.5.4",
"swagger-ui-express": "^4.1.4",
"swagger-ui-express": "^4.2.0",
"ts-node": "10.8.0",
"twilio": "^3.71.3",
"typeorm": "0.3.12",
Expand Down
2 changes: 2 additions & 0 deletions backend/core/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { PaperApplicationsModule } from "./paper-applications/paper-applications
import { ActivityLogModule } from "./activity-log/activity-log.module"
import { logger } from "./shared/middlewares/logger.middleware"
import { CatchAllFilter } from "./shared/filters/catch-all-filter"
import { MapLayersModule } from "./map-layers/map-layers.module"

export function applicationSetup(app: INestApplication) {
const { httpAdapter } = app.get(HttpAdapterHost)
Expand Down Expand Up @@ -106,6 +107,7 @@ export class AppModule {
UnitTypesModule,
UnitRentTypesModule,
UnitAccessibilityPriorityTypesModule,
MapLayersModule,
],
}
}
Expand Down
6 changes: 4 additions & 2 deletions backend/core/src/applications/applications.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SharedModule } from "../shared/shared.module"
import { ListingsModule } from "../listings/listings.module"
import { Address } from "../shared/entities/address.entity"
import { Applicant } from "./entities/applicant.entity"
import { MapLayer } from "../map-layers/entities/map-layer.entity"
import { ApplicationsSubmissionController } from "./applications-submission.controller"
import { TranslationsModule } from "../translations/translations.module"
import { Listing } from "../listings/entities/listing.entity"
Expand All @@ -16,10 +17,11 @@ import { CsvBuilder } from "./services/csv-builder.service"
import { ApplicationCsvExporterService } from "./services/application-csv-exporter.service"
import { EmailModule } from "../email/email.module"
import { ActivityLogModule } from "../activity-log/activity-log.module"
import { GeocodingService } from "./services/geocoding.service"

@Module({
imports: [
TypeOrmModule.forFeature([Application, Applicant, Address, Listing]),
TypeOrmModule.forFeature([Application, Applicant, Address, Listing, MapLayer]),
AuthModule,
ActivityLogModule,
SharedModule,
Expand All @@ -28,7 +30,7 @@ import { ActivityLogModule } from "../activity-log/activity-log.module"
EmailModule,
ScheduleModule.forRoot(),
],
providers: [ApplicationsService, CsvBuilder, ApplicationCsvExporterService],
providers: [ApplicationsService, CsvBuilder, ApplicationCsvExporterService, GeocodingService],
exports: [ApplicationsService],
controllers: [ApplicationsController, ApplicationsSubmissionController],
})
Expand Down
14 changes: 13 additions & 1 deletion backend/core/src/applications/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dayjs from "dayjs"
import { formatLocalDate } from "../shared/utils/format-local-date"
import { ApplicationSubmissionType } from "../../types"
import { ApplicationSubmissionType, GeocodingValues } from "../../types"
import { isEmpty } from "class-validator"

export const formatApplicationDate = (
Expand All @@ -14,3 +14,15 @@ export const formatApplicationDate = (
}
return dayjs(dateString).format("MM-DD-YYYY hh:mm:ssA")
}

export const formatGeocodingValues = (key: GeocodingValues) => {
switch (key) {
case GeocodingValues.true:
return "Yes"
case GeocodingValues.false:
return "No"
case GeocodingValues.unknown:
default:
return "Needs Manual Verification"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { formatBoolean } from "../../shared/utils/format-boolean"
import { ApplicationMultiselectQuestion } from "../entities/application-multiselect-question.entity"
import { AddressCreateDto } from "../../shared/dto/address.dto"
import { ApplicationReviewStatus } from "../types/application-review-status-enum"
import { formatApplicationDate } from "../helpers"
import { formatApplicationDate, formatGeocodingValues } from "../helpers"
import { GeocodingValues } from "../../shared/types/geocoding-values"

@Injectable({ scope: Scope.REQUEST })
export class ApplicationCsvExporterService {
Expand Down Expand Up @@ -88,20 +89,44 @@ export class ApplicationCsvExporterService {
claimedString = claimedString.concat(`${option.key}, `)
}
if (option.extraData?.length) {
const extraKey = `${root}: ${option.key} - Address`
let extraKey
let extraString = ""
option.extraData.forEach((extra) => {
if (extra.type === "address") {
extraString += `${(extra.value as AddressCreateDto).street}, ${
(extra.value as AddressCreateDto).street2
? `${(extra.value as AddressCreateDto).street2},`
: ""
} ${(extra.value as AddressCreateDto).city}, ${
(extra.value as AddressCreateDto).state
}, ${(extra.value as AddressCreateDto).zipCode}`
}
})
extraData[extraKey] = extraString
const order = [
"address",
"geocodingVerified",
"addressHolderName",
"addressHolderRelationship",
]

option.extraData
.sort((a, b) => order.indexOf(a.key) - order.indexOf(b.key))
.forEach((extra) => {
if (extra.type === "address") {
extraKey = `${root}: ${option.key} - Provided Address`
extraString += `${(extra.value as AddressCreateDto).street}, ${
(extra.value as AddressCreateDto).street2
? `${(extra.value as AddressCreateDto).street2},`
: ""
} ${(extra.value as AddressCreateDto).city}, ${
(extra.value as AddressCreateDto).state
}, ${(extra.value as AddressCreateDto).zipCode}`
}
if (extra.type === "text") {
if (extra.key === "geocodingVerified") {
extraKey = `${root}: ${option.key} - Passed Address Check`
extraString = formatGeocodingValues(extra.value as GeocodingValues)
}
if (extra.key === "addressHolderName") {
extraKey = `${root}: ${option.key} - Name of Address Holder`
extraString = extra.value as string
}
if (extra.key === "addressHolderRelationship") {
extraKey = `${root}: ${option.key} - Relationship to Address Holder`
extraString = extra.value as string
}
}
extraData[extraKey] = extraString
})
}
})
preferenceKeys[root] = 1
Expand Down
11 changes: 11 additions & 0 deletions backend/core/src/applications/services/applications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { Listing } from "../../listings/entities/listing.entity"
import { ApplicationCsvExporterService } from "./application-csv-exporter.service"
import { User } from "../../auth/entities/user.entity"
import { StatusDto } from "../../shared/dto/status.dto"
import { GeocodingService } from "./geocoding.service"

@Injectable({ scope: Scope.REQUEST })
export class ApplicationsService {
Expand All @@ -38,6 +39,7 @@ export class ApplicationsService {
private readonly listingsService: ListingsService,
private readonly emailService: EmailService,
private readonly applicationCsvExporter: ApplicationCsvExporterService,
private readonly geocodingService: GeocodingService,
@InjectRepository(Application) private readonly repository: Repository<Application>,
@InjectRepository(Listing) private readonly listingsRepository: Repository<Listing>
) {}
Expand Down Expand Up @@ -423,6 +425,15 @@ export class ApplicationsService {
if (application.applicant.emailAddress && shouldSendConfirmation) {
await this.emailService.confirmation(listing, application, applicationCreateDto.appUrl)
}

// Calculate geocoding preferences after save and email sent
if (listing.jurisdiction?.enableGeocodingPreferences) {
try {
void this.geocodingService.validateGeocodingPreferences(application, listing)
} catch (e) {
console.warn("error while validating geocoding preferences")
}
}
return application
}

Expand Down
Loading
Loading