Judicial System
TODO
First, make sure you have docker, then run:
yarn dev-services judicial-system-backend
yarn dev-services judicial-system-message-handler
Then run the migrations and seed the database:
yarn nx run judicial-system-backend:migrate
yarn nx run judicial-system-backend:seed
You can serve this service locally by running:
yarn start judicial-system-backend
To enable SMS notifications to an on-call judge provide a password for the SMS service and court mobile numbers:
NOVA_PASSWORD=<SMS password> COURTS_MOBILE_NUMBERS='{ <court-id>: mobileNumbers: <judge mobile number> }' yarn start judicial-system-backend
Similarly, you can enable electronic signatures of judge rulings by providing a Dokobit access token:
DOKOBIT_ACCESS_TOKEN=<Dokobit access token>
In local development you can preview emails with ethereal nodemailer previews by following the urls in the logs. Alternatively, you can enable email sending via AWS SES turn off email test account and provide an email region:
EMAIL_USE_TEST_ACCOUNT=false EMAIL_REGION=eu-west-1 yarn start judicial-system-backend
You need to be authenticated against AWS for this to work.
To enable prison and prison administration email notifications provide email addresses:
PRISON_EMAIL=<prison email> PRISON_ADMIN_EMAIL=<prison administration email>
To enable writing to AWS S3 you need to be authenticated against AWS.
Finally, you can enable communication with the court system via xRoad by providing appropriate values for the environment variables specified in the
xRoad
and courtClientOptions
sections in environment.ts
.To get latest texts from Contentful you need to provide an appropriate value for the environment variable
CONTENTFUL_ACCESS_TOKEN
.yarn test judicial-system-backend
Visit
localhost:3344/api/swagger
Migrations need to be created by hand.
npx sequelize-cli migration:generate --name update-case
this will generate a migration file with empty exports for up (Altering commands) and down (Reverting commands).
To run the migrations on the local database run:
# for UP migrations
yarn nx run judicial-system-backend:migrate
# for DOWN migrations
yarn nx run judicial-system-backend:migrate/undo
You can serve this service locally by running:
yarn start judicial-system-api
To get latest texts from Contentful you need to provide an appropriate value for the environment variable
CONTENTFUL_ACCESS_TOKEN
.Visit
localhost:3333/api/graphql
A platform for the exchange of data, information, formal decisions and notifications between parties in the Icelandic judicial system.
Start the application
yarn start judicial-system-web
Then the project should be running on https://localhost:4200/.
To be able to fetch a list of lawyers you need to provide a value for the environment variable
LAWYERS_ICELAND_API_KEY
To skip authentication at innskraning.island.is navigate to
/api/auth/login?nationalId=<national_id>
in the web project where <national_id>
is the national id of a known user. Known users:- Áki Ákærandi
- NationalId: 0000000009
- Role: Prosecutor
- Dalli Dómritari
- NationalId: 0000001119
- Role: Registrar
- Dóra Dómari
- NationalId: 0000002229
- Role: Judge
This project uses two types of automated tests, unit tests and e2e tests. We use Jest to write unit tests against code like utility functions. If we need to test custom components in isolation, we use React testing library. Finally, to test entire screens in our project we use Cypress.
Unit tests
yarn test judicial-system-web
e2e tests
yarn nx e2e judicial-system-web-e2e --watch
Running
yarn nx extract-strings judicial-system-{namespace}
in the root folder /island.is
will extract messages from the project and create or update a Namespace entry in Contentful. Make sure you have the env CONTENTFUL_ENVIRONMENT=test
to update the strings against dev
and staging
and CONTENTFUL_ENVIRONMENT=master
to update against prod
.yarn nx extract-strings judicial-system-web
will update namespaces:
- judicial.system.core
- judicial.system.restriction_cases
- judicial.system.investigation_cases
yarn nx extract-strings judicial-system-backend
will update namespaces:
- judicial.system.backend
npm install -g local-ssl-proxy
- change defaultcookie in apps/judicial-system/api/src/app/modules/auth/auth.controller.ts:const defaultCookieOptions: CookieOptions = { secure: true, }
- add .env to web project and change PORT to 4202
- start project
local-ssl-proxy --source 4200 --target 4202
This service is for access from xRoad.
You can serve this service locally by running:
yarn start judicial-system-xrd-api
This service is for running scheduled tasks. Currently, archiving old cases is the only task.
You can serve this service locally by running:
yarn start judicial-system-scheduler
This service handles messages posted by other services for downstream processing.
First, make sure you have docker, then run:
yarn dev-services judicial-system-message-handler
You can serve this service locally by running:
yarn start judicial-system-message-handler
If you want to hide some UI element in certain environments you can use a feature flag. Lets say you want to hide the
SECRET_FEATURE
in STAGING and PROD but still be able to see it on DEV. Start by adding it to Feature
in /libs/judicial-system/types/src/lib/feature.ts
export enum Feature {
NONE = 'NONE', // must be at least one
SECRET_FEATURE = 'SECRET_FEATURE',
}
Then you need to update the Helm charts. Add
SECRET_FEATURE
to HIDDEN_FEATURES
in ./apps/judicial-system/api/infra/judicial-system-api.ts
.Then run the script
./infra/scripts/generate-chart-values.sh judicial-system
You can now use the
FeatureContext
to hide SECRET_FEATURE
in the UI. const Component = () => {
const { features } = useContext(FeatureContext)
return (
if (features.includes(Feature.SECRET_FEATURE)) {
<p>This will only show on DEV, not STAGING or PROD</p>
}
)
}
Last modified 19d ago