Merged PR 159: Task一覧取得の、文字起こし担当者の型を修正する
## 概要 [Task1987: Task一覧取得の、文字起こし担当者の型を修正する](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1987) - 型の修正および、既存コードでAssigeeを使うべきでないところをTypistを使うように修正しました ## レビューポイント - 対応抜け漏れ無いか ## UIの変更 - なし ## 動作確認状況 - ローカルでビルド通ることを確認 - ローカルで既存テストに影響ないことを確認
This commit is contained in:
parent
418d568af2
commit
4065268820
@ -2551,7 +2551,7 @@
|
||||
"description": "割り当てられたユーザー",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/Assignee"
|
||||
"$ref": "#/components/schemas/Typist"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -2593,9 +2593,7 @@
|
||||
"isEncrypted",
|
||||
"jobNumber",
|
||||
"assignees",
|
||||
"status",
|
||||
"transcriptionStartedDate",
|
||||
"transcriptionFinishedDate"
|
||||
"status"
|
||||
]
|
||||
},
|
||||
"TasksResponse": {
|
||||
|
||||
@ -5,6 +5,7 @@ import { CheckoutPermission as CheckoutPermissionEntity } from '../../../reposit
|
||||
import { AudioOptionItem as AudioOptionItemEntity } from '../../../repositories/audio_option_items/entity/audio_option_item.entity';
|
||||
import { Task, Assignee } from './types';
|
||||
import { AudioOptionItem } from '../../files/types/types';
|
||||
import { Typist } from '../../../features/accounts/types/types';
|
||||
|
||||
// Repository側のDTOからTaskオブジェクトの一覧を構築する
|
||||
export const createTasks = (
|
||||
@ -41,8 +42,8 @@ const createTask = (
|
||||
const assignees = createAssignees(permissions);
|
||||
|
||||
// RepositoryDTO => ControllerDTOに変換
|
||||
const typist: Assignee =
|
||||
typist_user != null ? convertUserToAssignee(typist_user) : undefined;
|
||||
const typist: Typist =
|
||||
typist_user != null ? convertUserToTypist(typist_user) : undefined;
|
||||
|
||||
return {
|
||||
audioFileId: task.audio_file_id,
|
||||
@ -114,3 +115,11 @@ const convertUserGroupToAssignee = (userGroup: UserGroupEntity): Assignee => {
|
||||
typistName: userGroup.name,
|
||||
};
|
||||
};
|
||||
|
||||
// RepositoryDTOのUserからTypistオブジェクトを生成します
|
||||
const convertUserToTypist = (user: UserEntity): Typist => {
|
||||
return {
|
||||
id: user.id,
|
||||
name: `USER_${user?.external_id}`, // XXX Azure AD B2Cから取得した名前を入れる
|
||||
};
|
||||
};
|
||||
|
||||
@ -4,6 +4,7 @@ import { Type } from 'class-transformer';
|
||||
import { IsIn, IsInt, IsOptional, Min } from 'class-validator';
|
||||
import { TASK_LIST_SORTABLE_ATTRIBUTES } from '../../../constants';
|
||||
import { IsStatus } from '../../../common/validators/status.validator';
|
||||
import { Typist } from '../../../features/accounts/types/types';
|
||||
|
||||
export class TasksRequest {
|
||||
@ApiProperty({
|
||||
@ -128,7 +129,7 @@ export class Task {
|
||||
required: false,
|
||||
description: '割り当てられたユーザー',
|
||||
})
|
||||
typist?: Assignee | undefined;
|
||||
typist?: Typist | undefined;
|
||||
@ApiProperty({
|
||||
type: [Assignee],
|
||||
description:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user