Skip to content

Commit

Permalink
feat:store
Browse files Browse the repository at this point in the history
  • Loading branch information
Riyan0406 committed Jul 22, 2024
2 parents 29ee0f0 + 4c34f39 commit 324b53e
Show file tree
Hide file tree
Showing 47 changed files with 2,070 additions and 1,052 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
"@nestjs/core": "^10.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^10.0.0",
<<<<<<< HEAD
"@prisma/client": "^5.17.0",
=======
"@prisma/client": "^5.16.1",
"axios": "^1.7.2",
>>>>>>> 4c34f397f56e86b71f8c67209901d973b93e0d50
"bcrypt": "^5.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
Expand Down
18 changes: 9 additions & 9 deletions prisma/migrations/20240718104158_db_migrate/migration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CREATE TABLE "Carts" (
"id" SERIAL NOT NULL,
"price" INTEGER NOT NULL,
"discount" INTEGER NOT NULL,
"isComplete" BOOLEAN NOT NULL DEFAULT false,
"userId" INTEGER,
"storeId" INTEGER,

Expand Down Expand Up @@ -65,10 +66,12 @@ CREATE TABLE "Invoices" (
"receiverPhone" TEXT,
"receiverAddress" TEXT NOT NULL,
"receiverName" TEXT NOT NULL,
"receiverEmail" TEXT NOT NULL,
"invoiceNumber" TEXT NOT NULL,
"notes" TEXT,
"cartId" INTEGER,
"userId" INTEGER,
"courierId" INTEGER,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

Expand Down Expand Up @@ -101,7 +104,6 @@ CREATE TABLE "Payments" (
"bank" TEXT NOT NULL,
"amount" INTEGER NOT NULL,
"status" TEXT NOT NULL,
"mootaTransactionId" INTEGER NOT NULL,
"invoiceId" INTEGER NOT NULL,

CONSTRAINT "Payments_pkey" PRIMARY KEY ("id")
Expand All @@ -114,8 +116,6 @@ CREATE TABLE "Couriers" (
"courierServiceName" TEXT NOT NULL,
"courierServiceCode" TEXT NOT NULL,
"price" INTEGER NOT NULL,
"orderId" INTEGER NOT NULL,
"invoiceId" INTEGER NOT NULL,

CONSTRAINT "Couriers_pkey" PRIMARY KEY ("id")
);
Expand Down Expand Up @@ -264,13 +264,13 @@ CREATE UNIQUE INDEX "Roles_name_key" ON "Roles"("name");
CREATE UNIQUE INDEX "Profile_userId_key" ON "Profile"("userId");

-- CreateIndex
CREATE UNIQUE INDEX "ConfirmationPayment_invoiceId_key" ON "ConfirmationPayment"("invoiceId");
CREATE UNIQUE INDEX "Invoices_courierId_key" ON "Invoices"("courierId");

-- CreateIndex
CREATE UNIQUE INDEX "Payments_invoiceId_key" ON "Payments"("invoiceId");
CREATE UNIQUE INDEX "ConfirmationPayment_invoiceId_key" ON "ConfirmationPayment"("invoiceId");

-- CreateIndex
CREATE UNIQUE INDEX "Couriers_invoiceId_key" ON "Couriers"("invoiceId");
CREATE UNIQUE INDEX "Payments_invoiceId_key" ON "Payments"("invoiceId");

-- CreateIndex
CREATE UNIQUE INDEX "Products_url_key" ON "Products"("url");
Expand Down Expand Up @@ -314,6 +314,9 @@ ALTER TABLE "Invoices" ADD CONSTRAINT "Invoices_cartId_fkey" FOREIGN KEY ("cartI
-- AddForeignKey
ALTER TABLE "Invoices" ADD CONSTRAINT "Invoices_userId_fkey" FOREIGN KEY ("userId") REFERENCES "Users"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Invoices" ADD CONSTRAINT "Invoices_courierId_fkey" FOREIGN KEY ("courierId") REFERENCES "Couriers"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ConfirmationPayment" ADD CONSTRAINT "ConfirmationPayment_invoiceId_fkey" FOREIGN KEY ("invoiceId") REFERENCES "Invoices"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

Expand All @@ -323,9 +326,6 @@ ALTER TABLE "InvoiceHistories" ADD CONSTRAINT "InvoiceHistories_invoiceId_fkey"
-- AddForeignKey
ALTER TABLE "Payments" ADD CONSTRAINT "Payments_invoiceId_fkey" FOREIGN KEY ("invoiceId") REFERENCES "Invoices"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Couriers" ADD CONSTRAINT "Couriers_invoiceId_fkey" FOREIGN KEY ("invoiceId") REFERENCES "Invoices"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "StoreOnDecorations" ADD CONSTRAINT "StoreOnDecorations_decorationId_fkey" FOREIGN KEY ("decorationId") REFERENCES "Decorations"("id") ON DELETE SET NULL ON UPDATE CASCADE;

Expand Down
Loading

0 comments on commit 324b53e

Please sign in to comment.