-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(j-s): Display service status (#16177)
* Locks subpoena fields when arraignment date has been set * Show subpoena status * Move arraignment date message handling to the server side * Updates tests and fixes date comparison * Change subpoena data structure * Checkpoint * Map ServiceStatus to human readable text * Defender and electronically service * Schedules new subpoenas * Enforces operation ordering * Only sends query parameters with new subpoena requests * Service to defender * Sort in asc order * Cleanup * Checkpoint * Supports multiple subpoenas per defendant * Updates unit tests * Updates unit test * Fixes some typs and null reference guards * Improved type declaration * Improved date formatting * Improves indexing * Fixes spelling * Fixes indexing * Fixes optional arguments * Removes redundant constructor * Fix key error * Remove unused import * Remove unused import * Fix tests * Checkpoint * Checkpoint * Checkpoint * Save subpoena status in DB * Error handling * Move error handling * Update police.service.ts * Merge * Update police.service.ts * Update police.service.ts * Update police.service.ts * Error handling in frontend * Cleanup * Cleanup * Cleanup * Revert processing * Cleanup * Error handling * Add to prosecutor screen * Remove double encoding code * Hide ServiceAnnouncement if no subpoena id * Use correct data * Add defender national id * Fix Slack log * Rename interface * fix(j-s): xrd fixes * Update app.service.ts * Update updateSubpoena.dto.ts * fix(j-s): module import * Revert "fix(j-s): module import" This reverts commit a11885c. * Update createTestingPoliceModule.ts --------- Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: unakb <[email protected]>
- Loading branch information
1 parent
f1b145f
commit 8594e56
Showing
33 changed files
with
657 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
apps/judicial-system/api/src/app/modules/police/dto/subpoenaStatus.input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Allow } from 'class-validator' | ||
|
||
import { Field, ID, InputType } from '@nestjs/graphql' | ||
|
||
@InputType() | ||
export class SubpoenaStatusQueryInput { | ||
@Allow() | ||
@Field(() => ID) | ||
readonly caseId!: string | ||
|
||
@Allow() | ||
@Field(() => ID) | ||
readonly subpoenaId!: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { PoliceCaseInfo } from './models/policeCaseInfo.model' | ||
export { SubpoenaStatus } from './models/subpoenaStatus.model' | ||
export { PoliceCaseFile } from './models/policeCaseFile.model' | ||
export { UploadPoliceCaseFileResponse } from './models/uploadPoliceCaseFile.response' |
21 changes: 21 additions & 0 deletions
21
apps/judicial-system/api/src/app/modules/police/models/subpoenaStatus.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Field, ObjectType } from '@nestjs/graphql' | ||
|
||
import { ServiceStatus } from '@island.is/judicial-system/types' | ||
|
||
@ObjectType() | ||
export class SubpoenaStatus { | ||
@Field(() => ServiceStatus) | ||
readonly serviceStatus!: ServiceStatus | ||
|
||
@Field(() => String, { nullable: true }) | ||
readonly servedBy?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
readonly comment?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
readonly serviceDate?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
readonly defenderNationalId?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
apps/judicial-system/backend/migrations/20240925130059-update-subpoena.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction((transaction) => | ||
queryInterface | ||
.changeColumn( | ||
'subpoena', | ||
'acknowledged', | ||
{ type: Sequelize.STRING, allowNull: true }, | ||
{ transaction }, | ||
) | ||
.then( | ||
() => | ||
queryInterface.renameColumn( | ||
'subpoena', | ||
'acknowledged', | ||
'service_status', | ||
{ transaction }, | ||
), | ||
|
||
queryInterface.renameColumn( | ||
'subpoena', | ||
'acknowledged_date', | ||
'service_date', | ||
{ transaction }, | ||
), | ||
|
||
queryInterface.renameColumn( | ||
'subpoena', | ||
'registered_by', | ||
'served_by', | ||
{ transaction }, | ||
), | ||
|
||
queryInterface.addColumn( | ||
'subpoena', | ||
'defender_national_id', | ||
{ | ||
type: Sequelize.STRING, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
), | ||
) | ||
}, | ||
|
||
down: (queryInterface) => { | ||
return queryInterface.sequelize.transaction((transaction) => | ||
queryInterface | ||
.renameColumn('subpoena', 'service_status', 'acknowledged', { | ||
transaction, | ||
}) | ||
.then( | ||
() => | ||
queryInterface.changeColumn( | ||
'subpoena', | ||
'acknowledged', | ||
{ | ||
type: 'BOOLEAN USING CAST("acknowledged" as BOOLEAN)', | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
|
||
queryInterface.renameColumn( | ||
'subpoena', | ||
'service_date', | ||
'acknowledged_date', | ||
{ transaction }, | ||
), | ||
|
||
queryInterface.renameColumn( | ||
'subpoena', | ||
'served_by', | ||
'registered_by', | ||
{ transaction }, | ||
), | ||
|
||
queryInterface.removeColumn('subpoena', 'defender_national_id', { | ||
transaction, | ||
}), | ||
), | ||
) | ||
}, | ||
} |
1 change: 0 additions & 1 deletion
1
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...al-system/backend/src/app/modules/case/test/caseController/getIndictmentPdfGuards.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...ystem/backend/src/app/modules/file/test/fileController/getCaseFileSignedUrlGuards.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.