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

feat: CE-634 #722

Merged
merged 89 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
5e72328
fix: Ce 478 (#685)
gregorylavery Oct 3, 2024
da3a597
chore(CE-1118): CE-1118 Add Ryan as officer for test and prod (#689)
nayr974 Oct 3, 2024
da5087f
chore(CE-1118): add Jon as officer to test and prod data (#688)
jon-funk Oct 4, 2024
94f9304
chore: CE 1119 add Mike to users (#690)
mikevespi Oct 7, 2024
043c1e7
feat: CE-750 Display Current Date in Filter when only one date select…
afwilcox Oct 8, 2024
343bf71
chore(CE-535): Refactor ValidationInput and ValidationSelect to use C…
nayr974 Oct 8, 2024
91c1b3b
fix: CE-1050 Makes it so cypress tests work on empty case management …
afwilcox Oct 9, 2024
e2b7101
chore(ci): Dockerfile updates (#693)
mishraomp Oct 9, 2024
b4f59cd
fix: Config.js error while developing locally (#699)
nayr974 Oct 9, 2024
70f8b02
fix: Clear CDOGS templates with every run (#700)
afwilcox Oct 11, 2024
b8aae06
fix: Ce 1127 (#694)
gregorylavery Oct 12, 2024
fde5a56
chore(deps): update dependency @types/jest to v29.5.13 (#704)
renovate[bot] Oct 15, 2024
a788f68
feat: CE-550- modal-improvements-V2 (#703)
dmitri-korin-bcps Oct 15, 2024
46d6c1d
feat: Method Complaint Received Cypress Tests (#701)
afwilcox Oct 15, 2024
d86e33e
fix: CE 1124 (#705)
nayr974 Oct 16, 2024
24a3c76
fix: CE-1143-apply-scroll-bar-to-assign-modal (#710)
dmitri-korin-bcps Oct 16, 2024
02d58eb
fix: CE-917 enable autoscaling for test (#702)
jon-funk Oct 17, 2024
9df80c5
fix: CE-1078 persist secret content changes between rollouts (#698)
jon-funk Oct 17, 2024
20d34a3
feat: CE-1045 add action taken filter for ceeb (#708)
mikevespi Oct 17, 2024
a338648
fix: CE 1124 (#711)
nayr974 Oct 17, 2024
8e2e840
Link Complaint WIP
nayr974 Oct 21, 2024
bd54df1
Merge remote-tracking branch 'origin/release/noble-sea-lemon' into CE…
nayr974 Oct 21, 2024
562225d
rename link complaint to quick close
nayr974 Oct 22, 2024
d1f2287
update packages
nayr974 Oct 22, 2024
0103e8a
Add linked complaints in details view
Scarlett-Truong Oct 22, 2024
d5924f8
Add linked_complaint_xref table to track linked complaints
mikevespi Oct 22, 2024
dabf585
Working complaint search component
nayr974 Oct 23, 2024
300b940
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 23, 2024
dae9f80
Improve rendering of dropdown link component
nayr974 Oct 23, 2024
5a2dd89
Update package.json
nayr974 Oct 23, 2024
5cfbc5c
fix flashing on api call
nayr974 Oct 23, 2024
c4696a0
Update hwcr-complaint-assessment-link-complaint-search.tsx
nayr974 Oct 23, 2024
c4669b7
add linked-complaint-xref
Scarlett-Truong Oct 23, 2024
f91b144
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
Scarlett-Truong Oct 23, 2024
e69ea05
Merge branch 'release/noble-sea-lemon' into CE-634
Scarlett-Truong Oct 23, 2024
7d9ee44
Update craco.config.ts
nayr974 Oct 24, 2024
25bbdc8
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 24, 2024
0a31d1d
Merge branch 'release/noble-sea-lemon' into CE-634
Scarlett-Truong Oct 25, 2024
4f9cb3c
Add getLinkedComplaints api route (completed)
Scarlett-Truong Oct 25, 2024
372fd17
front calls API with linked complaint
nayr974 Oct 25, 2024
7562c10
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 25, 2024
a9059d9
Update hwcr-complaint-assessment.tsx
nayr974 Oct 25, 2024
bf212ef
Update linked-complaint-list.tsx
nayr974 Oct 25, 2024
3f993f4
fix failing test
nayr974 Oct 25, 2024
14760b5
Update change-complaint-assignee.cy.ts
nayr974 Oct 25, 2024
e6823a8
Update change-complaint-assignee.cy.ts
nayr974 Oct 25, 2024
4683f8d
remove console logs
nayr974 Oct 25, 2024
396bba3
feat: CE-1137 Add QC button to complaint header
afwilcox Oct 25, 2024
d9fdbe5
Add alert for outcome report
nayr974 Oct 25, 2024
615bfce
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 25, 2024
8aa3953
fix: modal css to remove border and padding
afwilcox Oct 25, 2024
b5377be
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
afwilcox Oct 25, 2024
f5aabe7
Add link process to createAssessment for duplicates
mikevespi Oct 26, 2024
7e190e5
Update change-complaint-assignee.cy.ts
nayr974 Oct 28, 2024
d2f1a9b
Update change-complaint-assignee.cy.ts
nayr974 Oct 28, 2024
98cb994
fix sonarqube warnings
nayr974 Oct 28, 2024
5ee1fce
Merge branch 'release/noble-sea-lemon' into CE-634
Scarlett-Truong Oct 28, 2024
012af0a
Update hwcr-complaint-assessment.tsx
nayr974 Oct 28, 2024
27a26d8
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 28, 2024
4eca3e4
Handle closeComplaintOnSuccess parameter in createAssessment
mikevespi Oct 28, 2024
f4ed62d
Update parameter name to actionCloseComplaint
mikevespi Oct 28, 2024
8dddb53
set close complaint param
nayr974 Oct 28, 2024
570bb57
Merge branch 'release/noble-sea-lemon' into CE-634
afwilcox Oct 28, 2024
ee785f9
chore: bump flyway version
afwilcox Oct 28, 2024
7a77a5b
Update hwcr-complaint-assessment.tsx
nayr974 Oct 28, 2024
aea6b76
fix orderby, update getLinkedComplaint path, sonarcloud issues
Scarlett-Truong Oct 28, 2024
b8303b1
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
Scarlett-Truong Oct 28, 2024
f649864
fix sonarcloud
Scarlett-Truong Oct 28, 2024
5ee6832
refresh search on modal close
nayr974 Oct 29, 2024
a4c4797
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 29, 2024
fa307c9
bug fixes
nayr974 Oct 29, 2024
22aa4c7
validate on change once submitted
nayr974 Oct 29, 2024
249ff55
Merge branch 'release/noble-sea-lemon' into CE-634
Scarlett-Truong Oct 29, 2024
11f28eb
change import path
Scarlett-Truong Oct 29, 2024
3bd1b6f
Add missing repository to jest test
mikevespi Oct 29, 2024
393a687
Update complaint-details-edit.tsx
nayr974 Oct 29, 2024
1d664ea
add refreshing getLinkedComplaint, fix sonarcloud
Scarlett-Truong Oct 29, 2024
ee9efbc
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
Scarlett-Truong Oct 29, 2024
1d7b13b
fix toast / modal state issues
nayr974 Oct 29, 2024
8d2fd24
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 29, 2024
ff4d0df
fix bug on quick close close
nayr974 Oct 29, 2024
55081f2
Merge branch 'release/noble-sea-lemon' into CE-634
afwilcox Oct 29, 2024
7a8c5ec
add redux migration
Scarlett-Truong Oct 29, 2024
ed2883b
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
Scarlett-Truong Oct 29, 2024
b2c12fb
Update hwcr-complaint-assessment.tsx
nayr974 Oct 29, 2024
820e096
Merge branch 'release/noble-sea-lemon' into CE-634
afwilcox Oct 29, 2024
fc9f4f1
move getLinkedComplaints to redux
Scarlett-Truong Oct 29, 2024
c8eb5ba
fix cases bug
nayr974 Oct 29, 2024
e918b17
Merge branch 'CE-634' of https://github.com/bcgov/nr-compliance-enfor…
nayr974 Oct 29, 2024
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: 2 additions & 0 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { TeamCodeModule } from "./v1/team_code/team_code.module";
import { OfficerTeamXrefModule } from "./v1/officer_team_xref/officer_team_xref.module";
import { ComplaintMethodReceivedCodeModule } from "./v1/complaint_method_received_code/complaint_method_received_code.module";
import { CompMthdRecvCdAgcyCdXrefModule } from "./v1/comp_mthd_recv_cd_agcy_cd_xref/comp_mthd_recv_cd_agcy_cd_xref.module";
import { LinkedComplaintXrefModule } from "./v1/linked_complaint_xref/linked_complaint_xref.module";

console.log("Var check - POSTGRESQL_HOST", process.env.POSTGRESQL_HOST);
console.log("Var check - POSTGRESQL_DATABASE", process.env.POSTGRESQL_DATABASE);
Expand Down Expand Up @@ -128,6 +129,7 @@ if (process.env.POSTGRESQL_PASSWORD != null) {
OfficerTeamXrefModule,
ComplaintMethodReceivedCodeModule,
CompMthdRecvCdAgcyCdXrefModule,
LinkedComplaintXrefModule,
],
controllers: [AppController],
providers: [AppService, ComplaintSequenceResetScheduler],
Expand Down
2 changes: 2 additions & 0 deletions backend/src/types/models/case-files/assessment-details.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AssessmentActionDto } from "./assessment-action";
export interface AssessmentDetailsDto {
actionNotRequired: boolean;
actionCloseComplaint: boolean;
actionLinkedComplaintIdentifier: string;
actionJustificationCode: string;
actionJustificationShortDescription: string;
actionJustificationLongDescription: string;
Expand Down
11 changes: 10 additions & 1 deletion backend/src/v1/case_file/case_file.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { AutomapperModule } from "@automapper/nestjs";
import { CaseFileController } from "./case_file.controller";
import { CaseFileService } from "./case_file.service";
import { CodeTableModule } from "../code-table/code-table.module";
import { ComplaintModule } from "../complaint/complaint.module";
import { Complaint } from "../complaint/entities/complaint.entity";
import { LinkedComplaintXref } from "../linked_complaint_xref/entities/linked_complaint_xref.entity";

@Module({
imports: [AutomapperModule, CodeTableModule, ComplaintModule],
imports: [
AutomapperModule,
CodeTableModule,
ComplaintModule,
TypeOrmModule.forFeature([Complaint]),
TypeOrmModule.forFeature([LinkedComplaintXref]),
],
controllers: [CaseFileController],
providers: [CaseFileService],
})
Expand Down
5 changes: 5 additions & 0 deletions backend/src/v1/case_file/case_file.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { StagingComplaint } from "../staging_complaint/entities/staging_complain
import { TeamCode } from "../team_code/entities/team_code.entity";
import { CompMthdRecvCdAgcyCdXref } from "../comp_mthd_recv_cd_agcy_cd_xref/entities/comp_mthd_recv_cd_agcy_cd_xref";
import { CompMthdRecvCdAgcyCdXrefService } from "../comp_mthd_recv_cd_agcy_cd_xref/comp_mthd_recv_cd_agcy_cd_xref.service";
import { LinkedComplaintXref } from "../linked_complaint_xref/entities/linked_complaint_xref.entity";

describe("Testing: Case File Service", () => {
let service: CaseFileService;
Expand Down Expand Up @@ -187,6 +188,10 @@ describe("Testing: Case File Service", () => {
provide: getRepositoryToken(CompMthdRecvCdAgcyCdXref),
useFactory: MockCompMthdRecvCdAgcyCdXrefRepository,
},
{
provide: getRepositoryToken(LinkedComplaintXref),
useValue: {},
},
ComplaintUpdatesService,
CaseFileService,
ComplaintService,
Expand Down
150 changes: 140 additions & 10 deletions backend/src/v1/case_file/case_file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ import { UpdateDecisionInput } from "src/types/models/case-files/ceeb/decision/u
import { CreateAuthorizationOutcomeInput } from "src/types/models/case-files/ceeb/site/create-authorization-outcome-input";
import { UpdateAuthorizationOutcomeInput } from "src/types/models/case-files/ceeb/site/update-authorization-outcome-input";
import { DeleteAuthorizationOutcomeInput } from "src/types/models/case-files/ceeb/site/delete-authorization-outcome-input";
import { DataSource, Repository } from "typeorm";
import { LinkedComplaintXref } from "../linked_complaint_xref/entities/linked_complaint_xref.entity";
import { InjectRepository } from "@nestjs/typeorm";
import { getIdirFromRequest } from "../../common/get-idir-from-request";
import { CodeTableService } from "../code-table/code-table.service";
import { Complaint } from "../complaint/entities/complaint.entity";
import { CreateLinkedComplaintXrefDto } from "../linked_complaint_xref/dto/create-linked_complaint_xref.dto";

@Injectable({ scope: Scope.REQUEST })
export class CaseFileService {
Expand Down Expand Up @@ -153,6 +160,8 @@ export class CaseFileService {
@Inject(REQUEST) private request: Request,
@InjectMapper() mapper,
private readonly complaintService: ComplaintService,
private readonly _codeTableService: CodeTableService,
private readonly dataSource: DataSource,
) {
this.mapper = mapper;
}
Expand All @@ -178,17 +187,138 @@ export class CaseFileService {
}
};

createAssessment = async (token: string, model: CaseFileDto): Promise<CaseFileDto> => {
const result = await post(token, {
query: `mutation CreateAssessment($createAssessmentInput: CreateAssessmentInput!) {
createAssessment(createAssessmentInput: $createAssessmentInput)
${this.caseFileQueryFields}
}`,
variables: model,
});
const returnValue = await this.handleAPIResponse(result);
// The linked complaint xref and complaint repositories are needed if an assessment being created is also linking two
// complaints. The codeTableService is needed to fetch the status used to update the closing complaint's status.
@InjectRepository(LinkedComplaintXref)
private readonly _linkedComplaintXrefRepository: Repository<LinkedComplaintXref>;
@InjectRepository(Complaint)
private readonly _complaintsRepository: Repository<Complaint>;

async createAssessment(token: string, model: CaseFileDto): Promise<CaseFileDto> {
/**
* If the assessment is linking the complaint to another, the assessment (CM db) and a linked complaint xref
* (NATCom db) both need to be created. To ensure that either both are successfully created, or neither of them
* are, the following takes place:
* A transaction is started in the NATCom database. If anything beyond this point fails, the transaction is
* rolled back. With the transaction open, the db's ability to fulfill the creation of the link is confirmed.
* Once confirmed, the assessment is created in the CM database. If this is successful, the transaction in the
* NATCom database is commit, the connection is closed, and the new assessmentis returned.
*
* This process of creating the complaint links is handled here to accommodate this pseudo two phase commit
* pattern.
*/

let returnValue;
// The model reaches this function in the shape { "createAssessmentInput": {...CaseFlieDTO} } despite that property
// not existing in the CaseFileDTO type, which renders the CaseFile fields inside inaccessible in this scope.
// For example, leadIdentifier would be found in model.leadIdentifier by the type's definition, however in this
// scope it is at model.createAssessmentInput.leadIdentifier, which errors due to type violation.
// This copies it into a new variable cast to any to allow access to the nested properties.
let modelAsAny: any = { ...model };
// If changes need to be made in both databases (i.e. we need to create a link or change the status of a complaint)
// then the transactional approach is taken.
if (
modelAsAny.createAssessmentInput.assessmentDetails.actionLinkedComplaintIdentifier ||
modelAsAny.createAssessmentInput.assessmentDetails.actionCloseComplaint
) {
const dateLinkCreated = new Date();
const complaintBeingLinkedId = modelAsAny.createAssessmentInput.leadIdentifier;
const linkingToComplaintId = modelAsAny.createAssessmentInput.assessmentDetails.actionLinkedComplaintIdentifier;
const queryRunner = this.dataSource.createQueryRunner();
await queryRunner.connect();
await queryRunner.startTransaction();
try {
const idir = getIdirFromRequest(this.request);
// If actionLinkedComplaintIdentifier is present the link must be created in the database
if (modelAsAny.createAssessmentInput.assessmentDetails.actionLinkedComplaintIdentifier) {
// When linking complaint "A" to complaint "B", if "A" already has other complaints linked to it those links
// are marked as inactive, and new links are created with them pointing to "B".
const trailingComplaints = await this._linkedComplaintXrefRepository
.createQueryBuilder()
.update(LinkedComplaintXref)
.set({ active_ind: false })
.where({
complaint_identifier: complaintBeingLinkedId,
})
.andWhere({
active_ind: true,
})
.returning("*")
.execute();

if (trailingComplaints.affected > 0) {
trailingComplaints.raw.forEach(async (row) => {
const linkString = await this._linkedComplaintXrefRepository.create(<CreateLinkedComplaintXrefDto>{
// ...row,
complaint_identifier: { complaint_identifier: linkingToComplaintId },
linked_complaint_identifier: row.linked_complaint_identifier,
active_ind: true,
create_user_id: idir,
create_utc_timestamp: dateLinkCreated,
});
await queryRunner.manager.save(linkString);
});
}

// Create the new link between the complaints
let newLink = new CreateLinkedComplaintXrefDto();
newLink = {
...newLink,
complaint_identifier: <Complaint>{
complaint_identifier: linkingToComplaintId,
},
linked_complaint_identifier: <Complaint>{ complaint_identifier: complaintBeingLinkedId },
active_ind: true,
create_user_id: idir,
create_utc_timestamp: dateLinkCreated,
};

const complaintLinkString = await this._linkedComplaintXrefRepository.create(newLink);
await queryRunner.manager.save(complaintLinkString);
}
// Update the status of the complaint to "closed" if actionCloseComplaint is set to true
if (modelAsAny.createAssessmentInput.assessmentDetails.actionCloseComplaint) {
const statusCode = await this._codeTableService.getComplaintStatusCodeByStatus("CLOSED");
await this._complaintsRepository
.createQueryBuilder("complaint")
.update()
.set({ complaint_status_code: statusCode, update_user_id: idir })
.where({ complaint_identifier: complaintBeingLinkedId })
.execute();
}

// Create the assessment in the Case Management database
const result = await post(token, {
query: `mutation CreateAssessment($createAssessmentInput: CreateAssessmentInput!) {
createAssessment(createAssessmentInput: $createAssessmentInput)
${this.caseFileQueryFields}
}`,
variables: model,
});
returnValue = await this.handleAPIResponse(result);
// If the mutation succeeded, commit the pending transaction
await queryRunner.commitTransaction();
} catch (err) {
this.logger.error(err);
await queryRunner.rollbackTransaction();
Promise.reject(new Error("An error occurred while linking the complaints. " + err));
} finally {
await queryRunner.release();
}
} else {
// If the assessment is not linking two complaints then simply create the new assessment in CM.
const result = await post(token, {
query: `mutation CreateAssessment($createAssessmentInput: CreateAssessmentInput!) {
createAssessment(createAssessmentInput: $createAssessmentInput)
${this.caseFileQueryFields}
}`,
variables: model,
});
returnValue = await this.handleAPIResponse(result);
}

return returnValue?.createAssessment;
};
}

updateAssessment = async (token: string, model: CaseFileDto): Promise<CaseFileDto> => {
const result = await post(token, {
Expand Down
18 changes: 17 additions & 1 deletion backend/src/v1/complaint/complaint.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { dtoAlias } from "../../types/models/complaints/dtoAlias-type";
import { RelatedDataDto } from "src/types/models/complaints/related-data";
import { ACTION_TAKEN_ACTION_TYPES } from "src/types/constants";
import { hasRole } from "src/common/has-role";
import { LinkedComplaintXrefService } from "../linked_complaint_xref/linked_complaint_xref.service";

@UseGuards(JwtRoleGuard)
@ApiTags("complaint")
Expand All @@ -29,7 +30,11 @@ import { hasRole } from "src/common/has-role";
version: "1",
})
export class ComplaintController {
constructor(private readonly service: ComplaintService, private readonly stagingService: StagingComplaintService) {}
constructor(
private readonly service: ComplaintService,
private readonly stagingService: StagingComplaintService,
private readonly linkedComplaintXrefService: LinkedComplaintXrefService,
) {}
private readonly logger = new Logger(ComplaintController.name);

@Get(":complaintType")
Expand Down Expand Up @@ -122,6 +127,17 @@ export class ComplaintController {
return this.service.getZoneAtAGlanceStatistics(complaintType, zone);
}

@Get("/linked-complaints/:complaint_id")
@Roles(Role.COS_OFFICER)
async findLinkedComplaintsById(@Param("complaint_id") complaintId: string) {
const childComplaints = await this.linkedComplaintXrefService.findChildComplaints(complaintId);
if (childComplaints.length > 0) return childComplaints;
else {
const parentComplaint = await this.linkedComplaintXrefService.findParentComplaint(complaintId);
return parentComplaint;
}
}

@Public()
@Post("/staging/action-taken")
@UseGuards(ApiKeyGuard)
Expand Down
2 changes: 2 additions & 0 deletions backend/src/v1/complaint/complaint.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ComplaintMethodReceivedCode } from "../complaint_method_received_code/e
import { CompMthdRecvCdAgcyCdXref } from "../comp_mthd_recv_cd_agcy_cd_xref/entities/comp_mthd_recv_cd_agcy_cd_xref";
import { CompMthdRecvCdAgcyCdXrefService } from "../comp_mthd_recv_cd_agcy_cd_xref/comp_mthd_recv_cd_agcy_cd_xref.service";
import { CompMthdRecvCdAgcyCdXrefModule } from "../comp_mthd_recv_cd_agcy_cd_xref/comp_mthd_recv_cd_agcy_cd_xref.module";
import { LinkedComplaintXrefModule } from "../linked_complaint_xref/linked_complaint_xref.module";

@Module({
imports: [
Expand Down Expand Up @@ -65,6 +66,7 @@ import { CompMthdRecvCdAgcyCdXrefModule } from "../comp_mthd_recv_cd_agcy_cd_xre
ComplaintUpdatesModule,
StagingComplaintModule,
CompMthdRecvCdAgcyCdXrefModule,
LinkedComplaintXrefModule,
],
controllers: [ComplaintController],
providers: [ComplaintService, CompMthdRecvCdAgcyCdXrefService],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { PickType } from "@nestjs/swagger";
import { LinkedComplaintXrefDto } from "./linked_complaint_xref.dto";

export class CreateLinkedComplaintXrefDto extends PickType(LinkedComplaintXrefDto, [
"create_user_id",
"create_utc_timestamp",
"update_user_id",
"update_utc_timestamp",
"complaint_identifier",
"linked_complaint_identifier",
"active_ind",
] as const) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { ApiProperty } from "@nestjs/swagger";
import { UUID } from "crypto";
import { Complaint } from "../../complaint/entities/complaint.entity";

export class LinkedComplaintXrefDto {
@ApiProperty({
example: "903f87c8-76dd-427c-a1bb-4d179e443252",
description:
"System generated unique key for a linked complaint relationship. This key should never be exposed to users via any system utilizing the tables.",
})
public linked_complaint_xref_guid: UUID;

@ApiProperty({
example: "mburns",
description: "The id of the user that created the cross reference.",
})
create_user_id: string;

@ApiProperty({
example: "2003-04-12 04:05:06",
description: "The timestamp when the cross reference was created. The timestamp is stored in UTC with no Offset.",
})
create_utc_timestamp: Date;

@ApiProperty({
example: "mburns",
description: "The id of the user that updated the cross reference.",
})
update_user_id: string;

@ApiProperty({
example: "2003-04-12 04:05:06",
description: "The timestamp when the cross reference was updated. The timestamp is stored in UTC with no Offset.",
})
update_utc_timestamp: Date;

@ApiProperty({
example: "24-007007",
description: "System generated unique key for a hwcr complaint.",
})
public linked_complaint_identifier: Complaint;

@ApiProperty({
example: "23-007007",
description: "System generated unique key for a hwcr complaint.",
})
public complaint_identifier: Complaint;

@ApiProperty({
example: "True",
description: "A boolean indicator to determine if the linked complaint is active.",
})
public active_ind: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { PartialType } from "@nestjs/mapped-types";
import { CreateLinkedComplaintXrefDto } from "./create-linked_complaint_xref.dto";

export class UpdateLinkedComplaintXrefDto extends PartialType(CreateLinkedComplaintXrefDto) {}
Loading
Loading