Skip to content

Commit d15b36d

Browse files
authored
Merge pull request #65 from nuon-dev/dev
새가족 주차별 출석자 기능 추가
2 parents 210c998 + b5ba769 commit d15b36d

7 files changed

Lines changed: 510 additions & 23 deletions

File tree

client/src/app/leader/newcomer/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const menuItems = [
77
{ label: "새신자 등록/조회", path: "/leader/newcomer/management" },
88
{ label: "교육 현황", path: "/leader/newcomer/education" },
99
{ label: "섬김이 관리", path: "/leader/newcomer/managers" },
10+
{ label: "주차별 예상 참석", path: "/leader/newcomer/weekly-attendance" },
1011
]
1112

1213
export default function NewcomerLayout({

client/src/app/leader/newcomer/management/NewcomerFilter.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ interface NewcomerFilterProps {
99
setFilterMinYear: (value: string) => void
1010
filterMaxYear: string
1111
setFilterMaxYear: (value: string) => void
12+
filterStatus: string
13+
setFilterStatus: (value: string) => void
1214
clearFilters: () => void
1315
}
1416

@@ -21,6 +23,8 @@ export default function NewcomerFilter({
2123
setFilterMinYear,
2224
filterMaxYear,
2325
setFilterMaxYear,
26+
filterStatus,
27+
setFilterStatus,
2428
clearFilters,
2529
}: NewcomerFilterProps) {
2630
return (
@@ -90,6 +94,26 @@ export default function NewcomerFilter({
9094
</TextField>
9195
</Stack>
9296

97+
<Stack direction="row" alignItems="center" gap="12px">
98+
<Box width="60px" fontSize="14px">
99+
상태:
100+
</Box>
101+
<TextField
102+
select
103+
size="small"
104+
value={filterStatus}
105+
onChange={(e) => setFilterStatus(e.target.value)}
106+
variant="outlined"
107+
sx={{ flex: 1 }}
108+
>
109+
<MenuItem value="">전체</MenuItem>
110+
<MenuItem value="NORMAL">활동중</MenuItem>
111+
<MenuItem value="PROMOTED">등반</MenuItem>
112+
<MenuItem value="PENDING">보류</MenuItem>
113+
<MenuItem value="DELETED">삭제</MenuItem>
114+
</TextField>
115+
</Stack>
116+
93117
<Stack direction="row" alignItems="center" gap="12px">
94118
<Box width="60px" fontSize="14px">
95119
생년:

client/src/app/leader/newcomer/management/NewcomerForm.tsx

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface Newcomer {
1111
yearOfBirth: number | null
1212
phone: string | null
1313
gender: "man" | "woman" | "" | null
14+
status?: "NORMAL" | "PROMOTED" | "PENDING" | "DELETED"
1415
newcomerManager?: {
1516
id: string
1617
user: { id: string; name: string }
@@ -22,6 +23,8 @@ interface NewcomerFormProps {
2223
onDataChange: (key: string, value: any) => void
2324
onSave: () => void
2425
onDelete: () => void
26+
onPending: () => void
27+
onPromote: () => void
2528
onClear: () => void
2629
managerList: Manager[]
2730
}
@@ -31,9 +34,26 @@ export default function NewcomerForm({
3134
onDataChange,
3235
onSave,
3336
onDelete,
37+
onPending,
38+
onPromote,
3439
onClear,
3540
managerList,
3641
}: NewcomerFormProps) {
42+
const getStatusLabel = (status?: string) => {
43+
switch (status) {
44+
case "NORMAL":
45+
return "활동중"
46+
case "PROMOTED":
47+
return "등반"
48+
case "PENDING":
49+
return "보류"
50+
case "DELETED":
51+
return "삭제"
52+
default:
53+
return "활동중"
54+
}
55+
}
56+
3757
return (
3858
<Stack
3959
flex={1}
@@ -61,19 +81,45 @@ export default function NewcomerForm({
6181
{selectedNewcomer.id ? "정보 수정 중.." : "새로 입력 중.."}
6282
</Box>
6383
<Stack direction="row" gap="8px">
64-
{selectedNewcomer.id && (
65-
<Button
66-
variant="outlined"
67-
color="error"
68-
onClick={onDelete}
69-
sx={{
70-
borderRadius: "8px",
71-
textTransform: "none",
72-
px: 2,
73-
}}
74-
>
75-
삭제
76-
</Button>
84+
{selectedNewcomer.id && selectedNewcomer.status !== "DELETED" && (
85+
<>
86+
<Button
87+
variant="outlined"
88+
color="warning"
89+
onClick={onPending}
90+
sx={{
91+
borderRadius: "8px",
92+
textTransform: "none",
93+
px: 2,
94+
}}
95+
>
96+
보류
97+
</Button>
98+
<Button
99+
variant="outlined"
100+
color="success"
101+
onClick={onPromote}
102+
sx={{
103+
borderRadius: "8px",
104+
textTransform: "none",
105+
px: 2,
106+
}}
107+
>
108+
등반
109+
</Button>
110+
<Button
111+
variant="outlined"
112+
color="error"
113+
onClick={onDelete}
114+
sx={{
115+
borderRadius: "8px",
116+
textTransform: "none",
117+
px: 2,
118+
}}
119+
>
120+
삭제
121+
</Button>
122+
</>
77123
)}
78124
<Button
79125
variant="contained"
@@ -188,6 +234,22 @@ export default function NewcomerForm({
188234
))}
189235
</TextField>
190236
</Stack>
237+
238+
<Stack direction="row" alignItems="center" gap="12px">
239+
<Box width="80px" textAlign="right">
240+
상태 :
241+
</Box>
242+
<Box
243+
sx={{
244+
flex: 1,
245+
p: 1,
246+
fontSize: "14px",
247+
color: "#666",
248+
}}
249+
>
250+
{getStatusLabel(selectedNewcomer.status)}
251+
</Box>
252+
</Stack>
191253
</Stack>
192254
)
193255
}

client/src/app/leader/newcomer/management/NewcomerTable.tsx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ interface Newcomer {
1616
phone: string | null
1717
gender: "man" | "woman" | "" | null
1818
status: string
19+
createdAt: string
20+
deletedAt?: string | null
21+
pendingDate?: string | null
22+
promotionDate?: string | null
1923
}
2024

2125
interface NewcomerTableProps {
@@ -35,6 +39,21 @@ export default function NewcomerTable({
3539
onSortClick,
3640
onNewcomerSelect,
3741
}: NewcomerTableProps) {
42+
const getStatusLabel = (status?: string) => {
43+
switch (status) {
44+
case "NORMAL":
45+
return "활동중"
46+
case "PROMOTED":
47+
return "등반"
48+
case "PENDING":
49+
return "보류"
50+
case "DELETED":
51+
return "삭제"
52+
default:
53+
return ""
54+
}
55+
}
56+
3857
return (
3958
<Stack
4059
width="50%"
@@ -85,6 +104,27 @@ export default function NewcomerTable({
85104
전화번호
86105
</TableSortLabel>
87106
</TableCell>
107+
<TableCell>
108+
<TableSortLabel
109+
active={orderProperty === "status"}
110+
direction={direction}
111+
onClick={() => onSortClick("status")}
112+
>
113+
상태
114+
</TableSortLabel>
115+
</TableCell>
116+
<TableCell>
117+
<TableSortLabel
118+
active={orderProperty === "createdAt"}
119+
direction={direction}
120+
onClick={() => onSortClick("createdAt")}
121+
>
122+
등록일
123+
</TableSortLabel>
124+
</TableCell>
125+
<TableCell>보류일</TableCell>
126+
<TableCell>등반일</TableCell>
127+
<TableCell>삭제일</TableCell>
88128
</TableRow>
89129
</TableHead>
90130
<TableBody>
@@ -108,6 +148,27 @@ export default function NewcomerTable({
108148
: newcomer.yearOfBirth}
109149
</TableCell>
110150
<TableCell>{newcomer.phone || ""}</TableCell>
151+
<TableCell>{getStatusLabel(newcomer.status)}</TableCell>
152+
<TableCell>
153+
{newcomer.createdAt
154+
? new Date(newcomer.createdAt).toLocaleDateString("ko-KR")
155+
: ""}
156+
</TableCell>
157+
<TableCell>
158+
{newcomer.pendingDate
159+
? new Date(newcomer.pendingDate).toLocaleDateString("ko-KR")
160+
: ""}
161+
</TableCell>
162+
<TableCell>
163+
{newcomer.promotionDate
164+
? new Date(newcomer.promotionDate).toLocaleDateString("ko-KR")
165+
: ""}
166+
</TableCell>
167+
<TableCell>
168+
{newcomer.deletedAt
169+
? new Date(newcomer.deletedAt).toLocaleDateString("ko-KR")
170+
: ""}
171+
</TableCell>
111172
</TableRow>
112173
))}
113174
</TableBody>

0 commit comments

Comments
 (0)