-
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): API endpoint to update subpoena (#15051)
* fix(j-s): Digital mailbox api config * fix(j-s): Config * fix(j-s): Added missing config value * Update judicial-system-xrd-robot-api.ts * Update app.config.ts * Update yaml * chore(j-s): Lawyers lib and controller added to digital mailbox api * Moving some files around * fix(j-s): cleanup * chore(j-s): Cleanup * import types as types * Update lawyers.service.ts * Update defender.controller.ts * chore(j-s): New functionality for subpoenas in API * Update case.controller.ts * chore(j-s): Continued API work * Update 20240530132001-update-defendant.js * chore(j-s): Retrieve ssn from ids token * fix(j-s): national id handling for defender * chore: nx format:write update dirty files * Update case.controller.ts * Update internalDefendant.controller.ts * fix(j-s): Test * Update SelectDefender.tsx * fix(j-s): Guards test * Update 20240514111505-update-defendant.js * Update internalDefendant.controller.ts * fix(j-s): cleanup * fix(j-s): Validation * Update subpoena.response.ts * fix(j-s): Controller decorators * Update internalDefendant.controller.ts * chore(j-s): Cleanups and handling different national id formats * fix(j-s): Feedback fixes * Update case.controller.ts --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d3ce693
commit 1566034
Showing
36 changed files
with
651 additions
and
283 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
56 changes: 56 additions & 0 deletions
56
apps/judicial-system/backend/migrations/20240530132001-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,56 @@ | ||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction((t) => | ||
queryInterface | ||
.addColumn( | ||
'defendant', | ||
'defender_choice', | ||
{ | ||
type: Sequelize.STRING, | ||
allowNull: true, | ||
}, | ||
{ transaction: t }, | ||
) | ||
.then(() => | ||
queryInterface.sequelize.query( | ||
`UPDATE "defendant" SET defender_choice = 'WAIVE' WHERE defendant_waives_right_to_counsel = true;`, | ||
{ transaction: t }, | ||
), | ||
) | ||
.then(() => | ||
queryInterface.removeColumn( | ||
'defendant', | ||
'defendant_waives_right_to_counsel', | ||
{ transaction: t }, | ||
), | ||
), | ||
) | ||
}, | ||
|
||
down: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction((t) => | ||
queryInterface | ||
.addColumn( | ||
'defendant', | ||
'defendant_waives_right_to_counsel', | ||
{ | ||
type: Sequelize.BOOLEAN, | ||
defaultValue: false, | ||
allowNull: false, | ||
}, | ||
{ transaction: t }, | ||
) | ||
.then(() => | ||
queryInterface.sequelize.query( | ||
`UPDATE "defendant" SET defendant_waives_right_to_counsel = true WHERE defender_choice = 'WAIVE';`, | ||
{ transaction: t }, | ||
), | ||
) | ||
.then(() => | ||
queryInterface.removeColumn('defendant', 'defender_choice', { | ||
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
Oops, something went wrong.