diff --git a/backend/core/scripts/ami-chart-import-files/oakland-2023.ts b/backend/core/scripts/ami-chart-import-files/oakland-2023.ts new file mode 100644 index 0000000000..157032caa6 --- /dev/null +++ b/backend/core/scripts/ami-chart-import-files/oakland-2023.ts @@ -0,0 +1,488 @@ +import { AmiChartCreateDto } from "../../src/ami-charts/dto/ami-chart.dto" +import { BaseEntity } from "typeorm" +// THIS FILE WAS AUTOMATICALLY GENERATED FROM oakland-2023.txt. +export const ami: Omit = { + name: "Oakland 2023", + items: [ + { + percentOfAmi: 20, + householdSize: 1, + income: 20700, + }, + { + percentOfAmi: 20, + householdSize: 2, + income: 23666, + }, + { + percentOfAmi: 20, + householdSize: 3, + income: 26633, + }, + { + percentOfAmi: 20, + householdSize: 4, + income: 29566, + }, + { + percentOfAmi: 20, + householdSize: 5, + income: 31933, + }, + { + percentOfAmi: 20, + householdSize: 6, + income: 34300, + }, + { + percentOfAmi: 20, + householdSize: 7, + income: 36666, + }, + { + percentOfAmi: 20, + householdSize: 8, + income: 39033, + }, + { + percentOfAmi: 25, + householdSize: 1, + income: 25875, + }, + { + percentOfAmi: 25, + householdSize: 2, + income: 29583, + }, + { + percentOfAmi: 25, + householdSize: 3, + income: 33291, + }, + { + percentOfAmi: 25, + householdSize: 4, + income: 36958, + }, + { + percentOfAmi: 25, + householdSize: 5, + income: 39916, + }, + { + percentOfAmi: 25, + householdSize: 6, + income: 42875, + }, + { + percentOfAmi: 25, + householdSize: 7, + income: 45833, + }, + { + percentOfAmi: 25, + householdSize: 8, + income: 48791, + }, + { + percentOfAmi: 30, + householdSize: 1, + income: 31050, + }, + { + percentOfAmi: 30, + householdSize: 2, + income: 35500, + }, + { + percentOfAmi: 30, + householdSize: 3, + income: 39950, + }, + { + percentOfAmi: 30, + householdSize: 4, + income: 44350, + }, + { + percentOfAmi: 30, + householdSize: 5, + income: 47900, + }, + { + percentOfAmi: 30, + householdSize: 6, + income: 51450, + }, + { + percentOfAmi: 30, + householdSize: 7, + income: 55000, + }, + { + percentOfAmi: 30, + householdSize: 8, + income: 58550, + }, + { + percentOfAmi: 35, + householdSize: 1, + income: 36260, + }, + { + percentOfAmi: 35, + householdSize: 2, + income: 41440, + }, + { + percentOfAmi: 35, + householdSize: 3, + income: 46620, + }, + { + percentOfAmi: 35, + householdSize: 4, + income: 51765, + }, + { + percentOfAmi: 35, + householdSize: 5, + income: 55930, + }, + { + percentOfAmi: 35, + householdSize: 6, + income: 60060, + }, + { + percentOfAmi: 35, + householdSize: 7, + income: 64190, + }, + { + percentOfAmi: 35, + householdSize: 8, + income: 68355, + }, + { + percentOfAmi: 40, + householdSize: 1, + income: 41440, + }, + { + percentOfAmi: 40, + householdSize: 2, + income: 47360, + }, + { + percentOfAmi: 40, + householdSize: 3, + income: 53280, + }, + { + percentOfAmi: 40, + householdSize: 4, + income: 59160, + }, + { + percentOfAmi: 40, + householdSize: 5, + income: 63920, + }, + { + percentOfAmi: 40, + householdSize: 6, + income: 68640, + }, + { + percentOfAmi: 40, + householdSize: 7, + income: 73360, + }, + { + percentOfAmi: 40, + householdSize: 8, + income: 78120, + }, + { + percentOfAmi: 45, + householdSize: 1, + income: 46620, + }, + { + percentOfAmi: 45, + householdSize: 2, + income: 53280, + }, + { + percentOfAmi: 45, + householdSize: 3, + income: 59940, + }, + { + percentOfAmi: 45, + householdSize: 4, + income: 66555, + }, + { + percentOfAmi: 45, + householdSize: 5, + income: 71910, + }, + { + percentOfAmi: 45, + householdSize: 6, + income: 77220, + }, + { + percentOfAmi: 45, + householdSize: 7, + income: 82530, + }, + { + percentOfAmi: 45, + householdSize: 8, + income: 87885, + }, + { + percentOfAmi: 50, + householdSize: 1, + income: 51800, + }, + { + percentOfAmi: 50, + householdSize: 2, + income: 59200, + }, + { + percentOfAmi: 50, + householdSize: 3, + income: 66600, + }, + { + percentOfAmi: 50, + householdSize: 4, + income: 73950, + }, + { + percentOfAmi: 50, + householdSize: 5, + income: 79900, + }, + { + percentOfAmi: 50, + householdSize: 6, + income: 85800, + }, + { + percentOfAmi: 50, + householdSize: 7, + income: 91700, + }, + { + percentOfAmi: 50, + householdSize: 8, + income: 97650, + }, + { + percentOfAmi: 55, + householdSize: 1, + income: 54003, + }, + { + percentOfAmi: 55, + householdSize: 2, + income: 61703, + }, + { + percentOfAmi: 55, + householdSize: 3, + income: 69403, + }, + { + percentOfAmi: 55, + householdSize: 4, + income: 77103, + }, + { + percentOfAmi: 55, + householdSize: 5, + income: 83290, + }, + { + percentOfAmi: 55, + householdSize: 6, + income: 89443, + }, + { + percentOfAmi: 55, + householdSize: 7, + income: 95631, + }, + { + percentOfAmi: 55, + householdSize: 8, + income: 101784, + }, + { + percentOfAmi: 60, + householdSize: 1, + income: 58912, + }, + { + percentOfAmi: 60, + householdSize: 2, + income: 67312, + }, + { + percentOfAmi: 60, + householdSize: 3, + income: 75712, + }, + { + percentOfAmi: 60, + householdSize: 4, + income: 84112, + }, + { + percentOfAmi: 60, + householdSize: 5, + income: 90863, + }, + { + percentOfAmi: 60, + householdSize: 6, + income: 97575, + }, + { + percentOfAmi: 60, + householdSize: 7, + income: 104325, + }, + { + percentOfAmi: 60, + householdSize: 8, + income: 111038, + }, + { + percentOfAmi: 80, + householdSize: 1, + income: 78550, + }, + { + percentOfAmi: 80, + householdSize: 2, + income: 89750, + }, + { + percentOfAmi: 80, + householdSize: 3, + income: 100950, + }, + { + percentOfAmi: 80, + householdSize: 4, + income: 112150, + }, + { + percentOfAmi: 80, + householdSize: 5, + income: 121150, + }, + { + percentOfAmi: 80, + householdSize: 6, + income: 130100, + }, + { + percentOfAmi: 80, + householdSize: 7, + income: 139100, + }, + { + percentOfAmi: 80, + householdSize: 8, + income: 148050, + }, + { + percentOfAmi: 100, + householdSize: 1, + income: 103550, + }, + { + percentOfAmi: 100, + householdSize: 2, + income: 118300, + }, + { + percentOfAmi: 100, + householdSize: 3, + income: 133100, + }, + { + percentOfAmi: 100, + householdSize: 4, + income: 147900, + }, + { + percentOfAmi: 100, + householdSize: 5, + income: 159750, + }, + { + percentOfAmi: 100, + householdSize: 6, + income: 171550, + }, + { + percentOfAmi: 100, + householdSize: 7, + income: 183400, + }, + { + percentOfAmi: 100, + householdSize: 8, + income: 195250, + }, + { + percentOfAmi: 120, + householdSize: 1, + income: 124250, + }, + { + percentOfAmi: 120, + householdSize: 2, + income: 142000, + }, + { + percentOfAmi: 120, + householdSize: 3, + income: 159750, + }, + { + percentOfAmi: 120, + householdSize: 4, + income: 177500, + }, + { + percentOfAmi: 120, + householdSize: 5, + income: 191700, + }, + { + percentOfAmi: 120, + householdSize: 6, + income: 205900, + }, + { + percentOfAmi: 120, + householdSize: 7, + income: 220100, + }, + { + percentOfAmi: 120, + householdSize: 8, + income: 234300, + }, + ], +} diff --git a/backend/core/scripts/ami-chart-import-files/oakland-2023.txt b/backend/core/scripts/ami-chart-import-files/oakland-2023.txt new file mode 100644 index 0000000000..ba65bf1ec0 --- /dev/null +++ b/backend/core/scripts/ami-chart-import-files/oakland-2023.txt @@ -0,0 +1,12 @@ +20 20700 23666 26633 29566 31933 34300 36666 39033 +25 25875 29583 33291 36958 39916 42875 45833 48791 +30 31050 35500 39950 44350 47900 51450 55000 58550 +35 36260 41440 46620 51765 55930 60060 64190 68355 +40 41440 47360 53280 59160 63920 68640 73360 78120 +45 46620 53280 59940 66555 71910 77220 82530 87885 +50 51800 59200 66600 73950 79900 85800 91700 97650 +55 54003 61703 69403 77103 83290 89443 95631 101784 +60 58912 67312 75712 84112 90863 97575 104325 111038 +80 78550 89750 100950 112150 121150 130100 139100 148050 +100 103550 118300 133100 147900 159750 171550 183400 195250 +120 124250 142000 159750 177500 191700 205900 220100 234300 diff --git a/backend/core/src/migration/1693604898155-new-oakland-ami-2023.ts b/backend/core/src/migration/1693604898155-new-oakland-ami-2023.ts new file mode 100644 index 0000000000..c6d74624c5 --- /dev/null +++ b/backend/core/src/migration/1693604898155-new-oakland-ami-2023.ts @@ -0,0 +1,20 @@ +import { MigrationInterface, QueryRunner } from "typeorm" +import { ami } from "../../scripts/ami-chart-import-files/oakland-2023" + +export class newOaklandAmi20231693604898155 implements MigrationInterface { + name = "newOaklandAmi20231693604898155" + + public async up(queryRunner: QueryRunner): Promise { + const [{ id }] = 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)}', '${id}') + `) + } + + public async down(queryRunner: QueryRunner): Promise { + // there is no down migration + } +}