-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adicionar produtos por categoria e filtrar por categoria
- Loading branch information
1 parent
34a3d59
commit 4a94559
Showing
19 changed files
with
380 additions
and
209 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
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 |
---|---|---|
|
@@ -5,10 +5,20 @@ services: | |
build: . | ||
container_name: node_app-api-gateway | ||
environment: | ||
- DATABASE_URL=postgresql://api-gateway_owner:[email protected]/api-gateway?sslmode=require | ||
- PORT=3000 | ||
- DATABASE_URL | ||
- PORT | ||
- SANDBOX_ACCESS_TOKEN | ||
- JWT_SECRET | ||
- SMTP_HOST | ||
- SMTP_PORT | ||
- SMTP_USER | ||
- SMTP_PASS | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules # Evita sobrescrever a pasta node_modules no container | ||
command: ["npm", "start"] | ||
# Dependências de serviço, caso tenha banco de dados, pode adicionar aqui | ||
# depends_on: | ||
# - postgres |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
16 changes: 16 additions & 0 deletions
16
prisma/migrations/20241019183234_add_category_to_product/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,16 @@ | ||
-- AlterTable | ||
ALTER TABLE "Product" ADD COLUMN "categoryId" INTEGER; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Category" ( | ||
"id" SERIAL NOT NULL, | ||
"name" TEXT NOT NULL, | ||
|
||
CONSTRAINT "Category_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Category_name_key" ON "Category"("name"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Product" ADD CONSTRAINT "Product_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("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
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,23 +1,23 @@ | ||
export interface PaymentData { | ||
document: string | undefined; | ||
last_name: string | undefined; | ||
first_name: string | undefined; | ||
email: string | undefined; | ||
transaction_amount: number; // Valor da transação | ||
description: string; // Descrição do pagamento | ||
payment_method_id: string; // ID do método de pagamento (ex: 'pix') | ||
document: string | undefined | ||
last_name: string | undefined | ||
first_name: string | undefined | ||
email: string | undefined | ||
transaction_amount: number // Valor da transação | ||
description: string // Descrição do pagamento | ||
payment_method_id: string // ID do método de pagamento (ex: 'pix') | ||
payer: { | ||
email: string; // Email do pagador | ||
first_name: string; // Primeiro nome do pagador | ||
last_name: string; // Sobrenome do pagador | ||
email: string // Email do pagador | ||
first_name: string // Primeiro nome do pagador | ||
last_name: string // Sobrenome do pagador | ||
identification: { | ||
type: string; // Tipo de documento (ex: 'CPF' ou 'CNPJ') | ||
number: string; // Número do documento (CPF ou CNPJ) | ||
}; | ||
}; | ||
notification_url?: string; // URL de notificação opcional para callbacks de status do pagamento | ||
external_reference?: string; // Referência externa opcional, útil para rastrear pedidos no seu sistema | ||
type: string // Tipo de documento (ex: 'CPF' ou 'CNPJ') | ||
number: string // Número do documento (CPF ou CNPJ) | ||
} | ||
} | ||
notification_url?: string // URL de notificação opcional para callbacks de status do pagamento | ||
external_reference?: string // Referência externa opcional, útil para rastrear pedidos no seu sistema | ||
|
||
// Add the productId property here | ||
productId: number; // ID of the associated product | ||
productId: number // ID of the associated product | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const DEFAULT_IMAGE_URL = 'https://i.ibb.co/dMNVYBj/noImae.png' // Substitua pelo link da sua imagem padrão |
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.