Skip to content

Commit

Permalink
feat: decouple workqueue from TCME (#374)
Browse files Browse the repository at this point in the history
* feat: workqueue wip

* fix: use same format for intl as in summarypage

* add ready for review and ready to print workqueue

* chore: bump up toolkit
jamil314 authored Jan 28, 2025
1 parent 2dd020d commit 36dca6e
Showing 4 changed files with 31 additions and 54 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "0.0.28",
"@opencrvs/toolkit": "0.0.29-events-jr",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
59 changes: 20 additions & 39 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
@@ -257,40 +257,29 @@ export const tennisClubMembershipEvent = defineConfig({
workqueues: [
{
id: 'all',
title: {
defaultMessage: 'All events',
description: 'Label for in progress workqueue',
id: 'event.tennis-club-membership.workqueue.all.label'
},
fields: [
{
id: 'applicant.firstname'
},
{
id: 'applicant.surname'
column: 'title',
label: {
defaultMessage: '{applicant.firstname} {applicant.surname}',
description: 'Label for name in all workqueue',
id: 'event.tennis-club-membership.workqueue.all.name.label'
}
}
],
filters: []
},
{
id: 'ready-for-review',
title: {
defaultMessage: 'Ready for review',
description: 'Label for in review workqueue',
id: 'event.tennis-club-membership.workqueue.in-review.label'
},

fields: [
{
id: 'applicant.firstname'
},
{
id: 'event.type'
},
{
id: 'event.createdAt'
},
{
id: 'event.modifiedAt'
column: 'title',
label: {
defaultMessage: '{applicant.firstname} {applicant.surname}',
description: 'Label for name in all workqueue',
id: 'event.tennis-club-membership.workqueue.readyForReview.name.label'
}
}
],
filters: [
@@ -301,23 +290,15 @@ export const tennisClubMembershipEvent = defineConfig({
},
{
id: 'registered',
title: {
defaultMessage: 'Ready to print',
description: 'Label for registered workqueue',
id: 'event.tennis-club-membership.workqueue.registered.label'
},

fields: [
{
id: 'applicant.firstname'
},
{
id: 'event.type'
},
{
id: 'event.createdAt'
},
{
id: 'event.modifiedAt'
column: 'title',
label: {
defaultMessage: '{applicant.firstname} {applicant.surname}',
description: 'Label for name in all workqueue',
id: 'event.tennis-club-membership.workqueue.registered.name.label'
}
}
],
filters: [
17 changes: 7 additions & 10 deletions src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export const birthEvent = defineConfig({
title: {
id: 'event.birth.summary.title',
label: {
defaultMessage: '{applicant.firstname} {applicant.surname}',
defaultMessage: '{child.firstname} {child.surname}',
description: 'This is the title of the summary',
id: 'event.birth.summary.title'
}
@@ -38,17 +38,14 @@ export const birthEvent = defineConfig({
workqueues: [
{
id: 'all',
title: {
defaultMessage: 'All birth events',
description: 'Label for all birth events workqueue',
id: 'event.birth.workqueue.all.label'
},
fields: [
{
id: 'child.firstname'
},
{
id: 'child.surname'
column: 'title',
label: {
defaultMessage: '{child.surname} {child.firstname}',
description: 'Label for name in all workqueue',
id: 'event.birth.workqueue.all.name.label'
}
}
],
filters: []
7 changes: 3 additions & 4 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -233,10 +233,9 @@ export async function getStatistics(path?: string) {
if (!path) {
path = join(__dirname, '../data-seeding/locations/source/statistics.csv')
}
const data =
await readCSVToJSON<Array<Record<string, string> & { adminPcode: string }>>(
path
)
const data = await readCSVToJSON<
Array<Record<string, string> & { adminPcode: string }>
>(path)

return data.map<LocationStatistic>((item) => {
const { adminPcode, name, ...yearKeys } = item

0 comments on commit 36dca6e

Please sign in to comment.