Skip to content

Commit

Permalink
Resolve merge conflicts & unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle1morel committed Nov 25, 2024
1 parent e17aa51 commit c2073d8
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 557 deletions.
4 changes: 4 additions & 0 deletions app/src/controllers/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ const controller = {
req.currentContext
);

// Create contacts
if (req.body.contacts)
await contactService.upsertContacts(submission.activityId, req.body.contacts, req.currentContext);

// Create new submission
const result = await submissionService.createSubmission({
...submission,
Expand Down
218 changes: 0 additions & 218 deletions app/src/db/migrations/20241028000000_012-user-contacts.ts

This file was deleted.

59 changes: 13 additions & 46 deletions app/src/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,19 @@ model submission {
@@schema("public")
}

model submission_draft {
submission_draft_id String @id @db.Uuid
activity_id String
data Json @db.Json
created_by String? @default("00000000-0000-0000-0000-000000000000")
created_at DateTime? @default(now()) @db.Timestamptz(6)
updated_by String?
updated_at DateTime? @db.Timestamptz(6)
activity activity @relation(fields: [activity_id], references: [activity_id], onDelete: Cascade, map: "submission_draft_activity_id_foreign")
@@schema("public")
}

model user {
user_id String @id @db.Uuid
identity_id String? @db.Uuid
Expand Down Expand Up @@ -483,52 +496,6 @@ model subject_group {
@@schema("yars")
}

model activity_contact {
activity_id String
contact_id String @db.Uuid
created_by String? @default("00000000-0000-0000-0000-000000000000")
created_at DateTime? @default(now()) @db.Timestamptz(6)
updated_by String?
updated_at DateTime? @db.Timestamptz(6)
activity activity @relation(fields: [activity_id], references: [activity_id], onDelete: Cascade, map: "activity_contact_activity_id_foreign")
contact contact @relation(fields: [contact_id], references: [contact_id], onDelete: Cascade, map: "activity_contact_contact_id_foreign")
@@id([activity_id, contact_id])
@@schema("public")
}

model contact {
contact_id String @id @db.Uuid
user_id String? @db.Uuid
first_name String?
last_name String?
phone_number String?
email String?
contact_preference String?
contact_applicant_relationship String?
created_by String? @default("00000000-0000-0000-0000-000000000000")
created_at DateTime? @default(now()) @db.Timestamptz(6)
updated_by String?
updated_at DateTime? @db.Timestamptz(6)
activity_contact activity_contact[]
user user? @relation(fields: [user_id], references: [user_id], onDelete: Cascade, map: "contact_user_id_foreign")
@@schema("public")
}

model submission_draft {
submission_draft_id String @id @db.Uuid
activity_id String
data Json @db.Json
created_by String? @default("00000000-0000-0000-0000-000000000000")
created_at DateTime? @default(now()) @db.Timestamptz(6)
updated_by String?
updated_at DateTime? @db.Timestamptz(6)
activity activity @relation(fields: [activity_id], references: [activity_id], onDelete: Cascade, map: "submission_draft_activity_id_foreign")
@@schema("public")
}

view group_role_policy_vw {
row_number BigInt @unique
group_id Int?
Expand Down
3 changes: 2 additions & 1 deletion app/src/middleware/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
noteService,
permitService,
submissionService,
submissionDraftService,
userService,
yarsService
} from '../services';
Expand Down Expand Up @@ -112,7 +113,7 @@ const paramMap = new Map<string, (id: string) => any>([
['noteId', noteService.getNote],
['permitId', permitService.getPermit],
['submissionId', submissionService.getSubmission],
['submissionDraftId', submissionService.getDraft]
['submissionDraftId', submissionDraftService.getDraft]
]);

/**
Expand Down
Loading

0 comments on commit c2073d8

Please sign in to comment.