From 418d568af244f24989125a9a1d0f87eccdce17fd Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Wed, 14 Jun 2023 08:42:48 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20153:=20Task=E4=B8=80=E8=A6=A7API?= =?UTF-8?q?=E3=81=AEResponse=E3=81=A7=E7=9C=81=E7=95=A5=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E3=81=A7=E3=81=AA=E3=81=84=E3=81=A8=E3=81=84=E3=81=91=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=97=E3=83=AD=E3=83=91=E3=83=86=E3=82=A3=E3=81=8C?= =?UTF-8?q?=E5=BF=85=E9=A0=88=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=82=8B=E7=AE=87=E6=89=80=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task1956: Task一覧APIのResponseで省略可能でないといけないプロパティが必須になっている箇所を修正する](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1956) [Task1918: タスク一覧、タスク追加APIのコメント修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/OMDSDictation/_workitems/edit/1918) - Transcription開始日時と終了日時がNULLでも問題ないようにプロパティの型を修正しました。 - タスク一覧の音声ファイル録音時間のコメントも併せて修正しています。 ## レビューポイント - 修正内容は適切か ## UIの変更 - なし ## 動作確認状況 - ローカルで確認 --- dictation_server/src/api/odms/openapi.json | 4 ++-- .../src/features/files/files.service.ts | 2 +- .../src/features/files/types/types.ts | 2 +- .../src/features/tasks/tasks.service.spec.ts | 10 +++++----- .../src/features/tasks/types/convert.ts | 4 ++-- .../src/features/tasks/types/types.ts | 16 +++++++++++----- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/dictation_server/src/api/odms/openapi.json b/dictation_server/src/api/odms/openapi.json index aedfdbe..3d38853 100644 --- a/dictation_server/src/api/odms/openapi.json +++ b/dictation_server/src/api/odms/openapi.json @@ -2358,7 +2358,7 @@ }, "duration": { "type": "string", - "description": "音声ファイルの録音時間(yyyy-mm-ddThh:mm:ss.sss)" + "description": "音声ファイルの録音時間(ミリ秒の整数値)" }, "createdDate": { "type": "string", @@ -2510,7 +2510,7 @@ }, "audioDuration": { "type": "string", - "description": "音声ファイルの録音時間(yyyy-mm-ddThh:mm:ss.sss)" + "description": "音声ファイルの録音時間(ミリ秒の整数値)" }, "audioCreatedDate": { "type": "string", diff --git a/dictation_server/src/features/files/files.service.ts b/dictation_server/src/features/files/files.service.ts index f18c6fd..7cc1de7 100644 --- a/dictation_server/src/features/files/files.service.ts +++ b/dictation_server/src/features/files/files.service.ts @@ -22,7 +22,7 @@ export class FilesService { * @param url アップロード先Blob Storage(ファイル名含む) * @param authorId 自分自身(ログイン認証)したAuthorID * @param fileName 音声ファイル名 - * @param duration 音声ファイルの録音時間(yyyy-mm-ddThh:mm:ss.sss) + * @param duration 音声ファイルの録音時間(ミリ秒の整数値) * @param createdDate 音声ファイルの録音作成日時(開始日時)(yyyy-mm-ddThh:mm:ss.sss)' * @param finishedDate 音声ファイルの録音作成終了日時(yyyy-mm-ddThh:mm:ss.sss) * @param uploadedDate 音声ファイルのアップロード日時(yyyy-mm-ddThh:mm:ss.sss) diff --git a/dictation_server/src/features/files/types/types.ts b/dictation_server/src/features/files/types/types.ts index 5136d3b..92c1144 100644 --- a/dictation_server/src/features/files/types/types.ts +++ b/dictation_server/src/features/files/types/types.ts @@ -46,7 +46,7 @@ export class AudioUploadFinishedRequest { @ApiProperty({ description: '音声ファイル名' }) fileName: string; @ApiProperty({ - description: '音声ファイルの録音時間(yyyy-mm-ddThh:mm:ss.sss)', + description: '音声ファイルの録音時間(ミリ秒の整数値)', }) duration: string; @ApiProperty({ diff --git a/dictation_server/src/features/tasks/tasks.service.spec.ts b/dictation_server/src/features/tasks/tasks.service.spec.ts index 45fa463..07d44c1 100644 --- a/dictation_server/src/features/tasks/tasks.service.spec.ts +++ b/dictation_server/src/features/tasks/tasks.service.spec.ts @@ -2,7 +2,7 @@ import { makeDefaultTasksRepositoryMockValue, makeDefaultUsersRepositoryMockValue, makeTasksServiceMock, -} from '../tasks/test/tasks.service.mock'; +} from './test/tasks.service.mock'; import { HttpException, HttpStatus } from '@nestjs/common'; import { makeErrorResponse } from '../../common/error/makeErrorResponse'; @@ -60,8 +60,8 @@ describe('TasksService', () => { ], priority: '00', status: 'Uploaded', - transcriptionFinishedDate: '', - transcriptionStartedDate: '', + transcriptionFinishedDate: undefined, + transcriptionStartedDate: undefined, typist: undefined, url: 'test/test.zip', workType: 'WorkType', @@ -258,8 +258,8 @@ describe('TasksService', () => { ], priority: '00', status: 'Uploaded', - transcriptionFinishedDate: '', - transcriptionStartedDate: '', + transcriptionFinishedDate: undefined, + transcriptionStartedDate: undefined, typist: undefined, url: 'test/test.zip', workType: 'WorkType', diff --git a/dictation_server/src/features/tasks/types/convert.ts b/dictation_server/src/features/tasks/types/convert.ts index 12a6351..fcd164e 100644 --- a/dictation_server/src/features/tasks/types/convert.ts +++ b/dictation_server/src/features/tasks/types/convert.ts @@ -49,8 +49,8 @@ const createTask = ( priority: task.priority, status: task.status, jobNumber: task.job_number, - transcriptionFinishedDate: task.finished_at?.toISOString() ?? '', // XXX Responseの型がnullableでないとおかしいのでdevelopマージ前に修正を行う[2023/06/07 17:43] - transcriptionStartedDate: task.started_at?.toISOString() ?? '', // XXX Responseの型がnullableでないとおかしいのでdevelopマージ前に修正を行う[2023/06/07 17:43] + transcriptionFinishedDate: task.finished_at?.toISOString(), + transcriptionStartedDate: task.started_at?.toISOString(), authorId: file.author_id, workType: file.work_type_id, audioCreatedDate: file.started_at.toISOString(), diff --git a/dictation_server/src/features/tasks/types/types.ts b/dictation_server/src/features/tasks/types/types.ts index a738634..381f73b 100644 --- a/dictation_server/src/features/tasks/types/types.ts +++ b/dictation_server/src/features/tasks/types/types.ts @@ -97,7 +97,7 @@ export class Task { @ApiProperty({ description: '音声ファイル名' }) fileName: string; @ApiProperty({ - description: '音声ファイルの録音時間(yyyy-mm-ddThh:mm:ss.sss)', + description: '音声ファイルの録音時間(ミリ秒の整数値)', }) audioDuration: string; @ApiProperty({ @@ -140,10 +140,16 @@ export class Task { '音声ファイルのファイルステータス Uploaded / Pending / InProgress / Finished / Backup', }) status: string; - @ApiProperty({ description: '文字起こし開始日時(yyyy-mm-ddThh:mm:ss.sss)' }) - transcriptionStartedDate: string; - @ApiProperty({ description: '文字起こし終了日時(yyyy-mm-ddThh:mm:ss.sss)' }) - transcriptionFinishedDate: string; + @ApiProperty({ + required: false, + description: '文字起こし開始日時(yyyy-mm-ddThh:mm:ss.sss)', + }) + transcriptionStartedDate?: string | undefined; + @ApiProperty({ + required: false, + description: '文字起こし終了日時(yyyy-mm-ddThh:mm:ss.sss)', + }) + transcriptionFinishedDate?: string | undefined; } export class TasksResponse {