-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Locks subpoena fields when arraignment date has been set * Move arraignment date message handling to the server side * Updates tests and fixes date comparison * Schedules new subpoenas * Enforces operation ordering * Only sends query parameters with new subpoena requests * 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 tests --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Ívar Oddsson <ivaroddsson@gmail.com>
- Loading branch information
1 parent
2e17b5d
commit 2197961
Showing
42 changed files
with
861 additions
and
352 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
31 changes: 31 additions & 0 deletions
31
apps/judicial-system/api/src/app/modules/defendant/models/subpoena.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,31 @@ | ||
import { Field, ID, ObjectType } from '@nestjs/graphql' | ||
|
||
@ObjectType() | ||
export class Subpoena { | ||
@Field(() => ID) | ||
readonly id!: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
created?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
modified?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
subpoenaId?: string | ||
|
||
@Field(() => Boolean, { nullable: true }) | ||
acknowledged?: boolean | ||
|
||
@Field(() => String, { nullable: true }) | ||
registeredBy?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
comment?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
arraignmentDate?: string | ||
|
||
@Field(() => String, { nullable: true }) | ||
location?: 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
61 changes: 61 additions & 0 deletions
61
apps/judicial-system/backend/migrations/20240926131706-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,61 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up(queryInterface, Sequelize) { | ||
return queryInterface.sequelize.transaction((transaction) => | ||
Promise.all([ | ||
queryInterface.addColumn( | ||
'subpoena', | ||
'arraignment_date', | ||
{ | ||
type: Sequelize.DATE, | ||
allowNull: false, | ||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
'subpoena', | ||
'location', | ||
{ type: Sequelize.STRING, allowNull: false, defaultValue: 'óþekkt' }, | ||
{ transaction }, | ||
), | ||
queryInterface.changeColumn( | ||
'subpoena', | ||
'case_id', | ||
{ | ||
type: Sequelize.UUID, | ||
allowNull: false, | ||
}, | ||
{ transaction }, | ||
), | ||
]).then(() => | ||
queryInterface.sequelize.query( | ||
`ALTER TABLE subpoena ALTER COLUMN arraignment_date DROP DEFAULT; | ||
ALTER TABLE subpoena ALTER COLUMN location DROP DEFAULT;`, | ||
{ transaction }, | ||
), | ||
), | ||
) | ||
}, | ||
|
||
down(queryInterface, Sequelize) { | ||
return queryInterface.sequelize.transaction((transaction) => | ||
Promise.all([ | ||
queryInterface.removeColumn('subpoena', 'arraignment_date', { | ||
transaction, | ||
}), | ||
queryInterface.removeColumn('subpoena', 'location', { transaction }), | ||
queryInterface.changeColumn( | ||
'subpoena', | ||
'case_id', | ||
{ | ||
type: Sequelize.UUID, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
]), | ||
) | ||
}, | ||
} |
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.