260617_01_ENH: 배정 테스트를 위해 개발 중도 커밋

This commit is contained in:
2026-06-17 15:56:38 +09:00
parent fcb2c7a270
commit 28da30b865
61 changed files with 5136 additions and 510 deletions

35
src/query/notification.ts Normal file
View File

@@ -0,0 +1,35 @@
"use client";
import {useMutation, useQuery} from "@tanstack/react-query";
import {nextApi} from "@/lib/http-client";
import {BulkSendResponse, SaveTemplateRequest, SendSmsBulkRequest, Template} from "@/types/notification";
export const SMS_TEMPLATE_IDS = {
ACCOUNT_MONITORING: 45,
ASSIGN_CONFIRM: 46,
CUSTOM: 47,
} as const;
export const NOTIFICATION_REQUEST_SERVICE = "gwcf-review";
export function useNotificationTemplateQuery(templateIdx: number, enabled = true) {
return useQuery({
queryKey: ["notification", "template", templateIdx],
queryFn: () => nextApi.get<Template>(`/notification/template/${templateIdx}`),
enabled: enabled && templateIdx > 0,
});
}
export function useSaveNotificationTemplateMutation() {
return useMutation({
mutationFn: (data: SaveTemplateRequest) =>
nextApi.patch<Template>("/notification/template", data),
});
}
export function useSendSmsBulkMutation() {
return useMutation({
mutationFn: (data: SendSmsBulkRequest) =>
nextApi.post<BulkSendResponse>("/notification/sms-bulk", data),
});
}