From 415a67bed32c9bf6091c5353be6bd4874ff7b796 Mon Sep 17 00:00:00 2001 From: cibelius Date: Tue, 11 Nov 2025 13:58:32 +0200 Subject: [PATCH 1/5] test --- package.json | 2 +- src/form/v2/birth/index.ts | 14 ++++++++++++++ yarn.lock | 8 ++++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 95a1df815f..1b7872f18a 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@hapi/boom": "^9.1.1", "@hapi/hapi": "^20.0.1", "@hapi/inert": "^6.0.3", - "@opencrvs/toolkit": "1.9.0-rc.f2d330d", + "@opencrvs/toolkit": "1.9.0-rc.f46f82d", "@types/chalk": "^2.2.0", "@types/csv2json": "^1.4.0", "@types/fhir": "^0.0.30", diff --git a/src/form/v2/birth/index.ts b/src/form/v2/birth/index.ts index 3897d74db6..bc97fe53ea 100644 --- a/src/form/v2/birth/index.ts +++ b/src/form/v2/birth/index.ts @@ -219,6 +219,20 @@ export const birthEvent = defineConfig({ } ] }, + { + type: ActionType.CUSTOM, + name: 'APPROVE', + label: { + defaultMessage: 'Approve', + description: + 'This is shown as the action name anywhere the user can trigger the action from', + id: 'event.birth.action.approve.label' + }, + form: [], + flags: [ + { id: 'approval-required-for-late-registration', operation: 'remove' } + ] + }, { type: ActionType.VALIDATE, label: { diff --git a/yarn.lock b/yarn.lock index be32229a84..6fcb402fbd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -834,10 +834,10 @@ dependencies: "@octokit/openapi-types" "^18.0.0" -"@opencrvs/toolkit@1.9.0-rc.f2d330d": - version "1.9.0-rc.f2d330d" - resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.f2d330d.tgz#9a5d8597711bde3d7cdb5ab02126386d91afe6c9" - integrity sha512-Ne+UMRbyHT7/YFXv/P8dW/qPujF3gUwtUUUHoxSI/JElKzmXIVVSbICVr35a0ko3NcrDpCPb1gCLCczYKIgS+g== +"@opencrvs/toolkit@1.9.0-rc.f46f82d": + version "1.9.0-rc.f46f82d" + resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.f46f82d.tgz#e23fc61f33f0f027b0e27821f10af5f5a6d7f160" + integrity sha512-MGgrARS8HyGZyBszxQ4AERxBv8zLVmtffya8RqeEkU4gucx9hEyQnUzaGvzizYvThenMEgNbT7jHlNgff2QKiQ== dependencies: "@trpc/client" "11.4.3" "@trpc/server" "11.4.3" From 9674775b48b417aabbb3efd117007f1f9522e8c2 Mon Sep 17 00:00:00 2001 From: cibelius Date: Fri, 14 Nov 2025 12:56:18 +0200 Subject: [PATCH 2/5] improve local dev env logging, add custom action handler, add config and fix analytics db --- infrastructure/postgres/setup-analytics.sh | 2 + package.json | 2 +- src/api/custom-event/handler.ts | 8 ++++ src/api/notification/informantNotification.ts | 14 ------- src/data-seeding/roles/roles.ts | 3 +- src/form/v2/birth/index.ts | 16 +++++++- src/index.ts | 38 +++++++++++-------- src/logger.ts | 5 +++ src/translations/client.csv | 1 + yarn.lock | 8 ++-- 10 files changed, 60 insertions(+), 37 deletions(-) diff --git a/infrastructure/postgres/setup-analytics.sh b/infrastructure/postgres/setup-analytics.sh index 0d09144c3d..97bcb0f484 100644 --- a/infrastructure/postgres/setup-analytics.sh +++ b/infrastructure/postgres/setup-analytics.sh @@ -85,6 +85,8 @@ CREATE TABLE IF NOT EXISTS analytics.event_actions ( UNIQUE (id, event_id) ); +ALTER TABLE analytics.event_actions ADD COLUMN IF NOT EXISTS custom_action_type TEXT; + CREATE TABLE IF NOT EXISTS analytics.location_levels ( id text PRIMARY KEY, level int NOT NULL, diff --git a/package.json b/package.json index 1b7872f18a..2ffe46a3f8 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@hapi/boom": "^9.1.1", "@hapi/hapi": "^20.0.1", "@hapi/inert": "^6.0.3", - "@opencrvs/toolkit": "1.9.0-rc.f46f82d", + "@opencrvs/toolkit": "1.9.0-rc.df81614", "@types/chalk": "^2.2.0", "@types/csv2json": "^1.4.0", "@types/fhir": "^0.0.30", diff --git a/src/api/custom-event/handler.ts b/src/api/custom-event/handler.ts index e575d75d1e..df488f2118 100644 --- a/src/api/custom-event/handler.ts +++ b/src/api/custom-event/handler.ts @@ -24,6 +24,13 @@ export function getCustomEventsHandler( .code(200) } +export async function onCustomActionHandler( + request: ActionConfirmationRequest, + h: Hapi.ResponseToolkit +) { + return h.response().code(200) +} + export async function onAnyActionHandler( request: ActionConfirmationRequest, h: Hapi.ResponseToolkit @@ -33,6 +40,7 @@ export async function onAnyActionHandler( const token = request.auth.artifacts.token as string const event = request.payload + await sendInformantNotification({ event, token }) return h.response().code(200) diff --git a/src/api/notification/informantNotification.ts b/src/api/notification/informantNotification.ts index 3cbe401def..e08c51df1f 100644 --- a/src/api/notification/informantNotification.ts +++ b/src/api/notification/informantNotification.ts @@ -26,8 +26,6 @@ import { InformantType as BirthInformantType } from '@countryconfig/form/v2/birt import { InformantTemplateType } from './sms-service' import { generateFailureLog, NotificationParams, notify } from './handler' import { InformantType as DeathInformantType } from '@countryconfig/form/v2/death/forms/pages/informant' -import { birthEvent } from '@countryconfig/form/v2/birth' -import { deathEvent } from '@countryconfig/form/v2/death' const resolveName = (name: FieldUpdateValue) => { const nameObj = { @@ -77,18 +75,6 @@ function getInformant(eventType: string, declaration: Record) { throw new Error('Invalid event type') } -function getEventConfig(eventType: string) { - if (eventType === Event.Birth) { - return birthEvent - } - - if (eventType === Event.Death) { - return deathEvent - } - - throw new Error('Invalid event type') -} - async function getNotificationParams( event: EventDocument, token: string, diff --git a/src/data-seeding/roles/roles.ts b/src/data-seeding/roles/roles.ts index 68e0189520..bc022bc165 100644 --- a/src/data-seeding/roles/roles.ts +++ b/src/data-seeding/roles/roles.ts @@ -221,7 +221,8 @@ export const roles: Role[] = [ 'record.register[event=birth|death|tennis-club-membership]', 'record.registered.print-certified-copies[event=birth|death|tennis-club-membership]', 'record.registered.correct[event=birth|death|tennis-club-membership]', - 'record.unassign-others[event=birth|death|tennis-club-membership]' + 'record.unassign-others[event=birth|death|tennis-club-membership]', + 'record.custom-action[event=birth,customActionType=APPROVE]' ] }, { diff --git a/src/form/v2/birth/index.ts b/src/form/v2/birth/index.ts index bc97fe53ea..9dc1bdd17a 100644 --- a/src/form/v2/birth/index.ts +++ b/src/form/v2/birth/index.ts @@ -221,17 +221,29 @@ export const birthEvent = defineConfig({ }, { type: ActionType.CUSTOM, - name: 'APPROVE', + customActionType: 'APPROVE', label: { defaultMessage: 'Approve', description: 'This is shown as the action name anywhere the user can trigger the action from', id: 'event.birth.action.approve.label' }, + confirmationText: { + defaultMessage: + 'This birth has been registered late. You are now approving it for further validation and registration.', + description: 'This is the confirmation text for the approve action', + id: 'event.birth.action.approve.confirmationText' + }, form: [], flags: [ { id: 'approval-required-for-late-registration', operation: 'remove' } - ] + ], + auditHistoryLabel: { + defaultMessage: 'Approved late registration', + description: + 'The label to show in audit history for the approve action', + id: 'event.birth.action.approve.audit-history-label' + } }, { type: ActionType.VALIDATE, diff --git a/src/index.ts b/src/index.ts index 3a128999f7..d222313491 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,9 +58,9 @@ import { fontsHandler } from './api/fonts/handler' import { recordNotificationHandler } from './api/record-notification/handler' import { getCustomEventsHandler, - onAnyActionHandler + onAnyActionHandler, + onCustomActionHandler } from '@countryconfig/api/custom-event/handler' -import { readFileSync } from 'fs' import { ActionDocument, ActionStatus, @@ -92,16 +92,14 @@ export interface ITokenPayload { export default function getPlugins() { const plugins: any[] = [inert, JWT] - if (process.env.NODE_ENV === 'production') { - plugins.push({ - plugin: Pino, - options: { - prettyPrint: false, - logPayload: false, - instance: logger - } - }) - } + plugins.push({ + plugin: Pino, + options: { + prettyPrint: false, + logPayload: false, + instance: logger + } + }) if (SENTRY_DSN) { plugins.push({ @@ -641,6 +639,16 @@ export async function createServer() { } }) + server.route({ + method: 'POST', + path: `/trigger/events/{event}/actions/${ActionType.CUSTOM}`, + handler: onCustomActionHandler, + options: { + tags: ['api', 'events'], + description: 'Receives notifications on event custom action' + } + }) + server.route({ method: 'POST', path: '/trigger/events/{event}/actions/{action}', @@ -748,9 +756,9 @@ export async function createServer() { await syncLocationLevels() await syncLocationStatistics() - const logMsg = `Server successfully started on ${COUNTRY_CONFIG_HOST}:${COUNTRY_CONFIG_PORT}` - logger.info(logMsg) - server.log('info', logMsg) + logger.info( + `Server successfully started on ${COUNTRY_CONFIG_HOST}:${COUNTRY_CONFIG_PORT}` + ) } return { server, start, stop } diff --git a/src/logger.ts b/src/logger.ts index 55a694bce0..5526689551 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -19,6 +19,11 @@ export const logger = ] }) : pino({ + serializers: { + req: () => undefined, + res: () => undefined, + responseTime: () => undefined + }, transport: { target: 'pino-pretty', options: { diff --git a/src/translations/client.csv b/src/translations/client.csv index 4cba2527a3..59a06c961c 100644 --- a/src/translations/client.csv +++ b/src/translations/client.csv @@ -862,6 +862,7 @@ event.birth.action.mark-as-duplicate.label,Label for review potential duplicate event.birth.action.register.label,Label for review record button in dropdown menu,Register,Enregistrer event.birth.action.request-correction.label,This is shown as the action name anywhere the user can trigger the action from,Correct record,Enregistrement correct event.birth.action.validate.label,This is shown as the action name anywhere the user can trigger the action from,Validate,Valider +event.birth.action.approve.confirmationText,This is the confirmation text for the approve action,This birth has been registered late. You are now approving it for further validation and registration.,Cette naissance a été enregistrée en retard. Vous l'approuvez maintenant pour une validation et un enregistrement supplémentaires. event.birth.label,This is what this event is referred as in the system,Birth,Naissance event.birth.summary.child.dob.empty,Label for date of birth not available,No date of birth,Pas de date de naissance event.birth.summary.child.placeOfBirth.empty,Label for place of birth not available,No place of birth,Pas de lieu de naissance diff --git a/yarn.lock b/yarn.lock index 6fcb402fbd..0a644a4fb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -834,10 +834,10 @@ dependencies: "@octokit/openapi-types" "^18.0.0" -"@opencrvs/toolkit@1.9.0-rc.f46f82d": - version "1.9.0-rc.f46f82d" - resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.f46f82d.tgz#e23fc61f33f0f027b0e27821f10af5f5a6d7f160" - integrity sha512-MGgrARS8HyGZyBszxQ4AERxBv8zLVmtffya8RqeEkU4gucx9hEyQnUzaGvzizYvThenMEgNbT7jHlNgff2QKiQ== +"@opencrvs/toolkit@1.9.0-rc.df81614": + version "1.9.0-rc.df81614" + resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.df81614.tgz#9815e10c0202feac82edfd5e568dc261a21d1c14" + integrity sha512-mKa10rqCBNQLNtpVLh+enDTSX5Z/I6LM4EK2j4sVggGqsK0RnFVGOoaKuOe44DXPl04bakQWMYUXfqstihd1Ug== dependencies: "@trpc/client" "11.4.3" "@trpc/server" "11.4.3" From 4107151e84e2c30cf041146bad4b18e80a239f4b Mon Sep 17 00:00:00 2001 From: cibelius Date: Fri, 14 Nov 2025 15:50:01 +0200 Subject: [PATCH 3/5] rename custom action type --- src/data-seeding/roles/roles.ts | 2 +- src/form/v2/birth/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data-seeding/roles/roles.ts b/src/data-seeding/roles/roles.ts index bc022bc165..ec9ae77975 100644 --- a/src/data-seeding/roles/roles.ts +++ b/src/data-seeding/roles/roles.ts @@ -222,7 +222,7 @@ export const roles: Role[] = [ 'record.registered.print-certified-copies[event=birth|death|tennis-club-membership]', 'record.registered.correct[event=birth|death|tennis-club-membership]', 'record.unassign-others[event=birth|death|tennis-club-membership]', - 'record.custom-action[event=birth,customActionType=APPROVE]' + 'record.custom-action[event=birth,customActionType=Approve]' ] }, { diff --git a/src/form/v2/birth/index.ts b/src/form/v2/birth/index.ts index 9dc1bdd17a..dc3ae9706f 100644 --- a/src/form/v2/birth/index.ts +++ b/src/form/v2/birth/index.ts @@ -221,7 +221,7 @@ export const birthEvent = defineConfig({ }, { type: ActionType.CUSTOM, - customActionType: 'APPROVE', + customActionType: 'Approve', label: { defaultMessage: 'Approve', description: From 60340a91014c33245ff72918d86dd9b3a3e94c9f Mon Sep 17 00:00:00 2001 From: cibelius Date: Mon, 17 Nov 2025 12:27:38 +0200 Subject: [PATCH 4/5] update config --- package.json | 2 +- src/form/v2/birth/index.ts | 4 ++-- src/translations/client.csv | 2 +- yarn.lock | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 2ffe46a3f8..faa43cc860 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "@hapi/boom": "^9.1.1", "@hapi/hapi": "^20.0.1", "@hapi/inert": "^6.0.3", - "@opencrvs/toolkit": "1.9.0-rc.df81614", + "@opencrvs/toolkit": "1.9.0-rc.59ad316", "@types/chalk": "^2.2.0", "@types/csv2json": "^1.4.0", "@types/fhir": "^0.0.30", diff --git a/src/form/v2/birth/index.ts b/src/form/v2/birth/index.ts index dc3ae9706f..8c04d1339b 100644 --- a/src/form/v2/birth/index.ts +++ b/src/form/v2/birth/index.ts @@ -228,7 +228,7 @@ export const birthEvent = defineConfig({ 'This is shown as the action name anywhere the user can trigger the action from', id: 'event.birth.action.approve.label' }, - confirmationText: { + supportingCopy: { defaultMessage: 'This birth has been registered late. You are now approving it for further validation and registration.', description: 'This is the confirmation text for the approve action', @@ -239,7 +239,7 @@ export const birthEvent = defineConfig({ { id: 'approval-required-for-late-registration', operation: 'remove' } ], auditHistoryLabel: { - defaultMessage: 'Approved late registration', + defaultMessage: 'Approved', description: 'The label to show in audit history for the approve action', id: 'event.birth.action.approve.audit-history-label' diff --git a/src/translations/client.csv b/src/translations/client.csv index 59a06c961c..cd0699f6e6 100644 --- a/src/translations/client.csv +++ b/src/translations/client.csv @@ -1114,7 +1114,7 @@ event.tennis-club-membership.summary.field.recommender.id.empty,Shown when the r event.tennis-club-membership.summary.field.recommender.id.label,Label for the recommender's ID field,Recommender's ID,Recommender's ID events.overview.tabs.record,Title of the Record tab,Record,Enregistrement events.overview.tabs.audit,Title of the Audit tab,Audit,Audit -events.history.status,Events status history,"{status, select, Requested {Waiting for external validation} other {{action, select, CREATE {Declaration started} NOTIFY {Sent incomplete} VALIDATE {Sent for approval} DRAFT {Draft} DECLARE {Sent for review} REGISTER {Registered} PRINT_CERTIFICATE {Certified} REJECT {Rejected} ARCHIVE {Archived} DUPLICATE_DETECTED {Flagged as potential duplicate} MARKED_AS_DUPLICATE {Marked as a duplicate} MARK_AS_NOT_DUPLICATE {Marked not a duplicate} CORRECTED {Record corrected} REQUEST_CORRECTION {Correction requested} APPROVE_CORRECTION {Correction approved} REJECT_CORRECTION {Correction rejected} READ {Viewed} ASSIGN {Assigned} UNASSIGN {Unassigned} UPDATE {Updated} other {Unknown}}}}","{status, select, Requested {En attente de validation externe} other {{action, select, CREATE {Déclaration commencée} NOTIFY {Envoyé incomplet} VALIDATE {Envoyé pour approbation} DRAFT {Brouillon} DECLARE {Envoyé pour révision} REGISTER {Enregistré} PRINT_CERTIFICATE {Certifié} REJECT {Rejeté} ARCHIVE {Archivé} DUPLICATE_DETECTED {Marqué comme doublon} MARKED_AS_DUPLICATE {Marqué comme doublon} MARK_AS_NOT_DUPLICATE {Marqué comme non en doublon} CORRECTED {Enregistrement corrigé} REQUEST_CORRECTION {Correction demandée} APPROVE_CORRECTION {Correction approuvée} REJECT_CORRECTION {Correction refusée} READ {Consulté} ASSIGN {Attribué} UNASSIGN {Désattribué} UPDATE {Mis à jour} other {Inconnu}}}}" +events.history.status,Events status history,"{status, select, Requested {Waiting for external validation} other {{action, select, CREATE {Declaration started} NOTIFY {Notified} VALIDATE {Sent for approval} DRAFT {Draft} DECLARE {Sent for review} REGISTER {Registered} PRINT_CERTIFICATE {Certified} REJECT {Rejected} ARCHIVE {Archived} DUPLICATE_DETECTED {Flagged as potential duplicate} MARKED_AS_DUPLICATE {Marked as a duplicate} MARK_AS_NOT_DUPLICATE {Marked not a duplicate} CORRECTED {Record corrected} REQUEST_CORRECTION {Correction requested} APPROVE_CORRECTION {Correction approved} REJECT_CORRECTION {Correction rejected} READ {Viewed} ASSIGN {Assigned} UNASSIGN {Unassigned} UPDATE {Updated} other {Unknown}}}}","{status, select, Requested {En attente de validation externe} other {{action, select, CREATE {Déclaration commencée} NOTIFY {Envoyé incomplet} VALIDATE {Envoyé pour approbation} DRAFT {Brouillon} DECLARE {Envoyé pour révision} REGISTER {Enregistré} PRINT_CERTIFICATE {Certifié} REJECT {Rejeté} ARCHIVE {Archivé} DUPLICATE_DETECTED {Marqué comme doublon} MARKED_AS_DUPLICATE {Marqué comme doublon} MARK_AS_NOT_DUPLICATE {Marqué comme non en doublon} CORRECTED {Enregistrement corrigé} REQUEST_CORRECTION {Correction demandée} APPROVE_CORRECTION {Correction approuvée} REJECT_CORRECTION {Correction refusée} READ {Consulté} ASSIGN {Attribué} UNASSIGN {Désattribué} UPDATE {Mis à jour} other {Inconnu}}}}" events.outbox.processingAction,Message in outbox when processing action,"{action, select, DECLARE {Sending} REGISTER {Registering} VALIDATE {Sending for approval} NOTIFY {Sending} REJECT {Sending for updates} ARCHIVE {Archiving} PRINT_CERTIFICATE {Certifying} REQUEST_CORRECTION {Requesting correction} APPROVE_CORRECTION {Approving correction} REJECT_CORRECTION {Rejecting correction} ASSIGN {Assigning} UNASSIGN {Unassigning} other {processing action}}","{action, select, DECLARE {Envoi} REGISTER {Enregistrement} VALIDATE {Envoi pour approbation} NOTIFY {Envoi} REJECT {Envoi pour mise à jour} ARCHIVE {Archivage} PRINT_CERTIFICATE {Certification} REQUEST_CORRECTION {Demande de correction} APPROVE_CORRECTION {Approbation de la correction} REJECT_CORRECTION {Rejet de la correction} ASSIGN {Attribution} UNASSIGN {Désattribution} other {action en cours}}" events.outbox.waitingForAction,Message in outbox when waiting for action,"Waiting to {action, select, DECLARE {send} CREATE {send} REGISTER {register} VALIDATE {send for approval} NOTIFY {send} REJECT {send for updates} ARCHIVE {archive} PRINT_CERTIFICATE {certify} REQUEST_CORRECTION {request correction} APPROVE_CORRECTION {approve correction} REJECT_CORRECTION {reject correction} ASSIGN {assign} UNASSIGN {unassign} other {action}}","En attente de {action, select, DECLARE {l'envoi} CREATE {l'envoi} REGISTER {l'enregistrement} VALIDATE {l'envoi pour approbation} NOTIFY {l'envoi} REJECT {l'envoi pour mise à jour} ARCHIVE {l'archivage} PRINT_CERTIFICATE {la certification} REQUEST_CORRECTION {la demande de correction} APPROVE_CORRECTION {l'approbation de la correction} REJECT_CORRECTION {le rejet de la correction} ASSIGN {l'attribution} UNASSIGN {la désattribution} other {l'action}}" events.status,Dynamic event status,"{status, select, OUTBOX {Syncing..} CREATED {Draft} VALIDATED {Validated} DRAFT {Draft} DECLARED {Declared} REGISTERED {Registered} CERTIFIED {Certified} REJECTED {Rejected} ARCHIVED {Archived} MARKED_AS_DUPLICATE {Marked as a duplicate} MARK_AS_NOT_DUPLICATE {Marked not a duplicate} NOTIFIED {In progress} other {Unknown}}","{status, select, OUTBOX {Synchronisation..} CREATED {Brouillon} VALIDATED {Validé} DRAFT {Brouillon} DECLARED {Déclaré} REGISTERED {Enregistré} CERTIFIED {Certifié} REJECTED {Nécessite une mise à jour} ARCHIVED {Archivé} MARKED_AS_DUPLICATE {Marqué comme doublon} MARK_AS_NOT_DUPLICATE {Marqué comme non en doublon} NOTIFIED {Notifié} other {Inconnu}}" diff --git a/yarn.lock b/yarn.lock index 0a644a4fb9..8c01d39c5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -834,10 +834,10 @@ dependencies: "@octokit/openapi-types" "^18.0.0" -"@opencrvs/toolkit@1.9.0-rc.df81614": - version "1.9.0-rc.df81614" - resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.df81614.tgz#9815e10c0202feac82edfd5e568dc261a21d1c14" - integrity sha512-mKa10rqCBNQLNtpVLh+enDTSX5Z/I6LM4EK2j4sVggGqsK0RnFVGOoaKuOe44DXPl04bakQWMYUXfqstihd1Ug== +"@opencrvs/toolkit@1.9.0-rc.59ad316": + version "1.9.0-rc.59ad316" + resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.59ad316.tgz#1978531735f043168227a17eed0d4c673471fb48" + integrity sha512-cM1HCs2WkDmyPoXXiSAIKtc/vH3TDTyaX6SjEM41Hs086+PYTv9rUhmcO0XYBP4so4QCqpceThADI6OJQMqNCA== dependencies: "@trpc/client" "11.4.3" "@trpc/server" "11.4.3" From 09e0da26dd39a8e12e6c4664697554087ca54456 Mon Sep 17 00:00:00 2001 From: cibelius Date: Tue, 18 Nov 2025 12:03:16 +0200 Subject: [PATCH 5/5] dont use pino in tests --- src/index.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index d222313491..acc411894e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -92,14 +92,16 @@ export interface ITokenPayload { export default function getPlugins() { const plugins: any[] = [inert, JWT] - plugins.push({ - plugin: Pino, - options: { - prettyPrint: false, - logPayload: false, - instance: logger - } - }) + if (process.env.NODE_ENV !== 'test') { + plugins.push({ + plugin: Pino, + options: { + prettyPrint: false, + logPayload: false, + instance: logger + } + }) + } if (SENTRY_DSN) { plugins.push({