diff --git a/dictation_function/src/functions/licenseAlert.ts b/dictation_function/src/functions/licenseAlert.ts index b3735fc..5e7fd6d 100644 --- a/dictation_function/src/functions/licenseAlert.ts +++ b/dictation_function/src/functions/licenseAlert.ts @@ -168,12 +168,13 @@ async function getAlertMailTargetAccount( // 第五のアカウントを取得 const accountRepository = datasource.getRepository(Account); // 管理者ユーザーが規約に同意しているアカウントのみを取得 + // 第五階層が同意する規約はeulaとprivacy_noticeのみであるため、それらがnullでないことを条件に追加 + // 管理者が規約同意していない = 一度もログインしていないアカウントであるため、そのアカウントにはアラートメールを送信しない // プロダクト バックログ項目 4073: [保守]システムに一度もログインしていないユーザーにはライセンスアラートメールを送信しないようにしたい の対応 const accounts = await accountRepository.find({ where: { tier: TIERS.TIER5, primaryAdminUser: { - accepted_dpa_version: Not(IsNull()), accepted_eula_version: Not(IsNull()), accepted_privacy_notice_version: Not(IsNull()), }, diff --git a/dictation_function/src/test/licenseAlert.spec.ts b/dictation_function/src/test/licenseAlert.spec.ts index f013f47..610fe7e 100644 --- a/dictation_function/src/test/licenseAlert.spec.ts +++ b/dictation_function/src/test/licenseAlert.spec.ts @@ -54,7 +54,7 @@ describe("licenseAlert", () => { const { account, admin } = await makeTestAccount( source, { tier: 5 }, - { external_id: "external_id1" } + { external_id: "external_id1", accepted_dpa_version: null } ); await createLicense( source, @@ -97,7 +97,11 @@ describe("licenseAlert", () => { const { account, admin } = await makeTestAccount( source, { tier: 5 }, - { external_id: "external_id2", auto_renew: false } + { + external_id: "external_id2", + auto_renew: false, + accepted_dpa_version: null, + } ); await createLicense( source, @@ -141,7 +145,7 @@ describe("licenseAlert", () => { const { account, admin } = await makeTestAccount( source, { tier: 5 }, - { external_id: "external_id3" } + { external_id: "external_id3", accepted_dpa_version: null } ); await createLicense( source, @@ -196,7 +200,11 @@ describe("licenseAlert", () => { const { account, admin } = await makeTestAccount( source, { tier: 5 }, - { external_id: "external_id4", auto_renew: true } + { + external_id: "external_id4", + auto_renew: true, + accepted_dpa_version: null, + } ); await createLicense( source, @@ -242,7 +250,6 @@ describe("licenseAlert", () => { { external_id: "external_id5", auto_renew: false, - accepted_dpa_version: null, accepted_eula_version: null, accepted_privacy_notice_version: null, }