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

HBA Release 04 18 2024 #4029

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
f346ba4
feat: adding new program and preferences
YazeedLoonat Apr 21, 2022
e706b1a
fix: updates per sean
YazeedLoonat Apr 22, 2022
be50f0b
feat: adding new program and preferences
YazeedLoonat Apr 22, 2022
6c7ecfc
fix: updates to migration and translations (#397)
YazeedLoonat Apr 25, 2022
5dc1e87
feat: translation for fremont preference (#404)
YazeedLoonat May 13, 2022
03ee1b3
Merge pull request #411 from housingbayarea/dev
YazeedLoonat May 13, 2022
558242d
Merge pull request #413 from housingbayarea/main
YazeedLoonat May 16, 2022
06ec688
Merge pull request #414 from bloom-housing/master
YazeedLoonat May 16, 2022
99499a1
feat: creating Emeryville preference (#416)
YazeedLoonat May 17, 2022
7a8ad87
Delete pre-release_components.yml
seanmalbert May 17, 2022
c0e579a
Delete pre-release_components.yml
seanmalbert May 17, 2022
bd2ddc8
Merge pull request #417 from housingbayarea/2022-05-17-release
seanmalbert May 17, 2022
1f8aff2
fix: alamedaProgramsAndPreferences migration
seanmalbert May 17, 2022
677affa
Merge remote-tracking branch 'remotes/hba/dev' into hba/main
seanmalbert May 17, 2022
3beb6b7
2022-05-24 release (#2753)
seanmalbert May 24, 2022
fdee7be
chore(release): version
seanmalbert May 24, 2022
a2117c5
Merge remote-tracking branch 'remotes/upstream/master' into hba/dev
seanmalbert May 24, 2022
cd02be3
perf: user list and user getQb (#2756)
seanmalbert May 25, 2022
9c144d5
perf: user list and user getQb (#2756)
seanmalbert May 25, 2022
72ac42f
Merge remote-tracking branch 'remotes/upstream/master' into hba/dev
seanmalbert May 25, 2022
e300d8d
chore: merge dev
seanmalbert May 25, 2022
ee2d81b
style: ts error
seanmalbert May 25, 2022
614898e
fix: public listings order (#2758)
seanmalbert May 25, 2022
e4a5d77
Merge pull request #425 from housingbayarea/2022-05-25-release
seanmalbert May 25, 2022
d4629ef
fix: selectAndOrder drag and drop (#2765)
seanmalbert May 26, 2022
4d6389f
feat: creating new ami charts & script
YazeedLoonat Jun 7, 2022
8c0284f
Merge pull request #443 from housingbayarea/427/2022-tcac-hud-ami-charts
seanmalbert Jun 10, 2022
8654421
feat: creating san mateo ami charts
YazeedLoonat Jun 14, 2022
4746779
Merge pull request #444 from housingbayarea/430/smc-ami-updates
seanmalbert Jun 16, 2022
1abd991
2022-06-16 release (#2824)
seanmalbert Jun 16, 2022
6af4743
chore(release): version
seanmalbert Jun 16, 2022
d80f453
fix: bad merge for search param
seanmalbert Jun 16, 2022
16b8507
Merge remote-tracking branch 'remotes/upstream/master' into 2022-06-1…
seanmalbert Jun 16, 2022
3b4b8e9
Merge pull request #445 from housingbayarea/2022-06-16-sync-core
seanmalbert Jun 16, 2022
1b7a354
fix: entity def test
seanmalbert Jun 16, 2022
74fd323
fix: undo test ormconfig test
seanmalbert Jun 16, 2022
4f033f8
build: test forwardref auth module
seanmalbert Jun 17, 2022
68b51ea
build: test forwardref auth module
seanmalbert Jun 17, 2022
0970ebe
Revert "fix: bad merge for search param"
seanmalbert Jun 17, 2022
35c2d1b
Revert "chore(release): version"
seanmalbert Jun 17, 2022
cf28736
Revert "2022-06-16 release (#2824)"
seanmalbert Jun 17, 2022
02f4540
chore: re-merge dev
seanmalbert Jun 17, 2022
660e791
chore: merge 17dabfeaf77afb55d629f97fe8e90001df94dc04
seanmalbert Jun 17, 2022
496c01a
build: start in debug
seanmalbert Jun 17, 2022
6632bfb
build: sets patch version for @nestjs/typeorm
seanmalbert Jun 17, 2022
823a802
Merge remote-tracking branch 'remotes/upstream/master' into hba/dev
seanmalbert Jun 17, 2022
7c694a1
Merge branch 'hba/dev' into hba/main
seanmalbert Jun 17, 2022
8510548
build: removes debug from start
seanmalbert Jun 17, 2022
37d9d54
Merge remote-tracking branch 'remotes/upstream/master' into hba/dev
seanmalbert Jun 17, 2022
ca64243
Merge remote-tracking branch 'remotes/hba/dev' into hba/main
seanmalbert Jun 17, 2022
58eae16
feat: exposing raw many applications endpoint
YazeedLoonat Jun 21, 2022
f02e8ef
Merge pull request #447 from housingbayarea/1509/raw-many-applicaiton…
seanmalbert Jun 22, 2022
ca25816
fix: mfa verificication fields (#2842)
seanmalbert Jun 23, 2022
af8d3df
2022-07-26 release (#2916)
seanmalbert Jul 27, 2022
0f25822
chore(release): version
seanmalbert Jul 27, 2022
39b9f89
chore: merge core master
seanmalbert Jul 27, 2022
88a8245
Merge remote-tracking branch 'remotes/hba/dev' into hba/main
seanmalbert Jul 27, 2022
9a8bb21
feat: new hopwa program (#455)
emilyjablonski Jul 27, 2022
1b8ceeb
Merge remote-tracking branch 'remotes/hba/dev' into hba/main
seanmalbert Jul 27, 2022
752a80e
fix: invite migration file
seanmalbert Jul 27, 2022
783b574
fix: another translation migration
seanmalbert Jul 28, 2022
f266818
fix: another translation migration
seanmalbert Jul 28, 2022
f63508b
fix: fix for big timeout on flagged set (#2946) (#460)
YazeedLoonat Aug 12, 2022
76eb93c
feat: adds new san jose ami charts (#463)
seanmalbert Aug 25, 2022
5a1bd8f
chore: merge core master (#465)
ludtkemorgan Aug 25, 2022
a1db933
Merge pull request #466 from housingbayarea/dev
ludtkemorgan Aug 25, 2022
fad89d9
fix: migration for application export clean up (#3036)
YazeedLoonat Sep 9, 2022
3ecd6ae
fix: migration for application export clean up
YazeedLoonat Sep 9, 2022
3af2901
fix: migration for application export clean up
YazeedLoonat Sep 9, 2022
5323892
fix(application): remove programs from autofill (#3021) (#471)
ludtkemorgan Sep 9, 2022
5bb49ee
chore: 2022-09-11 release
ludtkemorgan Sep 12, 2022
f42878a
Merge pull request #476 from housingbayarea/2022-09-11
ludtkemorgan Sep 13, 2022
88ec7c0
fix: updated css class naming (#483)
ColinBuyck Sep 14, 2022
b9f791f
chore: update codeql to accommodate main branch
ludtkemorgan Sep 14, 2022
e8de494
Merge pull request #478 from housingbayarea/dev
ludtkemorgan Sep 14, 2022
48e03f4
fix: disable applicationFlaggedSets call and add banner (#496)
ludtkemorgan Sep 23, 2022
bc8e788
chore: 2022-09-29 release (#500)
ludtkemorgan Sep 29, 2022
e8c9f11
chore: 2022-10-06 release (#504) (#505)
ludtkemorgan Oct 6, 2022
f9c2a13
fix: remove lottery date from confirmation email (#506) (#507)
ludtkemorgan Oct 7, 2022
437dabe
feat: backend changes for what to expect changes (#508) (#513)
ludtkemorgan Oct 18, 2022
8d30b4e
feat: toggle what to expect field based on listing type unless custom…
ludtkemorgan Oct 19, 2022
65075e2
feat: release 2022-10-25 (#528) (#529)
ludtkemorgan Oct 27, 2022
4944c2a
fix: migration to fix multiselect translation bug (#523)
YazeedLoonat Nov 1, 2022
7ecf9dc
fix: migration to fix multiselect translation bug
YazeedLoonat Nov 2, 2022
eb34a09
fix: multiselect question x translation issue (#537)
YazeedLoonat Nov 11, 2022
efcfd0b
fix: remove the queue for afs processing on listing close (#536)
ludtkemorgan Nov 11, 2022
1ae3bf2
fix: resolves application search crashes (#541)
YazeedLoonat Nov 15, 2022
f5c3ce5
feat: release 2022-11-17 (#543)
ludtkemorgan Nov 18, 2022
627cc30
fix: add new translation to migration and fix comma in export (#545) …
ludtkemorgan Nov 21, 2022
19e9b80
fix: migration update (#553)
YazeedLoonat Nov 21, 2022
a55f32b
fix: unit query separated from listing query (#550)
YazeedLoonat Nov 21, 2022
b1ece89
feat: adding UUID validation (#3172) (#552)
YazeedLoonat Nov 21, 2022
3a6ddb2
fix: cypress tests working again (#3180)
YazeedLoonat Nov 22, 2022
f07e87f
feat: move jurisdiction specific features to main (#521)
ludtkemorgan Nov 11, 2022
fc27b77
feat: add alameda what to expect overrides (#546)
ludtkemorgan Nov 17, 2022
fd928a6
fix: updates to a san jose resource card (#540)
emilyjablonski Nov 30, 2022
8b1ef66
Revert "fix: cypress tests working again (#3180)"
ludtkemorgan Nov 30, 2022
9c09a88
chore: add SMC What to Expect translations
jaredcwhite Nov 24, 2022
c190aaf
Merge pull request #560 from housingbayarea/489/smc-wte-translations-…
jaredcwhite Dec 5, 2022
a8132b1
feat: add what to expect translations for san-jose (#564)
ludtkemorgan Dec 6, 2022
924a67e
fix: public site user confirmation issue (#561)
YazeedLoonat Dec 16, 2022
9ead87c
chore: update the terms text (#563)
jaredcwhite Dec 19, 2022
2855952
fix: support tagalog jurisdiction translations (#567)
jaredcwhite Dec 19, 2022
f4fe221
3197/missing translations (#572)
ColinBuyck Dec 19, 2022
9edb21d
feat: release 2022-12-19 (#571)
ludtkemorgan Dec 19, 2022
ea1b5ca
fix: GA4 tracking script (#565)
ColinBuyck Dec 21, 2022
cbb4ca0
feat: add 5 bedroom option (#3230) (#576)
ludtkemorgan Dec 23, 2022
d9810f9
578/missing translations (#579)
ColinBuyck Jan 19, 2023
8eebcfb
feat: add call 211 to resource card (#580)
KrissDrawing Jan 20, 2023
bfdb61e
feat: release 2022-1-18
emilyjablonski Jan 20, 2023
d5eaab9
feat: translations update from core (#583)
emilyjablonski Jan 30, 2023
6db9c08
Release: 2022 01 31 (#589)
ludtkemorgan Feb 1, 2023
267a132
fix: update markdown files for formatting fixing (#590)
ludtkemorgan Feb 7, 2023
1f1dbb2
fix: spanish fixes for san mateo and alameda
ludtkemorgan Feb 8, 2023
149508b
fix: update smc housing search link
ludtkemorgan Feb 8, 2023
9cffed5
feat: release 2023-02-28 (#594)
ludtkemorgan Feb 28, 2023
4d96c63
fix: add feedback link in alameda (#593)
emilyjablonski Mar 1, 2023
16a01ee
fix: add SMC missing translations (#587)
KrissDrawing Mar 1, 2023
fc3c272
fix: update email address (#597)
ColinBuyck Mar 6, 2023
0e1ee1c
fix: alameda missing translations (#596)
KrissDrawing Mar 8, 2023
683c31a
fix: SMC content updates to the resources page (#598)
KrissDrawing Mar 14, 2023
424c8fd
feat: release 2023-03-27 (#604)
ludtkemorgan Apr 3, 2023
ab05126
fix: program/preference keys length uncap (#3376) (#607)
YazeedLoonat Apr 3, 2023
68a58a4
fix: remove max length from extra data app fields (#3394) (#609)
emilyjablonski Apr 13, 2023
0c99878
fix: frontend validation for char max (#3413) (#611)
ludtkemorgan Apr 25, 2023
f054a4e
fix: remove application due date question (#613)
KrissDrawing May 9, 2023
504d260
feat: release 2023-05-02 (#612)
ludtkemorgan May 18, 2023
fd75af0
fix: add listing id to bad request (#614)
ludtkemorgan May 22, 2023
4f438ad
Release/2023 05 30 (#616)
ludtkemorgan Jun 2, 2023
f56fdad
fix: comment out income validation and change to text field (#620)
emilyjablonski Jun 5, 2023
dfe0ee2
fix: update resources (#617)
KrissDrawing Jun 14, 2023
da969b8
Release: 2023-06-13 (#622)
ludtkemorgan Jun 14, 2023
728512d
fix: get correct time period for submitted (#623)
ludtkemorgan Jun 16, 2023
18ed358
619/redirect to doorway (#621)
ColinBuyck Jun 20, 2023
e56dc6f
feat: add doorway link to footer (#624)
KrissDrawing Jun 23, 2023
edc7681
fix: add check in afs for null email (#625)
ludtkemorgan Jun 26, 2023
3f8080e
Release/2023 06 26 (#626)
ludtkemorgan Jun 27, 2023
7c58b9f
fix: update links for housing choices resource card (#627)
KrissDrawing Jun 28, 2023
da5c55b
Release: 2023-06-28 (#628)
ludtkemorgan Jun 29, 2023
60e1d3e
fix: cherry pick from core (#629)
ColinBuyck Jul 7, 2023
150c970
fix: add signup link to smc (#631)
ludtkemorgan Jul 12, 2023
7f73194
fix: 07-14-2023 hot fixes (#633)
YazeedLoonat Jul 17, 2023
7704678
fix: add county to all create/update listing (#634)
ludtkemorgan Jul 25, 2023
2d1d931
Release: 2023-07-31 (#635)
ludtkemorgan Aug 1, 2023
35af402
feat: (re)adding sentry to public site (#3571) (#636)
ludtkemorgan Aug 7, 2023
409e569
fix: allow sms mfa to be toggled on and off (#637)
ludtkemorgan Aug 15, 2023
f6271e2
Release: 2023-08-16 (#638)
ludtkemorgan Aug 18, 2023
a54bead
feat: creating new SMC ami charts (#640)
YazeedLoonat Aug 31, 2023
6c2a0b9
feat: oakland ami (#642)
YazeedLoonat Sep 1, 2023
f634ef3
fix: remove SMC housing search resource card (#641)
KrissDrawing Sep 4, 2023
b66af87
Release: 2023-09-05 (#643)
ludtkemorgan Sep 6, 2023
68c0d54
Release/2023 09 21 (#644)
emilyjablonski Sep 28, 2023
88f5629
Release: 2023-10-10 (#645)
ludtkemorgan Oct 12, 2023
ae32a00
fix: add target (#647)
ColinBuyck Oct 12, 2023
e2e3e7b
fix: disable income validation (#646)
ludtkemorgan Oct 12, 2023
f2b899f
fix: add migration to add listing approval permissions (#648)
ludtkemorgan Oct 24, 2023
c9004fb
Release/2023 10 24 (#649)
ColinBuyck Oct 27, 2023
764dce1
fix: listingName, approval email from listingJuris (#3700) (#650)
YazeedLoonat Nov 3, 2023
7059f2c
feat: emeryville ami chart (#651)
YazeedLoonat Nov 15, 2023
456aa9a
Release: 2023-11-20 (#652)
ludtkemorgan Nov 27, 2023
6b07c09
feat: throwing error so verify is caught by sentry (#653)
YazeedLoonat Nov 28, 2023
048c593
fix: verify application errors (#654)
emilyjablonski Dec 4, 2023
64b34d4
fix: readding minimum monthly income verbiage (#655)
YazeedLoonat Dec 16, 2023
70afb70
fix: updated application checks (#656)
ColinBuyck Jan 4, 2024
6b7f7ac
Release/2024 01 17 (#657)
YazeedLoonat Jan 19, 2024
65d949d
Release: 2024-01-23 (#658)
ludtkemorgan Jan 25, 2024
8ca5e06
Release/2024 01 26 (#659)
ludtkemorgan Jan 30, 2024
75be9eb
fix: foreign language in export (#660)
emilyjablonski Feb 6, 2024
7e268c7
Release/2024 02 06 (#661)
emilyjablonski Feb 8, 2024
976bc02
fix: untranslate non-english preferences in db (#662)
ludtkemorgan Feb 12, 2024
dcb7a8a
fix: second script to cleanup last applications (#663)
ludtkemorgan Feb 14, 2024
c2df06b
Merge remote-tracking branch 'core/main'
ludtkemorgan Feb 17, 2024
aa6a627
fix: update seeding to have HBA jurisdictions
ludtkemorgan Feb 19, 2024
bac5f17
fix: change the address in cypress test
ludtkemorgan Feb 20, 2024
fcca33e
Merge remote-tracking branch 'core/main' into main
ludtkemorgan Feb 21, 2024
10490d7
fix: update link on smc resource card (#665)
emilyjablonski Feb 22, 2024
ce9752b
feat: creating external listing "stub" for doorway usage (#666)
YazeedLoonat Feb 22, 2024
ea90147
fix: limit the characters for name on user (#667)
ludtkemorgan Feb 28, 2024
652f5a1
feat: limit user names allowed (#668)
YazeedLoonat Feb 28, 2024
61a6b7f
fix: fixes password out of date error messaging (#669)
YazeedLoonat Feb 28, 2024
c53e50a
fix: public site fix take 2 (#670)
YazeedLoonat Feb 28, 2024
08257df
feat: new endpoint, forgot pwd fix (#671)
YazeedLoonat Feb 28, 2024
e2962a1
fix: add all of the jurisdiction data to external (#672)
ludtkemorgan Feb 28, 2024
323a5c7
fix: add security around application list (#674)
ludtkemorgan Mar 4, 2024
8fb523c
fix: user update/create fixes (#3932) (#676)
YazeedLoonat Mar 7, 2024
1bb4242
fix: shared helpers loading tailwind (#675)
ColinBuyck Mar 8, 2024
f878970
fix: add doorwayUrl back to next config (#673)
ColinBuyck Mar 8, 2024
7e5d969
Release 03-14-2024 (#678)
YazeedLoonat Mar 15, 2024
1015320
fix: afs needs to be paginating (#3955) (#679)
YazeedLoonat Mar 15, 2024
2647aa1
fix: Application perm hotfix (#680)
YazeedLoonat Mar 15, 2024
5a597aa
Merge remote-tracking branch 'origin/main' into HEAD
YazeedLoonat Mar 25, 2024
e73aa2c
fix: removing dupes
YazeedLoonat Mar 25, 2024
737721b
Merge remote-tracking branch 'origin/main' into hba-release-03-25-2024
YazeedLoonat Mar 25, 2024
4edb185
Merge pull request #682 from housingbayarea/hba-release-03-25-2024
YazeedLoonat Mar 26, 2024
bf51b1e
fix: haca banner (#684)
ColinBuyck Apr 1, 2024
c6586fc
Merge remote-tracking branch 'origin/main' into HEAD
YazeedLoonat Apr 2, 2024
f637653
Merge pull request #685 from housingbayarea/release-04-02-2024
YazeedLoonat Apr 2, 2024
a18c495
fix: correct link typo (#687)
ColinBuyck Apr 8, 2024
e07b215
fix: account for multiselect type mismatch (#686)
ColinBuyck Apr 16, 2024
c3daa80
Merge remote-tracking branch 'core/main' into hba-release-04-18-2024
mcgarrye Apr 18, 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
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ executors:
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom
JURISDICTION_NAME: Bloomington
JURISDICTION_NAME: Alameda
environment:
PORT: "3100"
EMAIL_API_KEY: "SG.SOME-LONG-SECRET-KEY"
Expand All @@ -23,7 +23,7 @@ executors:
# DB URL for the jest tests per ormconfig.test.ts
TEST_DATABASE_URL: "postgres://bloom-ci@localhost:5432/bloom"
PARTNERS_PORTAL_URL: "http://localhost:3001"
JURISDICTION_NAME: Bloomington
JURISDICTION_NAME: Alameda
standard-node:
docker:
- image: "cimg/node:18.14.2"
Expand All @@ -33,7 +33,7 @@ executors:
# Never do this in production or with any sensitive / non-test data:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: bloom_prisma
JURISDICTION_NAME: Bloomington
JURISDICTION_NAME: Alameda

jobs:
setup:
Expand Down Expand Up @@ -221,4 +221,4 @@ workflows:
- cypress-partners:
requires:
- setup
- setup-backend
- setup-backend
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ dev, master ]
branches: [ dev, main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ dev ]
branches: [ dev, main ]
schedule:
- cron: '40 8 * * 5'

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/*.hbs
**/*.md
.github
ui-components/CHANGELOG.md
sites/public/CHANGELOG.md
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ These steps allow for two development patterns. You can edit ui-components withi
Bloom will now be consuming the published version of @bloom-housing/ui-components specified in package.json and no local ui-component changes will be reflected.


### Bloom's UI-Component Development
- Because Bloom's ui-components package is a separate open source repository, developing within both repos locally requires linking the folders with the following steps:
### Directory Setup
1. Clone both Bloom and the [ui-components repository](https://github.com/bloom-housing/ui-components) on the same directory level.
### Symlinking UI-C
1. In the Bloom directory, run `yarn link:uic`.
2. Open the next.config.js file in the public and partner's directory.
3. Uncomment the experimental property at the bottom of each file.
4. Follow the directions above to run Bloom locally.
These steps allow for two development patterns. You can edit ui-components within the node_modules of Bloom and the changes will be reflected in your local version of ui-components. Alternatively, you can edit the local version of ui-components and the changes will be reflected in the node_modules in Bloom. Both patterns will display up-to-date changes on the local server.

### Unlinking UI-C
1. In the Bloom directory, run `yarn unlink:uic`.
2. Open the next.config.js file in the public and partner's directory.
3. Comment out the experimental property at the bottom of each file.
4. Follow the directions above to run Bloom locally.
Bloom will now be consuming the published version of @bloom-housing/ui-components specified in package.json and no local ui-component changes will be reflected.


## Contributing

Contributions to the core Bloom applications and services are welcomed. To help us meet the project's goals around quality and maintainability, we ask that all contributors read, understand, and agree to our guidelines.
Expand Down
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"db:migration:run": "yarn prisma migrate deploy",
"db:seed:production": "npx prisma db seed -- --environment production",
"db:seed:staging": "npx prisma db seed -- --environment staging",
"db:seed:development": "npx prisma db seed -- --environment development --jurisdictionName Bloomington",
"db:seed:development": "npx prisma db seed -- --environment development --jurisdictionName Alameda",
"generate:client": "ts-node scripts/generate-axios-client.ts && prettier -w ../shared-helpers/src/types/backend-swagger.ts",
"test:e2e": "yarn db:resetup && yarn db:migration:run && jest --config ./test/jest-e2e.config.js",
"db:setup": "yarn db:resetup && yarn db:migration:run && yarn db:seed:development",
"db:setup:staging": "yarn db:resetup && yarn db:migration:run && yarn db:seed:staging --jurisdictionName Bloomington",
"db:setup:staging": "yarn db:resetup && yarn db:migration:run && yarn db:seed:staging --jurisdictionName Alameda",
"setup": "yarn install && yarn prisma generate && yarn build && yarn db:setup:staging",
"db:migration:skip": "yarn prisma migrate resolve --applied ",
"setup:dev": "yarn install && yarn prisma generate && yarn build && yarn db:setup"
Expand Down
7 changes: 5 additions & 2 deletions api/prisma/seed-staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ export const stagingSeed = async (
const jurisdiction = await prismaClient.jurisdictions.create({
data: jurisdictionFactory(jurisdictionName, [UserRoleEnum.admin]),
});
// add another jurisdiction
// add additional jurisdictions
const additionalJurisdiction = await prismaClient.jurisdictions.create({
data: jurisdictionFactory(randomNoun()),
data: jurisdictionFactory('San Mateo'),
});
await prismaClient.jurisdictions.create({
data: jurisdictionFactory('San Jose'),
});
// create admin user
await prismaClient.userAccounts.create({
Expand Down
13 changes: 13 additions & 0 deletions api/src/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ export class AuthController {
return await this.authService.requestMfaCode(dto);
}

@Post('request-single-use-code')
@ApiOperation({
summary: 'Request single use code',
operationId: 'requestSingleUseCode',
})
@ApiOkResponse({ type: SuccessDTO })
async requestSingleUseCode(
@Request() req: ExpressRequest,
@Body() dto: RequestSingleUseCode,
): Promise<SuccessDTO> {
return await this.authService.requestSingleUseCode(dto, req);
}

@Get('requestNewToken')
@ApiOperation({
summary: 'Requests a new token given a refresh token',
Expand Down
74 changes: 73 additions & 1 deletion api/src/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
NotFoundException,
UnauthorizedException,
} from '@nestjs/common';
import { CookieOptions, Response } from 'express';
import { CookieOptions, Request, Response } from 'express';
import { sign, verify } from 'jsonwebtoken';
import { Prisma } from '@prisma/client';
import { UpdatePassword } from '../dtos/auth/update-password.dto';
Expand All @@ -22,6 +22,8 @@ import { generateSingleUseCode } from '../utilities/generate-single-use-code';
import { Confirm } from '../dtos/auth/confirm.dto';
import { SmsService } from './sms.service';
import { EmailService } from './email.service';
import { RequestSingleUseCode } from '../dtos/single-use-code/request-single-use-code.dto';
import { OrderByEnum } from '../enums/shared/order-by-enum';

// since our local env doesn't have an https cert we can't be secure. Hosted envs should be secure
const secure = process.env.NODE_ENV !== 'development';
Expand Down Expand Up @@ -244,6 +246,76 @@ export class AuthService {
};
}

/**
*
* @param dto the incoming request with the email
* @returns a SuccessDTO always, and if the user exists it will send a code to the requester
*/
async requestSingleUseCode(
dto: RequestSingleUseCode,
req: Request,
): Promise<SuccessDTO> {
const user = await this.prisma.userAccounts.findFirst({
where: { email: dto.email },
include: {
jurisdictions: true,
},
});
if (!user) {
return { success: true };
}

const jurisName = req?.headers?.jurisdictionname;
if (!jurisName) {
throw new BadRequestException(
'jurisdictionname is missing from the request headers',
);
}

const juris = await this.prisma.jurisdictions.findFirst({
select: {
id: true,
allowSingleUseCodeLogin: true,
},
where: {
name: jurisName as string,
},
orderBy: {
allowSingleUseCodeLogin: OrderByEnum.DESC,
},
});

if (!juris) {
throw new BadRequestException(
`Jurisidiction ${jurisName} does not exists`,
);
}

if (!juris.allowSingleUseCodeLogin) {
throw new BadRequestException(
`Single use code login is not setup for ${jurisName}`,
);
}

const singleUseCode = generateSingleUseCode();
await this.prisma.userAccounts.update({
data: {
singleUseCode,
singleUseCodeUpdatedAt: new Date(),
},
where: {
id: user.id,
},
});

await this.emailsService.sendSingleUseCode(
mapTo(User, user),
singleUseCode,
);

return { success: true };
}

/*
updates a user's password and logs them in
*/
Expand Down
2 changes: 1 addition & 1 deletion api/src/services/sendgrid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class SendGridService {
private readonly mailService: MailService,
private readonly configService: ConfigService,
) {
this.mailService.setApiKey(configService.get<string>('EMAIL_API_KEY'));
this.mailService.setApiKey(this.configService.get<string>('EMAIL_API_KEY'));
}

public async send(
Expand Down
3 changes: 0 additions & 3 deletions api/test/integration/auth.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
TOKEN_COOKIE_NAME,
} from '../../src/services/auth.service';
import { SmsService } from '../../src/services/sms.service';
import { EmailService } from '../../src/services/email.service';
import { RequestMfaCode } from '../../src/dtos/mfa/request-mfa-code.dto';
import { UpdatePassword } from '../../src/dtos/auth/update-password.dto';
import { Confirm } from '../../src/dtos/auth/confirm.dto';
Expand All @@ -24,7 +23,6 @@ describe('Auth Controller Tests', () => {
let app: INestApplication;
let prisma: PrismaService;
let smsService: SmsService;
let emailService: EmailService;

beforeAll(async () => {
const moduleFixture: TestingModule = await Test.createTestingModule({
Expand All @@ -35,7 +33,6 @@ describe('Auth Controller Tests', () => {
app.use(cookieParser());
prisma = moduleFixture.get<PrismaService>(PrismaService);
smsService = moduleFixture.get<SmsService>(SmsService);
emailService = moduleFixture.get<EmailService>(EmailService);
await app.init();
});

Expand Down
Loading
Loading