[feat] negodata: 협력사 채팅 계정(supplier_users) 관리 — 발급·비번 재설정·활성상태
- 백엔드: supplier_users/supplier_user_tokens ORM 매핑, /v1/supplier/{id}/account 4종(조회·발급·재설정·상태), 회사 스코프 게이팅, 재설정·비활성 시 토큰 삭제로 기존 로그인 즉시 무효화
- 비밀번호: 발급=서버 자동생성(1회 반환), 재설정=커스텀 지정 가능(미지정 시 자동생성)
- 프론트: 협력사 상세 SupplierAccountManager 섹션 + 목록 '채팅 계정' 컬럼, orval 재생성(SupplierType 은 enumLabels 로컬 상수로 이동)
- 테스트: test_supplier_account.py 9건, 전체 스위트 green
This commit is contained in:
1 parent
a80dac20ed
commit
7f1c0be2b3
37 files changed
+1385
-36
No files matched your search
@@ -162,6 +162,7 @@ export * from './reqCreateQuotationSetting';
|
||||
export * from './reqCreateQuotationStartTime';
|
||||
export * from './reqCreateQuotationVersionId';
|
||||
export * from './reqCreateSupplier';
|
||||
export * from './reqCreateSupplierAccount';
|
||||
export * from './reqCreateSupplierCode';
|
||||
export * from './reqCreateSupplierItem';
|
||||
export * from './reqCreateSupplierManagerContactNumber';
|
||||
@@ -170,6 +171,8 @@ export * from './reqCreateSupplierManagerName';
|
||||
export * from './reqCreateSupplierTotalRevenue';
|
||||
export * from './reqLogin';
|
||||
export * from './reqRegenerateQuotation';
|
||||
export * from './reqResetSupplierAccountPassword';
|
||||
export * from './reqResetSupplierAccountPasswordPassword';
|
||||
export * from './reqUpdateCard';
|
||||
export * from './reqUpdateCardCondition';
|
||||
export * from './reqUpdateCardEditScript';
|
||||
@@ -215,6 +218,7 @@ export * from './reqUpdateQuotationSetting';
|
||||
export * from './reqUpdateQuotationSettingCardCount';
|
||||
export * from './reqUpdateQuotationSettingTargetMarginRate';
|
||||
export * from './reqUpdateSupplier';
|
||||
export * from './reqUpdateSupplierAccountStatus';
|
||||
export * from './reqUpdateSupplierCode';
|
||||
export * from './reqUpdateSupplierManagerContactNumber';
|
||||
export * from './reqUpdateSupplierManagerEmail';
|
||||
@@ -239,6 +243,10 @@ export * from './resCompanyUserUser';
|
||||
export * from './resCreateQuotation';
|
||||
export * from './resCreateQuotationMsg';
|
||||
export * from './resCreateQuotationQtId';
|
||||
export * from './resCreateSupplierAccount';
|
||||
export * from './resCreateSupplierAccountAccount';
|
||||
export * from './resCreateSupplierAccountInitialPassword';
|
||||
export * from './resCreateSupplierAccountMsg';
|
||||
export * from './resDashboardSummary';
|
||||
export * from './resDashboardSummaryMsg';
|
||||
export * from './resDeleteCard';
|
||||
@@ -313,12 +321,18 @@ export * from './resQuotationStatusMsg';
|
||||
export * from './resQuotationStatusQtId';
|
||||
export * from './resRefreshToken';
|
||||
export * from './resRefreshTokenMsg';
|
||||
export * from './resResetSupplierAccountPassword';
|
||||
export * from './resResetSupplierAccountPasswordMsg';
|
||||
export * from './resResetSupplierAccountPasswordNewPassword';
|
||||
export * from './resSessionChat';
|
||||
export * from './resSessionChatMsg';
|
||||
export * from './resSessionChatSessionId';
|
||||
export * from './resStatisticsSummary';
|
||||
export * from './resStatisticsSummaryMsg';
|
||||
export * from './resSupplier';
|
||||
export * from './resSupplierAccount';
|
||||
export * from './resSupplierAccountAccount';
|
||||
export * from './resSupplierAccountMsg';
|
||||
export * from './resSupplierItem';
|
||||
export * from './resSupplierItemList';
|
||||
export * from './resSupplierItemListMsg';
|
||||
@@ -355,7 +369,11 @@ export * from './statOutcome';
|
||||
export * from './statParticipation';
|
||||
export * from './statScope';
|
||||
export * from './statTypeRow';
|
||||
export * from './supplierAccountData';
|
||||
export * from './supplierAccountDataCreatedAt';
|
||||
export * from './supplierData';
|
||||
export * from './supplierDataAccountLoginId';
|
||||
export * from './supplierDataAccountStatus';
|
||||
export * from './supplierDataCode';
|
||||
export * from './supplierDataCreatedAt';
|
||||
export * from './supplierDataCreatorName';
|
||||
@@ -368,10 +386,9 @@ export * from './supplierItemData';
|
||||
export * from './supplierItemDataCreatedAt';
|
||||
export * from './supplierItemDataItemCode';
|
||||
export * from './supplierItemDataUpdatedAt';
|
||||
export * from './supplierType';
|
||||
export * from './targetCandidate';
|
||||
export * from './userRole';
|
||||
export * from './userStatus';
|
||||
export * from './validationError';
|
||||
export * from './validationErrorCtx';
|
||||
export * from './validationErrorLocItem';
|
||||
export * from './validationErrorLocItem';
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface ReqCreateSupplierAccount {
|
||||
login_id?: string;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ReqResetSupplierAccountPasswordPassword } from './reqResetSupplierAccountPasswordPassword';
|
||||
|
||||
export interface ReqResetSupplierAccountPassword {
|
||||
password?: ReqResetSupplierAccountPasswordPassword;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ReqResetSupplierAccountPasswordPassword = string | null;
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface ReqUpdateSupplierAccountStatus {
|
||||
status?: number;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ErrorInfo } from './errorInfo';
|
||||
import type { ResCreateSupplierAccountMsg } from './resCreateSupplierAccountMsg';
|
||||
import type { ResCreateSupplierAccountAccount } from './resCreateSupplierAccountAccount';
|
||||
import type { ResCreateSupplierAccountInitialPassword } from './resCreateSupplierAccountInitialPassword';
|
||||
|
||||
export interface ResCreateSupplierAccount {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResCreateSupplierAccountMsg;
|
||||
account?: ResCreateSupplierAccountAccount;
|
||||
initial_password?: ResCreateSupplierAccountInitialPassword;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { SupplierAccountData } from './supplierAccountData';
|
||||
|
||||
export type ResCreateSupplierAccountAccount = SupplierAccountData | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCreateSupplierAccountInitialPassword = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCreateSupplierAccountMsg = string | null;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ErrorInfo } from './errorInfo';
|
||||
import type { ResResetSupplierAccountPasswordMsg } from './resResetSupplierAccountPasswordMsg';
|
||||
import type { ResResetSupplierAccountPasswordNewPassword } from './resResetSupplierAccountPasswordNewPassword';
|
||||
|
||||
export interface ResResetSupplierAccountPassword {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResResetSupplierAccountPasswordMsg;
|
||||
new_password?: ResResetSupplierAccountPasswordNewPassword;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResResetSupplierAccountPasswordMsg = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResResetSupplierAccountPasswordNewPassword = string | null;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ErrorInfo } from './errorInfo';
|
||||
import type { ResSupplierAccountMsg } from './resSupplierAccountMsg';
|
||||
import type { ResSupplierAccountAccount } from './resSupplierAccountAccount';
|
||||
|
||||
export interface ResSupplierAccount {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResSupplierAccountMsg;
|
||||
account?: ResSupplierAccountAccount;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { SupplierAccountData } from './supplierAccountData';
|
||||
|
||||
export type ResSupplierAccountAccount = SupplierAccountData | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResSupplierAccountMsg = string | null;
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { SupplierAccountDataCreatedAt } from './supplierAccountDataCreatedAt';
|
||||
|
||||
export interface SupplierAccountData {
|
||||
su_id: string;
|
||||
login_id: string;
|
||||
status: number;
|
||||
created_at?: SupplierAccountDataCreatedAt;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SupplierAccountDataCreatedAt = string | null;
|
||||
@@ -10,6 +10,8 @@ import type { SupplierDataManagerName } from './supplierDataManagerName';
|
||||
import type { SupplierDataManagerEmail } from './supplierDataManagerEmail';
|
||||
import type { SupplierDataManagerContactNumber } from './supplierDataManagerContactNumber';
|
||||
import type { SupplierDataTotalRevenue } from './supplierDataTotalRevenue';
|
||||
import type { SupplierDataAccountLoginId } from './supplierDataAccountLoginId';
|
||||
import type { SupplierDataAccountStatus } from './supplierDataAccountStatus';
|
||||
import type { SupplierDataCreatedAt } from './supplierDataCreatedAt';
|
||||
import type { SupplierDataUpdatedAt } from './supplierDataUpdatedAt';
|
||||
|
||||
@@ -24,6 +26,8 @@ export interface SupplierData {
|
||||
manager_email?: SupplierDataManagerEmail;
|
||||
manager_contact_number?: SupplierDataManagerContactNumber;
|
||||
total_revenue?: SupplierDataTotalRevenue;
|
||||
account_login_id?: SupplierDataAccountLoginId;
|
||||
account_status?: SupplierDataAccountStatus;
|
||||
created_at?: SupplierDataCreatedAt;
|
||||
updated_at?: SupplierDataUpdatedAt;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SupplierDataAccountLoginId = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SupplierDataAccountStatus = number | null;
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Negodata Api Server
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* partner.supplier_items.supply_type 코드값. 없음(0,미지정)/유통(1)/제조(2)/총판(3).
|
||||
없음은 상품-협력사 매핑에서 유형 미지정 상태를 뜻한다.
|
||||
*/
|
||||
export type SupplierType = typeof SupplierType[keyof typeof SupplierType];
|
||||
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
||||
export const SupplierType = {
|
||||
NONE: 0,
|
||||
DISTRIBUTION: 1,
|
||||
MANUFACTURE: 2,
|
||||
SOLE_AGENCY: 3,
|
||||
} as const;
|
||||
@@ -1135,9 +1135,7 @@ export const useDeleteQuotation = <TError = void | HTTPValidationError,
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @summary 견적 조회
|
||||
*/
|
||||
export const getQuotation = (
|
||||
@@ -1228,3 +1226,4 @@ export function useGetQuotation<TData = Awaited<ReturnType<typeof getQuotation>>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,10 +28,16 @@ import type {
|
||||
ListSuppliersParams,
|
||||
ReqCheckCodes,
|
||||
ReqCreateSupplier,
|
||||
ReqCreateSupplierAccount,
|
||||
ReqResetSupplierAccountPassword,
|
||||
ReqUpdateSupplier,
|
||||
ReqUpdateSupplierAccountStatus,
|
||||
ResCheckCodes,
|
||||
ResCreateSupplierAccount,
|
||||
ResDeleteSupplier,
|
||||
ResResetSupplierAccountPassword,
|
||||
ResSupplier,
|
||||
ResSupplierAccount,
|
||||
ResSupplierList
|
||||
} from '.././model';
|
||||
|
||||
@@ -420,7 +426,7 @@ export const useUpdateSupplier = <TError = void | HTTPValidationError,
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 협력사 삭제
|
||||
* @summary 협력사 삭제 (최고관리자 전용)
|
||||
*/
|
||||
export const deleteSupplier = (
|
||||
supplierId: string,
|
||||
@@ -465,7 +471,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
export type DeleteSupplierMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 협력사 삭제
|
||||
* @summary 협력사 삭제 (최고관리자 전용)
|
||||
*/
|
||||
export const useDeleteSupplier = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSupplier>>, TError,{supplierId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
@@ -480,4 +486,290 @@ export const useDeleteSupplier = <TError = void | HTTPValidationError,
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 채팅 계정 조회 (미발급이면 account=null)
|
||||
*/
|
||||
export const getSupplierAccount = (
|
||||
supplierId: string,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResSupplierAccount>(
|
||||
{url: `/v1/supplier/${supplierId}/account`, method: 'GET', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetSupplierAccountQueryKey = (supplierId?: string,) => {
|
||||
return [
|
||||
`/v1/supplier/${supplierId}/account`
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetSupplierAccountQueryOptions = <TData = Awaited<ReturnType<typeof getSupplierAccount>>, TError = void | HTTPValidationError>(supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierAccount>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetSupplierAccountQueryKey(supplierId);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSupplierAccount>>> = ({ signal }) => getSupplierAccount(supplierId, requestOptions, signal);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, enabled: !!(supplierId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSupplierAccount>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetSupplierAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getSupplierAccount>>>
|
||||
export type GetSupplierAccountQueryError = void | HTTPValidationError
|
||||
|
||||
|
||||
export function useGetSupplierAccount<TData = Awaited<ReturnType<typeof getSupplierAccount>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierAccount>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getSupplierAccount>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getSupplierAccount>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetSupplierAccount<TData = Awaited<ReturnType<typeof getSupplierAccount>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierAccount>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getSupplierAccount>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getSupplierAccount>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetSupplierAccount<TData = Awaited<ReturnType<typeof getSupplierAccount>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierAccount>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary 채팅 계정 조회 (미발급이면 account=null)
|
||||
*/
|
||||
|
||||
export function useGetSupplierAccount<TData = Awaited<ReturnType<typeof getSupplierAccount>>, TError = void | HTTPValidationError>(
|
||||
supplierId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSupplierAccount>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetSupplierAccountQueryOptions(supplierId,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey ;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @summary 채팅 계정 발급 (비밀번호 자동생성·1회 반환)
|
||||
*/
|
||||
export const createSupplierAccount = (
|
||||
supplierId: string,
|
||||
reqCreateSupplierAccount: ReqCreateSupplierAccount,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResCreateSupplierAccount>(
|
||||
{url: `/v1/supplier/${supplierId}/account/create`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqCreateSupplierAccount, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getCreateSupplierAccountMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSupplierAccount>>, TError,{supplierId: string;data: ReqCreateSupplierAccount}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof createSupplierAccount>>, TError,{supplierId: string;data: ReqCreateSupplierAccount}, TContext> => {
|
||||
|
||||
const mutationKey = ['createSupplierAccount'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof createSupplierAccount>>, {supplierId: string;data: ReqCreateSupplierAccount}> = (props) => {
|
||||
const {supplierId,data} = props ?? {};
|
||||
|
||||
return createSupplierAccount(supplierId,data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type CreateSupplierAccountMutationResult = NonNullable<Awaited<ReturnType<typeof createSupplierAccount>>>
|
||||
export type CreateSupplierAccountMutationBody = ReqCreateSupplierAccount
|
||||
export type CreateSupplierAccountMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 채팅 계정 발급 (비밀번호 자동생성·1회 반환)
|
||||
*/
|
||||
export const useCreateSupplierAccount = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createSupplierAccount>>, TError,{supplierId: string;data: ReqCreateSupplierAccount}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof createSupplierAccount>>,
|
||||
TError,
|
||||
{supplierId: string;data: ReqCreateSupplierAccount},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getCreateSupplierAccountMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 채팅 계정 비밀번호 재설정 (커스텀 지정 가능, 기존 로그인 즉시 무효화)
|
||||
*/
|
||||
export const resetSupplierAccountPassword = (
|
||||
supplierId: string,
|
||||
reqResetSupplierAccountPassword: ReqResetSupplierAccountPassword,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResResetSupplierAccountPassword>(
|
||||
{url: `/v1/supplier/${supplierId}/account/reset-password`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqResetSupplierAccountPassword, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getResetSupplierAccountPasswordMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof resetSupplierAccountPassword>>, TError,{supplierId: string;data: ReqResetSupplierAccountPassword}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof resetSupplierAccountPassword>>, TError,{supplierId: string;data: ReqResetSupplierAccountPassword}, TContext> => {
|
||||
|
||||
const mutationKey = ['resetSupplierAccountPassword'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof resetSupplierAccountPassword>>, {supplierId: string;data: ReqResetSupplierAccountPassword}> = (props) => {
|
||||
const {supplierId,data} = props ?? {};
|
||||
|
||||
return resetSupplierAccountPassword(supplierId,data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type ResetSupplierAccountPasswordMutationResult = NonNullable<Awaited<ReturnType<typeof resetSupplierAccountPassword>>>
|
||||
export type ResetSupplierAccountPasswordMutationBody = ReqResetSupplierAccountPassword
|
||||
export type ResetSupplierAccountPasswordMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 채팅 계정 비밀번호 재설정 (커스텀 지정 가능, 기존 로그인 즉시 무효화)
|
||||
*/
|
||||
export const useResetSupplierAccountPassword = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof resetSupplierAccountPassword>>, TError,{supplierId: string;data: ReqResetSupplierAccountPassword}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof resetSupplierAccountPassword>>,
|
||||
TError,
|
||||
{supplierId: string;data: ReqResetSupplierAccountPassword},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getResetSupplierAccountPasswordMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 채팅 계정 활성/비활성 (비활성 시 기존 로그인 즉시 무효화)
|
||||
*/
|
||||
export const updateSupplierAccountStatus = (
|
||||
supplierId: string,
|
||||
reqUpdateSupplierAccountStatus: ReqUpdateSupplierAccountStatus,
|
||||
options?: SecondParameter<typeof customFetch>,) => {
|
||||
|
||||
|
||||
return customFetch<ResSupplierAccount>(
|
||||
{url: `/v1/supplier/${supplierId}/account/status`, method: 'PATCH',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqUpdateSupplierAccountStatus
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getUpdateSupplierAccountStatusMutationOptions = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSupplierAccountStatus>>, TError,{supplierId: string;data: ReqUpdateSupplierAccountStatus}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof updateSupplierAccountStatus>>, TError,{supplierId: string;data: ReqUpdateSupplierAccountStatus}, TContext> => {
|
||||
|
||||
const mutationKey = ['updateSupplierAccountStatus'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateSupplierAccountStatus>>, {supplierId: string;data: ReqUpdateSupplierAccountStatus}> = (props) => {
|
||||
const {supplierId,data} = props ?? {};
|
||||
|
||||
return updateSupplierAccountStatus(supplierId,data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type UpdateSupplierAccountStatusMutationResult = NonNullable<Awaited<ReturnType<typeof updateSupplierAccountStatus>>>
|
||||
export type UpdateSupplierAccountStatusMutationBody = ReqUpdateSupplierAccountStatus
|
||||
export type UpdateSupplierAccountStatusMutationError = void | HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary 채팅 계정 활성/비활성 (비활성 시 기존 로그인 즉시 무효화)
|
||||
*/
|
||||
export const useUpdateSupplierAccountStatus = <TError = void | HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateSupplierAccountStatus>>, TError,{supplierId: string;data: ReqUpdateSupplierAccountStatus}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof updateSupplierAccountStatus>>,
|
||||
TError,
|
||||
{supplierId: string;data: ReqUpdateSupplierAccountStatus},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getUpdateSupplierAccountStatusMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user