feat: 그룹 관리 작업

This commit is contained in:
2025-06-17 11:06:33 +09:00
parent e390026bfe
commit 318bae3a1e
30 changed files with 952 additions and 96 deletions
@@ -1,56 +1,38 @@
import { z } from "zod";
import type { PageableList, PageableParams } from "@/shared/model";
// 그룹 검색 파라미터 인터페이스
export interface GroupSearchParams {
page?: number;
size?: number;
sort?: string;
grpNm?: string;
useYn?: string;
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 {
grpSn: number;
grpNm: string;
grpExpln: string;
useYn: string;
regDt: string;
rgtr: string;
groupId: string;
groupNm: string;
groupSeCd: string;
groupSeNm: string;
delYn: string;
authrtId: string;
groupExpln: string;
siteId: string;
mngrYn: string;
roleId: string;
roleNm: string;
mdfcnDt: string;
mdfr: string;
rgtrNm: string;
mdfrNm: string;
}
// 그룹 페이지 응답 인터페이스
export interface GroupList {
content: GroupListResponseDto[];
pageable: {
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
offset: number;
pageSize: number;
pageNumber: number;
paged: boolean;
unpaged: boolean;
};
last: boolean;
totalPages: number;
totalElements: number;
size: number;
number: number;
sort: {
empty: boolean;
sorted: boolean;
unsorted: boolean;
};
first: boolean;
numberOfElements: number;
empty: boolean;
}
// 그룹 상세 응답 인터페이스
export interface GroupDetailResponse {
grpSn: number;
@@ -65,19 +47,20 @@ export interface GroupDetailResponse {
mdfrNm: string;
}
// 그룹 저장 데이터 인터페이스
export interface GroupSaveData {
grpNm: string;
grpExpln: string;
useYn: 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 interface GroupUpdateData {
grpNm: string;
grpExpln: string;
useYn: string;
}
export type GroupList = PageableList<GroupListResponseDto>;
export type GroupFormData = z.infer<typeof groupFormSchema>;
// 그룹 서비스 인터페이스
export interface GroupService {
@@ -85,17 +68,17 @@ export interface GroupService {
findPageGroup: (params: GroupSearchParams) => Promise<GroupList>;
// 그룹 단건 조회
findById: (id: number) => Promise<GroupDetailResponse>;
findById: (groupId: string) => Promise<GroupDetailResponse>;
// 그룹 저장
saveGroup: (data: GroupSaveData) => Promise<GroupDetailResponse>;
saveGroup: (data: GroupFormData) => Promise<GroupDetailResponse>;
// 그룹 수정
updateGroup: (
id: number,
data: GroupUpdateData,
groupId: string,
data: GroupFormData,
) => Promise<GroupDetailResponse>;
// 그룹 삭제
deleteGroup: (id: number) => Promise<boolean>;
deleteGroup: (groupId: string) => Promise<boolean>;
}