-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from SkinSightYnov/dev
Update dev + pull request
- Loading branch information
Showing
17 changed files
with
359 additions
and
119 deletions.
There are no files selected for viewing
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
27 changes: 0 additions & 27 deletions
27
prisma/migrations/20240221222138_modifiy_appointement/migration.sql
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
prisma/migrations/20240221225021_add_enum_status_appointement/migration.sql
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
prisma/migrations/20240222105619_update_firstname_lastname/migration.sql
This file was deleted.
Oops, something went wrong.
153 changes: 153 additions & 0 deletions
153
prisma/migrations/20240222142320_new_migration/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,153 @@ | ||
-- CreateEnum | ||
CREATE TYPE "Role" AS ENUM ('PATIENT', 'MEDECIN', 'DERMATOLOGUE', 'ADMIN'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "Sexe" AS ENUM ('M', 'F'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "statusConsultation" AS ENUM ('WAITING', 'IN_PROGRESS', 'PROCESSED', 'CLOSED', 'CANCELED'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "FileType" AS ENUM ('IMAGE', 'FILE'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "statusAppointment" AS ENUM ('WAITING', 'ACCEPTED', 'CANCELED', 'REFUSED'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" TEXT NOT NULL, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"role" "Role" NOT NULL, | ||
"firstName" TEXT NOT NULL, | ||
"lastName" TEXT NOT NULL, | ||
"email" TEXT NOT NULL, | ||
"sexe" TEXT NOT NULL DEFAULT 'M', | ||
"password" TEXT NOT NULL, | ||
"rppsNumber" TEXT, | ||
"address" TEXT, | ||
"city" TEXT, | ||
"zipCode" TEXT, | ||
"secuNumber" TEXT, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Consultation" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"idMedecin" TEXT NOT NULL, | ||
"idPatient" TEXT NOT NULL, | ||
"status" "statusConsultation" NOT NULL DEFAULT 'WAITING', | ||
"criticity" INTEGER NOT NULL DEFAULT 0, | ||
"informations" TEXT NOT NULL DEFAULT '', | ||
"resultat" TEXT NOT NULL DEFAULT '', | ||
|
||
CONSTRAINT "Consultation_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "File" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"url" TEXT NOT NULL, | ||
"type" "FileType" NOT NULL, | ||
"size" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "File_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Appointment" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"idDermatologue" TEXT NOT NULL, | ||
"idPatient" TEXT NOT NULL, | ||
"date" TIMESTAMP(3) NOT NULL, | ||
"status" "statusAppointment" NOT NULL DEFAULT 'WAITING', | ||
"idConsultation" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Appointment_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Conversation" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"idFrom" TEXT NOT NULL, | ||
"idToUser" TEXT NOT NULL, | ||
"idToIa" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Conversation_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Message" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"content" TEXT NOT NULL, | ||
"idConversation" TEXT NOT NULL, | ||
"idFrom" TEXT, | ||
|
||
CONSTRAINT "Message_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Ia" ( | ||
"id" TEXT NOT NULL, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
"model" TEXT NOT NULL, | ||
"parameters" JSONB NOT NULL, | ||
|
||
CONSTRAINT "Ia_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_rppsNumber_key" ON "User"("rppsNumber"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Appointment_idConsultation_key" ON "Appointment"("idConsultation"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Consultation" ADD CONSTRAINT "Consultation_idMedecin_fkey" FOREIGN KEY ("idMedecin") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Consultation" ADD CONSTRAINT "Consultation_idPatient_fkey" FOREIGN KEY ("idPatient") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "File" ADD CONSTRAINT "File_id_fkey" FOREIGN KEY ("id") REFERENCES "Consultation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Appointment" ADD CONSTRAINT "Appointment_idDermatologue_fkey" FOREIGN KEY ("idDermatologue") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Appointment" ADD CONSTRAINT "Appointment_idPatient_fkey" FOREIGN KEY ("idPatient") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Appointment" ADD CONSTRAINT "Appointment_idConsultation_fkey" FOREIGN KEY ("idConsultation") REFERENCES "Consultation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Conversation" ADD CONSTRAINT "Conversation_idFrom_fkey" FOREIGN KEY ("idFrom") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Conversation" ADD CONSTRAINT "Conversation_idToUser_fkey" FOREIGN KEY ("idToUser") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Conversation" ADD CONSTRAINT "Conversation_idToIa_fkey" FOREIGN KEY ("idToIa") REFERENCES "Ia"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Message" ADD CONSTRAINT "Message_idConversation_fkey" FOREIGN KEY ("idConversation") REFERENCES "Conversation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Message" ADD CONSTRAINT "Message_idFrom_fkey" FOREIGN KEY ("idFrom") REFERENCES "User"("id") ON DELETE SET NULL 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
export class CreateAppointmentDto {} | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { statusAppointment } from '@prisma/client'; | ||
import { | ||
IsDateString, | ||
IsEnum, | ||
IsNotEmpty, | ||
IsOptional, | ||
IsString, | ||
} from 'class-validator'; | ||
|
||
export class CreateAppointmentDto { | ||
@ApiProperty() | ||
@IsNotEmpty() | ||
@IsString() | ||
idDermatologue: string; | ||
|
||
@ApiProperty() | ||
@IsNotEmpty() | ||
@IsString() | ||
idPatient: string; | ||
|
||
@ApiProperty() | ||
@IsNotEmpty() | ||
@IsDateString() | ||
date: Date; | ||
|
||
@ApiProperty({ enum: statusAppointment, default: statusAppointment.WAITING }) | ||
@IsOptional() | ||
@IsEnum(statusAppointment) | ||
status: statusAppointment; | ||
|
||
@ApiProperty() | ||
@IsNotEmpty() | ||
@IsString() | ||
idConsultation: string; | ||
} |
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 |
---|---|---|
@@ -1,37 +1,22 @@ | ||
import { | ||
Controller, | ||
Get, | ||
Post, | ||
Body, | ||
Patch, | ||
Param, | ||
Delete, | ||
} from '@nestjs/common'; | ||
import { Controller, Get, Param } from '@nestjs/common'; | ||
import { DermatologuesService } from './dermatologues.service'; | ||
import { ApiTags } from '@nestjs/swagger'; | ||
import { ApiOkResponse, ApiTags } from '@nestjs/swagger'; | ||
import { DermatologueEntity } from './entities/dermatologue.entity'; | ||
|
||
@ApiTags('dermatologues') | ||
@Controller('dermatologues') | ||
export class DermatologuesController { | ||
constructor(private readonly dermatologuesService: DermatologuesService) {} | ||
|
||
@Get() | ||
@ApiOkResponse({ type: DermatologueEntity, isArray: true }) | ||
findAll() { | ||
return this.dermatologuesService.findAll(); | ||
} | ||
|
||
@Get(':id') | ||
@ApiOkResponse({ type: DermatologueEntity }) | ||
findOne(@Param('id') id: string) { | ||
return this.dermatologuesService.findOne(id); | ||
} | ||
|
||
// @Patch(':id') | ||
// update(@Param('id') id: string, @Body() updateDermatologueDto: ) { | ||
// return this.dermatologuesService.update(+id, updateDermatologueDto); | ||
// } | ||
|
||
// @Delete(':id') | ||
// remove(@Param('id') id: string) { | ||
// return this.dermatologuesService.remove(+id); | ||
// } | ||
} |
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.