Skip to content

Commit

Permalink
update script and run to support HMRC
Browse files Browse the repository at this point in the history
  • Loading branch information
saralk committed Feb 17, 2025
1 parent 6c7bd87 commit 0363f4c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion clients/dfeApplyForTeacherTraining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const dfeApplyForTeacherTraining: Client = {
description: "Apply for a teacher training course to teach in England.",
linkText: "Go to your Apply for teacher training account",
linkUrl:
"https://www.apply-for-teacher-training.service.gov.uk/candidate/",
"https://www.apply-for-teacher-training.service.gov.uk/candidate/account",
},
},
};
Expand Down
9 changes: 9 additions & 0 deletions clients/hmrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ const hmrc: Client = {
header: "A service run by HM Revenue and Customs (HMRC)",
linkText: "Find the HMRC service you need",
linkUrl: "https://www.gov.uk/government/organisations/hm-revenue-customs",
hintText: "For example services about tax, childcare, or state pensions.",
paragraph1:
"At the moment, GOV.UK One Login cannot show you which HMRC service you’ve used.",
paragraph2: "We’re working to make this possible.",
},
cy: {
header: "Gwasanaeth a weithredir gan Gyllid a Thollau EF (CThEF)",
linkText: "Dod o hyd i wasanaeth CThEF rydych ei angen",
linkUrl:
"https://www.gov.uk/government/organisations/hm-revenue-customs.cy",
hintText:
"Er enghraifft gwasanaethau am dreth, gofal plant, neu bensiynau'r wladwriaeth.",
paragraph1:
"Ar hyn o bryd, ni all GOV.UK One Login ddangos i chi pa wasanaeth CThEF rydych wedi'i ddefnyddio.",
paragraph2: "Rydym yn gweithio i wneud hyn yn bosibl.",
},
},
};
Expand Down
16 changes: 5 additions & 11 deletions clients/iaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,20 @@ const iaa: Client = {
integration: "Gk-D7WMvytB44Nze7oEC5KcThQZ4yl7sAA",
nonProduction: "iaa",
},
isAvailableInWelsh: true,
isAvailableInWelsh: false,
isAllowed: true,
clientType: "account",
isHmrc: false,
isReportSuspiciousActivityEnabled: false,
showInClientSearch: { production: true, nonProduction: true },
translations: {
en: {
header: "Register of immigration advisers",
header: "Immigration Advice Authority",
description:
"Authorise and register an immigration adviser or organisation.",
linkText: "Go to your Register of immigration advisers account",
linkUrl: "https://portal.oisc.gov.uk/",
},
cy: {
header: "Cofrestr o ymgynghorwyr mewnfudo",
description:
"Awdurdodi a chofrestru ymgynghorydd neu sefydliad mewnfudo.",
linkText: "Ewch i'ch cyfrif Cofrestr o gynghorwyr mewnfudo",
linkUrl: "https://portal.oisc.gov.uk/",
linkText: "Go to your Immigration Advice Authority account",
linkUrl:
"https://www.gov.uk/government/organisations/immigration-advice-authority",
},
},
};
Expand Down
3 changes: 3 additions & 0 deletions interfaces/client.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ interface Translations {
description?: string;
linkText: string;
linkUrl: EnvironmentValue<string>;
hintText?: string;
paragraph1?: string;
paragraph2?: string;
}

interface BaseClient {
Expand Down
3 changes: 3 additions & 0 deletions interfaces/translations.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ export interface Translation {
description?: string;
link_text: string;
link_href: string;
hint_text?: string;
paragraph1?: string;
paragraph2?: string;
}

export type TranslationsObject = Record<string, Translation>;
11 changes: 4 additions & 7 deletions scripts/generate
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
#!/usr/bin/env bun
import { writeFileSync, readFileSync } from "fs";
import { Client } from "../interfaces/client.interface";
import { Translation } from '../interfaces/translations.interface'
import {
getAllowedAccountListClientIDs,
clientsToShowInSearchProd,
hmrcClientIds,
rsaAllowList,
} from "../../di-account-management-frontend/src/config";

interface Translation {
header: string;
description?: string;
link_text: string;
link_href: string;
}

interface IDs {
production: string;
integration: string;
Expand Down Expand Up @@ -88,6 +82,9 @@ function transformTranslate(
description: client.description,
linkText: client.link_text,
linkUrl: generateLinkObject(ids, language),
...client.hint_text && { hintText: client.hint_text },
...client.paragraph1 && { paragraph1: client.paragraph1 },
...client.paragraph2 && { paragraph2: client.paragraph2 },
};
}

Expand Down

0 comments on commit 0363f4c

Please sign in to comment.