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(j-s): Add a mergeCaseNumber field to case table #17507

Merged
merged 4 commits into from
Jan 16, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ export class UpdateCaseInput {
@Field(() => ID, { nullable: true })
readonly mergeCaseId?: string

@Allow()
@IsOptional()
@Field(() => String, { nullable: true })
readonly mergeCaseNumber?: string

@Allow()
@IsOptional()
@Field(() => String, { nullable: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ export class Case {
@Field(() => [Case], { nullable: true })
readonly mergedCases?: Case[]

@Field(() => String, { nullable: true })
readonly mergeCaseNumber?: string

@Field(() => [CivilClaimant], { nullable: true })
readonly civilClaimants?: CivilClaimant[]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
async up(queryInterface, Sequelize) {
return queryInterface.sequelize.transaction((t) =>
Promise.all([
queryInterface.addColumn(
'case',
'merge_case_number',
{
type: Sequelize.STRING,
allowNull: true,
},
{ transaction: t },
),
]),
)
},
async down(queryInterface) {
return queryInterface.sequelize.transaction((t) =>
queryInterface.removeColumn('case', 'merge_case_number', {
transaction: t,
}),
)
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export interface UpdateCase
| 'judgeId'
| 'courtSessionType'
| 'mergeCaseId'
| 'mergeCaseNumber'
> {
type?: CaseType
state?: CaseState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,11 @@ export class UpdateCaseDto {
@ApiPropertyOptional({ type: String })
readonly mergeCaseId?: string

@IsOptional()
@IsString()
@ApiPropertyOptional({ type: String })
readonly mergeCaseNumber?: string

@IsOptional()
@IsString()
@ApiPropertyOptional({ type: String })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const districtCourtFields: (keyof UpdateCaseDto)[] = [
'indictmentDecision',
'courtSessionType',
'mergeCaseId',
'mergeCaseNumber',
]

const courtOfAppealsFields: (keyof UpdateCaseDto)[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1061,13 +1061,21 @@ export class Case extends Model {
@ApiPropertyOptional({ type: () => Case })
mergeCase?: Case

// /**********
// * The cases that have been merged in to the current case - only used if the case was merged
// **********/
/**********
* The cases that have been merged in to the current case - only used if the case was merged
**********/
@HasMany(() => Case, 'mergeCaseId')
@ApiPropertyOptional({ type: () => Case })
mergedCases?: Case[]

/**********
* The court case number this case was merged in to - only used if the case was merged
* with a case that is not in RVG
**********/
@Column({ type: DataType.STRING, allowNull: true })
@ApiPropertyOptional({ type: String })
mergeCaseNumber?: string

/**********
* Indicates whether a case should include any civil claims -
* optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ query Case($input: CaseQueryInput!) {
caseFilesSharedWithSpokesperson
isSpokespersonConfirmed
}
mergeCaseNumber
civilDemands
hasCivilClaims
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,6 @@ mutation UpdateCase($input: UpdateCaseInput!) {
mergeCase {
id
}
mergeCaseNumber
}
}
Loading