Skip to content

Commit 46bc732

Browse files
Merge pull request #21 from bloom-housing/release/2-24-26
feat: release 2-24-26
2 parents abcf71b + 74e2b12 commit 46bc732

File tree

156 files changed

+5203
-1922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+5203
-1922
lines changed

api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
},
3636
"dependencies": {
3737
"@aws-sdk/client-s3": "^3.758.0",
38+
"@aws-sdk/client-sesv2": "^3.758.0",
3839
"@aws-sdk/lib-storage": "^3.758.0",
3940
"@aws-sdk/rds-signer": "^3.758.0",
4041
"@aws-sdk/s3-request-presigner": "^3.750.0",

api/prisma/seed-helpers/address-factory.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const addressFactory =
1717
export const yellowstoneAddress = {
1818
placeName: 'Yellowstone National Park',
1919
city: 'Yellowstone National Park',
20-
county: 'Teton County',
20+
county: 'Teton',
2121
state: 'WY',
2222
street: '3200 Old Faithful Inn Rd',
2323
zipCode: '82190',
@@ -28,7 +28,7 @@ export const yellowstoneAddress = {
2828
export const yosemiteAddress = {
2929
placeName: 'Yosemite National Park',
3030
city: 'Yosemite Valley',
31-
county: 'Mariposa County',
31+
county: 'Mariposa',
3232
state: 'CA',
3333
street: '9035 Village Dr',
3434
zipCode: '95389',
@@ -39,7 +39,7 @@ export const yosemiteAddress = {
3939
export const rockyMountainAddress = {
4040
placeName: 'Rocky Mountain National Park',
4141
city: 'Estes Park',
42-
county: 'Larimer County',
42+
county: 'Larimer',
4343
state: 'CO',
4444
street: '1000 US-36',
4545
zipCode: '80517',
@@ -50,7 +50,7 @@ export const rockyMountainAddress = {
5050
export const moabAddress = {
5151
placeName: 'Arches National Park',
5252
city: 'Moab',
53-
county: 'Grand County',
53+
county: 'Grand',
5454
state: 'UT',
5555
street: '25 E Center St',
5656
zipCode: '84532',
@@ -61,7 +61,7 @@ export const moabAddress = {
6161
export const acadiaAddress = {
6262
placeName: 'Acadia National Park',
6363
city: 'Bar Harbor',
64-
county: 'Hancock County',
64+
county: 'Hancock',
6565
state: 'ME',
6666
street: '25 Visitor Center Rd',
6767
zipCode: '04609',
@@ -72,7 +72,7 @@ export const acadiaAddress = {
7272
export const grandCanyonAddress = {
7373
placeName: 'Grand Canyon National Park',
7474
city: 'Grand Canyon Village',
75-
county: 'Coconino County',
75+
county: 'Coconino',
7676
state: 'AZ',
7777
street: 'S Entrance Rd',
7878
zipCode: '86023',
@@ -83,7 +83,7 @@ export const grandCanyonAddress = {
8383
export const glacierAddress = {
8484
placeName: 'Glacier National Park',
8585
city: 'West Glacier',
86-
county: 'Glacier County',
86+
county: 'Glacier',
8787
state: 'MT',
8888
street: '64 Grinnell Dr',
8989
zipCode: '59936',
@@ -94,7 +94,7 @@ export const glacierAddress = {
9494
export const carlsbadAddress = {
9595
placeName: 'Carlsbad Caverns National Park',
9696
city: 'Carlsbad',
97-
county: 'Eddy County',
97+
county: 'Eddy',
9898
state: 'NM',
9999
street: '727 Carlsbad Cavern Hwy',
100100
zipCode: '88220',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { PrismaClient } from '@prisma/client';
2+
import { randomName } from './word-generator';
3+
4+
export const agencyFactory = async (
5+
jurisdictionId: string,
6+
prismaClient: PrismaClient,
7+
numberToCreate = 3,
8+
jurisdictionName?: string,
9+
) => {
10+
await prismaClient.agency.createMany({
11+
data: [...Array(numberToCreate)].map(() => {
12+
return {
13+
name: `${randomName()}${
14+
jurisdictionName ? ` - ${jurisdictionName}` : ''
15+
}`,
16+
jurisdictionsId: jurisdictionId,
17+
};
18+
}),
19+
});
20+
};

api/prisma/seed-helpers/application-factory.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
YesNoEnum,
88
MultiselectQuestionsApplicationSectionEnum,
99
} from '@prisma/client';
10+
import dayjs from 'dayjs';
11+
import { randomInt } from 'crypto';
1012
import { generateConfirmationCode } from '../../src/utilities/applications-utilities';
1113
import { addressFactory } from './address-factory';
1214
import { randomNoun } from './word-generator';
@@ -56,16 +58,23 @@ export const applicationFactory = async (optionalParams?: {
5658
if (optionalParams?.householdMember) {
5759
householdSize = optionalParams.householdMember.length + 1;
5860
}
61+
const createdAtDate =
62+
optionalParams?.createdAt ||
63+
// Created at date sometime in the last 2 months
64+
dayjs(new Date()).subtract(randomInt(87_600), 'minutes').toDate();
5965
return {
60-
createdAt: optionalParams?.createdAt || new Date(),
66+
createdAt: createdAtDate,
6167
confirmationCode: generateConfirmationCode(),
6268
applicant: { create: applicantFactory(optionalParams?.applicant) },
6369
appUrl: '',
6470
status: ApplicationStatusEnum.submitted,
6571
submissionType:
6672
optionalParams?.submissionType ??
6773
ApplicationSubmissionTypeEnum.electronical,
68-
submissionDate: new Date(),
74+
submissionDate:
75+
optionalParams?.submissionType !== ApplicationSubmissionTypeEnum.paper
76+
? createdAtDate
77+
: dayjs(createdAtDate).add(2, 'days').toDate(),
6978
householdSize: householdSize,
7079
income: '40000',
7180
incomePeriod: randomBoolean()

api/prisma/seed-helpers/listing-data/district-view-apartments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const districtViewApartments: Prisma.ListingsCreateInput = {
7777
waitlistOpenSpots: null,
7878
customMapPin: false,
7979
contentUpdatedAt: new Date(),
80-
publishedAt: new Date(),
80+
publishedAt: dayjs(new Date()).subtract(2, 'months').toDate(),
8181
listingsApplicationPickUpAddress: undefined,
8282
listingsApplicationDropOffAddress: undefined,
8383
listingsApplicationMailingAddress: undefined,

api/prisma/seed-helpers/listing-data/elm-village.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ export const elmVillage: Prisma.ListingsCreateInput = {
8787
waitlistOpenSpots: null,
8888
customMapPin: false,
8989
contentUpdatedAt: new Date(),
90-
publishedAt: new Date(),
90+
publishedAt: dayjs(new Date())
91+
.subtract(1, 'months')
92+
.subtract(3, 'days')
93+
.subtract(12, 'minutes')
94+
.toDate(),
9195
listingsApplicationPickUpAddress: undefined,
9296
listingsApplicationDropOffAddress: undefined,
9397
reservedCommunityTypes: undefined,

api/prisma/seed-helpers/listing-data/hollywood-hills-heights.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ReviewOrderTypeEnum,
66
} from '@prisma/client';
77
import { yellowstoneAddress } from '../address-factory';
8+
import dayjs from 'dayjs';
89

910
export const hollywoodHillsHeights: Prisma.ListingsCreateInput = {
1011
additionalApplicationSubmissionNotes: null,
@@ -75,7 +76,10 @@ export const hollywoodHillsHeights: Prisma.ListingsCreateInput = {
7576
waitlistOpenSpots: null,
7677
customMapPin: false,
7778
contentUpdatedAt: new Date(),
78-
publishedAt: new Date(),
79+
publishedAt: dayjs(new Date())
80+
.subtract(1, 'months')
81+
.subtract(1, 'days')
82+
.toDate(),
7983
listingsBuildingAddress: {
8084
create: yellowstoneAddress,
8185
},

api/prisma/seed-helpers/listing-data/lakeview-villa.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const lakeviewVilla: Prisma.ListingsCreateInput = {
7777
waitlistOpenSpots: null,
7878
customMapPin: false,
7979
contentUpdatedAt: new Date(),
80-
publishedAt: new Date(),
80+
publishedAt: dayjs(new Date()).subtract(22, 'minutes').toDate(),
8181
listingsBuildingAddress: {
8282
create: yellowstoneAddress,
8383
},

api/prisma/seed-helpers/listing-data/little-village-apartments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const littleVillageApartments: Prisma.ListingsCreateInput = {
7373
waitlistOpenSpots: 6,
7474
customMapPin: false,
7575
contentUpdatedAt: new Date(),
76-
publishedAt: new Date(),
76+
publishedAt: dayjs(new Date()).subtract(19, 'seconds').toDate(),
7777
listingsApplicationPickUpAddress: undefined,
7878
listingsApplicationDropOffAddress: undefined,
7979
listingsApplicationMailingAddress: undefined,

api/prisma/seed-helpers/listing-data/sunshine-flats.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const sunshineFlats: Prisma.ListingsCreateInput = {
7575
waitlistOpenSpots: null,
7676
customMapPin: false,
7777
contentUpdatedAt: new Date(),
78-
publishedAt: new Date(),
78+
publishedAt: dayjs(new Date()).subtract(12, 'hours').toDate(),
7979
listingsBuildingAddress: {
8080
create: glacierAddress,
8181
},

0 commit comments

Comments
 (0)