-
-
+
+
{produit.nomProduit}
{produit.description}
-
- Prix conseillé : {produit.prixTtc} €
+
+ Prix conseillé : {produit.prixTtc} €
diff --git a/prisma/migrations/20221203141301_/migration.sql b/prisma/migrations/20221203141301_/migration.sql
new file mode 100644
index 0000000..0ebe374
--- /dev/null
+++ b/prisma/migrations/20221203141301_/migration.sql
@@ -0,0 +1,117 @@
+-- CreateEnum
+CREATE TYPE "Role" AS ENUM ('USER', 'ADMIN', 'SUPERADMIN');
+
+-- CreateTable
+CREATE TABLE "accounts" (
+ "id" SERIAL NOT NULL,
+ "user_id" INTEGER NOT NULL,
+ "type" TEXT NOT NULL,
+ "provider" TEXT NOT NULL,
+ "provider_account_id" TEXT NOT NULL,
+ "refresh_token" TEXT,
+ "access_token" TEXT,
+ "expires_at" INTEGER,
+ "token_type" TEXT,
+ "scope" TEXT,
+ "id_token" TEXT,
+ "session_state" TEXT,
+ "oauth_token_secret" TEXT,
+ "oauth_token" TEXT,
+
+ CONSTRAINT "accounts_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "sessions" (
+ "id" SERIAL NOT NULL,
+ "session_token" TEXT NOT NULL,
+ "user_id" INTEGER NOT NULL,
+ "expires" TIMESTAMP(3) NOT NULL,
+
+ CONSTRAINT "sessions_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "users" (
+ "id" SERIAL NOT NULL,
+ "name" TEXT,
+ "surname" TEXT,
+ "address" TEXT,
+ "zipCode" INTEGER,
+ "phoneNumber" INTEGER,
+ "email" TEXT,
+ "email_verified" TIMESTAMP(3),
+ "image" TEXT,
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ "updated_at" TIMESTAMP(3) NOT NULL,
+ "role" "Role" NOT NULL DEFAULT 'USER',
+
+ CONSTRAINT "users_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "TicketsRestants" (
+ "id" SERIAL NOT NULL,
+ "total" INTEGER NOT NULL,
+
+ CONSTRAINT "TicketsRestants_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "Gain" (
+ "id" SERIAL NOT NULL,
+ "codeCadeau" TEXT NOT NULL,
+ "dateRetrait" TIMESTAMP(3),
+ "produitId" INTEGER,
+ "userId" INTEGER,
+ "actif" BOOLEAN NOT NULL DEFAULT true,
+
+ CONSTRAINT "Gain_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "Produit" (
+ "id" SERIAL NOT NULL,
+ "actif" BOOLEAN,
+ "nomProduit" TEXT,
+ "prixTtc" INTEGER,
+
+ CONSTRAINT "Produit_pkey" PRIMARY KEY ("id")
+);
+
+-- CreateTable
+CREATE TABLE "verificationtokens" (
+ "identifier" TEXT NOT NULL,
+ "token" TEXT NOT NULL,
+ "expires" TIMESTAMP(3) NOT NULL
+);
+
+-- CreateIndex
+CREATE UNIQUE INDEX "accounts_provider_provider_account_id_key" ON "accounts"("provider", "provider_account_id");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "sessions_session_token_key" ON "sessions"("session_token");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "users_email_key" ON "users"("email");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "Gain_codeCadeau_key" ON "Gain"("codeCadeau");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "verificationtokens_token_key" ON "verificationtokens"("token");
+
+-- CreateIndex
+CREATE UNIQUE INDEX "verificationtokens_identifier_token_key" ON "verificationtokens"("identifier", "token");
+
+-- AddForeignKey
+ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Gain" ADD CONSTRAINT "Gain_produitId_fkey" FOREIGN KEY ("produitId") REFERENCES "Produit"("id") ON DELETE SET NULL ON UPDATE CASCADE;
+
+-- AddForeignKey
+ALTER TABLE "Gain" ADD CONSTRAINT "Gain_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml
new file mode 100644
index 0000000..fbffa92
--- /dev/null
+++ b/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 (i.e. Git)
+provider = "postgresql"
\ No newline at end of file
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index fdaebd5..1d0de67 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -53,7 +53,7 @@ model User {
updatedAt DateTime @updatedAt @map(name: "updated_at")
accounts Account[]
sessions Session[]
- gain Gain[]
+ gains Gain[]
role Role @default(USER)
@@map(name: "users")
@@ -72,21 +72,22 @@ model Gain {
produitId Int?
user User? @relation(fields: [userId], references: [id])
userId Int?
- actif Boolean @default(true)
+ codeActif Boolean @default(true)
+ retrait Boolean @default(false)
}
model Produit {
- id Int @id @default(autoincrement())
- actif Boolean?
- nomProduit String?
- prixTtc Int?
- image String?
+ id Int @id @default(autoincrement())
+ nomProduit String?
+ prixTtc Int?
+ image String?
description String?
- refGain Gain[]
+ refGain Gain[]
}
enum Role {
USER
+ SELLER
ADMIN
SUPERADMIN
}
diff --git a/prisma/seed.ts b/prisma/seed.ts
index bb97f82..117a53e 100644
--- a/prisma/seed.ts
+++ b/prisma/seed.ts
@@ -3,7 +3,7 @@ import { PrismaClient } from '@prisma/client';
import { generateGains } from './seed/gains'
import { produitsData } from './seed/produits'
-// import { userData } from './seed/user'
+import { userData } from './seed/user'
const prisma = new PrismaClient();
@@ -29,13 +29,13 @@ async function main() {
/////////////////////////////////////////////////////
- //création des utilisateurs
- // for (const u of userData) {
- // const user = await prisma.user.create({
- // data: u,
- // })
- // console.log(`Created user with id: ${user.id}`)
- // }
+ // création des utilisateurs
+ for (const u of userData) {
+ const user = await prisma.user.create({
+ data: u,
+ })
+ console.log(`Created user with id: ${user.id}`)
+ }
//création de 5 gains
for (let i = 1; i <= 5; i++) {
diff --git a/prisma/seed/gains.ts b/prisma/seed/gains.ts
index 9ecc250..ac4b6e8 100644
--- a/prisma/seed/gains.ts
+++ b/prisma/seed/gains.ts
@@ -13,6 +13,8 @@ export const generateGains = async () => {
const gainCreated = await prisma.gain.create({
data: {
codeCadeau: randomNoGain,
+ codeActif: true,
+ retrait: false
}
})
diff --git a/prisma/seed/produits.ts b/prisma/seed/produits.ts
index 61a0a97..58cae52 100644
--- a/prisma/seed/produits.ts
+++ b/prisma/seed/produits.ts
@@ -1,33 +1,33 @@
import { Prisma } from "@prisma/client";
export const produitsData: Prisma.ProduitCreateInput[] = [
- {
- nomProduit: 'Grand coffret découverte',
- prixTtc: 69,
- image: '/images/coffret-degustation.webp',
- description: "Une version XXL de notre fameux coffret découverte. Faites découvrir à vos invités leur saveur de thé préféré !"
- },
- {
- nomProduit: 'Coffret découverte',
- prixTtc: 39,
- image: '/images/coffret-degustation2.webp',
- description: "Ce coffret élégant vous permettra de découvrir les différentes saveurs de la gamme de Thé Tip Top. Offrez à votre palais de nouveaux horizons de saveurs. Découvrez avec ce coffret votre parfum préféré !"
- },
- {
- nomProduit: 'Thé signature',
- prixTtc: 10,
- image: '/images/the-signature.webp',
- description: "Le grand incontournable de notre gamme, le thé signature représente ce que Thé Tip Top souhaite vous transmettre : plus qu'un goût subtil et savoureux, c'est une expérience de saveur qui s'ouvre à vous !"
- },
- {
- nomProduit: 'Thé détox',
- prixTtc: 6,
- image: '/images/the-detox.webp',
- description: "Notre thé détox soutient l’élimination des déchets et purifie le corps des toxines accumulées. Il lutte contre la rétention d’eau. Pour chasser les toxines, il n’y a pas mieux !"
- },
- {
- nomProduit: 'Infuseur à thé',
- prixTtc: 3,
- image: '/images/infuseur.webp',
- description: "Préparer un bon thé chaud ou glacé de façon rapide et ludique. Profiter d'une infusion parfaite : L’infuseur permet aux feuilles de thé de se déployer librement, pleinement et de libérer ainsi toutes les molécules aromatiques au contact de l’eau. "
- }]
+ {
+ nomProduit: 'Grand coffret découverte',
+ prixTtc: 69,
+ image: '/images/coffret-degustation.webp',
+ description: "Une version XXL de notre fameux coffret découverte. Faites découvrir à vos invités leur saveur de thé préféré !"
+ },
+ {
+ nomProduit: 'Coffret découverte',
+ prixTtc: 39,
+ image: '/images/coffret-degustation2.webp',
+ description: "Ce coffret élégant vous permettra de découvrir les différentes saveurs de la gamme de Thé Tip Top. Offrez à votre palais de nouveaux horizons de saveurs. Découvrez avec ce coffret votre parfum préféré !"
+ },
+ {
+ nomProduit: 'Thé signature',
+ prixTtc: 10,
+ image: '/images/the-signature.webp',
+ description: "Le grand incontournable de notre gamme, le thé signature représente ce que Thé Tip Top souhaite vous transmettre : plus qu'un goût subtil et savoureux, c'est une expérience de saveur qui s'ouvre à vous !"
+ },
+ {
+ nomProduit: 'Thé détox',
+ prixTtc: 6,
+ image: '/images/the-detox.webp',
+ description: "Notre thé détox soutient l’élimination des déchets et purifie le corps des toxines accumulées. Il lutte contre la rétention d’eau. Pour chasser les toxines, il n’y a pas mieux !"
+ },
+ {
+ nomProduit: 'Infuseur à thé',
+ prixTtc: 3,
+ image: '/images/infuseur.webp',
+ description: "Préparer un bon thé chaud ou glacé de façon rapide et ludique. Profiter d'une infusion parfaite : L’infuseur permet aux feuilles de thé de se déployer librement, pleinement et de libérer ainsi toutes les molécules aromatiques au contact de l’eau. "
+ }]
diff --git a/prisma/seed/user.ts b/prisma/seed/user.ts
index bc9c26e..b1f839c 100644
--- a/prisma/seed/user.ts
+++ b/prisma/seed/user.ts
@@ -4,44 +4,19 @@ export const userData: Prisma.UserCreateInput[] = [
{
name: 'Alice',
email: 'alice@prisma.io',
- posts: {
- create: [
- {
- title: 'Join the Prisma Slack',
- content: 'https://slack.prisma.io',
- published: true,
- },
- ],
- },
+ createdAt: new Date(),
+ role: 'USER'
},
{
- name: 'Nilu',
- email: 'nilu@prisma.io',
- posts: {
- create: [
- {
- title: 'Follow Prisma on Twitter',
- content: 'https://www.twitter.com/prisma',
- published: true,
- },
- ],
- },
+ name: 'John',
+ email: 'john@prisma.io',
+ createdAt: new Date(),
+ role: 'SELLER'
},
{
- name: 'Mahmoud',
- email: 'mahmoud@prisma.io',
- posts: {
- create: [
- {
- title: 'Ask a question about Prisma on GitHub',
- content: 'https://www.github.com/prisma/prisma/discussions',
- published: true,
- },
- {
- title: 'Prisma on YouTube',
- content: 'https://pris.ly/youtube',
- },
- ],
- },
+ name: 'Mosse',
+ email: 'mosse@prisma.io',
+ createdAt: new Date(),
+ role: 'USER'
},
]
\ No newline at end of file
diff --git a/public/images/coffret-degustation-mousselines-individuelles-n3-PhotoRoom.webp b/public/images/coffret-degustation-mousselines-individuelles-n3-PhotoRoom.webp
new file mode 100644
index 0000000..3606c5a
Binary files /dev/null and b/public/images/coffret-degustation-mousselines-individuelles-n3-PhotoRoom.webp differ
diff --git a/public/images/coffret-the-PhotoRoom.webp b/public/images/coffret-the-PhotoRoom.webp
new file mode 100644
index 0000000..de1d6c8
Binary files /dev/null and b/public/images/coffret-the-PhotoRoom.webp differ
diff --git a/public/images/png/coffret-the-PhotoRoom.png b/public/images/png/coffret-the-PhotoRoom.png
new file mode 100644
index 0000000..0ced5a3
Binary files /dev/null and b/public/images/png/coffret-the-PhotoRoom.png differ
diff --git a/styles/Connexion.module.css b/styles/Connexion.module.css
index b86b1c0..1027061 100644
--- a/styles/Connexion.module.css
+++ b/styles/Connexion.module.css
@@ -9,6 +9,10 @@
z-index: 8888
}
+.cursor:hover {
+ cursor: pointer;
+}
+
.imageWrapper {
display: block;
}
diff --git a/styles/Loader.module.css b/styles/Loader.module.css
new file mode 100644
index 0000000..459bee2
--- /dev/null
+++ b/styles/Loader.module.css
@@ -0,0 +1,34 @@
+.wrapper {
+ width: 100%;
+ height: 100vh;
+ position: absolute;
+ top: 0;
+ left: 0;
+ background-color: rgb(0, 0, 0, 0.3);
+ backdrop-filter: blur(10px);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 9999;
+}
+
+/*code for custom loading icon*/
+
+.loader {
+ border: 10px solid #f3f3f3;
+ border-radius: 50%;
+ border-top: 10px solid #505050;
+ width: 60px;
+ height: 60px;
+ animation: spin 2s linear infinite;
+}
+
+@keyframes spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
\ No newline at end of file
diff --git a/styles/NavBar.module.css b/styles/NavBar.module.css
index 3b281a4..1eeb5d0 100644
--- a/styles/NavBar.module.css
+++ b/styles/NavBar.module.css
@@ -17,7 +17,6 @@
/**************************/
.overlay {
- height: 0;
width: 100%;
bottom: 100%;
position: fixed;
@@ -36,14 +35,14 @@
.overlay-content {
position: relative;
- top: 25%;
+ height: 90%;
+ top: 10px;
width: 100%;
text-align: center;
- margin-top: 30px;
+ margin-top: 5px;
display: flex;
flex-direction: column;
align-items: center;
- margin-top: 20vh;
}
.overlay a {
diff --git a/styles/ToutSavoir.module.css b/styles/ToutSavoir.module.css
index fa72727..814ada7 100644
--- a/styles/ToutSavoir.module.css
+++ b/styles/ToutSavoir.module.css
@@ -1,26 +1,31 @@
.aCard {
/* width:200px; */
- max-width:300px;
+ max-width: 300px;
}
+
.aCard img {
- width:fit-content;
+ width: fit-content;
block-size: -moz-fit-content;
max-width: 100%;
}
-.aCard img, .grosLot img {
- height:fit-content;
+.aCard img,
+.grosLot img {
+ height: fit-content;
}
+
.grosLot img {
- border-radius:0.375rem;
+ border-radius: 0.375rem;
}
-@media (min-width: 992px){
- .explicationContainer{
- --padding-x:15%;
+
+@media (min-width: 992px) {
+ .explicationContainer {
+ --padding-x: 15%;
padding-left: var(--padding-x);
padding-right: var(--padding-x);
}
- .aCard div {
+
+ .aCard div {
min-height: 205px;
}
}
\ No newline at end of file
diff --git a/styles/globals.css b/styles/globals.css
index 8f18263..feec989 100644
--- a/styles/globals.css
+++ b/styles/globals.css
@@ -8,7 +8,7 @@ body {
font-size: small;
}
-body{
+body {
background-image: url(/images/pageprincipale.webp);
background-size: cover;
background-position: 50% 50%;
@@ -16,21 +16,22 @@ body{
background-attachment: fixed;
}
-@media (min-width: 992px){
+@media (min-width: 992px) {
+
html,
- body{
+ body {
font-size: medium;
}
}
-.layout-container{
- display : table;
+.layout-container {
+ display: table;
width: 100%;
- position:relative;
- min-height:100vh;
+ position: relative;
+ min-height: 100vh;
}
-.body-content{
+.body-content {
display: table-row-group;
}
@@ -64,6 +65,6 @@ a:hover {
--bs-btn-disabled-border-color: var(--color2);
}
-.link {
+.link {
text-decoration: underline;
}
\ No newline at end of file
diff --git a/types/userGain.ts b/types/userGain.ts
index 5dbd626..c6ca48c 100644
--- a/types/userGain.ts
+++ b/types/userGain.ts
@@ -5,5 +5,6 @@ export type UserGainProps = {
dateRetrait: Date;
produit: Produit;
produitId: number;
- actif: Boolean;
+ codeActif: true,
+ retrait: false
}
\ No newline at end of file