@@ -57,6 +57,7 @@ import type {
5757 GetItemsParams ,
5858 GetMemberRentalHistoryParams ,
5959 GetSchedulesParams ,
60+ ItemCodeUpdateRequest ,
6061 ItemDetail ,
6162 ItemFindAllResponse ,
6263 MemberFCMTokenRequest ,
@@ -69,6 +70,7 @@ import type {
6970 RentalHistoryFindAllResponse ,
7071 RentalHistoryRequest ,
7172 RentalStatusUpdateRequest ,
73+ RentalStatusWorkerLogFindAllResponse ,
7274 ReturnRequiredItemFindAllResponse ,
7375 SearchItemsParams ,
7476 SignUpRequest ,
@@ -2801,6 +2803,72 @@ export const useUpdateRentalStatus = <TError = unknown,
28012803 return useMutation ( mutationOptions , queryClient ) ;
28022804 }
28032805
2806+ /**
2807+ * 대여 기록의 물품 코드를 수정하는 관리자용 API
2808+ * @summary 물품 코드 수정
2809+ */
2810+ export const updateItemCode = (
2811+ rentalHistoryId : number ,
2812+ itemCodeUpdateRequest : ItemCodeUpdateRequest ,
2813+ ) => {
2814+
2815+
2816+ return customMutator < void > (
2817+ { url : `/admin/rentals/${ rentalHistoryId } /item-code` , method : 'PATCH' ,
2818+ headers : { 'Content-Type' : 'application/json' , } ,
2819+ data : itemCodeUpdateRequest
2820+ } ,
2821+ ) ;
2822+ }
2823+
2824+
2825+
2826+ export const getUpdateItemCodeMutationOptions = < TError = unknown ,
2827+ TContext = unknown > ( options ?: { mutation ?:UseMutationOptions < Awaited < ReturnType < typeof updateItemCode > > , TError , { rentalHistoryId : number ; data : ItemCodeUpdateRequest } , TContext > , }
2828+ ) : UseMutationOptions < Awaited < ReturnType < typeof updateItemCode > > , TError , { rentalHistoryId : number ; data : ItemCodeUpdateRequest } , TContext > => {
2829+
2830+ const mutationKey = [ 'updateItemCode' ] ;
2831+ const { mutation : mutationOptions } = options ?
2832+ options . mutation && 'mutationKey' in options . mutation && options . mutation . mutationKey ?
2833+ options
2834+ : { ...options , mutation : { ...options . mutation , mutationKey} }
2835+ : { mutation : { mutationKey, } } ;
2836+
2837+
2838+
2839+
2840+ const mutationFn : MutationFunction < Awaited < ReturnType < typeof updateItemCode > > , { rentalHistoryId : number ; data : ItemCodeUpdateRequest } > = ( props ) => {
2841+ const { rentalHistoryId, data} = props ?? { } ;
2842+
2843+ return updateItemCode ( rentalHistoryId , data , )
2844+ }
2845+
2846+
2847+
2848+
2849+ return { mutationFn, ...mutationOptions } }
2850+
2851+ export type UpdateItemCodeMutationResult = NonNullable < Awaited < ReturnType < typeof updateItemCode > > >
2852+ export type UpdateItemCodeMutationBody = ItemCodeUpdateRequest
2853+ export type UpdateItemCodeMutationError = unknown
2854+
2855+ /**
2856+ * @summary 물품 코드 수정
2857+ */
2858+ export const useUpdateItemCode = < TError = unknown ,
2859+ TContext = unknown > ( options ?: { mutation ?:UseMutationOptions < Awaited < ReturnType < typeof updateItemCode > > , TError , { rentalHistoryId : number ; data : ItemCodeUpdateRequest } , TContext > , }
2860+ , queryClient ?: QueryClient ) : UseMutationResult <
2861+ Awaited < ReturnType < typeof updateItemCode > > ,
2862+ TError ,
2863+ { rentalHistoryId : number ; data : ItemCodeUpdateRequest } ,
2864+ TContext
2865+ > => {
2866+
2867+ const mutationOptions = getUpdateItemCodeMutationOptions ( options ) ;
2868+
2869+ return useMutation ( mutationOptions , queryClient ) ;
2870+ }
2871+
28042872/**
28052873 * 관리자의 역할을 변경하는 API
28062874 * @summary 관리자 역할 변경
@@ -3378,6 +3446,95 @@ export function useGetDisplay<TData = Awaited<ReturnType<typeof getDisplay>>, TE
33783446
33793447
33803448
3449+ /**
3450+ * 대여 기록의 상태별 처리자 로그를 조회하는 관리자용 API
3451+ * @summary 대여 상태 변경 처리자 로그 조회
3452+ */
3453+ export const getWorkerLogs = (
3454+ rentalHistoryId : number ,
3455+ signal ?: AbortSignal
3456+ ) => {
3457+
3458+
3459+ return customMutator < RentalStatusWorkerLogFindAllResponse > (
3460+ { url : `/admin/rentals/${ rentalHistoryId } /workers` , method : 'GET' , signal
3461+ } ,
3462+ ) ;
3463+ }
3464+
3465+
3466+ export const getGetWorkerLogsQueryKey = ( rentalHistoryId : number , ) => {
3467+ return [ `/admin/rentals/${ rentalHistoryId } /workers` ] as const ;
3468+ }
3469+
3470+
3471+ export const getGetWorkerLogsQueryOptions = < TData = Awaited < ReturnType < typeof getWorkerLogs > > , TError = unknown > ( rentalHistoryId : number , options ?: { query ?:Partial < UseQueryOptions < Awaited < ReturnType < typeof getWorkerLogs > > , TError , TData > > , }
3472+ ) => {
3473+
3474+ const { query : queryOptions } = options ?? { } ;
3475+
3476+ const queryKey = queryOptions ?. queryKey ?? getGetWorkerLogsQueryKey ( rentalHistoryId ) ;
3477+
3478+
3479+
3480+ const queryFn : QueryFunction < Awaited < ReturnType < typeof getWorkerLogs > > > = ( { signal } ) => getWorkerLogs ( rentalHistoryId , signal ) ;
3481+
3482+
3483+
3484+
3485+
3486+ return { queryKey, queryFn, enabled : ! ! ( rentalHistoryId ) , ...queryOptions } as UseQueryOptions < Awaited < ReturnType < typeof getWorkerLogs > > , TError , TData > & { queryKey : DataTag < QueryKey , TData , TError > }
3487+ }
3488+
3489+ export type GetWorkerLogsQueryResult = NonNullable < Awaited < ReturnType < typeof getWorkerLogs > > >
3490+ export type GetWorkerLogsQueryError = unknown
3491+
3492+
3493+ export function useGetWorkerLogs < TData = Awaited < ReturnType < typeof getWorkerLogs > > , TError = unknown > (
3494+ rentalHistoryId : number , options : { query :Partial < UseQueryOptions < Awaited < ReturnType < typeof getWorkerLogs > > , TError , TData > > & Pick <
3495+ DefinedInitialDataOptions <
3496+ Awaited < ReturnType < typeof getWorkerLogs > > ,
3497+ TError ,
3498+ Awaited < ReturnType < typeof getWorkerLogs > >
3499+ > , 'initialData'
3500+ > , }
3501+ , queryClient ?: QueryClient
3502+ ) : DefinedUseQueryResult < TData , TError > & { queryKey : DataTag < QueryKey , TData , TError > }
3503+ export function useGetWorkerLogs < TData = Awaited < ReturnType < typeof getWorkerLogs > > , TError = unknown > (
3504+ rentalHistoryId : number , options ?: { query ?:Partial < UseQueryOptions < Awaited < ReturnType < typeof getWorkerLogs > > , TError , TData > > & Pick <
3505+ UndefinedInitialDataOptions <
3506+ Awaited < ReturnType < typeof getWorkerLogs > > ,
3507+ TError ,
3508+ Awaited < ReturnType < typeof getWorkerLogs > >
3509+ > , 'initialData'
3510+ > , }
3511+ , queryClient ?: QueryClient
3512+ ) : UseQueryResult < TData , TError > & { queryKey : DataTag < QueryKey , TData , TError > }
3513+ export function useGetWorkerLogs < TData = Awaited < ReturnType < typeof getWorkerLogs > > , TError = unknown > (
3514+ rentalHistoryId : number , options ?: { query ?:Partial < UseQueryOptions < Awaited < ReturnType < typeof getWorkerLogs > > , TError , TData > > , }
3515+ , queryClient ?: QueryClient
3516+ ) : UseQueryResult < TData , TError > & { queryKey : DataTag < QueryKey , TData , TError > }
3517+ /**
3518+ * @summary 대여 상태 변경 처리자 로그 조회
3519+ */
3520+
3521+ export function useGetWorkerLogs < TData = Awaited < ReturnType < typeof getWorkerLogs > > , TError = unknown > (
3522+ rentalHistoryId : number , options ?: { query ?:Partial < UseQueryOptions < Awaited < ReturnType < typeof getWorkerLogs > > , TError , TData > > , }
3523+ , queryClient ?: QueryClient
3524+ ) : UseQueryResult < TData , TError > & { queryKey : DataTag < QueryKey , TData , TError > } {
3525+
3526+ const queryOptions = getGetWorkerLogsQueryOptions ( rentalHistoryId , options )
3527+
3528+ const query = useQuery ( queryOptions , queryClient ) as UseQueryResult < TData , TError > & { queryKey : DataTag < QueryKey , TData , TError > } ;
3529+
3530+ query . queryKey = queryOptions . queryKey ;
3531+
3532+ return query ;
3533+ }
3534+
3535+
3536+
3537+
33813538/**
33823539 * 관리자 대시보드 페이지 조회를 위한 API
33833540 * @summary 관리자 대시보드 목록 조회
0 commit comments