Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:opencrvs/opencrvs-countryconfig …
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
rikukissa committed Jan 21, 2025
2 parents 5c6cb4f + 95fd512 commit 60d61e6
Show file tree
Hide file tree
Showing 17 changed files with 1,669 additions and 40 deletions.
34 changes: 13 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@

## 1.7.0 Release candidate

### Breaking changes

- `INFORMANT_SIGNATURE` & `INFORMANT_SIGNATURE_REQUIRED` are now deprecated
- Existing implementations relying on database-stored SVGs need to be updated to use the new configuration-based approach. A migration needs to be run (defined in [migration](https://github.com/opencrvs/opencrvs-core/pull/7813/files#diff-e5472dec87399bb9f73f75ec379ceb6a32ca135bc01dd8d0eb8f7d7aaa0bc0b1)), and default certificate templates must be created for each event type, following the convention `${event}-certificate` as the certificate template ID.

### New features

- Update the translations for System user add/edit form, `Last name` to `User's surname` and `First name` to `User's first name` to make them less confusing for system users [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830)
- **Refactored certificate handling:** SVGs are no longer stored in the database; streamlined configurations now include certificate details, and clients request SVGs directly via URLs.
- Add constant.humanName to allow countries to have custom ordering on their full name e.g. start with `lastName` or `firstName` [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830)

### Improvements

- Auth token, ip address, remote address, mobile number, email redacted/masked from server log
- Optimized deployment times by making docker images download in parallel.
- Country alpha3 ISO code now is derived from variables to the Docker Compose files and don't need to be hard coded

### Bug fixes

Expand All @@ -16,36 +29,15 @@
- Previously it was possible MongoDB replica set and users were left randomly uninitialised after a deployment. MongoDB initialisation container now retries on failure.
- On some machines 'file' utility was not preinstalled causing provision to fail. We now install the utility if it doesn't exist.

### Breaking changes

- Existing implementations relying on database-stored SVGs need to be updated to use the new configuration-based approach. A migration needs to be run (defined in [migration](https://github.com/opencrvs/opencrvs-core/pull/7813/files#diff-e5472dec87399bb9f73f75ec379ceb6a32ca135bc01dd8d0eb8f7d7aaa0bc0b1)), and default certificate templates must be created for each event type, following the convention `${event}-certificate` as the certificate template ID.

### Improvements

- Auth token, ip address, remote address, mobile number, email redacted/masked from server log
- Optimised deployment times by making docker images download in parallel.
- Country alpha3 ISO code now is derived from variables to the Docker Compose files and don't need to be hard coded

### Infrastructure breaking changes

- **Title** Description

### New features

- **Refactored certificate handling:** SVGs are no longer stored in the database; streamlined configurations now include certificate details, and clients request SVGs directly via URLs.
- Misc new feature
- Add constant.humanName to allow coutries to have custom ordering on thier full name e.g start with `lastName` or `firstName` [#6830](https://github.com/opencrvs/opencrvs-core/issues/6830)

### New content keys requiring translation

```
INSERT CSV ROWS IN ENGLISH ONLY
```

## Bug fixes

- TBC

## 1.6.1 (TBD)

### Bug fixes
Expand Down
4 changes: 3 additions & 1 deletion infrastructure/docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ services:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- MONGO_URL=mongodb://events:${EVENTS_MONGODB_PASSWORD}@mongo1/events?replicaSet=rs0
- EVENTS_MONGO_URL=mongodb://events:${EVENTS_MONGODB_PASSWORD}@mongo1/events?replicaSet=rs0
- USER_MGNT_MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1/user-mgnt?replicaSet=rs0
- ES_URL=http://search-user:${ROTATING_SEARCH_ELASTIC_PASSWORD}@elasticsearch:9200
deploy:
labels:
- 'traefik.enable=false'
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/mongodb/on-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ if [[ $EVENTS_USER != "FOUND" ]]; then
db.createUser({
user: 'events',
pwd: '$EVENTS_MONGODB_PASSWORD',
roles: [{ role: 'readWrite', db: 'events' }]
roles: [{ role: 'readWrite', db: 'events' }, {role: 'read', db: 'user-mgnt'}]
})
EOF
else
Expand All @@ -271,7 +271,7 @@ else
use events
db.updateUser('events', {
pwd: '$EVENTS_MONGODB_PASSWORD',
roles: [{ role: 'readWrite', db: 'events' }]
roles: [{ role: 'readWrite', db: 'events' }, {role: 'read', db: 'user-mgnt'}]
})
EOF
fi
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "0.0.9-events",
"@opencrvs/toolkit": "0.0.17-events",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
4 changes: 1 addition & 3 deletions src/api/application/application-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ export const applicationConfig = {
DEATH_REGISTRATION: true,
MARRIAGE_REGISTRATION: false,
EXTERNAL_VALIDATION_WORKQUEUE: false,
INFORMANT_SIGNATURE: false,
PRINT_DECLARATION: false,
DATE_OF_BIRTH_UNKNOWN: true,
INFORMANT_SIGNATURE_REQUIRED: false
DATE_OF_BIRTH_UNKNOWN: true
},
USER_NOTIFICATION_DELIVERY_METHOD: 'email', // or 'sms', or '' ... You can use 'sms' for WhatsApp
INFORMANT_NOTIFICATION_DELIVERY_METHOD: 'email', // or 'sms', or '' ... You can use 'sms' for WhatsApp
Expand Down
27 changes: 24 additions & 3 deletions src/api/custom-event/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,31 @@
*/
import * as Hapi from '@hapi/hapi'
import { tennisClubMembershipEvent } from '@countryconfig/form/tennis-club-membership'
import { EventDocument } from '@opencrvs/toolkit/events'
import { birthEvent } from '@countryconfig/form/v2/birth'

export const customEventHandler = (
export function getCustomEventsHandler(
request: Hapi.Request,
h: Hapi.ResponseToolkit
) => {
return h.response([tennisClubMembershipEvent]).code(200)
) {
return h.response([tennisClubMembershipEvent, birthEvent]).code(200)
}

export function onRegisterHandler(
request: Hapi.Request,
h: Hapi.ResponseToolkit
) {
const event = EventDocument.parse(request.payload)
console.log(event)
return h.response().code(200)
}

export function onAnyActionHandler(
request: Hapi.Request,
h: Hapi.ResponseToolkit
) {
console.log(request.params.event, request.params.action)
const event = EventDocument.parse(request.payload)
console.log(event)
return h.response().code(200)
}
36 changes: 34 additions & 2 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
*/

import { defineConfig, defineForm } from '@opencrvs/toolkit/events'

import {
defineConditional,
or,
eventHasAction,
userHasScope,
and,
not,
field
field,
deduplication
} from '@opencrvs/toolkit/conditionals'
import { getAddressFields } from './v2/person/address'

const TENNIS_CLUB_FORM = defineForm({
label: {
Expand Down Expand Up @@ -110,7 +113,21 @@ const TENNIS_CLUB_FORM = defineForm({
description: 'This is the label for the field',
id: 'event.tennis-club-membership.action.declare.form.section.who.field.image.label'
}
}
},
{
id: 'applicant.address.helper',
type: 'PARAGRAPH',
required: false,
label: {
defaultMessage: "Applicant's address",
description: 'This is the label for the field',
id: 'event.tennis-club-membership.action.declare.form.section.who.field.address.helper.label'
},
options: {
fontVariant: 'h3'
}
},
...getAddressFields('applicant')
]
},
{
Expand Down Expand Up @@ -288,6 +305,21 @@ export const tennisClubMembershipEvent = defineConfig({
]
}
],
deduplication: [
{
id: 'STANDARD CHECK',
label: {
defaultMessage: 'Standard check',
description:
'This could be shown to the user in a reason for duplicate detected',
id: '...'
},
query: deduplication.or([
deduplication.field('requester.phone').strictMatches(),
deduplication.field('requester.name').fuzzyMatches()
])
}
],
actions: [
{
type: 'DECLARE',
Expand Down
Loading

0 comments on commit 60d61e6

Please sign in to comment.