Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions apps/backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import AppDataSource from './data-source';
import { UtilModule } from './util/util.module';
import { ApplicationsModule } from './applications/applications.module';
import { LearnerInfoModule } from './learner-info/learner-info.module';
import { VolunteerInfoModule } from './volunteer-info/volunteer-info.module';
import { Application } from './applications/application.entity';
import { UsersModule } from './users/users.module';
import { ConfigModule } from '@nestjs/config';
Expand All @@ -32,7 +31,6 @@ import { AdminInfoModule } from './admin-info/admin-info.module';
TypeOrmModule.forFeature([Application]),
DisciplinesModule,
LearnerInfoModule,
VolunteerInfoModule,
ApplicationsModule,
ApplicationsModule,
],
Expand Down
2 changes: 0 additions & 2 deletions apps/backend/src/data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as dotenv from 'dotenv';
import { Application } from './applications/application.entity';
import { Discipline } from './disciplines/disciplines.entity';
import { LearnerInfo } from './learner-info/learner-info.entity';
import { VolunteerInfo } from './volunteer-info/volunteer-info.entity';
import { CandidateInfo } from './candidate-info/candidate-info.entity';

dotenv.config();
Expand All @@ -23,7 +22,6 @@ const AppDataSource = new DataSource({
CandidateInfo,
AdminInfo,
Discipline,
VolunteerInfo,
LearnerInfo,
User,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class CreateLearnerInfoDto {
/**
* School of the applicant; includes well-known medical schools or an 'other' option.
*
* Example: School.STANFORD_MEDICINE.
* Example: School.BOSTON_UNIVERSITY.
*/
@IsEnum(School)
@IsDefined()
Expand Down
8 changes: 4 additions & 4 deletions apps/backend/src/learner-info/learner-info.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('LearnerInfoController', () => {
it('should create a new learner info', async () => {
const createLearnerInfo: CreateLearnerInfoDto = {
appId: 0,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
schoolDepartment: 'Infectious Diseases',
isSupervisorApplying: false,
isLegalAdult: true,
Expand All @@ -72,7 +72,7 @@ describe('LearnerInfoController', () => {
);
const createLearnerInfoDto: CreateLearnerInfoDto = {
appId: 0,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand All @@ -85,7 +85,7 @@ describe('LearnerInfoController', () => {
it('should not accept negative appId', async () => {
const createLearnerInfoDto: CreateLearnerInfoDto = {
appId: -1,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand All @@ -104,7 +104,7 @@ describe('LearnerInfoController', () => {
it('should get the learner info by appId', async () => {
const learnerInfo: LearnerInfo = {
appId: 0,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
schoolDepartment: 'Infectious Diseases',
isSupervisorApplying: false,
isLegalAdult: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/learner-info/learner-info.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class LearnerInfo {
/**
* School of the applicant; includes well-known medical schools or an 'other' option.
*
* Example: School.STANFORD_MEDICINE.
* Example: School.BOSTON_UNIVERSITY.
*/
@Column({ type: 'enum', enum: School })
school!: School;
Expand Down
10 changes: 5 additions & 5 deletions apps/backend/src/learner-info/learner-info.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('LearnerInfoService', () => {
it('should create and save a new learner info', async () => {
const LearnerInfo: LearnerInfo = {
appId: 0,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand All @@ -67,7 +67,7 @@ describe('LearnerInfoService', () => {
);
const LearnerInfo: LearnerInfo = {
appId: 0,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand All @@ -80,7 +80,7 @@ describe('LearnerInfoService', () => {
it('should not accept negative appId', async () => {
const LearnerInfo: LearnerInfo = {
appId: -1,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand All @@ -92,7 +92,7 @@ describe('LearnerInfoService', () => {
it('should reject duplicate appId', async () => {
const LearnerInfo: LearnerInfo = {
appId: 2,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand All @@ -116,7 +116,7 @@ describe('LearnerInfoService', () => {
it('should return a single application', async () => {
const LearnerInfo: LearnerInfo = {
appId: 1,
school: School.HARVARD_MEDICAL_SCHOOL,
school: School.BOSTON_UNIVERSITY,
isSupervisorApplying: false,
isLegalAdult: true,
};
Expand Down
33 changes: 30 additions & 3 deletions apps/backend/src/learner-info/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,36 @@ export enum InterestArea {
* School of the applicant, includes well-known medical schools, or an other option
*/
export enum School {
HARVARD_MEDICAL_SCHOOL = 'Harvard Medical School',
BIDMC_RESIDENTS = 'BIDMC - Residents',
BMC_ADDICTION_MEDICINE = 'BMC Addiction Medicine',
BMC_FAMILY_MEDICINE = 'BMC - Family Medicine',
BMC_CENTER_FOR_MULTICULTURAL_TRAINING_IN_PSYCHOLOGY = 'BMC SOM - Center for Multicultural Training in Psychology',
BOSTON_COLLEGE_LYNCH_SCHOOL = 'Boston College - Lynch School of Ed and Human Development',
BOSTON_GRADUATE_SCHOOL_OF_PSYCHOANALYSIS = 'Boston Graduate School of Psychoanalysis',
BOSTON_UNIVERSITY = 'Boston University',
BOSTON_MEDICAL_CENTER_GRAYKEN_CENTER = 'Boston Medical Center Grayken Center',
BOSTON_UNIVERSITY_SCHOOL_OF_MEDICINE_PA = 'Boston University SOM DGMS physician assistant program',
BU_MENTAL_HEALTH_COUNSELING_AND_BEHAVIORAL_MEDICINE = 'BU Mental Health Counseling and Behavioral Medicine Program',
BWH_ADDICTION_MEDICINE = 'BWH Addiction Medicine',
CAPELLA_UNIVERSITY = 'Capella University',
FISHER_COLLEGE = 'Fisher College',
GEORGETOWN_UNIVERSITY_SCHOOL_OF_MEDICINE = 'Georgetown University School of Medicine',
JOHNS_HOPKINS = 'Johns Hopkins',
STANFORD_MEDICINE = 'Stanford Medicine',
MAYO_CLINIC = 'Mayo Clinic',
LABOURE_COLLEGE = 'Laboure College',
MEDEX_NORTHWEST_PA = 'Medex Northwest PA',
MGH_ADDICTION_MEDICINE = 'MGH Addiction Medicine',
MGH_PEDIATRIC_RESIDENCY_PROGRAM = 'MGH Pediatric Residency Program',
MICHIGAN_STATE_UNIVERSITY = 'Michigan State University',
NORTHEASTERN = 'Northeastern',
NORTHEASTERN_BOUVE_COLLEGE_OF_HEALTH_SCIENCES = 'Northeastern Bouve College of Health Sciences',
NORWICH_UNIVERSITY = 'Norwich University',
SALEM_STATE = 'Salem State',
STATE_UNIVERSITY_OF_NEW_YORK = 'State University of New York',
UMASS_BOSTON_NP_PA = 'UMass Boston - NP/PA',
UMASS_BOSTON_NURSING = 'UMass Boston - Nursing',
UNIVERSITY_OF_WASHINGTON_SCHOOL_OF_MEDICINE = 'University of Washington School of Medicine',
WESTERN_GOVERNORS_UNIVERSITY = 'Western Governors University',
WORCESTER_STATE_UNIVERSITY = 'Worcester State University',
OTHER = 'Other',
DOES_NOT_APPLY = 'Does not apply',
}
33 changes: 33 additions & 0 deletions apps/backend/src/migrations/1775270174327-AlterLearnerInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AlterLearnerInfo1775270174327 implements MigrationInterface {
name = 'AlterLearnerInfo1775270174327';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TYPE "public"."learner_info_school_enum" RENAME TO "learner_info_school_enum_old"`,
);
await queryRunner.query(
`CREATE TYPE "public"."learner_info_school_enum" AS ENUM('BIDMC - Residents', 'BMC Addiction Medicine', 'BMC - Family Medicine', 'BMC SOM - Center for Multicultural Training in Psychology', 'Boston College - Lynch School of Ed and Human Development', 'Boston Graduate School of Psychoanalysis', 'Boston University', 'Boston Medical Center Grayken Center', 'Boston University SOM DGMS physician assistant program', 'BU Mental Health Counseling and Behavioral Medicine Program', 'BWH Addiction Medicine', 'Capella University', 'Fisher College', 'Georgetown University School of Medicine', 'Johns Hopkins', 'Laboure College', 'Medex Northwest PA', 'MGH Addiction Medicine', 'MGH Pediatric Residency Program', 'Michigan State University', 'Northeastern', 'Northeastern Bouve College of Health Sciences', 'Norwich University', 'Salem State', 'State University of New York', 'UMass Boston - NP/PA', 'UMass Boston - Nursing', 'University of Washington School of Medicine', 'Western Governors University', 'Worcester State University', 'Other', 'Does not apply')`,
);
await queryRunner.query(
`ALTER TABLE "learner_info" ALTER COLUMN "school" TYPE "public"."learner_info_school_enum" USING "school"::"text"::"public"."learner_info_school_enum"`,
);
await queryRunner.query(
`DROP TYPE "public"."learner_info_school_enum_old"`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TYPE "public"."learner_info_school_enum_old" AS ENUM('Harvard Medical School', 'Johns Hopkins', 'Stanford Medicine', 'Mayo Clinic', 'Other')`,
);
await queryRunner.query(
`ALTER TABLE "learner_info" ALTER COLUMN "school" TYPE "public"."learner_info_school_enum_old" USING "school"::"text"::"public"."learner_info_school_enum_old"`,
);
await queryRunner.query(`DROP TYPE "public"."learner_info_school_enum"`);
await queryRunner.query(
`ALTER TYPE "public"."learner_info_school_enum_old" RENAME TO "learner_info_school_enum"`,
);
}
}
20 changes: 20 additions & 0 deletions apps/backend/src/migrations/1775519032454-RemoveVolunteerInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class RemoveVolunteerInfo1775519032454 implements MigrationInterface {
name = 'RemoveVolunteerInfo1775519032454';

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "volunteer_info"`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE IF NOT EXISTS "volunteer_info" (
"appId" integer NOT NULL,
"license" character varying NOT NULL,
CONSTRAINT "PK_volunteer_info_appId" PRIMARY KEY ("appId"),
CONSTRAINT "FK_volunteer_info_appId" FOREIGN KEY ("appId") REFERENCES "application"("appId") ON DELETE CASCADE
)`,
);
}
}
Loading
Loading