diff --git a/client/src/pages/Project.tsx b/client/src/pages/Project.tsx
index 8f4d932..491c903 100644
--- a/client/src/pages/Project.tsx
+++ b/client/src/pages/Project.tsx
@@ -89,6 +89,7 @@ export default function ProjectPage() {
mode: "onChange",
defaultValues: {
name: "",
+ description: "",
startDate: eventId ? "" : dayjs().format("YYYY-MM-DD"),
endDate: eventId ? "" : dayjs().add(6, "day").format("YYYY-MM-DD"),
allowedRanges: [{ startTime: "00:00", endTime: "23:45" }],
@@ -109,6 +110,7 @@ export default function ProjectPage() {
if (!project) return;
reset({
name: project.name,
+ description: project.description,
startDate: dayjs(project.startDate).format("YYYY-MM-DD"),
endDate: dayjs(project.endDate).format("YYYY-MM-DD"),
allowedRanges: [
@@ -136,6 +138,7 @@ export default function ProjectPage() {
const eventData = {
name: data.name ?? "",
+ description: data.description ?? "",
startDate: startDateTime,
endDate: endDateTime,
allowedRanges: rangeWithDateTime ?? [],
@@ -235,6 +238,19 @@ export default function ProjectPage() {
/>
{errors.name &&
{errors.name.message}
}
+
+
+
+ {errors.description &&
{errors.description.message}
}
+
{!project || (project && project.guests.length === 0) ? (
<>
diff --git a/client/src/pages/eventId/Submission.tsx b/client/src/pages/eventId/Submission.tsx
index 41c2b9a..636a310 100644
--- a/client/src/pages/eventId/Submission.tsx
+++ b/client/src/pages/eventId/Submission.tsx
@@ -169,6 +169,9 @@ export default function SubmissionPage() {
)}
+ {project.description && (
+ {project.description}
+ )}
{editMode ? (
diff --git a/client/src/types.ts b/client/src/types.ts
index 353a64e..b76ab0d 100644
--- a/client/src/types.ts
+++ b/client/src/types.ts
@@ -28,6 +28,7 @@ type Guest = {
export type Project = {
id: string;
name: string;
+ description: string;
startDate: Date;
endDate: Date;
allowedRanges: AllowedRange[];
@@ -41,6 +42,7 @@ export type Project = {
export type ISOStringProject = {
id: string;
name: string;
+ description: string;
startDate: string;
endDate: string;
allowedRanges: {
diff --git a/common/validators.ts b/common/validators.ts
index 86f7bc0..2a7d68e 100644
--- a/common/validators.ts
+++ b/common/validators.ts
@@ -23,6 +23,7 @@ const isQuarterHour = (time: string): boolean => {
const baseProjectReqSchema = z.object({
name: z.string().min(1, "イベント名を入力してください"),
+ description: z.string(),
startDate: z.string().min(1, "開始日を入力してください"),
// TODO: 新規作成時のみ、過去日付を制限する必要
// .refine(
diff --git a/server/prisma/migrations/20251116043209_add_description_to_project/migration.sql b/server/prisma/migrations/20251116043209_add_description_to_project/migration.sql
new file mode 100644
index 0000000..ee93005
--- /dev/null
+++ b/server/prisma/migrations/20251116043209_add_description_to_project/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "Project" ADD COLUMN "description" TEXT;
diff --git a/server/prisma/migrations/migration_lock.toml b/server/prisma/migrations/migration_lock.toml
new file mode 100644
index 0000000..044d57c
--- /dev/null
+++ b/server/prisma/migrations/migration_lock.toml
@@ -0,0 +1,3 @@
+# Please do not edit this file manually
+# It should be added in your version-control system (e.g., Git)
+provider = "postgresql"
diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma
index d61d51f..2913bd3 100644
--- a/server/prisma/schema.prisma
+++ b/server/prisma/schema.prisma
@@ -17,8 +17,9 @@ datasource db {
model Project {
id String @id @db.VarChar(21)
name String
+ description String? /// イベントの説明(オプショナル)
/// 注: 日付部分のみ利用。時間は考慮しない。
- startDate DateTime
+ startDate DateTime
/// 注: 日付部分のみ利用。時間は考慮しない。
endDate DateTime
/// 注: 現在は 1 つのみ設定可能
diff --git a/server/src/routes/projects.ts b/server/src/routes/projects.ts
index 95def7f..d46b761 100644
--- a/server/src/routes/projects.ts
+++ b/server/src/routes/projects.ts
@@ -26,6 +26,7 @@ const router = new Hono()
data: {
id: nanoid(),
name: data.name,
+ description: data.description.trim() || null,
startDate: new Date(data.startDate),
endDate: new Date(data.endDate),
allowedRanges: {
@@ -79,6 +80,7 @@ const router = new Hono()
select: {
id: true,
name: true,
+ description: true,
startDate: true,
endDate: true,
hosts: {
@@ -93,6 +95,7 @@ const router = new Hono()
involvedProjects.map((p) => ({
id: p.id,
name: p.name,
+ description: p.description ?? "",
startDate: p.startDate,
endDate: p.endDate,
isHost: p.hosts.some((host) => host.browserId === browserId),
@@ -136,6 +139,7 @@ const router = new Hono()
const data = {
...projectRow,
+ description: projectRow.description ?? "",
hosts: projectRow.hosts.map((h) => {
const { browserId: _, ...rest } = h;
return rest;
@@ -187,9 +191,13 @@ const router = new Hono()
const updatedEvent = await prisma.project.update({
where: { id: projectId },
data: existingGuest
- ? { name: data.name } // ゲストがいれば名前だけ
+ ? {
+ name: data.name,
+ description: data.description?.trim() || null,
+ } // ゲストがいれば名前と説明だけ
: {
name: data.name,
+ description: data.description?.trim() || null,
startDate: data.startDate ? new Date(data.startDate) : undefined,
endDate: data.endDate ? new Date(data.endDate) : undefined,
allowedRanges: {