-
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.
- Loading branch information
1 parent
4f269e3
commit 6e0ffc5
Showing
16 changed files
with
190 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
DATABASE_URL=postgresql://<usuario-banco>:<senha>@<url-de-acesso-a-base>/<nome-da-base-de-dados> | ||
DATABASE_URL_POSTGRES="postgresql://postgres:postgres@localhost:5432/printgo-local" | ||
DATABASE_URL_COCKROACHDB= |
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,9 +1,9 @@ | ||
name: Prisma CI/CD Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
jobs: | ||
deploy: | ||
|
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,9 +1,9 @@ | ||
name: Prisma CI/CD Prod | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
jobs: | ||
deploy: | ||
|
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,23 @@ | ||
# 2023.2-PrintGo-Prisma | ||
|
||
|
||
## Executando container | ||
|
||
1. Instale dependencias do projeto | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
2. Para executar o container execute o comando: | ||
|
||
```bash | ||
docker-compose up --build -d | ||
``` | ||
|
||
3. Container do banco rodando execute as migrações da base de dados: | ||
|
||
```bash | ||
npm run migrate | ||
``` | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,115 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
binaryTargets = ["native", "debian-openssl-3.0.x"] | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model User { | ||
id String @id @default(cuid()) | ||
email String @unique | ||
nome String | ||
senha String | ||
documento String | ||
unidade_id String? | ||
resetPasswordToken String? | ||
resetPasswordExpires String? | ||
cargos Cargo[] @default([USER]) | ||
impressoes Impressao[] | ||
impressoras Impressora[] | ||
@@map("users") | ||
} | ||
|
||
model Padrao { | ||
id String @id @default(cuid()) | ||
tipo String | ||
marca String | ||
modeloImpressora String? | ||
modelo String | ||
numeroSerie String | ||
versaoFirmware String | ||
totalDigitalizacoes String | ||
totalCopiasPB String | ||
totalCopiasColoridas String | ||
totalImpressoesPb String | ||
totalImpressoesColoridas String | ||
totalGeral String | ||
enderecoIp String | ||
status PadraoStatus @default(ATIVO) | ||
tempoAtivoSistema String | ||
impressoras Impressora[] | ||
num String? | ||
@@map("padroes") | ||
} | ||
|
||
model Impressora { | ||
id String @id @default(cuid()) | ||
ip String @unique | ||
numeroSerie String @unique | ||
padrao_id String | ||
codigoLocadora String? | ||
locadora_id String? | ||
contadorInstalacao Int @default(0) | ||
dataInstalacao DateTime? | ||
ultimoContador Int @default(0) | ||
dataUltimoContador DateTime? | ||
contadorRetiradas Int @default(0) | ||
dataContadorRetirada DateTime? | ||
unidadeId String? | ||
status ImpressoraStatus @default(ATIVO) | ||
impressoes Impressao[] | ||
locadora User? @relation(fields: [locadora_id], references: [id]) | ||
padrao Padrao @relation(fields: [padrao_id], references: [id]) | ||
contadores Contador[] | ||
@@map("impressoras") | ||
} | ||
|
||
model Impressao { | ||
id String @id @default(cuid()) | ||
impressora_id String | ||
user_id String | ||
data_impressao DateTime @default(now()) | ||
nome_documento String | ||
numero_paginas Int | ||
impressora Impressora @relation(fields: [impressora_id], references: [id]) | ||
user User @relation(fields: [user_id], references: [id]) | ||
@@map("impressoes") | ||
} | ||
|
||
model Contador { | ||
id String @id @default(cuid()) | ||
numeroSerie String | ||
contadorCopiasPB String | ||
contadorImpressoesPB String | ||
contadorCopiasColoridas String? | ||
contadorImpressoesColoridas String? | ||
contadorGeral String | ||
dataHoraEmissaoRelatorio DateTime | ||
pdfAnexo String? | ||
serie Impressora @relation(fields: [numeroSerie], references: [numeroSerie]) | ||
@@map("contadores") | ||
} | ||
|
||
enum ImpressoraStatus { | ||
ATIVO | ||
DESATIVADO | ||
} | ||
|
||
enum PadraoStatus { | ||
ATIVO | ||
DESATIVADO | ||
} | ||
|
||
enum Cargo { | ||
USER | ||
ADMIN | ||
LOCADORA | ||
} | ||
|
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,35 @@ | ||
version: "3" | ||
|
||
services: | ||
postgres: | ||
image: postgres:alpine | ||
container_name: schedula_location_db | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- ./.ignore/postgres/postgres:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=printgo-local | ||
networks: | ||
- printgo_network | ||
|
||
pgadmin: | ||
image: dpage/pgadmin4 | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: "[email protected]" | ||
PGADMIN_DEFAULT_PASSWORD: "printgo123!" | ||
ports: | ||
- "16544:80" | ||
depends_on: | ||
- postgres | ||
networks: | ||
- printgo_network | ||
|
||
|
||
networks: | ||
printgo_network: | ||
driver: bridge | ||
driver_opts: | ||
com.docker.network.bridge.enable_icc: "true" |
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