Skip to content

Commit

Permalink
Merge branch 'main' into j-s/reassignment-indictment
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Apr 30, 2024
2 parents ce34840 + 57a4c05 commit 717b16c
Show file tree
Hide file tree
Showing 19 changed files with 266 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,13 @@ export class InternalCaseService {
theCase.id,
theCase.appealCaseNumber,
theCase.appealAssistant?.nationalId,
theCase.appealAssistant?.name,
theCase.appealJudge1?.nationalId,
theCase.appealJudge1?.name,
theCase.appealJudge2?.nationalId,
theCase.appealJudge2?.name,
theCase.appealJudge3?.nationalId,
theCase.appealJudge3?.name,
)
.then(() => ({ delivered: true }))
.catch((reason) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ describe('InternalCaseController - Deliver assigned roles to court of appeals',
const appealJudge2Id = uuid()
const appealJudge3Id = uuid()
const appealAssistantNationalId = uuid()
const appealAssistantName = uuid()
const appealJudge1NationalId = uuid()
const appealJudge1Name = uuid()
const appealJudge2NationalId = uuid()
const appealJudge2Name = uuid()
const appealJudge3NationalId = uuid()
const appealJudge3Name = uuid()

const theCase = {
id: caseId,
Expand All @@ -36,10 +40,22 @@ describe('InternalCaseController - Deliver assigned roles to court of appeals',
appealJudge1Id,
appealJudge2Id,
appealJudge3Id,
appealAssistant: { nationalId: appealAssistantNationalId },
appealJudge1: { nationalId: appealJudge1NationalId },
appealJudge2: { nationalId: appealJudge2NationalId },
appealJudge3: { nationalId: appealJudge3NationalId },
appealAssistant: {
nationalId: appealAssistantNationalId,
name: appealAssistantName,
},
appealJudge1: {
nationalId: appealJudge1NationalId,
name: appealJudge1Name,
},
appealJudge2: {
nationalId: appealJudge2NationalId,
name: appealJudge2Name,
},
appealJudge3: {
nationalId: appealJudge3NationalId,
name: appealJudge3Name,
},
} as Case

let mockCourtService: CourtService
Expand Down Expand Up @@ -83,9 +99,13 @@ describe('InternalCaseController - Deliver assigned roles to court of appeals',
caseId,
appealCaseNumber,
appealAssistantNationalId,
appealAssistantName,
appealJudge1NationalId,
appealJudge1Name,
appealJudge2NationalId,
appealJudge2Name,
appealJudge3NationalId,
appealJudge3Name,
)
expect(then.result).toEqual({ delivered: true })
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,17 +593,25 @@ export class CourtService {
caseId: string,
appealCaseNumber?: string,
appealAssistantNationalId?: string,
appealAssistantName?: string,
appealJudge1NationalId?: string,
appealJudge1Name?: string,
appealJudge2NationalId?: string,
appealJudge2Name?: string,
appealJudge3NationalId?: string,
appealJudge3Name?: string,
): Promise<unknown> {
try {
const subject = `Landsréttur - ${appealCaseNumber} - aðilar`
const content = JSON.stringify({
appealAssistantNationalId,
appealAssistantName,
appealJudge1NationalId,
appealJudge1Name,
appealJudge2NationalId,
appealJudge2Name,
appealJudge3NationalId,
appealJudge3Name,
})

return this.sendToRobot(
Expand All @@ -621,9 +629,13 @@ export class CourtService {
institution: user.institution?.name,
appealCaseNumber,
appealAssistantNationalId,
appealAssistantName,
appealJudge1NationalId,
appealJudge1Name,
appealJudge2NationalId,
appealJudge2Name,
appealJudge3NationalId,
appealJudge3Name,
},
error,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export class FileService {
})

if (
theCase.appealCaseNumber &&
file.category &&
[
CaseFileCategory.PROSECUTOR_APPEAL_STATEMENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('FileController - Create case file', () => {
'case file created for %s case',
(type) => {
const caseId = uuid()
const theCase = { id: caseId, type } as Case
const theCase = { id: caseId, type, appealCaseNumber: uuid() } as Case
const uuId = uuid()
const createCaseFile: CreateFileDto = {
type: 'text/plain',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('limitedAccessFileController - Create case file', () => {
'case file created for %s case',
(type) => {
const caseId = uuid()
const theCase = { id: caseId, type } as Case
const theCase = { id: caseId, type, appealCaseNumber: uuid() } as Case
const uuId = uuid()
const createCaseFile: CreateFileDto = {
type: 'text/plain',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ const getChapter = (category?: string): number | undefined => {
}

const formatCrimeScenePlace = (
street?: string,
streetNumber?: string,
municipality?: string,
street?: string | null,
streetNumber?: string | null,
municipality?: string | null,
) => {
if (!street && !municipality) {
return ''
Expand Down Expand Up @@ -102,9 +102,9 @@ export class PoliceService {
upprunalegtMalsnumer: z.string(),
licencePlate: z.optional(z.string()),
gotuHeiti: z.optional(z.string()),
gotuNumer: z.optional(z.string()),
sveitafelag: z.optional(z.string()),
postnumer: z.optional(z.string()),
gotuNumer: z.string().nullish(),
sveitafelag: z.string().nullish(),
postnumer: z.string().nullish(),
})
private responseStructure = z.object({
malsnumer: z.string(),
Expand Down Expand Up @@ -336,9 +336,9 @@ export class PoliceService {
vettvangur?: string
brotFra?: string
licencePlate?: string
gotuHeiti?: string
gotuNumer?: string
sveitafelag?: string
gotuHeiti?: string | null
gotuNumer?: string | null
sveitafelag?: string | null
}) => {
const policeCaseNumber = info.upprunalegtMalsnumer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ describe('PoliceController - Get police case info', () => {
upprunalegtMalsnumer: '007-2020-000103',
brotFra: '2021-02-23T13:17:00',
gotuHeiti: 'Teststígur',
gotuNumer: null,
sveitafelag: 'Testbær',
licencePlate: 'CDE-123',
},
{
upprunalegtMalsnumer: '007-2020-000057',
brotFra: '2021-02-23T13:17:00',
gotuHeiti: 'Teststígur',
sveitafelag: null,
},
],
}),
Expand Down
4 changes: 2 additions & 2 deletions apps/web/screens/PetitionView/PetitionSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Skeleton = () => {
return (
<Stack space={3}>
<SkeletonLoader height={70} width="100%" borderRadius="large" />
<SkeletonLoader height={350} borderRadius="large" />
<SkeletonLoader height={250} borderRadius="large" />
<Box display="flex" justifyContent="spaceBetween">
<SkeletonLoader height={70} width="30%" borderRadius="large" />
<SkeletonLoader height={70} width="30%" borderRadius="large" />
Expand All @@ -13,7 +13,7 @@ const Skeleton = () => {
<Box marginY={3}>
<SkeletonLoader height={70} width="45%" borderRadius="large" />
</Box>
<SkeletonLoader height={250} borderRadius="large" />
<SkeletonLoader height={350} borderRadius="large" />
</Stack>
)
}
Expand Down
Loading

0 comments on commit 717b16c

Please sign in to comment.