Skip to content

Commit

Permalink
fix(j-s): Indictment Appeal (#15906)
Browse files Browse the repository at this point in the history
* Fixes review status on case lists for the public prosecutors office

* Only shows indictment view info for indictments that end with a verdict

* Updates unit tests

* Fixes cases query for fmst

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and jonnigs committed Sep 12, 2024
1 parent 4d1ab67 commit 98b2516
Show file tree
Hide file tree
Showing 19 changed files with 782 additions and 475 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
NestInterceptor,
} from '@nestjs/common'

import { isRequestCase } from '@island.is/judicial-system/types'

import { getIndictmentInfo } from '../../case/interceptors/case.transformer'
import { CaseListEntry } from '../models/caseList.model'

Expand All @@ -27,21 +29,28 @@ export class CaseListInterceptor implements NestInterceptor {
return next.handle().pipe(
map((cases: CaseListEntry[]) => {
return cases.map((theCase) => {
if (isRequestCase(theCase.type)) {
return {
...theCase,
isValidToDateInThePast: theCase.validToDate
? Date.now() > new Date(theCase.validToDate).getTime()
: theCase.isValidToDateInThePast,
appealedDate: getAppealedDate(
theCase.prosecutorPostponedAppealDate,
theCase.accusedPostponedAppealDate,
),
}
}

const indictmentInfo = getIndictmentInfo(
theCase.indictmentRulingDecision,
theCase.rulingDate,
theCase.type,
theCase.defendants,
theCase.eventLogs,
)

return {
...theCase,
isValidToDateInThePast: theCase.validToDate
? Date.now() > new Date(theCase.validToDate).getTime()
: theCase.isValidToDateInThePast,
appealedDate: getAppealedDate(
theCase.prosecutorPostponedAppealDate,
theCase.accusedPostponedAppealDate,
),
...indictmentInfo,
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export class CaseListEntry {
@Field(() => Boolean, { nullable: true })
readonly indictmentVerdictViewedByAll?: boolean

@Field(() => String, { nullable: true })
readonly indictmentVerdictAppealDeadline?: string
@Field(() => Boolean, { nullable: true })
readonly indictmentVerdictAppealDeadlineExpired?: boolean

@Field(() => IndictmentDecision, { nullable: true })
readonly indictmentDecision?: IndictmentDecision
Expand Down
Loading

0 comments on commit 98b2516

Please sign in to comment.