Merged PR 680: タスク削除API IF実装
## 概要 [Task3456: タスク削除API IF実装](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3456) - タスク削除APIのIFを実装しopenapi.jsonを更新しました。 ## レビューポイント - パス、バリデータは想定通りでしょうか? ## UIの変更 - なし ## 動作確認状況 - ローカルで確認
This commit is contained in:
parent
cbf7622909
commit
81c299dd99
@ -1,2 +1,2 @@
|
||||
npx openapi-generator-cli version-manager set latest
|
||||
npx openapi-generator-cli version-manager set 7.1.0
|
||||
npx openapi-generator-cli generate -g typescript-axios -i /app/dictation_server/src/api/odms/openapi.json -o /app/dictation_client/src/api/
|
||||
|
||||
@ -1549,12 +1549,6 @@ export interface PostUpdateUserRequest {
|
||||
* @memberof PostUpdateUserRequest
|
||||
*/
|
||||
'autoRenew': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof PostUpdateUserRequest
|
||||
*/
|
||||
'licenseAlart': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
@ -1660,12 +1654,6 @@ export interface SignupRequest {
|
||||
* @memberof SignupRequest
|
||||
*/
|
||||
'autoRenew': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof SignupRequest
|
||||
*/
|
||||
'licenseAlert': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
@ -2212,12 +2200,6 @@ export interface User {
|
||||
* @memberof User
|
||||
*/
|
||||
'autoRenew': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof User
|
||||
*/
|
||||
'licenseAlert': boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
|
||||
@ -164,7 +164,6 @@ export const updateUserAsync = createAsyncThunk<
|
||||
encryptionPassword,
|
||||
prompt,
|
||||
autoRenew: updateUser.autoRenew,
|
||||
licenseAlart: updateUser.licenseAlert,
|
||||
notification: updateUser.notification,
|
||||
},
|
||||
{
|
||||
|
||||
@ -131,8 +131,6 @@ export const selectAuthorId = (state: RootState) =>
|
||||
state.user.apps.addUser.authorId;
|
||||
export const selectAutoRenew = (state: RootState) =>
|
||||
state.user.apps.addUser.autoRenew;
|
||||
export const selectLicenseAlert = (state: RootState) =>
|
||||
state.user.apps.addUser.licenseAlert;
|
||||
export const selectNotification = (state: RootState) =>
|
||||
state.user.apps.addUser.notification;
|
||||
// AddUserを返却する
|
||||
|
||||
@ -16,7 +16,6 @@ export interface UserView
|
||||
encryption: boolean | string;
|
||||
emailVerified: boolean;
|
||||
autoRenew: boolean;
|
||||
licenseAlert: boolean;
|
||||
notification: boolean;
|
||||
name: string;
|
||||
email: string;
|
||||
@ -28,7 +27,6 @@ export interface AddUser {
|
||||
role: RoleType;
|
||||
email: string;
|
||||
autoRenew: boolean;
|
||||
licenseAlert: boolean;
|
||||
notification: boolean;
|
||||
authorId?: string;
|
||||
encryption?: boolean;
|
||||
@ -46,7 +44,6 @@ export interface UpdateUser {
|
||||
encryptionPassword?: string | undefined;
|
||||
prompt?: boolean | undefined;
|
||||
autoRenew: boolean;
|
||||
licenseAlert: boolean;
|
||||
notification: boolean;
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@ const initialState: UsersState = {
|
||||
encryptionPassword: undefined,
|
||||
prompt: undefined,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
},
|
||||
selectedUser: {
|
||||
@ -36,7 +35,6 @@ const initialState: UsersState = {
|
||||
encryptionPassword: undefined,
|
||||
prompt: undefined,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
},
|
||||
addUser: {
|
||||
@ -44,7 +42,6 @@ const initialState: UsersState = {
|
||||
role: USER_ROLES.NONE,
|
||||
email: "",
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
authorId: undefined,
|
||||
encryption: false,
|
||||
@ -93,13 +90,6 @@ export const userSlice = createSlice({
|
||||
const { autoRenew } = action.payload;
|
||||
state.apps.addUser.autoRenew = autoRenew;
|
||||
},
|
||||
changeLicenseAlert: (
|
||||
state,
|
||||
action: PayloadAction<{ licenseAlert: boolean }>
|
||||
) => {
|
||||
const { licenseAlert } = action.payload;
|
||||
state.apps.addUser.licenseAlert = licenseAlert;
|
||||
},
|
||||
changeEncryption: (
|
||||
state,
|
||||
action: PayloadAction<{ encryption: boolean }>
|
||||
@ -149,7 +139,6 @@ export const userSlice = createSlice({
|
||||
state.apps.updateUser.encryptionPassword = undefined;
|
||||
state.apps.updateUser.prompt = user.prompt;
|
||||
state.apps.updateUser.autoRenew = user.autoRenew;
|
||||
state.apps.updateUser.licenseAlert = user.licenseAlert;
|
||||
state.apps.updateUser.notification = user.notification;
|
||||
|
||||
state.apps.selectedUser.id = user.id;
|
||||
@ -161,7 +150,6 @@ export const userSlice = createSlice({
|
||||
state.apps.selectedUser.encryptionPassword = undefined;
|
||||
state.apps.selectedUser.prompt = user.prompt;
|
||||
state.apps.selectedUser.autoRenew = user.autoRenew;
|
||||
state.apps.selectedUser.licenseAlert = user.licenseAlert;
|
||||
state.apps.selectedUser.notification = user.notification;
|
||||
|
||||
state.apps.hasPasswordMask = user.encryption;
|
||||
@ -211,13 +199,6 @@ export const userSlice = createSlice({
|
||||
const { autoRenew } = action.payload;
|
||||
state.apps.updateUser.autoRenew = autoRenew;
|
||||
},
|
||||
changeUpdateLicenseAlert: (
|
||||
state,
|
||||
action: PayloadAction<{ licenseAlert: boolean }>
|
||||
) => {
|
||||
const { licenseAlert } = action.payload;
|
||||
state.apps.updateUser.licenseAlert = licenseAlert;
|
||||
},
|
||||
changeUpdateNotification: (
|
||||
state,
|
||||
action: PayloadAction<{ notification: boolean }>
|
||||
@ -318,7 +299,6 @@ export const {
|
||||
changeRole,
|
||||
changeAuthorId,
|
||||
changeAutoRenew,
|
||||
changeLicenseAlert,
|
||||
changeNotification,
|
||||
cleanupAddUser,
|
||||
changeUpdateUser,
|
||||
@ -328,7 +308,6 @@ export const {
|
||||
changeUpdateEncryptionPassword,
|
||||
changeUpdatePrompt,
|
||||
changeUpdateAutoRenew,
|
||||
changeUpdateLicenseAlert,
|
||||
changeUpdateNotification,
|
||||
cleanupUpdateUser,
|
||||
changeEncryption,
|
||||
|
||||
@ -10,6 +10,14 @@ import {
|
||||
import React, { useEffect } from "react";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import {
|
||||
clearToken,
|
||||
isAdminUser,
|
||||
isApproveTier,
|
||||
isStandardUser,
|
||||
loadAccessToken,
|
||||
} from "features/auth";
|
||||
import { TIERS } from "components/auth/constants";
|
||||
|
||||
const AuthPage: React.FC = (): JSX.Element => {
|
||||
const { instance } = useMsal();
|
||||
@ -26,6 +34,39 @@ const AuthPage: React.FC = (): JSX.Element => {
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
// ログイン済みの場合、ログイン後の遷移先を決定する
|
||||
if (loadAccessToken()) {
|
||||
// 第一~第四階層の管理者はライセンス画面へ遷移
|
||||
if (
|
||||
isApproveTier([
|
||||
TIERS.TIER1,
|
||||
TIERS.TIER2,
|
||||
TIERS.TIER3,
|
||||
TIERS.TIER4,
|
||||
]) &&
|
||||
isAdminUser()
|
||||
) {
|
||||
navigate("/license");
|
||||
return;
|
||||
}
|
||||
// 第五階層の管理者はユーザー画面へ遷移
|
||||
if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
|
||||
navigate("/user");
|
||||
return;
|
||||
}
|
||||
// 一般ユーザーはdictationPageへ遷移
|
||||
if (isStandardUser()) {
|
||||
navigate("/dictations");
|
||||
return;
|
||||
}
|
||||
// それ以外は認証エラー画面へ遷移
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/AuthError",
|
||||
});
|
||||
clearToken();
|
||||
return;
|
||||
}
|
||||
|
||||
const loginResult = await instance.handleRedirectPromise();
|
||||
|
||||
// eslint-disable-next-line
|
||||
|
||||
@ -28,6 +28,33 @@ const LoginPage: React.FC = (): JSX.Element => {
|
||||
selectLocalStorageKeyforIdToken
|
||||
);
|
||||
|
||||
// ログイン後の遷移先を決定する
|
||||
const navigateToLoginedPage = useCallback(() => {
|
||||
// 第一~第四階層の管理者はライセンス画面へ遷移
|
||||
if (
|
||||
isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
|
||||
isAdminUser()
|
||||
) {
|
||||
navigate("/license");
|
||||
return;
|
||||
}
|
||||
// 第五階層の管理者はユーザー画面へ遷移
|
||||
if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
|
||||
navigate("/user");
|
||||
return;
|
||||
}
|
||||
// 一般ユーザーはdictationPageへ遷移
|
||||
if (isStandardUser()) {
|
||||
navigate("/dictations");
|
||||
return;
|
||||
}
|
||||
// それ以外は認証エラー画面へ遷移
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/AuthError",
|
||||
});
|
||||
clearToken();
|
||||
}, [instance, navigate]);
|
||||
|
||||
const tokenSet = useCallback(
|
||||
async (idToken: string) => {
|
||||
// ログイン処理呼び出し
|
||||
@ -59,44 +86,36 @@ const LoginPage: React.FC = (): JSX.Element => {
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
// 第一~第四階層の管理者はライセンス画面へ遷移
|
||||
if (
|
||||
isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
|
||||
isAdminUser()
|
||||
) {
|
||||
navigate("/license");
|
||||
return;
|
||||
}
|
||||
// 第五階層の管理者はユーザー画面へ遷移
|
||||
if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
|
||||
navigate("/user");
|
||||
return;
|
||||
}
|
||||
// 一般ユーザーはdictationPageへ遷移
|
||||
if (isStandardUser()) {
|
||||
navigate("/dictations");
|
||||
return;
|
||||
}
|
||||
// それ以外は認証エラー画面へ遷移
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/AuthError",
|
||||
});
|
||||
clearToken();
|
||||
|
||||
// ログイン成功した場合、適切なページに遷移する
|
||||
navigateToLoginedPage();
|
||||
}
|
||||
},
|
||||
[dispatch, i18n.language, instance, navigate]
|
||||
[dispatch, i18n.language, instance, navigate, navigateToLoginedPage]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
// idTokenStringがあるか⇒認証中
|
||||
// accessTokenがある場合⇒ログイン済み
|
||||
// どちらもなければ直打ち
|
||||
(async () => {
|
||||
if (loadAccessToken()) {
|
||||
navigateToLoginedPage();
|
||||
return;
|
||||
}
|
||||
|
||||
// AADB2Cのログイン画面とLoginPageを経由していない場合はトップページに遷移する
|
||||
if (!localStorageKeyforIdToken) {
|
||||
navigate("/");
|
||||
return;
|
||||
}
|
||||
|
||||
(async () => {
|
||||
// IDトークンの取得
|
||||
const idTokenString = localStorage.getItem(localStorageKeyforIdToken);
|
||||
|
||||
if (idTokenString === null) {
|
||||
navigate("/");
|
||||
return;
|
||||
}
|
||||
|
||||
if (idTokenString) {
|
||||
const idTokenObject = JSON.parse(idTokenString);
|
||||
if (isIdToken(idTokenObject)) {
|
||||
|
||||
@ -18,10 +18,19 @@ import {
|
||||
} from "features//terms";
|
||||
import { selectLocalStorageKeyforIdToken } from "features/login";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import {
|
||||
clearToken,
|
||||
isAdminUser,
|
||||
isApproveTier,
|
||||
isStandardUser,
|
||||
loadAccessToken,
|
||||
} from "features/auth";
|
||||
import { useMsal } from "@azure/msal-react";
|
||||
|
||||
const TermsPage: React.FC = (): JSX.Element => {
|
||||
const [t] = useTranslation();
|
||||
const dispatch: AppDispatch = useDispatch();
|
||||
const { instance } = useMsal();
|
||||
const navigate = useNavigate();
|
||||
const updateAccceptVersions = useSelector(selectTermVersions);
|
||||
const localStorageKeyforIdToken = useSelector(
|
||||
@ -40,6 +49,34 @@ const TermsPage: React.FC = (): JSX.Element => {
|
||||
|
||||
// 画面起動時
|
||||
useEffect(() => {
|
||||
// ログイン済みの場合、ログイン後の遷移先を決定する
|
||||
if (loadAccessToken()) {
|
||||
// 第一~第四階層の管理者はライセンス画面へ遷移
|
||||
if (
|
||||
isApproveTier([TIERS.TIER1, TIERS.TIER2, TIERS.TIER3, TIERS.TIER4]) &&
|
||||
isAdminUser()
|
||||
) {
|
||||
navigate("/license");
|
||||
return;
|
||||
}
|
||||
// 第五階層の管理者はユーザー画面へ遷移
|
||||
if (isApproveTier([TIERS.TIER5]) && isAdminUser()) {
|
||||
navigate("/user");
|
||||
return;
|
||||
}
|
||||
// 一般ユーザーはdictationPageへ遷移
|
||||
if (isStandardUser()) {
|
||||
navigate("/dictations");
|
||||
return;
|
||||
}
|
||||
// それ以外は認証エラー画面へ遷移
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/AuthError",
|
||||
});
|
||||
clearToken();
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(getTermsInfoAsync());
|
||||
if (localStorageKeyforIdToken) {
|
||||
dispatch(getAccountInfoMinimalAccessAsync({ localStorageKeyforIdToken }));
|
||||
|
||||
@ -174,9 +174,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
<th>
|
||||
{t(getTranslationID("userListPage.label.autoRenew"))}
|
||||
</th>
|
||||
<th>
|
||||
{t(getTranslationID("userListPage.label.licenseAlert"))}
|
||||
</th>
|
||||
<th>
|
||||
{t(getTranslationID("userListPage.label.notification"))}
|
||||
</th>
|
||||
@ -292,7 +289,6 @@ const UserListPage: React.FC = (): JSX.Element => {
|
||||
</span>
|
||||
</td>
|
||||
<td>{boolToElement(user.autoRenew)}</td>
|
||||
<td>{boolToElement(user.licenseAlert)}</td>
|
||||
<td>{boolToElement(user.notification)}</td>
|
||||
<td>{boolToElement(user.emailVerified)}</td>
|
||||
</tr>
|
||||
|
||||
@ -10,7 +10,6 @@ import {
|
||||
changeRole,
|
||||
changeAuthorId,
|
||||
changeAutoRenew,
|
||||
changeLicenseAlert,
|
||||
changeNotification,
|
||||
cleanupAddUser,
|
||||
addUserAsync,
|
||||
@ -324,22 +323,6 @@ export const UserAddPopup: React.FC<UserAddPopupProps> = (props) => {
|
||||
{t(getTranslationID("userListPage.label.autoRenew"))}
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label htmlFor="add_LicenseAlert">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="add_LicenseAlert"
|
||||
checked={addUser.licenseAlert}
|
||||
className={styles.formCheck}
|
||||
onChange={(e) => {
|
||||
dispatch(
|
||||
changeLicenseAlert({ licenseAlert: e.target.checked })
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{t(getTranslationID("userListPage.label.licenseAlert"))}
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label htmlFor="add_Notification">
|
||||
<input
|
||||
|
||||
@ -9,7 +9,6 @@ import {
|
||||
changeUpdateAutoRenew,
|
||||
changeUpdateEncryption,
|
||||
changeUpdateEncryptionPassword,
|
||||
changeUpdateLicenseAlert,
|
||||
changeUpdateNotification,
|
||||
changeUpdatePrompt,
|
||||
changeUpdateRole,
|
||||
@ -336,24 +335,6 @@ export const UserUpdatePopup: React.FC<UserUpdatePopupProps> = (props) => {
|
||||
{t(getTranslationID("userListPage.label.autoRenew"))}
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label htmlFor="edit_LicenseAlert">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="edit_LicenseAlert"
|
||||
className={styles.formCheck}
|
||||
checked={user.licenseAlert}
|
||||
onChange={(e) => {
|
||||
dispatch(
|
||||
changeUpdateLicenseAlert({
|
||||
licenseAlert: e.target.checked,
|
||||
})
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{t(getTranslationID("userListPage.label.licenseAlert"))}
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label htmlFor="edit_Notification">
|
||||
<input
|
||||
|
||||
@ -2869,6 +2869,60 @@
|
||||
"security": [{ "bearer": [] }]
|
||||
}
|
||||
},
|
||||
"/tasks/{audioFileId}/delete": {
|
||||
"post": {
|
||||
"operationId": "deleteTask",
|
||||
"summary": "",
|
||||
"description": "指定した文字起こしタスクを削除します。",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "audioFileId",
|
||||
"required": true,
|
||||
"in": "path",
|
||||
"description": "ODMS Cloud上の音声ファイルID",
|
||||
"schema": { "type": "number" }
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "成功時のレスポンス",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PostDeleteTaskResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "不正なパラメータ",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "認証エラー",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "想定外のサーバーエラー",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": ["tasks"],
|
||||
"security": [{ "bearer": [] }]
|
||||
}
|
||||
},
|
||||
"/licenses/orders": {
|
||||
"post": {
|
||||
"operationId": "createOrders",
|
||||
@ -4087,7 +4141,6 @@
|
||||
"email": { "type": "string" },
|
||||
"emailVerified": { "type": "boolean" },
|
||||
"autoRenew": { "type": "boolean" },
|
||||
"licenseAlert": { "type": "boolean" },
|
||||
"notification": { "type": "boolean" },
|
||||
"encryption": { "type": "boolean" },
|
||||
"prompt": { "type": "boolean" },
|
||||
@ -4106,7 +4159,6 @@
|
||||
"email",
|
||||
"emailVerified",
|
||||
"autoRenew",
|
||||
"licenseAlert",
|
||||
"notification",
|
||||
"encryption",
|
||||
"prompt",
|
||||
@ -4131,20 +4183,12 @@
|
||||
"authorId": { "type": "string" },
|
||||
"email": { "type": "string" },
|
||||
"autoRenew": { "type": "boolean" },
|
||||
"licenseAlert": { "type": "boolean" },
|
||||
"notification": { "type": "boolean" },
|
||||
"encryption": { "type": "boolean" },
|
||||
"encryptionPassword": { "type": "string" },
|
||||
"prompt": { "type": "boolean" }
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"role",
|
||||
"email",
|
||||
"autoRenew",
|
||||
"licenseAlert",
|
||||
"notification"
|
||||
]
|
||||
"required": ["name", "role", "email", "autoRenew", "notification"]
|
||||
},
|
||||
"SignupResponse": { "type": "object", "properties": {} },
|
||||
"OptionItem": {
|
||||
@ -4260,13 +4304,12 @@
|
||||
"role": { "type": "string", "description": "none/author/typist" },
|
||||
"authorId": { "type": "string" },
|
||||
"autoRenew": { "type": "boolean" },
|
||||
"licenseAlart": { "type": "boolean" },
|
||||
"notification": { "type": "boolean" },
|
||||
"encryption": { "type": "boolean" },
|
||||
"encryptionPassword": { "type": "string" },
|
||||
"prompt": { "type": "boolean" }
|
||||
},
|
||||
"required": ["id", "role", "autoRenew", "licenseAlart", "notification"]
|
||||
"required": ["id", "role", "autoRenew", "notification"]
|
||||
},
|
||||
"PostUpdateUserResponse": { "type": "object", "properties": {} },
|
||||
"AllocateLicenseRequest": {
|
||||
@ -4611,6 +4654,7 @@
|
||||
"required": ["assignees"]
|
||||
},
|
||||
"PostCheckoutPermissionResponse": { "type": "object", "properties": {} },
|
||||
"PostDeleteTaskResponse": { "type": "object", "properties": {} },
|
||||
"CreateOrdersRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
@ -187,7 +187,6 @@ export const makeTestAccount = async (
|
||||
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
|
||||
email_verified: d?.email_verified ?? true,
|
||||
auto_renew: d?.auto_renew ?? true,
|
||||
license_alert: d?.license_alert ?? true,
|
||||
notification: d?.notification ?? true,
|
||||
encryption: d?.encryption ?? true,
|
||||
encryption_password: d?.encryption_password ?? 'password',
|
||||
@ -295,7 +294,6 @@ export const makeTestUser = async (
|
||||
accepted_dpa_version: d?.accepted_dpa_version ?? '1.0',
|
||||
email_verified: d?.email_verified ?? true,
|
||||
auto_renew: d?.auto_renew ?? true,
|
||||
license_alert: d?.license_alert ?? true,
|
||||
notification: d?.notification ?? true,
|
||||
encryption: d?.encryption ?? true,
|
||||
encryption_password: d?.encryption_password,
|
||||
|
||||
@ -309,7 +309,6 @@ export const makeDefaultAccountsRepositoryMockValue =
|
||||
user.accepted_dpa_version = '1.0';
|
||||
user.email_verified = true;
|
||||
user.auto_renew = false;
|
||||
user.license_alert = false;
|
||||
user.notification = false;
|
||||
user.deleted_at = null;
|
||||
user.created_by = 'test';
|
||||
@ -339,7 +338,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
user.accepted_dpa_version = '1.0';
|
||||
user.email_verified = true;
|
||||
user.auto_renew = false;
|
||||
user.license_alert = false;
|
||||
user.notification = false;
|
||||
user.deleted_at = null;
|
||||
user.created_by = 'test';
|
||||
@ -388,7 +386,6 @@ export const makeDefaultUserGroupsRepositoryMockValue =
|
||||
user.accepted_dpa_version = '1.0';
|
||||
user.email_verified = true;
|
||||
user.auto_renew = false;
|
||||
user.license_alert = false;
|
||||
user.notification = false;
|
||||
user.deleted_at = null;
|
||||
user.created_by = 'test';
|
||||
|
||||
@ -483,7 +483,6 @@ export class UpdateTypistGroupResponse {}
|
||||
|
||||
export class CreatePartnerAccountResponse {}
|
||||
|
||||
|
||||
export class PartnerLicenseInfo {
|
||||
@ApiProperty({ description: 'アカウントID' })
|
||||
accountId: number;
|
||||
@ -523,7 +522,6 @@ export class GetPartnerLicensesResponse {
|
||||
childrenPartnerLicenses: PartnerLicenseInfo[];
|
||||
}
|
||||
|
||||
|
||||
export class LicenseOrder {
|
||||
@ApiProperty({ description: '注文日付' })
|
||||
orderDate: string;
|
||||
@ -546,7 +544,6 @@ export class GetOrderHistoriesResponse {
|
||||
|
||||
export class IssueLicenseResponse {}
|
||||
|
||||
|
||||
export class Dealer {
|
||||
@ApiProperty({ description: 'アカウントID' })
|
||||
id: number;
|
||||
@ -563,7 +560,6 @@ export class GetDealersResponse {
|
||||
|
||||
export class CancelIssueResponse {}
|
||||
|
||||
|
||||
export class Worktype {
|
||||
@ApiProperty({ description: 'WorktypeのID' })
|
||||
id: number;
|
||||
@ -588,7 +584,6 @@ export class CreateWorktypeResponse {}
|
||||
|
||||
export class UpdateWorktypeResponse {}
|
||||
|
||||
|
||||
export class GetWorktypeOptionItem extends PostWorktypeOptionItem {
|
||||
@ApiProperty()
|
||||
id: number;
|
||||
@ -609,7 +604,6 @@ export class DeleteWorktypeResponse {}
|
||||
|
||||
export class PostActiveWorktypeResponse {}
|
||||
|
||||
|
||||
export class Partner {
|
||||
@ApiProperty({ description: '会社名' })
|
||||
name: string;
|
||||
|
||||
@ -148,7 +148,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
updated_by: null,
|
||||
updated_at: new Date(),
|
||||
auto_renew: true,
|
||||
license_alert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
|
||||
@ -120,7 +120,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
user1.accepted_dpa_version = '1.0';
|
||||
user1.email_verified = true;
|
||||
user1.auto_renew = false;
|
||||
user1.license_alert = false;
|
||||
user1.notification = false;
|
||||
user1.encryption = false;
|
||||
user1.prompt = false;
|
||||
|
||||
@ -82,7 +82,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
user.accepted_dpa_version = '1.0';
|
||||
user.email_verified = true;
|
||||
user.auto_renew = false;
|
||||
user.license_alert = false;
|
||||
user.notification = false;
|
||||
user.deleted_at = null;
|
||||
user.created_by = 'test';
|
||||
|
||||
@ -29,6 +29,8 @@ import {
|
||||
ChangeStatusResponse,
|
||||
PostCheckoutPermissionRequest,
|
||||
PostCheckoutPermissionResponse,
|
||||
PostDeleteTaskRequest,
|
||||
PostDeleteTaskResponse,
|
||||
TasksRequest,
|
||||
TasksResponse,
|
||||
} from './types/types';
|
||||
@ -752,4 +754,82 @@ export class TasksController {
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@Post(':audioFileId/delete')
|
||||
@ApiResponse({
|
||||
status: HttpStatus.OK,
|
||||
type: PostDeleteTaskResponse,
|
||||
description: '成功時のレスポンス',
|
||||
})
|
||||
@ApiResponse({
|
||||
status: HttpStatus.BAD_REQUEST,
|
||||
description: '不正なパラメータ',
|
||||
type: ErrorResponse,
|
||||
})
|
||||
@ApiResponse({
|
||||
status: HttpStatus.UNAUTHORIZED,
|
||||
description: '認証エラー',
|
||||
type: ErrorResponse,
|
||||
})
|
||||
@ApiResponse({
|
||||
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
description: '想定外のサーバーエラー',
|
||||
type: ErrorResponse,
|
||||
})
|
||||
@ApiOperation({
|
||||
operationId: 'deleteTask',
|
||||
description: '指定した文字起こしタスクを削除します。',
|
||||
})
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(AuthGuard)
|
||||
@UseGuards(
|
||||
RoleGuard.requireds({ roles: [ADMIN_ROLES.ADMIN, USER_ROLES.AUTHOR] }),
|
||||
)
|
||||
async deleteTask(
|
||||
@Req() req: Request,
|
||||
@Param() params: PostDeleteTaskRequest,
|
||||
): Promise<PostDeleteTaskResponse> {
|
||||
const { audioFileId } = params;
|
||||
|
||||
// AuthGuardでチェック済みなのでここでのアクセストークンチェックはしない
|
||||
const accessToken = retrieveAuthorizationToken(req);
|
||||
if (!accessToken) {
|
||||
throw new HttpException(
|
||||
makeErrorResponse('E000107'),
|
||||
HttpStatus.UNAUTHORIZED,
|
||||
);
|
||||
}
|
||||
|
||||
const ip = retrieveIp(req);
|
||||
if (!ip) {
|
||||
throw new HttpException(
|
||||
makeErrorResponse('E000401'),
|
||||
HttpStatus.UNAUTHORIZED,
|
||||
);
|
||||
}
|
||||
|
||||
const requestId = retrieveRequestId(req);
|
||||
if (!requestId) {
|
||||
throw new HttpException(
|
||||
makeErrorResponse('E000501'),
|
||||
HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
|
||||
const decodedAccessToken = jwt.decode(accessToken, { json: true });
|
||||
if (!decodedAccessToken) {
|
||||
throw new HttpException(
|
||||
makeErrorResponse('E000101'),
|
||||
HttpStatus.UNAUTHORIZED,
|
||||
);
|
||||
}
|
||||
const { userId } = decodedAccessToken as AccessToken;
|
||||
|
||||
const context = makeContext(userId, requestId);
|
||||
this.logger.log(`[${context.getTrackingId()}] ip : ${ip}`);
|
||||
|
||||
// TODO: Task削除処理を実装する
|
||||
console.log(audioFileId);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,7 +338,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
user1.role = 'admin';
|
||||
user1.email_verified = true;
|
||||
user1.auto_renew = false;
|
||||
user1.license_alert = false;
|
||||
user1.notification = false;
|
||||
user1.deleted_at = null;
|
||||
user1.created_by = 'test';
|
||||
@ -482,7 +481,6 @@ const defaultTasksRepositoryMockValue: {
|
||||
accepted_dpa_version: '',
|
||||
email_verified: true,
|
||||
auto_renew: true,
|
||||
license_alert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
|
||||
@ -227,3 +227,13 @@ export class PostCheckoutPermissionRequest {
|
||||
}
|
||||
|
||||
export class PostCheckoutPermissionResponse {}
|
||||
|
||||
export class PostDeleteTaskRequest {
|
||||
@ApiProperty({ description: 'ODMS Cloud上の音声ファイルID' })
|
||||
@Type(() => Number)
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
audioFileId: number;
|
||||
}
|
||||
|
||||
export class PostDeleteTaskResponse {}
|
||||
|
||||
@ -331,7 +331,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
user1.accepted_dpa_version = '1.0';
|
||||
user1.email_verified = true;
|
||||
user1.auto_renew = false;
|
||||
user1.license_alert = false;
|
||||
user1.notification = false;
|
||||
user1.encryption = false;
|
||||
user1.prompt = false;
|
||||
@ -351,7 +350,6 @@ export const makeDefaultUsersRepositoryMockValue =
|
||||
user2.accepted_dpa_version = '1.0';
|
||||
user2.email_verified = true;
|
||||
user2.auto_renew = false;
|
||||
user2.license_alert = false;
|
||||
user2.notification = false;
|
||||
user2.encryption = false;
|
||||
user2.prompt = false;
|
||||
|
||||
@ -1,5 +1,12 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsBoolean, IsEmail, IsIn, IsInt, IsOptional, MaxLength } from 'class-validator';
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEmail,
|
||||
IsIn,
|
||||
IsInt,
|
||||
IsOptional,
|
||||
MaxLength,
|
||||
} from 'class-validator';
|
||||
import {
|
||||
TASK_LIST_SORTABLE_ATTRIBUTES,
|
||||
USER_LICENSE_STATUS,
|
||||
@ -44,9 +51,6 @@ export class User {
|
||||
@ApiProperty()
|
||||
autoRenew: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
licenseAlert: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
notification: boolean;
|
||||
|
||||
@ -97,11 +101,6 @@ export class SignupRequest {
|
||||
@IsBoolean()
|
||||
autoRenew: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@Type(() => Boolean)
|
||||
@IsBoolean()
|
||||
licenseAlert: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@Type(() => Boolean)
|
||||
@IsBoolean()
|
||||
@ -233,11 +232,6 @@ export class PostUpdateUserRequest {
|
||||
@IsBoolean()
|
||||
autoRenew: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@Type(() => Boolean)
|
||||
@IsBoolean()
|
||||
licenseAlart: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@Type(() => Boolean)
|
||||
@IsBoolean()
|
||||
|
||||
@ -249,7 +249,6 @@ export class UsersController {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -301,7 +300,6 @@ export class UsersController {
|
||||
role as UserRoles,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -569,7 +567,6 @@ export class UsersController {
|
||||
role,
|
||||
authorId,
|
||||
autoRenew,
|
||||
licenseAlart,
|
||||
notification,
|
||||
encryption,
|
||||
encryptionPassword,
|
||||
@ -619,7 +616,6 @@ export class UsersController {
|
||||
role,
|
||||
authorId,
|
||||
autoRenew,
|
||||
licenseAlart,
|
||||
notification,
|
||||
encryption,
|
||||
encryptionPassword,
|
||||
|
||||
@ -221,7 +221,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
||||
updated_by: 'string;',
|
||||
updated_at: new Date(),
|
||||
auto_renew: true,
|
||||
license_alert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -273,7 +272,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
||||
updated_by: 'string;',
|
||||
updated_at: new Date(),
|
||||
auto_renew: true,
|
||||
license_alert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -324,7 +322,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
||||
updated_by: 'string;',
|
||||
updated_at: new Date(),
|
||||
auto_renew: true,
|
||||
license_alert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -380,7 +377,6 @@ describe('UsersService.confirmUserAndInitPassword', () => {
|
||||
updated_by: 'string;',
|
||||
updated_at: new Date(),
|
||||
auto_renew: true,
|
||||
license_alert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -494,7 +490,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
),
|
||||
).toEqual(undefined);
|
||||
@ -507,7 +502,6 @@ describe('UsersService.createUser', () => {
|
||||
expect(user?.author_id).toEqual(null);
|
||||
expect(user?.email_verified).toEqual(false);
|
||||
expect(user?.auto_renew).toEqual(autoRenew);
|
||||
expect(user?.license_alert).toEqual(licenseAlert);
|
||||
expect(user?.notification).toEqual(notification);
|
||||
expect(user?.encryption).toEqual(false);
|
||||
expect(user?.encryption_password).toEqual(null);
|
||||
@ -574,7 +568,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -591,7 +584,6 @@ describe('UsersService.createUser', () => {
|
||||
expect(user?.author_id).toEqual(authorId);
|
||||
expect(user?.email_verified).toEqual(false);
|
||||
expect(user?.auto_renew).toEqual(autoRenew);
|
||||
expect(user?.license_alert).toEqual(licenseAlert);
|
||||
expect(user?.notification).toEqual(notification);
|
||||
expect(user?.encryption).toEqual(encryption);
|
||||
expect(user?.encryption_password).toEqual(encryptionPassword);
|
||||
@ -657,7 +649,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -674,7 +665,6 @@ describe('UsersService.createUser', () => {
|
||||
expect(user?.author_id).toEqual(authorId);
|
||||
expect(user?.email_verified).toEqual(false);
|
||||
expect(user?.auto_renew).toEqual(autoRenew);
|
||||
expect(user?.license_alert).toEqual(licenseAlert);
|
||||
expect(user?.notification).toEqual(notification);
|
||||
expect(user?.encryption).toEqual(encryption);
|
||||
expect(user?.encryption_password).toBeNull();
|
||||
@ -737,7 +727,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
),
|
||||
).toEqual(undefined);
|
||||
@ -750,7 +739,6 @@ describe('UsersService.createUser', () => {
|
||||
expect(user?.author_id).toBeNull();
|
||||
expect(user?.email_verified).toEqual(false);
|
||||
expect(user?.auto_renew).toEqual(autoRenew);
|
||||
expect(user?.license_alert).toEqual(licenseAlert);
|
||||
expect(user?.notification).toEqual(notification);
|
||||
expect(user?.encryption).toEqual(false);
|
||||
expect(user?.encryption_password).toBeNull();
|
||||
@ -817,7 +805,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
);
|
||||
} catch (e) {
|
||||
@ -896,7 +883,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
);
|
||||
} catch (e) {
|
||||
@ -958,7 +944,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
);
|
||||
} catch (e) {
|
||||
@ -1018,7 +1003,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
);
|
||||
} catch (e) {
|
||||
@ -1086,7 +1070,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email_1,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -1127,7 +1110,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email_2,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -1209,7 +1191,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -1284,7 +1265,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
);
|
||||
} catch (e) {
|
||||
@ -1361,7 +1341,6 @@ describe('UsersService.createUser', () => {
|
||||
role,
|
||||
email,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
);
|
||||
} catch (e) {
|
||||
@ -1458,7 +1437,6 @@ describe('UsersService.getUsers', () => {
|
||||
email: 'test1@mail.com',
|
||||
emailVerified: true,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -1475,7 +1453,6 @@ describe('UsersService.getUsers', () => {
|
||||
email: 'test2@mail.com',
|
||||
emailVerified: true,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -1492,7 +1469,6 @@ describe('UsersService.getUsers', () => {
|
||||
email: 'test3@mail.com',
|
||||
emailVerified: true,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -1571,7 +1547,6 @@ describe('UsersService.getUsers', () => {
|
||||
email: 'test1@mail.com',
|
||||
emailVerified: true,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -1590,7 +1565,6 @@ describe('UsersService.getUsers', () => {
|
||||
email: 'test2@mail.com',
|
||||
emailVerified: true,
|
||||
autoRenew: true,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -1609,7 +1583,6 @@ describe('UsersService.getUsers', () => {
|
||||
email: 'test3@mail.com',
|
||||
emailVerified: true,
|
||||
autoRenew: false,
|
||||
licenseAlert: true,
|
||||
notification: true,
|
||||
encryption: false,
|
||||
prompt: false,
|
||||
@ -1927,7 +1900,6 @@ describe('UsersService.updateUser', () => {
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@ -1940,7 +1912,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.NONE);
|
||||
expect(createdUser?.author_id).toBeNull();
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(false);
|
||||
expect(createdUser?.encryption_password).toBeNull();
|
||||
@ -1987,7 +1958,6 @@ describe('UsersService.updateUser', () => {
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@ -2000,7 +1970,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
|
||||
expect(createdUser?.author_id).toBeNull();
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(false);
|
||||
expect(createdUser?.encryption_password).toBeNull();
|
||||
@ -2047,7 +2016,6 @@ describe('UsersService.updateUser', () => {
|
||||
'AUTHOR_ID',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
'new_password',
|
||||
true,
|
||||
@ -2060,7 +2028,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(true);
|
||||
expect(createdUser?.encryption_password).toBe('new_password');
|
||||
@ -2107,7 +2074,6 @@ describe('UsersService.updateUser', () => {
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@ -2120,7 +2086,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.TYPIST);
|
||||
expect(createdUser?.author_id).toBeNull();
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(false);
|
||||
expect(createdUser?.encryption_password).toBeNull();
|
||||
@ -2168,7 +2133,6 @@ describe('UsersService.updateUser', () => {
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
undefined,
|
||||
false,
|
||||
),
|
||||
@ -2180,7 +2144,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(false);
|
||||
expect(createdUser?.encryption_password).toBeNull();
|
||||
@ -2227,7 +2190,6 @@ describe('UsersService.updateUser', () => {
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@ -2277,7 +2239,6 @@ describe('UsersService.updateUser', () => {
|
||||
'AUTHOR_ID',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
undefined,
|
||||
true,
|
||||
@ -2290,7 +2251,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(true);
|
||||
expect(createdUser?.encryption_password).toBe('password');
|
||||
@ -2338,7 +2298,6 @@ describe('UsersService.updateUser', () => {
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'password',
|
||||
true,
|
||||
),
|
||||
@ -2350,7 +2309,6 @@ describe('UsersService.updateUser', () => {
|
||||
expect(createdUser?.role).toBe(USER_ROLES.AUTHOR);
|
||||
expect(createdUser?.author_id).toBe('AUTHOR_ID');
|
||||
expect(createdUser?.auto_renew).toBe(false);
|
||||
expect(createdUser?.license_alert).toBe(false);
|
||||
expect(createdUser?.notification).toBe(false);
|
||||
expect(createdUser?.encryption).toBe(false);
|
||||
expect(createdUser?.encryption_password).toBeNull();
|
||||
@ -2397,7 +2355,6 @@ describe('UsersService.updateUser', () => {
|
||||
'AUTHOR_ID',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
undefined,
|
||||
true,
|
||||
@ -2458,7 +2415,6 @@ describe('UsersService.updateUser', () => {
|
||||
'AUTHOR_ID2',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
undefined,
|
||||
true,
|
||||
|
||||
@ -148,18 +148,18 @@ export class UsersService {
|
||||
|
||||
/**
|
||||
* Creates user
|
||||
* @param accessToken
|
||||
* @param context
|
||||
* @param externalId
|
||||
* @param name
|
||||
* @param role
|
||||
* @param email
|
||||
* @param autoRenew
|
||||
* @param licenseAlert
|
||||
* @param notification
|
||||
* @param [authorId]
|
||||
* @param [encryption]
|
||||
* @param [encryptionPassword]
|
||||
* @param [prompt]
|
||||
* @returns void
|
||||
* @returns user
|
||||
*/
|
||||
async createUser(
|
||||
context: Context,
|
||||
@ -168,7 +168,6 @@ export class UsersService {
|
||||
role: UserRoles,
|
||||
email: string,
|
||||
autoRenew: boolean,
|
||||
licenseAlert: boolean,
|
||||
notification: boolean,
|
||||
authorId?: string | undefined,
|
||||
encryption?: boolean | undefined,
|
||||
@ -180,7 +179,6 @@ export class UsersService {
|
||||
`externalId: ${externalId}, ` +
|
||||
`role: ${role}, ` +
|
||||
`autoRenew: ${autoRenew}, ` +
|
||||
`licenseAlert: ${licenseAlert}, ` +
|
||||
`notification: ${notification}, ` +
|
||||
`authorId: ${authorId}, ` +
|
||||
`encryption: ${encryption}, ` +
|
||||
@ -272,7 +270,6 @@ export class UsersService {
|
||||
accountId,
|
||||
externalUser.sub,
|
||||
autoRenew,
|
||||
licenseAlert,
|
||||
notification,
|
||||
authorId,
|
||||
encryption,
|
||||
@ -408,7 +405,6 @@ export class UsersService {
|
||||
accountId: number,
|
||||
externalId: string,
|
||||
autoRenew: boolean,
|
||||
licenseAlert: boolean,
|
||||
notification: boolean,
|
||||
authorId?: string | undefined,
|
||||
encryption?: boolean | undefined,
|
||||
@ -424,7 +420,6 @@ export class UsersService {
|
||||
`authorId: ${authorId}, ` +
|
||||
`externalId: ${externalId}, ` +
|
||||
`autoRenew: ${autoRenew}, ` +
|
||||
`licenseAlert: ${licenseAlert}, ` +
|
||||
`notification: ${notification}, ` +
|
||||
`authorId: ${authorId}, ` +
|
||||
`encryption: ${encryption}, ` +
|
||||
@ -438,7 +433,6 @@ export class UsersService {
|
||||
account_id: accountId,
|
||||
external_id: externalId,
|
||||
auto_renew: autoRenew,
|
||||
license_alert: licenseAlert,
|
||||
notification,
|
||||
role,
|
||||
accepted_dpa_version: null,
|
||||
@ -454,7 +448,6 @@ export class UsersService {
|
||||
account_id: accountId,
|
||||
external_id: externalId,
|
||||
auto_renew: autoRenew,
|
||||
license_alert: licenseAlert,
|
||||
notification,
|
||||
role,
|
||||
author_id: authorId ?? null,
|
||||
@ -671,7 +664,6 @@ export class UsersService {
|
||||
email: mail,
|
||||
emailVerified: dbUser.email_verified,
|
||||
autoRenew: dbUser.auto_renew,
|
||||
licenseAlert: dbUser.license_alert,
|
||||
notification: dbUser.notification,
|
||||
encryption: dbUser.encryption,
|
||||
prompt: dbUser.prompt,
|
||||
@ -901,14 +893,13 @@ export class UsersService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定したユーザーの情報を更新します
|
||||
* Updates user
|
||||
* @param context
|
||||
* @param extarnalId
|
||||
* @param id
|
||||
* @param role
|
||||
* @param authorId
|
||||
* @param autoRenew
|
||||
* @param licenseAlart
|
||||
* @param notification
|
||||
* @param encryption
|
||||
* @param encryptionPassword
|
||||
@ -922,7 +913,6 @@ export class UsersService {
|
||||
role: string,
|
||||
authorId: string | undefined,
|
||||
autoRenew: boolean,
|
||||
licenseAlart: boolean,
|
||||
notification: boolean,
|
||||
encryption: boolean | undefined,
|
||||
encryptionPassword: string | undefined,
|
||||
@ -938,7 +928,6 @@ export class UsersService {
|
||||
`role: ${role}, ` +
|
||||
`authorId: ${authorId}, ` +
|
||||
`autoRenew: ${autoRenew}, ` +
|
||||
`licenseAlart: ${licenseAlart}, ` +
|
||||
`notification: ${notification}, ` +
|
||||
`encryption: ${encryption}, ` +
|
||||
`prompt: ${prompt} }`,
|
||||
@ -957,7 +946,6 @@ export class UsersService {
|
||||
role,
|
||||
authorId,
|
||||
autoRenew,
|
||||
licenseAlart,
|
||||
notification,
|
||||
encryption,
|
||||
encryptionPassword,
|
||||
|
||||
@ -59,7 +59,11 @@ import {
|
||||
deleteEntity,
|
||||
} from '../../common/repository';
|
||||
import { Context } from '../../common/log';
|
||||
import { LicenseSummaryInfo, PartnerInfoFromDb, PartnerLicenseInfoForRepository } from '../../features/accounts/types/types';
|
||||
import {
|
||||
LicenseSummaryInfo,
|
||||
PartnerInfoFromDb,
|
||||
PartnerLicenseInfoForRepository,
|
||||
} from '../../features/accounts/types/types';
|
||||
|
||||
@Injectable()
|
||||
export class AccountsRepositoryService {
|
||||
|
||||
@ -46,9 +46,6 @@ export class User {
|
||||
@Column({ default: true })
|
||||
auto_renew: boolean;
|
||||
|
||||
@Column({ default: true })
|
||||
license_alert: boolean;
|
||||
|
||||
@Column({ default: true })
|
||||
notification: boolean;
|
||||
|
||||
@ -127,9 +124,6 @@ export class UserArchive {
|
||||
@Column()
|
||||
auto_renew: boolean;
|
||||
|
||||
@Column()
|
||||
license_alert: boolean;
|
||||
|
||||
@Column()
|
||||
notification: boolean;
|
||||
|
||||
|
||||
@ -67,7 +67,6 @@ export class UsersRepositoryService {
|
||||
external_id: externalUserId,
|
||||
role,
|
||||
auto_renew,
|
||||
license_alert,
|
||||
notification,
|
||||
author_id,
|
||||
accepted_eula_version,
|
||||
@ -82,7 +81,6 @@ export class UsersRepositoryService {
|
||||
userEntity.account_id = accountId;
|
||||
userEntity.external_id = externalUserId;
|
||||
userEntity.auto_renew = auto_renew;
|
||||
userEntity.license_alert = license_alert;
|
||||
userEntity.notification = notification;
|
||||
userEntity.author_id = author_id;
|
||||
userEntity.accepted_eula_version = accepted_eula_version;
|
||||
@ -278,7 +276,6 @@ export class UsersRepositoryService {
|
||||
role: string,
|
||||
authorId: string | undefined,
|
||||
autoRenew: boolean,
|
||||
licenseAlart: boolean,
|
||||
notification: boolean,
|
||||
encryption: boolean | undefined,
|
||||
encryptionPassword: string | undefined,
|
||||
@ -345,7 +342,6 @@ export class UsersRepositoryService {
|
||||
// 共通項目を更新
|
||||
targetUser.role = role;
|
||||
targetUser.auto_renew = autoRenew;
|
||||
targetUser.license_alert = licenseAlart;
|
||||
targetUser.notification = notification;
|
||||
|
||||
const result = await updateEntity(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user