Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(license-service): update license service #15204

Merged
merged 85 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
5f0e007
feat:updat emodels
thorkellmani Jun 11, 2024
b0bd894
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 11, 2024
84f8b09
feat/bunch
thorkellmani Jun 12, 2024
959c1fa
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 13, 2024
ff1bb57
feat: updates
thorkellmani Jun 18, 2024
1ac46db
feat: add and remove
thorkellmani Jun 18, 2024
3066d37
chore: stash merge
thorkellmani Jun 20, 2024
b0abee0
feat: more stuff
thorkellmani Jun 20, 2024
726e7db
fix: license type
thorkellmani Jun 20, 2024
eee35a1
feat: license overivew works
thorkellmani Jun 21, 2024
9e2300e
chore:revert
thorkellmani Jun 21, 2024
b2f7363
chore: revert messages
thorkellmani Jun 21, 2024
553c1bc
chore: console
thorkellmani Jun 21, 2024
caf4447
chore: revert
thorkellmani Jun 21, 2024
0b7fe69
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 21, 2024
00ed428
chore: nx format:write update dirty files
andes-it Jun 21, 2024
8e1519a
fix: passports
thorkellmani Jun 24, 2024
c934636
chore: start details
thorkellmani Jun 24, 2024
5387007
chore: nx format:write update dirty files
andes-it Jun 24, 2024
5108eb6
feat: update details
thorkellmani Jun 25, 2024
7a438b0
Merge remote-tracking branch 'refs/remotes/origin/feat/update-license…
thorkellmani Jun 25, 2024
32f39fc
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 25, 2024
250073f
fix: enum
thorkellmani Jun 25, 2024
aee18d0
fix: date format
thorkellmani Jun 25, 2024
98de224
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 26, 2024
e71e7a4
fix: type import
thorkellmani Jun 26, 2024
0a7d9bb
Merge remote-tracking branch 'refs/remotes/origin/feat/update-license…
thorkellmani Jun 26, 2024
1a86227
chore:small fixes
thorkellmani Jun 26, 2024
464b050
chore:rename-liceinse-service
thorkellmani Jun 26, 2024
39b6609
chore: remove original license service
thorkellmani Jun 26, 2024
5d97c1d
chore: add unchanged license service
thorkellmani Jun 26, 2024
4ab3093
chore: add mocks back
thorkellmani Jun 26, 2024
f835e34
chore: add to resolver
thorkellmani Jun 26, 2024
ced1ba4
chore:renmae license
thorkellmani Jun 26, 2024
abba81d
chore: readd licens service
thorkellmani Jun 26, 2024
431a326
fix: license-v2
thorkellmani Jun 26, 2024
845c5b9
fix: readd ls-v1
thorkellmani Jun 26, 2024
6f08e5c
feat: rename
thorkellmani Jun 27, 2024
8d0bd02
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 27, 2024
abf7b9b
chore: nx format:write update dirty files
andes-it Jun 27, 2024
1f9cd1d
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 27, 2024
2053f92
fix: passport display
thorkellmani Jun 27, 2024
73c0e65
Merge branch 'main' into feat/update-license-service
thorkellmani Jun 27, 2024
48919e7
Merge remote-tracking branch 'refs/remotes/origin/feat/update-license…
thorkellmani Jun 27, 2024
23b3b6f
chore: codeowners
thorkellmani Jun 28, 2024
3865524
chore: move datafields
thorkellmani Jun 28, 2024
ea28e0d
fix: html semantics
thorkellmani Jun 28, 2024
0e33190
fix:pkpass display
thorkellmani Jun 28, 2024
7e7fd0b
chore:console log
thorkellmani Jun 28, 2024
7ee74da
chore: use types
thorkellmani Jun 28, 2024
ee57f94
feat: remove v2 and merge in v1
thorkellmani Jun 28, 2024
f644109
chore:import
thorkellmani Jun 28, 2024
27c29ca
fix: expires
thorkellmani Jul 1, 2024
1b6a5c2
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 1, 2024
2ea9391
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 5, 2024
2df58b9
fix:navigation
thorkellmani Jul 5, 2024
2f40e87
fix: mapping
thorkellmani Jul 5, 2024
448a9f4
chore: import
thorkellmani Jul 5, 2024
0aceda1
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 8, 2024
55c96c2
fix: time format
thorkellmani Jul 8, 2024
2fa2114
fix:fix
thorkellmani Jul 8, 2024
b172814
chore: clean up types
thorkellmani Jul 9, 2024
d35f9c8
fix: async
thorkellmani Jul 9, 2024
0fd08aa
fix: messages
thorkellmani Jul 10, 2024
48fa9bd
fix: update display slightly
thorkellmani Jul 10, 2024
e05d4eb
fix: mcoks
thorkellmani Jul 10, 2024
cd57061
chore: deprecate model
thorkellmani Jul 10, 2024
326ba14
chore: import clean up
thorkellmani Jul 10, 2024
07d12e8
fix: update mapping
thorkellmani Jul 10, 2024
25cb249
chore: import clean up
thorkellmani Jul 10, 2024
8b25f30
fix: reimport reaect
thorkellmani Jul 10, 2024
e1f7113
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 10, 2024
e5a47ee
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 10, 2024
e709bab
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 10, 2024
dbad808
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 10, 2024
57b31f8
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 11, 2024
f17cf23
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 11, 2024
881b09e
Merge branch 'main' into feat/update-license-service
thorkellmani Jul 11, 2024
3c53d29
Merge branch 'main' into feat/update-license-service
thorkellmani Aug 12, 2024
8b50893
chore: use tag map
thorkellmani Aug 12, 2024
9e1c392
chore: coderabbit improvements
thorkellmani Aug 12, 2024
fcc370f
fix: const issues
thorkellmani Aug 12, 2024
8b94bfa
Merge branch 'main' into feat/update-license-service
thorkellmani Aug 12, 2024
781a01e
chore: concising
thorkellmani Aug 14, 2024
b2a324d
Merge branch 'main' into feat/update-license-service
kodiakhq[bot] Aug 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ const NotificationMenu = ({
isVisible={sideMenuOpen}
hideOnClickOutside={true}
hideOnEsc={true}
modalLabel={formatMessage({
id: 'service.portal:notification-button-aria',
defaultMessage: 'Valmynd fyrir tilkynningar',
})}
modalLabel={formatMessage(m.notificationButtonAria)}
removeOnClose={true}
preventBodyScroll={false}
onVisibilityChange={(visibility: boolean) => {
Expand Down
6 changes: 1 addition & 5 deletions apps/service-portal/src/components/Sidemenu/Sidemenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ const Sidemenu = ({
isVisible={sideMenuOpen}
hideOnClickOutside={true}
hideOnEsc={true}
modalLabel={formatMessage({
id: 'service.portal:menu-button-aria',
description: 'Lýsing á notendavalmynd fyrir skjálesara',
defaultMessage: 'Valmynd fyrir yfirlit',
})}
modalLabel={formatMessage(m.menuButtonAria)}
removeOnClose={true}
preventBodyScroll={false}
onVisibilityChange={(visibility: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export const loadLicensesXroadMocks = async () => {
categories: [
{
id: 68446262,
nr: '5u84961',
nr: 'A',
categoryName: 'Big big trucks',
publishDate: new Date('2017-04-22T15:30:23Z'),
dateTo: new Date('2030-04-22T15:30:23Z'),
Expand Down Expand Up @@ -524,7 +524,7 @@ export const loadLicensesXroadMocks = async () => {
licenseNumber: '987654321',
properties: [
{
category: 'testCatA',
category: 'A',
typeOfFirearm: 'cannon',
name: 'Howitzer',
serialNumber: '1337',
Expand All @@ -533,7 +533,7 @@ export const loadLicensesXroadMocks = async () => {
limitation: 'aint no brakes',
},
{
category: 'testCatB',
category: 'B',
typeOfFirearm: 'laserrailgun',
name: 'Macguffin',
serialNumber: '010101',
Expand All @@ -552,8 +552,18 @@ export const loadLicensesXroadMocks = async () => {
apiPath: '/api/FirearmApplication/Categories',
response: [
new Response().withJSONBody({
testCatA: 'bibbiddí boo',
testCatB: 'babbbada',
'Flokkur A':
'1. Haglabyssum nr. 12 og minni, þó eigi sjálfvirkum eða hálfsjálfvirkum.\n2. Rifflum cal. 22 (long rifle og minni), þ.m.t. loftrifflum, þó eigi sjálfvirkum eða hálfsjálfvirkum.',
'Flokkur B':
'Leyfi fyrir rifflum með hlaupvídd allt að cal. 30 og hálfsjálfvirkum haglabyssum skal ekki veitt nema sérstakar ástæður mæli með því, enda hafi umsækjandi haft skotvopnaleyfi í a.m.k. eitt ár.',
'Flokkur C':
'Leyfi fyrir skotvopnum sem sérstaklega eru ætluð til minkaveiða eða meindýraeyðingar (t.d. skammbyssur fyrir haglaskot) má aðeins veita að fenginni umsögn veiðistjóra. Áskilið er að umsækjandi hafi haft aukin skotvopnaréttindi (B flokkur) í eitt ár. Slík leyfi vegna þeirra sem stunda minkaveiðar skal ekki veita til að eignast skotvopn heldur einungis til láns eða leigu. Lögreglustjóri skal senda slíkar umsóknir með umsögn sinni ríkislögreglustjóra til ákvörðunar.',
'Flokkur D':
'Leyfi sem sérstaklega er veitt einstaklingi eða skotfélagi fyrir skammbyssum vegna íþróttaskotfimi sbr. 11. gr. Lögreglustjóri skal senda slíkar umsóknir með umsögn sinni ríkislögreglustjóra til ákvörðunar.',
'Flokkur E':
'Leyfi lögreglustjóra til að hlaða skothylki til eigin nota í þau skotvopn sem viðkomandi hefur leyfi fyrir, enda sé að öðru leyti heimilt að nota slík skotfæri hér á landi.',
'Flokkur S':
'Söfnunarleyfi sbr. 20. gr. Reglugerð um skotvopn, skotfæri o.fl.',
}),
],
})
Expand Down
6 changes: 6 additions & 0 deletions libs/api/domains/license-service/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
"options": {
"jestConfig": "libs/api/domains/license-service/jest.config.ts"
}
},
"extract-strings": {
"executor": "nx:run-commands",
"options": {
"command": "yarn ts-node -P libs/localization/tsconfig.lib.json libs/localization/scripts/extract 'libs/api/domains/license-service/src/lib/messages.ts'"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Field, ObjectType } from '@nestjs/graphql'
import { Field, ObjectType, Int } from '@nestjs/graphql'

@ObjectType('CreateBarcodeResult')
export class CreateBarcodeResult {
Expand All @@ -7,7 +7,7 @@ export class CreateBarcodeResult {
})
token!: string

@Field(() => Number, {
@Field(() => Int, {
description: 'Barcode expire time in seconds',
})
expiresIn!: number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql'
import { Field, Int, ObjectType, registerEnumType } from '@nestjs/graphql'
import {
GenericLicenseType,
GenericUserLicensePkPassStatus,
Expand Down Expand Up @@ -33,20 +33,19 @@ export class GenericLicense {
})
provider!: GenericLicenseProvider

@Field({ description: 'Display name of license' })
name?: string

@Field({ description: 'Does the license support pkpass?' })
pkpass!: boolean

@Field({ description: 'Does the license support verification of pkpass?' })
pkpassVerify!: boolean

@Field({
@Field(() => Int, {
description:
'How long the data about the license should be treated as fresh',
nullable: true,
deprecationReason: 'Unclear if this is used, will revert if necessary',
})
thorkellmani marked this conversation as resolved.
Show resolved Hide resolved
timeout!: number
timeout?: number

@Field(() => GenericUserLicenseStatus, { description: 'Status of license' })
status!: GenericUserLicenseStatus
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Field, ObjectType } from '@nestjs/graphql'
import { GenericLicenseError } from './GenericLicenseError.dto'
import { GenericUserLicense } from './GenericUserLicense.dto'

@ObjectType('GenericLicenseCollection')
export class LicenseCollection {
@Field(() => [GenericUserLicense], { nullable: true })
licenses!: Array<GenericUserLicense>

@Field(() => [GenericLicenseError], { nullable: true })
errors?: Array<GenericLicenseError>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql'
import { GenericLicenseDataFieldType } from '../licenceService.type'
import { GenericUserLicenseMetaLinks } from './GenericUserLicenseMetaLinks.dto'
import { GenericUserLicenseMetaTag } from './GenericUserLicenseMetaTag.dto'

registerEnumType(GenericLicenseDataFieldType, {
name: 'GenericLicenseDataFieldType',
Expand All @@ -20,15 +21,19 @@ export class GenericLicenseDataField {
@Field({ nullable: true, description: 'Label of data field' })
label?: string

@Field({ nullable: true, description: 'Value of data field' })
value?: string

@Field({
nullable: true,
description: 'Same as value, used in service portal',
description: 'Display value of data field category',
deprecationReason: 'Only used for cosmetic purposes, can be done better',
})
description?: string

@Field({ nullable: true, description: 'Value of data field' })
value?: string

@Field(() => GenericUserLicenseMetaTag, { nullable: true })
tag?: GenericUserLicenseMetaTag

@Field(() => GenericUserLicenseMetaLinks, {
nullable: true,
description: 'External meta link',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Field, Int, ObjectType } from '@nestjs/graphql'
import { GenericLicenseType } from '../licenceService.type'
import { GenericLicenseProvider } from './GenericLicenseProvider.dto'
import { GenericLicenseFetch } from './GenericLicenseFetch.dto'

@ObjectType('GenericLicenseError')
export class GenericLicenseError {
@Field(() => GenericLicenseType)
type!: GenericLicenseType

@Field(() => GenericLicenseFetch, { description: 'Info about license fetch' })
fetch!: GenericLicenseFetch

@Field(() => GenericLicenseProvider, { nullable: true })
provider?: GenericLicenseProvider

@Field(() => Int, { nullable: true })
errorCode?: number
thorkellmani marked this conversation as resolved.
Show resolved Hide resolved

@Field({ nullable: true })
errorMessage?: string

@Field({ nullable: true })
extraData?: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,16 @@ export class GenericLicenseProvider {
description: 'ID of license provider',
})
id!: GenericLicenseProviderId

@Field({
nullable: true,
description: 'Contentful reference id',
})
referenceId?: string

@Field({ nullable: true })
providerName?: string

@Field({ nullable: true })
providerLogo?: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { Field, ObjectType } from '@nestjs/graphql'

@ObjectType()
export class GenericPkPass {
@Field(() => String)
@Field()
pkpassUrl!: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { Field, ObjectType } from '@nestjs/graphql'

@ObjectType()
export class GenericPkPassQrCode {
@Field(() => String)
@Field()
pkpassQRCode!: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import { Field, ObjectType } from '@nestjs/graphql'

@ObjectType()
export class GenericPkPassVerificationError {
@Field(() => String, {
@Field({
nullable: true,
description:
'pkpass verification error code, depandant on origination service, "0" for unknown error',
})
status?: string

@Field(() => String, {
@Field({
nullable: true,
description:
'pkpass verification error message, depandant on origination service',
})
message?: string

@Field(() => String, {
@Field({
nullable: true,
description: 'Optional data related to the error',
})
Expand All @@ -25,7 +25,7 @@ export class GenericPkPassVerificationError {

@ObjectType()
export class GenericPkPassVerification {
@Field(() => String, {
@Field({
nullable: true,
description: 'Optional data related to the pkpass verification',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ import { Payload } from './Payload.dto'
export class GenericUserLicense {
@Field({
description: 'National ID of license owner',
deprecationReason: 'Moved one level up',
})
nationalId!: string

@Field({
nullable: true,
description: 'Is license owner child of user',
})
isOwnerChildOfUser?: boolean

@Field(() => GenericLicense, { description: 'License info' })
license!: GenericLicense

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql'
import { AlertType } from '../licenceService.type'

registerEnumType(AlertType, {
name: 'GenericUserLicenseAlertType',
})

@ObjectType('GenericUserLicenseAlert')
export class GenericUserLicenseAlert {
@Field()
title!: string

@Field(() => AlertType, { defaultValue: AlertType.WARNING })
type?: AlertType

@Field({ nullable: true })
message?: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ registerEnumType(GenericUserLicenseMetaLinksType, {

@ObjectType()
export class GenericUserLicenseMetaLinks {
@Field(() => String, { nullable: true })
@Field({ nullable: true })
label?: string

@Field(() => String, { nullable: true })
@Field({ nullable: true })
value?: string

@Field(() => String, { nullable: true })
@Field({ nullable: true })
name?: string

@Field(() => GenericUserLicenseMetaLinksType, { nullable: true })
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql'
import {
GenericUserLicenseDataFieldTagColor,
GenericUserLicenseDataFieldTagType,
} from '../licenceService.type'

registerEnumType(GenericUserLicenseDataFieldTagType, {
name: 'GenericUserLicenseDataFieldTagType',
description: 'Exhaustive list of possible tag icons',
})
registerEnumType(GenericUserLicenseDataFieldTagColor, {
name: 'GenericUserLicenseDataFieldTagColor',
description: 'Exhaustive list of possible tag icon color',
})

@ObjectType('GenericUserLicenseMetaTag')
export class GenericUserLicenseMetaTag {
@Field()
text!: string

@Field({ nullable: true })
color?: string

@Field(() => GenericUserLicenseDataFieldTagType, { nullable: true })
icon?: GenericUserLicenseDataFieldTagType

@Field(() => GenericUserLicenseDataFieldTagColor, { nullable: true })
iconColor?: GenericUserLicenseDataFieldTagColor

@Field({
nullable: true,
description:
'Defaults to the text property if icon defined but iconText left undefined',
})
iconText?: string
}
Loading
Loading