fix - noms produits

feature/page-admin
unknown 4 years ago
parent cce6fa777d
commit 3d8f792d7e

@ -1,6 +1,6 @@
export enum Cadeaux {
CoffretDecouvert69 = 1,
CoffretDecouvert39 = 2,
GrandCoffretDecouverte = 1,
CoffretDecouverte = 2,
TheSignature = 3,
TheDetox = 4,
Infuseur = 5,

@ -45,8 +45,8 @@ export default async function generationGain(req: NextApiRequest, res: NextApiRe
//création d'un id de produit de façon pondérée
let weightedRandomGainId = chance().weighted([
Cadeaux.CoffretDecouvert69,
Cadeaux.CoffretDecouvert39,
Cadeaux.GrandCoffretDecouverte,
Cadeaux.CoffretDecouverte,
Cadeaux.TheSignature,
Cadeaux.TheDetox,
Cadeaux.Infuseur],

@ -50,7 +50,7 @@ const ToutSavoir = ({ produits }: Props) => {
<h1 className="text-center mt-3">Tout savoir sur le jeu concours</h1>
<div className="container mt-3">
<p className="mt-5 text-center">
Le jeu concours vous est proposé à l'occasion de l'ouverture de notre 10e boutique à Nice ! Pour participer, il vous suffit de faire un achat supérieur à 49€, un code vous sera fourni sur votre facture à saisir <Link href="/"><a>ici</a></Link>
Le jeu concours vous est proposé à l'occasion de l'ouverture de notre 10e boutique à Nice ! Pour participer, il vous suffit de faire un achat supérieur à 49€, un code vous sera fourni sur votre facture à saisir <Link href="/" legacyBehavior><a>ici</a></Link>
</p>
<h2 className="text-center">Le gros lot</h2>
<div className="row">

@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Gain" ADD COLUMN "disponible" BOOLEAN NOT NULL DEFAULT true;

@ -1,9 +0,0 @@
/*
Warnings:
- You are about to drop the column `disponible` on the `Gain` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Gain" DROP COLUMN "disponible",
ADD COLUMN "actif" BOOLEAN NOT NULL DEFAULT true;

@ -1,31 +0,0 @@
/*
Warnings:
- You are about to alter the column `prixTtc` on the `Produit` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Integer`.
- You are about to drop the `Post` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Profile` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "Post" DROP CONSTRAINT "Post_authorId_fkey";
-- DropForeignKey
ALTER TABLE "Profile" DROP CONSTRAINT "Profile_userId_fkey";
-- DropIndex
DROP INDEX "Gain_userId_key";
-- AlterTable
ALTER TABLE "Produit" ALTER COLUMN "prixTtc" SET DATA TYPE INTEGER;
-- AlterTable
ALTER TABLE "users" ADD COLUMN "address" TEXT,
ADD COLUMN "phoneNumber" TEXT,
ADD COLUMN "surname" TEXT,
ADD COLUMN "zipCode" TEXT;
-- DropTable
DROP TABLE "Post";
-- DropTable
DROP TABLE "Profile";

@ -1,9 +0,0 @@
/*
Warnings:
- The `phoneNumber` column on the `users` table would be dropped and recreated. This will lead to data loss if there is data in the column.
*/
-- AlterTable
ALTER TABLE "users" DROP COLUMN "phoneNumber",
ADD COLUMN "phoneNumber" INTEGER;

@ -1,9 +0,0 @@
/*
Warnings:
- The `zipCode` column on the `users` table would be dropped and recreated. This will lead to data loss if there is data in the column.
*/
-- AlterTable
ALTER TABLE "users" DROP COLUMN "zipCode",
ADD COLUMN "zipCode" INTEGER;

@ -35,6 +35,10 @@ CREATE TABLE "sessions" (
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,
@ -45,26 +49,6 @@ CREATE TABLE "users" (
CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Post" (
"id" SERIAL NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT,
"published" BOOLEAN NOT NULL DEFAULT false,
"authorId" INTEGER,
CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Profile" (
"id" SERIAL NOT NULL,
"bio" TEXT,
"userId" INTEGER NOT NULL,
CONSTRAINT "Profile_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "TicketsRestants" (
"id" SERIAL NOT NULL,
@ -80,6 +64,7 @@ CREATE TABLE "Gain" (
"dateRetrait" TIMESTAMP(3),
"produitId" INTEGER,
"userId" INTEGER,
"actif" BOOLEAN NOT NULL DEFAULT true,
CONSTRAINT "Gain_pkey" PRIMARY KEY ("id")
);
@ -89,7 +74,7 @@ CREATE TABLE "Produit" (
"id" SERIAL NOT NULL,
"actif" BOOLEAN,
"nomProduit" TEXT,
"prixTtc" DECIMAL(65,30),
"prixTtc" INTEGER,
CONSTRAINT "Produit_pkey" PRIMARY KEY ("id")
);
@ -110,15 +95,9 @@ 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 "Profile_userId_key" ON "Profile"("userId");
-- CreateIndex
CREATE UNIQUE INDEX "Gain_codeCadeau_key" ON "Gain"("codeCadeau");
-- CreateIndex
CREATE UNIQUE INDEX "Gain_userId_key" ON "Gain"("userId");
-- CreateIndex
CREATE UNIQUE INDEX "verificationtokens_token_key" ON "verificationtokens"("token");
@ -131,12 +110,6 @@ ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_fkey" FOREIGN KEY ("user
-- 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 "Post" ADD CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "users"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Profile" ADD CONSTRAINT "Profile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT 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;

@ -18,8 +18,8 @@ export const generateGains = async () => {
//crétion d'un id de produit de façon pondérée
let weightedRandomGain = chance.weighted([
Cadeaux.CoffretDecouvert69,
Cadeaux.CoffretDecouvert39,
Cadeaux.GrandCoffretDecouverte,
Cadeaux.CoffretDecouverte,
Cadeaux.TheSignature,
Cadeaux.TheDetox,
Cadeaux.Infuseur],

@ -2,23 +2,23 @@ import { Prisma } from "@prisma/client";
export const produitsData: Prisma.ProduitCreateInput[] = [
{
nomProduit: 'coffret découverte à 69€',
nomProduit: 'Grand coffret découverte',
prixTtc: 69,
},
{
nomProduit: 'coffret découverte à 39€',
nomProduit: 'Coffret découverte',
prixTtc: 39,
},
{
nomProduit: 'thé signature',
nomProduit: 'Thé signature',
prixTtc: 10,
},
{
nomProduit: 'thé détox',
nomProduit: 'Thé détox',
prixTtc: 6,
},
{
nomProduit: 'infuseur à thé',
nomProduit: 'Infuseur à thé',
prixTtc: 3,
}]

@ -91,10 +91,6 @@
}
@keyframes blinking {
<<<<<<< HEAD
=======
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437
0%,
50%,
100% {
@ -115,20 +111,12 @@
display: block;
}
<<<<<<< HEAD
.aButton {
position: relative;
z-index: 9992;
}
.aButton:after {
=======
.masthead .aButton {
position: relative;
}
.masthead .aButton:after {
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437
content: "";
position: absolute;
@ -142,19 +130,11 @@
height: calc(100% + var(--aButton-base-padding));
}
<<<<<<< HEAD
.aButton:hover:after {
=======
.masthead .aButton:hover:after {
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437
display: block;
animation: 0.7s linear infinite alternate expand;
}
<<<<<<< HEAD
=======
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437
@keyframes expand {
to {
left: calc(var(--aButton-base-padding) - var(--aButton-grow-padding));
@ -188,14 +168,10 @@
}
<<<<<<< HEAD
.feuilleGauche,
.feuilleDroite,
.cadeau,
.jeuConcours {
=======
.feuilleGauche, .feuilleDroite, .cadeau, .jeuConcours {
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437
position: absolute;
}
@ -268,7 +244,6 @@
bottom: -20px;
}
}
<<<<<<< HEAD
@keyframes inAnimation {
0% {
@ -293,8 +268,6 @@
}
}
=======
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437
/* @keyframes moveLeftRight {
0%,
100% {
@ -303,8 +276,4 @@
50% {
right: 0;
}
<<<<<<< HEAD
} */
=======
} */
>>>>>>> e3ede7484e3484cf4585da285d221d44f9b9e437

Loading…
Cancel
Save