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
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ module.exports = {
'builtin',
'external',
'internal',
'parent',
'sibling',
'parent',
'index',
],
'newlines-between': 'always',
pathGroups: [
{
pattern: '~/**',
group: 'external',
position: 'after',
},
],
alphabetize: { order: 'asc' },
},
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
-- CreateTable
CREATE TABLE "HackathonCommunityRegistration" (
"id" SERIAL NOT NULL,
"code" TEXT NOT NULL,
"expiresAt" TIMESTAMP(3),
"isActive" BOOLEAN NOT NULL DEFAULT true,
"requiredUniversity" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "HackathonCommunityRegistration_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "HackathonCommunityTeam" (
"id" SERIAL NOT NULL,
"publicId" TEXT NOT NULL,
"communityRegistrationId" INTEGER NOT NULL,
"teamName" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "HackathonCommunityTeam_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "HackathonCommunityTeamMember" (
"id" SERIAL NOT NULL,
"publicId" TEXT NOT NULL,
"teamId" INTEGER NOT NULL,
"firstName" TEXT NOT NULL,
"lastName" TEXT NOT NULL,
"nickname" TEXT NOT NULL,
"pronoun" "HackathonPronoun" NOT NULL,
"phoneNumber" TEXT NOT NULL,
"email" TEXT NOT NULL,
"studentId" TEXT NOT NULL,
"faculty" TEXT NOT NULL,
"department" TEXT NOT NULL,
"university" TEXT NOT NULL,
"role" "HackathonRole" NOT NULL,
"foodRestriction" TEXT,
"medication" TEXT,
"medicalCondition" TEXT,
"chestSize" INTEGER NOT NULL DEFAULT 0,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "HackathonCommunityTeamMember_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "HackathonCommunityRegistration_code_key" ON "HackathonCommunityRegistration"("code");

-- CreateIndex
CREATE UNIQUE INDEX "HackathonCommunityTeam_publicId_key" ON "HackathonCommunityTeam"("publicId");

-- CreateIndex
CREATE UNIQUE INDEX "HackathonCommunityTeam_communityRegistrationId_key" ON "HackathonCommunityTeam"("communityRegistrationId");

-- CreateIndex
CREATE UNIQUE INDEX "HackathonCommunityTeamMember_publicId_key" ON "HackathonCommunityTeamMember"("publicId");

-- AddForeignKey
ALTER TABLE "HackathonCommunityTeam" ADD CONSTRAINT "HackathonCommunityTeam_communityRegistrationId_fkey" FOREIGN KEY ("communityRegistrationId") REFERENCES "HackathonCommunityRegistration"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "HackathonCommunityTeamMember" ADD CONSTRAINT "HackathonCommunityTeamMember_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "HackathonCommunityTeam"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "HackathonRegistration" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
56 changes: 56 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,69 @@ model HackathonTeamTicket {
registration HackathonRegistration? @relation("HackathonTeamTicketToRegistration")
}

model HackathonCommunityRegistration {
id Int @id @default(autoincrement())
code String @unique
expiresAt DateTime?
isActive Boolean @default(true)
requiredUniversity String

communityTeam HackathonCommunityTeam? @relation("HackathonCommunityRegistrationToTeam")

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model HackathonRegistration {
id Int @id @default(autoincrement())
teamTicketId Int @unique

teamTicket HackathonTeamTicket @relation(fields: [teamTicketId], references: [id], name: "HackathonTeamTicketToRegistration")
teamName String
teamMembers HackathonTeamMember[] @relation("HackathonRegistrationToTeamMembers")

createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}

model HackathonCommunityTeam {
id Int @id @default(autoincrement())
publicId String @unique
communityRegistrationId Int @unique
communityRegistration HackathonCommunityRegistration @relation(fields: [communityRegistrationId], references: [id], name: "HackathonCommunityRegistrationToTeam")

teamName String
teamMembers HackathonCommunityTeamMember[] @relation("HackathonCommunityTeamToMembers")

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model HackathonCommunityTeamMember {
id Int @id @default(autoincrement())
publicId String @unique
teamId Int
team HackathonCommunityTeam @relation(fields: [teamId], references: [id], name: "HackathonCommunityTeamToMembers")

firstName String
lastName String
nickname String
pronoun HackathonPronoun
phoneNumber String
email String
studentId String
faculty String
department String
university String
role HackathonRole

foodRestriction String?
medication String?
medicalCondition String?
chestSize Int @default(0)

createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model HackathonTeamMember {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Page: React.FC = async () => {
return notFound()
}

const resMyRegistrationIndex = await getMyRegistrationIndex()
const resMyRegistrationIndex = await getMyRegistrationIndex({})
if (!resMyRegistrationIndex.success || resMyRegistrationIndex.data === -1) {
return notFound()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Page: React.FC = async () => {
return redirect(`/hackathon/login?redirectUrl=/hackathon/ticket/share`)
}

const resMyRegistrationIndex = await getMyRegistrationIndex()
const resMyRegistrationIndex = await getMyRegistrationIndex({})
if (!resMyRegistrationIndex.success || resMyRegistrationIndex.data === -1) {
return notFound()
}
Expand Down
Loading