## 概要 [Task3210: 画面修正(Terms画面)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3210) [Task3211:API修正(バージョン取得API)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/OMDSDictation/_sprints/taskboard/OMDSDictation%20%E3%83%81%E3%83%BC%E3%83%A0/OMDSDictation/%E3%82%B9%E3%83%97%E3%83%AA%E3%83%B3%E3%83%88%2023-1?workitem=3211) [Task3212:API修正(バージョン更新API))](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/OMDSDictation/_sprints/taskboard/OMDSDictation%20%E3%83%81%E3%83%BC%E3%83%A0/OMDSDictation/%E3%82%B9%E3%83%97%E3%83%AA%E3%83%B3%E3%83%88%2023-1?workitem=3212) - このPull Requestでの対象/対象外 Click here to read the terms of use.の文言は多言語対応の対象のため、現在一律同じ文言がでます。 第一~第四階層は 上からEULA,PrivacyNotice,DPAが表示されています 第五階層は、 上から、PrivacyNotice,DPAが表示されています - 影響範囲(他の機能にも影響があるか) ユーザアーカイブテーブルにPrivacyNoticeのバージョンを追加 ## レビューポイント 同意済みプライバシーポリシーはユーザーアーカイブの対象だと認識しているが正しいか。 termsテーブルのdocument_typeの値をPrivacyNoticeにしているが、PRIVACY_NOTICEにしたほうがよいか。 ユニットテストに不足はないか。 ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 https://ndstokyo.sharepoint.com/sites/Piranha/Shared%20Documents/Forms/AllItems.aspx?csf=1&web=1&e=hzPw9b&cid=7737ed1b%2D0eb4%2D4331%2Da238%2D14dd35b27e18&FolderCTID=0x012000C0DCEE65AC2177479C3C761CD137C9C9&id=%2Fsites%2FPiranha%2FShared%20Documents%2FGeneral%2FOMDS%2F%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%2FTask3210&viewid=786a81cf%2Dd15f%2D4dc2%2D9e55%2Dc7a729fbc72f ## 動作確認状況 - ローカルで確認 ## 補足 - 相談、参考資料などがあれば
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import { HttpException, HttpStatus, Injectable, Logger } from '@nestjs/common';
|
|
import { Context } from '../../common/log';
|
|
import { makeErrorResponse } from '../../common/error/makeErrorResponse';
|
|
import { TermInfo } from './types/types';
|
|
import { TermsRepositoryService } from '../../repositories/terms/terms.repository.service';
|
|
import { TERM_TYPE } from '../../constants';
|
|
|
|
@Injectable()
|
|
export class TermsService {
|
|
constructor(private readonly termsRepository: TermsRepositoryService) {}
|
|
private readonly logger = new Logger(TermsService.name);
|
|
|
|
/**
|
|
* 利用規約情報を取得する
|
|
* return termsInfo
|
|
*/
|
|
async getTermsInfo(context: Context): Promise<TermInfo[]> {
|
|
this.logger.log(
|
|
`[IN] [${context.getTrackingId()}] ${this.getTermsInfo.name}`,
|
|
);
|
|
try {
|
|
const { eulaVersion, privacyNoticeVersion, dpaVersion } =
|
|
await this.termsRepository.getLatestTermsInfo();
|
|
return [
|
|
{
|
|
documentType: TERM_TYPE.EULA,
|
|
version: eulaVersion,
|
|
},
|
|
{
|
|
documentType: TERM_TYPE.PRIVACY_NOTICE,
|
|
version: privacyNoticeVersion,
|
|
},
|
|
{
|
|
documentType: TERM_TYPE.DPA,
|
|
version: dpaVersion,
|
|
},
|
|
];
|
|
} catch (e) {
|
|
this.logger.error(`[${context.getTrackingId()}] error=${e}`);
|
|
throw new HttpException(
|
|
makeErrorResponse('E009999'),
|
|
HttpStatus.INTERNAL_SERVER_ERROR,
|
|
);
|
|
} finally {
|
|
this.logger.log(
|
|
`[OUT] [${context.getTrackingId()}] ${this.getTermsInfo.name}`,
|
|
);
|
|
}
|
|
}
|
|
}
|