Skip to content

Commit

Permalink
Merge pull request #47 from AOT-Technologies/feature/update-lob
Browse files Browse the repository at this point in the history
Added workflow activities section
  • Loading branch information
nagarajaPC-AOT authored Apr 22, 2024
2 parents 9de79df + 676ad42 commit 37f0685
Show file tree
Hide file tree
Showing 21 changed files with 733 additions and 46 deletions.
4 changes: 3 additions & 1 deletion app/caseflow_core/microservices/server/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { CaseStatusModule } from './case_status/case_status.module';
import { CaseTypesModule } from './case_types/case_types.module';
import { NatsModule } from './nats/nats.module';
import { CaseNotesModule } from './case_notes/case_notes.module';
import { WorkflowActivityModule } from './workflow_activities/workflow_activity.module';

/**
* Summary :Keyclock settings
Expand Down Expand Up @@ -74,7 +75,8 @@ const keyCloakOptionsProvider = {
CaseStatusModule,
CaseTypesModule,
NatsModule,
CaseNotesModule
CaseNotesModule,
WorkflowActivityModule
],
controllers: [],
providers: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { UpdateCaseNoteInput } from './dto/update-case_note.input';
export class CaseNotesResolver {
constructor(private readonly caseNotesService: CaseNotesService) {}

@Mutation(() => CaseNotes)
@Mutation(() => CaseNotes, {name:'createCaseNote'})
createCaseNote(@Args('createCaseNoteInput') createCaseNoteInput: CreateCaseNoteInput) {
return this.caseNotesService.create(createCaseNoteInput);
}
Expand All @@ -30,12 +30,12 @@ export class CaseNotesResolver {
return this.caseNotesService.findByCaseId(id);
}

@Mutation(() => CaseNotes)
@Mutation(() => CaseNotes, {name:'updateCaseNote'})
updateCaseNote(@Args('updateCaseNoteInput') updateCaseNoteInput: UpdateCaseNoteInput) {
return this.caseNotesService.update(updateCaseNoteInput.id, updateCaseNoteInput);
}

@Mutation(() => CaseNotes)
@Mutation(() => CaseNotes, {name:'removeCaseNote'})
removeCaseNote(@Args('id', { type: () => Int }) id: number) {
return this.caseNotesService.remove(id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { CaseHistory } from '../../case_history/entities/case_history.entity';
import { CaseStatuses } from '../../case_status/entities/case_status.entity';
import { CaseTypes } from '../../case_types/entities/case_type.entity';
import { CaseNotes } from 'src/case_notes/entities/case_note.entity';
import { WorkflowActivity } from 'src/workflow_activities/entities/workflow_activity.entity';

/**
* Summary : Entity Class For External Cases
Expand Down Expand Up @@ -115,6 +116,10 @@ export class Cases {
@Field(() => [CaseNotes], { nullable: true })
casenote: CaseNotes[];

@OneToMany(() => WorkflowActivity, (workflowactivity) => workflowactivity.case)
@Field(() => [WorkflowActivity], { nullable: true })
workflowactivity: WorkflowActivity[];

@Column({ nullable: true })
@Field({ nullable: true })
contactid: string;
Expand Down
47 changes: 40 additions & 7 deletions app/caseflow_core/microservices/server/src/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ type CaseNotes {
case: Cases
}

type WorkflowActivity {
id: ID!
taskid: String
caseid: Float
creationdate: DateTime!
userid: String!
taskname: String
formurl: String
status: String
selectedform: String
case: Cases
}

type Cases {
id: ID!
lobid: Int!
Expand All @@ -107,6 +120,7 @@ type Cases {
casestatus: CaseStatuses
casestype: CaseTypes
casenote: [CaseNotes!]
workflowactivity: [WorkflowActivity!]
contactid: String
individualid: String
email: String
Expand Down Expand Up @@ -143,6 +157,7 @@ type Query {
caseNotes: [CaseNotes!]!
caseNote(id: Int!): CaseNotes!
caseNotesByCaseId(id: Int!): [CaseNotes!]!
workflowActivitiesByCaseId(id: Int!): [WorkflowActivity!]!
}

type Mutation {
Expand All @@ -164,14 +179,16 @@ type Mutation {
createCaseNote(createCaseNoteInput: CreateCaseNoteInput!): CaseNotes!
updateCaseNote(updateCaseNoteInput: UpdateCaseNoteInput!): CaseNotes!
removeCaseNote(id: Int!): CaseNotes!
createWorkflowActivity(createWorkflowActivityInput: CreateWorkflowActivityInput!): WorkflowActivity!
updateWorkflowActivity(updateWorkflowActivityInput: UpdateWorkflowActivityInput!): WorkflowActivity!
}

input CreateCaseInput {
lobid: Int
statusid: Int!
typeid: Float
linkedcases: [Int!]
creationdate: DateTime = "2024-03-26T01:07:20.509Z"
creationdate: DateTime = "2024-04-21T04:08:52.906Z"
completiondate: DateTime
lastmodificationdate: DateTime
penduntildate: DateTime
Expand Down Expand Up @@ -200,9 +217,9 @@ input UpdateCaseInput {
statusid: Int!
typeid: Float
linkedcases: [Int!]
creationdate: DateTime = "2024-03-26T01:07:20.505Z"
creationdate: DateTime = "2024-04-21T04:08:52.902Z"
completiondate: DateTime
lastmodificationdate: DateTime = "2024-03-26T01:07:20.505Z"
lastmodificationdate: DateTime = "2024-04-21T04:08:52.902Z"
penduntildate: DateTime
archivedate: DateTime
startuserid: Int
Expand All @@ -228,7 +245,7 @@ input RemoveCaseArgs {
}

input CreateCaseHistoryInput {
datetime: DateTime = "2024-03-26T01:07:20.519Z"
datetime: DateTime = "2024-04-21T04:08:52.912Z"
outcome: String = "sucess"
userid: Float
caseId: [Int!]!
Expand All @@ -238,7 +255,7 @@ input CreateCaseHistoryInput {
}

input UpdateCaseHistoryInput {
datetime: DateTime = "2024-03-26T01:07:20.519Z"
datetime: DateTime = "2024-04-21T04:08:52.912Z"
outcome: String = "sucess"
userid: Float
caseId: [Int!]
Expand Down Expand Up @@ -293,17 +310,33 @@ input UpdateCaseTypeInput {

input CreateCaseNoteInput {
caseid: Float!
creationdate: DateTime = "2024-03-26T01:07:20.621Z"
creationdate: DateTime = "2024-04-21T04:08:52.987Z"
userid: Float
notetext: String
}

input UpdateCaseNoteInput {
caseid: Float
creationdate: DateTime = "2024-03-26T01:07:20.621Z"
creationdate: DateTime = "2024-04-21T04:08:52.987Z"
userid: Float
notetext: String
id: Int!
}

input CreateWorkflowActivityInput {
caseid: Float
creationdate: DateTime = "2024-04-21T04:08:52.992Z"
userid: String
taskid: String!
taskname: String
formurl: String
status: String
selectedform: String
}

input UpdateWorkflowActivityInput {
taskid: String
status: String
}

scalar link__Import
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { InputType, Field } from '@nestjs/graphql';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';


@InputType()
export class CreateWorkflowActivityInput {
@Field({ nullable: true })
@IsNumber()
@IsNotEmpty()
caseid: number;

@Field({ defaultValue: new Date() })
creationdate: Date;

@Field({ nullable: true })
@IsString()
@IsNotEmpty()
userid: string;

@Field({ nullable: false })
@IsString()
@IsNotEmpty()
taskid: string;

@Field({ nullable: true })
@IsString()
@IsNotEmpty()
taskname: string;

@Field({ nullable: true })
@IsString()
@IsNotEmpty()
formurl: string;

@Field({ nullable: true })
@IsString()
@Field({ nullable: true })
status: string;

@Field({ nullable: true })
@IsString()
@IsNotEmpty()
selectedform: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { InputType, Field, Int, PartialType } from '@nestjs/graphql';
import { IsNotEmpty, IsString } from 'class-validator';

@InputType()
export class UpdateWorkflowActivityInput{
@Field({ nullable: true })
@IsString()
@IsNotEmpty()
taskid: string;

@Field({ nullable: true })
@IsString()
@IsNotEmpty()
status: string;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

import { ObjectType, Field, ID } from '@nestjs/graphql';
import { Cases } from 'src/cases/entities/cases.entity';
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
@ObjectType()
export class WorkflowActivity {

@PrimaryGeneratedColumn()
@Field((type) => ID)
id: number;

@Column({ nullable: true })
@Field({ nullable: true })
taskid: string;

@Column({ nullable: true })
@Field({ nullable: true })
caseid: number;

@Column({ nullable: true })
@Field()
creationdate: Date;

@Column({ nullable: true })
@Field()
userid: string;

@Column({ nullable: true })
@Field({ nullable: true })
taskname: string;

@Column({ nullable: true })
@Field({ nullable: true })
formurl: string;

@Column({ nullable: true })
@Field({ nullable: true })
status: string;

@Column({ nullable: true })
@Field({ nullable: true })
selectedform: string;

@ManyToOne(() => Cases, (cases) => cases.id)
@Field(() => Cases, { nullable: true })
@JoinColumn({ name: 'id' })
case: Cases;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

import { Resolver, Query, Mutation, Args, Int } from '@nestjs/graphql';
import { WorkflowActivitiesService } from './workflow_activities.service';
import { WorkflowActivity } from './entities/workflow_activity.entity';
import { CreateWorkflowActivityInput } from './dto/create-workflow_activity.input';
import { UpdateWorkflowActivityInput } from './dto/update-workflow_activity.input';

@Resolver(() => WorkflowActivity)
export class WorkflowActivityResolver {
constructor(private readonly workflowActivityService: WorkflowActivitiesService) {}

@Mutation(() => WorkflowActivity)
createWorkflowActivity(@Args('createWorkflowActivityInput') createWorkflowActivityInput: CreateWorkflowActivityInput) {
return this.workflowActivityService.create(createWorkflowActivityInput);
}

@Query(() => [WorkflowActivity], { name: 'workflowActivitiesByCaseId' })
workflowActivitiesByCaseId(@Args('id', { type: () => Int }) id: number) {
return this.workflowActivityService.findByCaseId(id);
}

@Mutation(() => WorkflowActivity)
updateWorkflowActivity(@Args('updateWorkflowActivityInput') updateWorkflowActivityInput: UpdateWorkflowActivityInput) {
return this.workflowActivityService.update(updateWorkflowActivityInput.taskid, updateWorkflowActivityInput);
}
}



Loading

0 comments on commit 37f0685

Please sign in to comment.