refactor: 그룹 서비스 및 인터페이스 엔티티 폴더로 이동

This commit is contained in:
2025-06-19 10:33:50 +09:00
parent 3b7f8bcca7
commit cb38462164
7 changed files with 22 additions and 13 deletions
@@ -0,0 +1,87 @@
import { z } from "zod";
import type { PageableList, PageableParams } from "@/shared/model";
// 그룹 검색 파라미터 인터페이스
export interface GroupSearchParams extends PageableParams {
keywordType?: string;
keyword?: string;
groupId?: string;
groupNm?: string;
groupSeCd?: string;
delYn?: string;
authrtId?: string;
siteId?: string;
groupExpln?: string;
roleId?: string;
mngrYn?: string;
}
// 그룹 목록 응답 인터페이스
export interface GroupListResponseDto {
groupId: string;
groupNm: string;
groupSeCd: string;
groupSeNm: string;
delYn: string;
authrtId: string;
groupExpln: string;
siteId: string;
mngrYn: string;
roleId: string;
roleNm: string;
mdfcnDt: string;
mdfrNm: string;
}
// 그룹 상세 응답 인터페이스
export interface GroupResponseDto {
groupId: string;
groupNm: string;
groupSeCd: string;
groupSeNm: string;
groupExpln: string;
delYn: string;
regDt: string;
rgtr: string;
mdfcnDt: string;
mdfr: string;
authrtId: string;
siteId: string;
mngrYn: string;
}
// 그룹 저장 데이터 스키마
export const groupFormSchema = z.object({
groupId: z.string().min(1, { message: "그룹 ID를 입력해주세요." }),
groupNm: z.string().min(1, { message: "그룹명을 입력해주세요." }),
groupSeCd: z.string().min(1, { message: "그룹구분을 선택해주세요." }),
groupExpln: z.string().optional(),
delYn: z.string().default("N"),
authrtId: z.string().min(1, { message: "권한ID를 선택해주세요." }),
siteId: z.string().optional(),
mngrYn: z.string().default("N"),
});
export type GroupList = PageableList<GroupListResponseDto>;
export type GroupFormData = z.infer<typeof groupFormSchema>;
// 그룹 서비스 인터페이스
export interface GroupService {
// 그룹 목록 조회
findPageGroup: (params: GroupSearchParams) => Promise<GroupList>;
// 그룹 단건 조회
findGroupById: (groupId: string) => Promise<GroupResponseDto>;
// 그룹 저장
saveGroup: (data: GroupFormData) => Promise<GroupResponseDto>;
// 그룹 수정
updateGroup: (
groupId: string,
data: GroupFormData,
) => Promise<GroupResponseDto>;
// 그룹 삭제
deleteGroup: (groupId: string) => Promise<boolean>;
}