-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Registrar historial mentorias (#102)
* Registrar historial mentorias * store invitee too
- Loading branch information
Showing
15 changed files
with
349 additions
and
41 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
prisma/migrations/20241104012943_mentorias_history/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- CreateEnum | ||
CREATE TYPE "MentoriaStatus" AS ENUM ('SCHEDULED', 'CANCELLED', 'NO_SHOW', 'COMPLETED'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Mentoria" ( | ||
"id" TEXT NOT NULL, | ||
"volunteerParticipationId" TEXT NOT NULL, | ||
"contestantParticipantId" TEXT NOT NULL, | ||
"meetingTime" TIMESTAMP(3) NOT NULL, | ||
"status" "MentoriaStatus" NOT NULL, | ||
"metadata" JSONB, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Mentoria_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Mentoria_volunteerParticipationId_contestantParticipantId_m_key" ON "Mentoria"("volunteerParticipationId", "contestantParticipantId", "meetingTime"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Mentoria" ADD CONSTRAINT "Mentoria_volunteerParticipationId_fkey" FOREIGN KEY ("volunteerParticipationId") REFERENCES "VolunteerParticipation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Mentoria" ADD CONSTRAINT "Mentoria_contestantParticipantId_fkey" FOREIGN KEY ("contestantParticipantId") REFERENCES "ContestantParticipation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ScheduleMentoriaRequest } from "@/types/mentorias.schema"; | ||
|
||
export async function registerMentoria( | ||
payload: ScheduleMentoriaRequest, | ||
): Promise<void> { | ||
await fetch("/api/mentoria/schedule", { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify(payload), | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.