Skip to content

Commit

Permalink
feat(app): ECB-12: add new tag for medical, create entry in language …
Browse files Browse the repository at this point in the history
…json file for english (#1450)

<!--- Please provide a general summary of your changes in the title
above -->

# Pull Request type

<!-- Please try to limit your pull request to one type; submit multiple
pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build-related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?
Add a new tag under “Medical” category named: “Medical information and
referrals”
status is not active, will not appear in front end ui for filtering but
will appear on the backend for selection

-
-
-

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this does introduce a breaking change, please describe the
impact and migration path for existing applications below. -->

## Other information

<!-- Any other information that is important to this PR, such as
screenshots of how the component looks before and after the change. -->
  • Loading branch information
trigal2012 authored Jan 16, 2025
2 parents 92fe6ff + 4e9ab72 commit 5d0e902
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/app/public/locales/en/services.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"dental-care": "Dental care",
"fertility-and-family-planning-services": "Fertility and family planning services",
"hiv-and-sexual-health": "HIV and sexual health",
"medical-info-and-referrals": "Medical information and referrals",
"medical-clinics": "Medical clinics",
"obgyn-services": "OBGYN services",
"physical-evaluations-for-asylum-claim": "Physical evaluations for asylum claim",
Expand Down
1 change: 1 addition & 0 deletions apps/app/public/locales/ht/services.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"dental-care": "Swen dantè",
"fertility-and-family-planning-services": "Fertility and family planning services",
"hiv-and-sexual-health": "VIH ak sante seksyèl",
"medical-info-and-referrals": "Medical information and referrals",
"medical-clinics": "Klinik medikal",
"obgyn-services": "Sèvis OBGYN",
"physical-evaluations-for-asylum-claim": "Evalyasyon fizik pou reklamasyon azil",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { type MigrationJob } from '~db/prisma/dataMigrationRunner'
import { type JobDef } from '~db/prisma/jobPreRun'

/** Define the job metadata here. */
const jobDef: JobDef = {
jobId: '2025-01-15_new-medical-service-tags',
title: 'new service tags',
createdBy: 'Diana Garbarino',
/** Optional: Longer description for the job */
description: undefined,
}
/**
* Job export - this variable MUST be UNIQUE
*/
export const job20250115_new_medical_service_tags = {
title: `[${jobDef.jobId}] ${jobDef.title}`,
task: async (ctx, task) => {
const { createLogger, downloadFromDatastore, generateId, formatMessage, jobPostRunner, prisma } = ctx
/** Create logging instance */
createLogger(task, jobDef.jobId)
const log = (...args: Parameters<typeof formatMessage>) => (task.output = formatMessage(...args))
/**
* Start defining your data migration from here.
*
* To log output, use `task.output = 'Message to log'`
*
* This will be written to `stdout` and to a log file in `/prisma/migration-logs/`
*/

// Do stuff

const medicalTag = await prisma.serviceTag.create({
data: {
id: 'svtg_01GW2HHFBXY9V3KJZR4MND7YPQ',
name: 'Medical information and referrals',
active: false,
categories: {
create: { active: true, category: { connect: { id: 'svct_01GW2HHEVKVHTWSBY7PVWC5390' } } },
},
primaryCategory: { connect: { id: 'svct_01GW2HHEVKVHTWSBY7PVWC5390' } },
key: {
create: {
key: 'medical.medical-info-and-referrals',
text: 'Medical information and referrals',
namespace: { connect: { name: 'services' } },
},
},
},
})
log(`Created service tag: ${medicalTag.name} (${medicalTag.id})`)

/**
* DO NOT REMOVE BELOW
*
* This writes a record to the DB to register that this migration has run successfully.
*/
await jobPostRunner(jobDef)
},
def: jobDef,
} satisfies MigrationJob
1 change: 1 addition & 0 deletions packages/db/prisma/data-migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from './2024-08-22_election-alert'
export * from './2024-12-22_update-alert-link'
export * from './2025-01-07_update-locationbased-alert-string'
export * from './2025-01-15_new_food-service-tag'
export * from './2025-01-15_new_medical-service-tag'
export * from './2025-01-15_update-cost-tags'
export * from './2025-01-15_update-food-tags'
// codegen:end

0 comments on commit 5d0e902

Please sign in to comment.