Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/app/admin/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function AdminHeader() {
path: "/admin/soon/attendance",
type: "menu",
},
/*
{
title: "AI로 데이터 분석",
icon: <AutoAwesomeIcon fontSize="small" />,
Expand All @@ -71,7 +72,7 @@ export default function AdminHeader() {
},
{
type: "divider",
},
},*/
/* Todo: 지울지, 유지할지 결정 필요
{
title: "워십 콘테스트",
Expand Down
48 changes: 23 additions & 25 deletions client/src/app/admin/soon/attendance/AttendanceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface AttendanceTableProps {
leaders: User[]
getAttendUserCount: (
attendDataList: AttendData[],
worshipScheduleId: number
worshipScheduleId: number,
) => { count: number; attend: number }
}

Expand All @@ -24,6 +24,7 @@ export default function AttendanceTable({
leaders,
getAttendUserCount,
}: AttendanceTableProps) {
const isMobile = window.innerWidth < 600
return (
<Box sx={{ p: 2 }}>
{/* 출석 테이블 제목 */}
Expand Down Expand Up @@ -52,10 +53,10 @@ export default function AttendanceTable({
>
<Box
sx={{
width: 150,
minWidth: 150,
maxWidth: 150,
p: 1.5,
width: isMobile ? 104 : 150,
minWidth: isMobile ? 104 : 150,
maxWidth: isMobile ? 104 : 150,
p: isMobile ? 0.2 : 1.5,
borderRight: "1px solid #e0e0e0",
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -89,7 +90,7 @@ export default function AttendanceTable({
{worshipScheduleMapList.map((worshipSchedule) => {
const { attend, count } = getAttendUserCount(
attendDataList,
worshipSchedule.id
worshipSchedule.id,
)
const percentage =
count > 0 ? Math.round((attend / count) * 100) : 0
Expand All @@ -98,10 +99,10 @@ export default function AttendanceTable({
<Box
key={worshipSchedule.id}
sx={{
width: 98,
minWidth: 98,
maxWidth: 98,
p: 1.5,
width: isMobile ? 85 : 98,
minWidth: isMobile ? 85 : 98,
maxWidth: isMobile ? 85 : 98,
p: isMobile ? 0.2 : 1.5,
borderRight: "1px solid #e0e0e0",
display: "flex",
flexDirection: "column",
Expand Down Expand Up @@ -135,34 +136,31 @@ export default function AttendanceTable({
bgcolor: isLeader
? "#e3f2fd"
: isDeputyLeader
? "#f3e5f5"
: "white",
? "#f3e5f5"
: "white",
borderBottom: "1px solid #e0e0e0",
"&:hover": {
bgcolor: isLeader
? "#bbdefb"
: isDeputyLeader
? "#e1bee7"
: "#f5f5f5",
? "#e1bee7"
: "#f5f5f5",
},
}}
>
<Box
sx={{
width: 150,
minWidth: 150,
maxWidth: 150,
p: 1.5,
width: isMobile ? 104 : 150,
minWidth: isMobile ? 104 : 150,
maxWidth: isMobile ? 104 : 150,
p: isMobile ? 0.2 : 1.5,
borderRight: "1px solid #e0e0e0",
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
<Stack direction="row" alignItems="center" spacing={1}>
{isLeader && (
<StarIcon sx={{ fontSize: 16, color: "#1976d2" }} />
)}
{isDeputyLeader && (
<StarBorderIcon sx={{ fontSize: 16, color: "#7b1fa2" }} />
)}
Expand All @@ -183,15 +181,15 @@ export default function AttendanceTable({
const attendData = attendDataList.find(
(data) =>
data.user.id === user.id &&
data.worshipSchedule.id === worshipSchedule.id
data.worshipSchedule.id === worshipSchedule.id,
)
return (
<Box
key={worshipSchedule.id}
sx={{
width: 114,
minWidth: 114,
maxWidth: 114,
width: isMobile ? 80 : 114,
minWidth: isMobile ? 80 : 114,
maxWidth: isMobile ? 80 : 114,
p: "4px",
borderRight: "1px solid #e0e0e0",
display: "flex",
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/leader/attendance/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function SoonAttendance() {
<CardContent sx={{ textAlign: "center", py: 4 }}>
<EventNoteIcon sx={{ fontSize: 48, mb: 2, opacity: 0.9 }} />
<Typography variant="h4" fontWeight="bold" gutterBottom>
출석 관리 {selectedScheduleId}
출석 관리
</Typography>
<Typography variant="body1" sx={{ opacity: 0.9 }}>
순원들의 출석을 관리해보세요
Expand Down
109 changes: 109 additions & 0 deletions client/src/app/leader/newcomer/management/NewcomerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ interface Newcomer {
phone: string | null
gender: "man" | "woman" | "" | null
status?: "NORMAL" | "PROMOTED" | "PENDING" | "DELETED"
address?: string | null
occupation?: string | null
visitPath?: string | null
registrationMotivation?: string | null
faithLevel?: "초신자" | "세례" | "입교" | "학습" | null
previousChurch?: string | null
carNumber?: string | null
newcomerManager?: {
id: string
user: { id: string; name: string }
Expand Down Expand Up @@ -206,6 +213,108 @@ export default function NewcomerForm({
</TextField>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
주소 :
</Box>
<TextField
value={selectedNewcomer.address || ""}
onChange={(e) => onDataChange("address", e.target.value)}
variant="outlined"
size="small"
sx={{ flex: 1 }}
/>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
신분 :
</Box>
<TextField
value={selectedNewcomer.occupation || ""}
onChange={(e) => onDataChange("occupation", e.target.value)}
variant="outlined"
size="small"
placeholder="학생-학교/전공, 직장인-계열/분야 등"
sx={{ flex: 1 }}
/>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
방문경로 :
</Box>
<TextField
value={selectedNewcomer.visitPath || ""}
onChange={(e) => onDataChange("visitPath", e.target.value)}
variant="outlined"
size="small"
sx={{ flex: 1 }}
/>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
등록계기 :
</Box>
<TextField
value={selectedNewcomer.registrationMotivation || ""}
onChange={(e) =>
onDataChange("registrationMotivation", e.target.value)
}
variant="outlined"
size="small"
sx={{ flex: 1 }}
/>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
신앙생활 :
</Box>
<TextField
select
value={selectedNewcomer.faithLevel || ""}
onChange={(e) => onDataChange("faithLevel", e.target.value)}
variant="outlined"
size="small"
sx={{ flex: 1 }}
>
<MenuItem value="">선택</MenuItem>
<MenuItem value="초신자">초신자</MenuItem>
<MenuItem value="학습">학습</MenuItem>
<MenuItem value="세례">세례</MenuItem>
<MenuItem value="입교">입교</MenuItem>
</TextField>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
전 출석교회 :
</Box>
<TextField
value={selectedNewcomer.previousChurch || ""}
onChange={(e) => onDataChange("previousChurch", e.target.value)}
variant="outlined"
size="small"
placeholder="교회명 / 담임목사님 성함"
sx={{ flex: 1 }}
/>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
차량번호 :
</Box>
<TextField
value={selectedNewcomer.carNumber || ""}
onChange={(e) => onDataChange("carNumber", e.target.value)}
variant="outlined"
size="small"
sx={{ flex: 1 }}
/>
</Stack>

<Stack direction="row" alignItems="center" gap="12px">
<Box width="80px" textAlign="right">
담당자 :
Expand Down
30 changes: 30 additions & 0 deletions client/src/app/leader/newcomer/management/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ interface Newcomer {
deletedAt?: string | null
pendingDate?: string | null
promotionDate?: string | null
address: string | null
occupation: string | null
visitPath: string | null
registrationMotivation: string | null
faithLevel: "초신자" | "세례" | "입교" | "학습" | null
previousChurch: string | null
carNumber: string | null
}

interface Manager {
Expand All @@ -55,6 +62,13 @@ const emptyNewcomer: Newcomer = {
deletedAt: null,
pendingDate: null,
promotionDate: null,
address: null,
occupation: null,
visitPath: null,
registrationMotivation: null,
faithLevel: null,
previousChurch: null,
carNumber: null,
}

export default function NewcomerManagement() {
Expand Down Expand Up @@ -120,6 +134,15 @@ export default function NewcomerManagement() {
guiderId: selectedNewcomer.guider?.id || null,
assignmentId: selectedNewcomer.assignment?.id || null,
status: selectedNewcomer.status,
pendingDate: selectedNewcomer.pendingDate,
promotionDate: selectedNewcomer.promotionDate,
address: selectedNewcomer.address,
occupation: selectedNewcomer.occupation,
visitPath: selectedNewcomer.visitPath,
registrationMotivation: selectedNewcomer.registrationMotivation,
faithLevel: selectedNewcomer.faithLevel,
previousChurch: selectedNewcomer.previousChurch,
carNumber: selectedNewcomer.carNumber,
})
notification.success("새신자 정보가 수정되었습니다.")
} else {
Expand All @@ -129,6 +152,13 @@ export default function NewcomerManagement() {
gender: selectedNewcomer.gender,
phone: selectedNewcomer.phone,
newcomerManagerId: selectedNewcomer.newcomerManager?.id || null,
address: selectedNewcomer.address,
occupation: selectedNewcomer.occupation,
visitPath: selectedNewcomer.visitPath,
registrationMotivation: selectedNewcomer.registrationMotivation,
faithLevel: selectedNewcomer.faithLevel,
previousChurch: selectedNewcomer.previousChurch,
carNumber: selectedNewcomer.carNumber,
})
notification.success("새신자가 추가되었습니다.")
}
Expand Down
27 changes: 26 additions & 1 deletion server/src/entity/newcomer/newcomer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "typeorm"
import { User } from "../user"
import { Community } from "../community"
import { NewcomerStatus } from "../types"
import { NewcomerStatus, FaithLevel } from "../types"
import { NewcomerEducation } from "./newcomerEducation"
import { NewcomerManager } from "./newcomerManager"

Expand All @@ -32,6 +32,31 @@ export class Newcomer {
@Column({ nullable: true })
phone: string // 연락처

@Column({ nullable: true })
address: string // 주소

@Column({ nullable: true })
occupation: string // 신분(학생-학교/전공, 대학원생-학교/전공, 취업준비-준비계열/분야, 직장인-계열/분야)

@Column({ nullable: true })
visitPath: string // 방문경로

@Column({ nullable: true })
registrationMotivation: string // 등록계기

@Column({
type: "enum",
enum: FaithLevel,
nullable: true,
})
faithLevel: FaithLevel // 신앙생활(초신자, 세례, 입교, 학습)

@Column({ nullable: true })
previousChurch: string // 전 출석교회/담임목사님 성함

@Column({ nullable: true })
carNumber: string // 차량번호

@ManyToOne(() => User)
@JoinColumn({ name: "guiderId" })
guider: User // 인도자
Expand Down
7 changes: 7 additions & 0 deletions server/src/entity/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,10 @@ export enum NewcomerStatus {
DELETED = "DELETED",
PENDING = "PENDING",
}

export enum FaithLevel {
BEGINNER = "초신자",
BAPTIZED = "세례",
CONFIRMED = "입교",
LEARNING = "학습",
}
Loading
Loading