forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: emeryville ami chart * fix: update to ami chart name
- Loading branch information
1 parent
764dce1
commit 7059f2c
Showing
3 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
backend/core/scripts/ami-chart-import-files/emeryville-2023.ts
This file contains 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,83 @@ | ||
import { AmiChartCreateDto } from "../../src/ami-charts/dto/ami-chart.dto" | ||
import { BaseEntity } from "typeorm" | ||
// THIS FILE WAS AUTOMATICALLY GENERATED FROM emeryville-2023.txt. | ||
export const ami: Omit<AmiChartCreateDto, keyof BaseEntity | "jurisdiction"> = { | ||
name: "Emeryville 2023", | ||
items: [ | ||
{ | ||
percentOfAmi: 32, | ||
householdSize: 1, | ||
income: 33152, | ||
}, | ||
{ | ||
percentOfAmi: 32, | ||
householdSize: 2, | ||
income: 37888, | ||
}, | ||
{ | ||
percentOfAmi: 32, | ||
householdSize: 3, | ||
income: 42624, | ||
}, | ||
{ | ||
percentOfAmi: 32, | ||
householdSize: 4, | ||
income: 47328, | ||
}, | ||
{ | ||
percentOfAmi: 32, | ||
householdSize: 5, | ||
income: 51136, | ||
}, | ||
{ | ||
percentOfAmi: 37, | ||
householdSize: 1, | ||
income: 38332, | ||
}, | ||
{ | ||
percentOfAmi: 37, | ||
householdSize: 2, | ||
income: 43808, | ||
}, | ||
{ | ||
percentOfAmi: 37, | ||
householdSize: 3, | ||
income: 49284, | ||
}, | ||
{ | ||
percentOfAmi: 37, | ||
householdSize: 4, | ||
income: 54723, | ||
}, | ||
{ | ||
percentOfAmi: 37, | ||
householdSize: 5, | ||
income: 59126, | ||
}, | ||
{ | ||
percentOfAmi: 42, | ||
householdSize: 1, | ||
income: 43512, | ||
}, | ||
{ | ||
percentOfAmi: 42, | ||
householdSize: 2, | ||
income: 49728, | ||
}, | ||
{ | ||
percentOfAmi: 42, | ||
householdSize: 3, | ||
income: 55944, | ||
}, | ||
{ | ||
percentOfAmi: 42, | ||
householdSize: 4, | ||
income: 62118, | ||
}, | ||
{ | ||
percentOfAmi: 42, | ||
householdSize: 5, | ||
income: 67166, | ||
}, | ||
], | ||
} |
3 changes: 3 additions & 0 deletions
3
backend/core/scripts/ami-chart-import-files/emeryville-2023.txt
This file contains 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,3 @@ | ||
32 33152 37888 42624 47328 51136 | ||
37 38332 43808 49284 54723 59126 | ||
42 43512 49728 55944 62118 67166 |
20 changes: 20 additions & 0 deletions
20
backend/core/src/migration/1699486370874-emeryville-2023-ami-chart.ts
This file contains 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,20 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
import { ami } from "../../scripts/ami-chart-import-files/emeryville-2023" | ||
|
||
export class emeryville2023AmiChart1699486370874 implements MigrationInterface { | ||
name = "emeryville2023AmiChart1699486370874" | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
const [{ id: juris }] = await queryRunner.query( | ||
`SELECT id FROM jurisdictions WHERE name = 'Alameda'` | ||
) | ||
|
||
await queryRunner.query(` | ||
INSERT INTO ami_chart | ||
(name, items, jurisdiction_id) | ||
VALUES ('${ami.name}', '${JSON.stringify(ami.items)}', '${juris}') | ||
`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |