Skip to content
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

CE-365 updated #35

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ test-report.xml
.vscode/

# Mac
.DS_Store
.DS_Store
backend/nr-compliance-enforcement-cm.code-workspace
2 changes: 2 additions & 0 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { HWCRAssessmentActionModule } from "./hwcr_assessment_action/hwcr_assess
import { CaseFileModule } from "./case_file/case_file.module";
import { InactionJustificationTypeModule } from "./inaction_justification_type/inaction_justification_type.module";
import { DateScalar } from "./common/custom_scalars";
import { HWCRPreventionActionModule } from "./hwcr_prevention_education_action/hwcr_prevention_eduction_action.module";

@Module({
imports: [
Expand All @@ -45,6 +46,7 @@ import { DateScalar } from "./common/custom_scalars";
HwcrOutcomeCodeModule,
ConfigurationModule,
HWCRAssessmentActionModule,
HWCRPreventionActionModule,
CaseFileModule,
InactionJustificationTypeModule
],
Expand Down
71 changes: 58 additions & 13 deletions backend/src/case_file/case_file.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ type CaseFile {
caseIdentifier : String
leadIdentifier: String
assessmentDetails: Assessment
preventionDetails: PreventionMeasure
}

input CreateCaseFileInput {
leadIdentifier: String
assessmentDetails: AssessmentDetailsInput!
preventionDetails: PreventionMeasureDetailsInput!
agencyCode: String!
caseCode: String!
createUserId: String!
}

input UpdateCaseFileInput {
leadIdentifier: String
assessmentDetails: AssessmentDetailsInput!
preventionDetails: PreventionMeasureDetailsInput!
agencyCode: String!
caseCode: String!
createUserId: String!
}

input UpdateCaseFileInput {
caseIdentifier: String!
leadIdentifier: String
assessmentDetails: AssessmentDetailsInput!
preventionDetails: PreventionMeasureDetailsInput!
agencyCode: String!
caseCode: String!
updateUserId: String!
}

type Assessment {
Expand All @@ -24,13 +53,6 @@ type AssessmentAction{
activeIndicator: Boolean
}

input CreateAssessmentInput {
leadIdentifier: String
assessmentDetails: AssessmentDetailsInput!
agencyCode: String!
caseCode: String!
createUserId: String!
}

input AssessmentDetailsInput {
actionNotRequired: Boolean!
Expand All @@ -45,13 +67,36 @@ input AssessmentActionInput{
activeIndicator: Boolean!
}

input UpdateAssessmentInput {
caseIdentifier: String!
type PreventionMeasure {
actions: [PreventionMeasureAction]
}

type PreventionMeasureAction{
actor: String!
date: Date!
actionCode: String!
shortDescription: String
longDescription: String
activeIndicator: Boolean
}

input CreatePreventionMeasureInput {
leadIdentifier: String
assessmentDetails: AssessmentDetailsInput!
preventionDetails: PreventionMeasureDetailsInput!
agencyCode: String!
caseCode: String!
updateUserId: String!
createUserId: String!
}

input PreventionMeasureDetailsInput {
actions: [AssessmentActionInput]!
}

input PreventionMeasureActionInput{
actor: String!
date: Date!
actionCode: String!
activeIndicator: Boolean!
}

type Query {
Expand All @@ -60,6 +105,6 @@ type Query {
}

type Mutation {
createAssessment(createAssessmentInput: CreateAssessmentInput!): CaseFile!
updateAssessment(updateAssessmentInput: UpdateAssessmentInput!): CaseFile!
createCaseFile(createCaseFileInput: CreateCaseFileInput!): CaseFile!
updateCaseFile(updateCaseFileInput: UpdateCaseFileInput!): CaseFile!
}
16 changes: 8 additions & 8 deletions backend/src/case_file/case_file.resolver.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Resolver, Query, Mutation, Args } from '@nestjs/graphql';
import { CaseFileService } from './case_file.service';
import { CreateAssessmentInput } from './dto/create-case_file.input';
import { UpdateAssessmentInput } from './dto/update-case_file.input';
import { CreateCaseFileInput } from './dto/create-case_file.input';
import { UpdateCaseFileInput } from './dto/update-case_file.input';
import { JwtRoleGuard } from "../auth/jwtrole.guard";
import { UseGuards } from "@nestjs/common";
import { Role } from "../enum/role.enum";
Expand All @@ -12,10 +12,10 @@ import { Roles } from "../auth/decorators/roles.decorator";
export class CaseFileResolver {
constructor(private readonly caseFileService: CaseFileService) { }

@Mutation('createAssessment')
@Mutation('createCaseFile')
@Roles(Role.COS_OFFICER)
create(@Args('createAssessmentInput') createAssessmentInput: CreateAssessmentInput) {
return this.caseFileService.create(createAssessmentInput);
create(@Args('createCaseFileInput') createCaseFileInput: CreateCaseFileInput) {
return this.caseFileService.create(createCaseFileInput);
}

@Query('getCaseFile')
Expand All @@ -30,10 +30,10 @@ export class CaseFileResolver {
return this.caseFileService.findOneByLeadId(leadIdentifier);
}

@Mutation('updateAssessment')
@Mutation('updateCaseFile')
@Roles(Role.COS_OFFICER)
update(@Args('updateAssessmentInput') updateAssessmentInput: UpdateAssessmentInput) {
return this.caseFileService.update(updateAssessmentInput.caseIdentifier, updateAssessmentInput);
update(@Args('updateCaseFileInput') updateCaseFileInput: UpdateCaseFileInput) {
return this.caseFileService.update(updateCaseFileInput.caseIdentifier, updateCaseFileInput);
}

}
Loading
Loading