-
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.
feat(j-s): Send to prison admin (#16831)
* Add a send to fmst button that routes to a page * Remove unused code * Add UI * Create event log when indictment is sent to FMSt * Create event log when indictment is sent to FMSt * Create event log when indictment is sent to FMSt * Refactor * Refactor * Refactor * Updates FMST queries * Refactor * Refactor * Refactor * Refactor * Add DefendantEventLog table * Refactor * Send sentToPrisonAdminDate to client * Show sent to prison admin date on info cards * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Frontend: Upload file to prison admin * Frontend: Upload file to prison admin * Add SentToPrisonAdmin tag in cases list for PP * Merge * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Refactor * Remove caseId from defendant event log table * Remove caseId from defendant event log table * Revert * Remove unused code * Refactor * Removes unused event type * Removes the defendant event log from the api * Moves defendant event log to defendant model * Fixes backend case retrieval * Updates unit test * Sets the sent to prison admin date to undefined it the defendant has not been sent to prison admin * Fixes linting issues * Updates unit tests * Updates unit tests * Updates unit tests * Updates unit tests --------- Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e0596d3
commit 78bdd5b
Showing
54 changed files
with
855 additions
and
265 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
25 changes: 25 additions & 0 deletions
25
apps/judicial-system/backend/migrations/20241112125245-update-defendant.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,25 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up(queryInterface, Sequelize) { | ||
return queryInterface.sequelize.transaction((transaction) => | ||
queryInterface.addColumn( | ||
'defendant', | ||
'is_sent_to_prison_admin', | ||
{ | ||
type: Sequelize.BOOLEAN, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
) | ||
}, | ||
|
||
down(queryInterface) { | ||
return queryInterface.sequelize.transaction((transaction) => | ||
queryInterface.removeColumn('defendant', 'is_sent_to_prison_admin', { | ||
transaction, | ||
}), | ||
) | ||
}, | ||
} |
56 changes: 56 additions & 0 deletions
56
apps/judicial-system/backend/migrations/20241114123528-create-defendant-event-log.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,56 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction((t) => | ||
queryInterface.createTable( | ||
'defendant_event_log', | ||
{ | ||
id: { | ||
type: Sequelize.UUID, | ||
primaryKey: true, | ||
allowNull: false, | ||
defaultValue: Sequelize.UUIDV4, | ||
}, | ||
created: { | ||
type: 'TIMESTAMP WITH TIME ZONE', | ||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), | ||
allowNull: false, | ||
}, | ||
modified: { | ||
type: 'TIMESTAMP WITH TIME ZONE', | ||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), | ||
allowNull: false, | ||
}, | ||
case_id: { | ||
type: Sequelize.UUID, | ||
references: { | ||
model: 'case', | ||
key: 'id', | ||
}, | ||
allowNull: false, | ||
}, | ||
defendant_id: { | ||
type: Sequelize.UUID, | ||
references: { | ||
model: 'defendant', | ||
key: 'id', | ||
}, | ||
allowNull: false, | ||
}, | ||
event_type: { | ||
type: Sequelize.STRING, | ||
allowNull: false, | ||
}, | ||
}, | ||
{ transaction: t }, | ||
), | ||
) | ||
}, | ||
|
||
down: (queryInterface) => { | ||
return queryInterface.sequelize.transaction((t) => | ||
queryInterface.dropTable('defendant_event_log', { transaction: t }), | ||
) | ||
}, | ||
} |
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
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
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
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.