-
Notifications
You must be signed in to change notification settings - Fork 0
Pris 137 #179
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
Merged
Merged
Pris 137 #179
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2a07a96
Notification be refactor (#157)
jacktoncelli 4747c0a
basic Impl
josh-torre 86c5d32
Merge branch 'main' into pris-137
josh-torre 8733d86
cleanup
josh-torre dd5e2d1
Merge branch 'main' into pris-137
josh-torre ed2e49b
Cleanup types
josh-torre 6503915
Fix lint?
josh-torre 5343787
fix lint? pt 2 the electric boogaloo
josh-torre e8f111d
One who thinks all the time, has only thoughts
josh-torre 6ee02e1
remove file
josh-torre b6b6550
Remove file pt 2 the electric boogaloo
josh-torre 8a84dfb
Merge remote-tracking branch 'origin/main' into pris-137
ZainabImadulla 8e6cbd7
Apply requested changes and improve cron structure
josh-torre 323395a
Merge branch 'pris-137' of github.com:GenerateNU/prisere into pris-137
josh-torre b2f8a5b
Merged with main
josh-torre ffbdc09
fix lint :(
josh-torre 8aaf3af
took out featurethon
ZainabImadulla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { Entity, Column, CreateDateColumn, UpdateDateColumn, PrimaryColumn } from "typeorm"; | ||
|
|
||
| @Entity("county_fema_risk_data") | ||
| export class CountyFemaRisk { | ||
| //Column title STCOFIPS | ||
| @PrimaryColumn({ length: 5, unique: true }) | ||
| countyFipsCode!: string; | ||
|
|
||
| //Column title RISK_RATNG | ||
| @Column({ length: 20 }) | ||
| riskRating!: string; | ||
|
|
||
| //EAL_RATING | ||
| @Column({ length: 20 }) | ||
| ealRating!: string; | ||
|
|
||
| //Column title SOVI_RATNG | ||
| @Column({ length: 20 }) | ||
| socialVuln!: string; | ||
|
|
||
| //Column title RESL_RATNG | ||
| @Column({ length: 20 }) | ||
| communityResilience!: string; | ||
|
|
||
| //Column title CFLD_RISKR | ||
| @Column({ length: 20 }) | ||
| coastalFlooding!: string; | ||
|
|
||
| //Column title DRGT_RISKR | ||
| @Column({ length: 20 }) | ||
| drought!: string; | ||
|
|
||
| //Column title WFIR_RISKR | ||
| @Column({ length: 20 }) | ||
| wildFire!: string; | ||
|
|
||
| @CreateDateColumn() | ||
| createdAt!: Date; | ||
|
|
||
| @UpdateDateColumn() | ||
| updatedAt!: Date; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
backend/src/migrations/1763616684714-add-fema-risk-index-data.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
|
||
| export class AddFemaRiskIndexData1763616684714 implements MigrationInterface { | ||
| name = "AddFemaRiskIndexData1763616684714"; | ||
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query( | ||
| `CREATE TABLE "county_fema_risk_data" ("countyFipsCode" character varying(5) NOT NULL, "riskRating" character varying(20) NOT NULL, "ealRating" character varying(20) NOT NULL, "socialVuln" character varying(20) NOT NULL, "communityResilience" character varying(20) NOT NULL, "coastalFlooding" character varying(20) NOT NULL, "drought" character varying(20) NOT NULL, "wildFire" character varying(20) NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_448aaa477ad2d846fa079d6dd9c" PRIMARY KEY ("countyFipsCode"))` | ||
| ); | ||
| } | ||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`DROP TABLE "county_fema_risk_data"`); | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
backend/src/migrations/1763709019323-add-location-lat-long.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
|
||
| export class AddLocationLatLong1763709019323 implements MigrationInterface { | ||
| name = 'AddLocationLatLong1763709019323' | ||
|
|
||
| public async up(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`ALTER TABLE "location_address" ADD "lat" double precision NOT NULL DEFAULT '0'`); | ||
| await queryRunner.query(`ALTER TABLE "location_address" ADD "long" double precision NOT NULL DEFAULT '0'`); | ||
| } | ||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.query(`ALTER TABLE "location_address" DROP COLUMN "long"`); | ||
| await queryRunner.query(`ALTER TABLE "location_address" DROP COLUMN "lat"`); | ||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { Context, TypedResponse } from "hono"; | ||
| import { withControllerErrorHandling } from "../../utilities/error"; | ||
| import { IFemaRiskIndexService } from "./service"; | ||
| import { FemaRiskIndexDataResult } from "./types"; | ||
|
|
||
| export interface IFemaRiskIndex { | ||
| updateFemaRiskIndexData(ctx: Context): Promise<TypedResponse<number, 200> | Response>; | ||
| getFemaRiskIndexData(ctx: Context): Promise<TypedResponse<FemaRiskIndexDataResult, 200> | Response>; | ||
| } | ||
|
|
||
| export class FemaRiskIndexController implements IFemaRiskIndex { | ||
| private femaRiskIndexService: IFemaRiskIndexService; | ||
|
|
||
| constructor(service: IFemaRiskIndexService) { | ||
| this.femaRiskIndexService = service; | ||
| } | ||
|
|
||
| updateFemaRiskIndexData = withControllerErrorHandling(async (ctx: Context): Promise<TypedResponse<number, 200>> => { | ||
| await this.femaRiskIndexService.updateFemaRiskIndexData(); | ||
| return ctx.json(1, 200); | ||
| }); | ||
|
|
||
| getFemaRiskIndexData = withControllerErrorHandling( | ||
| async (ctx: Context): Promise<TypedResponse<FemaRiskIndexDataResult, 200>> => { | ||
| const result = await this.femaRiskIndexService.getFemaRiskIndexData(); | ||
| return ctx.json(result, 200); | ||
| } | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { DataSource } from "typeorm"; | ||
| import { Hono } from "hono"; | ||
| import { FemaRiskIndexController } from "./controller"; | ||
| import { FemaRiskIndexService } from "./service"; | ||
| import { FemaRiskTransaction } from "./transaction"; | ||
|
|
||
| export const femaRiskIndexProcessing = (db: DataSource): Hono => { | ||
| const femaRiskIndex = new Hono(); | ||
|
|
||
| const transaction = new FemaRiskTransaction(db); | ||
| const service = new FemaRiskIndexService(transaction); | ||
| const controller = new FemaRiskIndexController(service); | ||
|
|
||
| femaRiskIndex.post("/", (ctx) => controller.updateFemaRiskIndexData(ctx)); | ||
| femaRiskIndex.get("/", (ctx) => controller.getFemaRiskIndexData(ctx)); | ||
|
|
||
| return femaRiskIndex; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.