-
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.
Merge branch 'main' into j-s/court-session-type-arraignment
- Loading branch information
Showing
289 changed files
with
5,799 additions
and
2,730 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
73 changes: 0 additions & 73 deletions
73
apps/download-service/src/app/modules/health/payment-overview-documents.controller.ts
This file was deleted.
Oops, something went wrong.
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
54 changes: 54 additions & 0 deletions
54
apps/judicial-system/api/src/app/modules/defendant/limitedAccessDefendant.resolver.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,54 @@ | ||
import { Inject, UseGuards } from '@nestjs/common' | ||
import { Args, Context, Mutation, Resolver } from '@nestjs/graphql' | ||
|
||
import type { Logger } from '@island.is/logging' | ||
import { LOGGER_PROVIDER } from '@island.is/logging' | ||
|
||
import { | ||
AuditedAction, | ||
AuditTrailService, | ||
} from '@island.is/judicial-system/audit-trail' | ||
import { | ||
CurrentGraphQlUser, | ||
JwtGraphQlAuthGuard, | ||
} from '@island.is/judicial-system/auth' | ||
import type { User } from '@island.is/judicial-system/types' | ||
|
||
import { BackendService } from '../backend' | ||
import { UpdateDefendantInput } from './dto/updateDefendant.input' | ||
import { Defendant } from './models/defendant.model' | ||
|
||
@UseGuards(JwtGraphQlAuthGuard) | ||
@Resolver() | ||
export class LimitedAccessDefendantResolver { | ||
constructor( | ||
private readonly auditTrailService: AuditTrailService, | ||
@Inject(LOGGER_PROVIDER) | ||
private readonly logger: Logger, | ||
) {} | ||
|
||
@Mutation(() => Defendant, { nullable: true }) | ||
limitedAccessUpdateDefendant( | ||
@Args('input', { type: () => UpdateDefendantInput }) | ||
input: UpdateDefendantInput, | ||
@CurrentGraphQlUser() user: User, | ||
@Context('dataSources') | ||
{ backendService }: { backendService: BackendService }, | ||
): Promise<Defendant> { | ||
const { caseId, defendantId, ...updateDefendant } = input | ||
this.logger.debug( | ||
`Updating limitedAccess defendant ${defendantId} for case ${caseId}`, | ||
) | ||
|
||
return this.auditTrailService.audit( | ||
user.id, | ||
AuditedAction.UPDATE_DEFENDANT, | ||
backendService.limitedAccessUpdateDefendant( | ||
caseId, | ||
defendantId, | ||
updateDefendant, | ||
), | ||
defendantId, | ||
) | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
apps/judicial-system/backend/migrations/20241211095654-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,26 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
return queryInterface.sequelize.transaction((t) => | ||
Promise.all([ | ||
queryInterface.addColumn( | ||
'defendant', | ||
'punishment_type', | ||
{ | ||
type: Sequelize.STRING, | ||
allowNull: true, | ||
}, | ||
{ transaction: t }, | ||
), | ||
]), | ||
) | ||
}, | ||
async down(queryInterface, Sequelize) { | ||
return queryInterface.sequelize.transaction((t) => | ||
queryInterface.removeColumn('defendant', 'punishment_type', { | ||
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
Oops, something went wrong.