mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-11-11 19:33:55 +01:00
feat: upgraded nx, added databae service
This commit is contained in:
parent
a0316edce7
commit
fe53aabc17
7
monorepo/.vscode/extensions.json
vendored
7
monorepo/.vscode/extensions.json
vendored
@ -2,6 +2,11 @@
|
|||||||
"recommendations": [
|
"recommendations": [
|
||||||
"nrwl.angular-console",
|
"nrwl.angular-console",
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"firsttris.vscode-jest-runner"
|
"firsttris.vscode-jest-runner",
|
||||||
|
"angular.ng-template",
|
||||||
|
"wesbos.theme-cobalt2",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"wix.vscode-import-cost",
|
||||||
|
"prisma.prisma"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,65 +7,36 @@ datasource db {
|
|||||||
url = env("DATABASE_URL")
|
url = env("DATABASE_URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
model Restauracja {
|
model Recencja {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
adres String
|
tekst String
|
||||||
znizkas Znizka[] @relation("RestauracjaZnizka")
|
wartosc Int
|
||||||
recenzjas Recenzja[] @relation("RestauracjaRecenzja")
|
|
||||||
}
|
|
||||||
|
|
||||||
model Recenzja {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
tekst String
|
|
||||||
wartosc Int
|
|
||||||
restauracjaId Int
|
|
||||||
uzytkownikId Int
|
|
||||||
restauracja Restauracja @relation("RestauracjaRecenzja", fields: [restauracjaId], references: [id])
|
|
||||||
uzytkownik Uzytkownik @relation("UzytkownikRecenzja", fields: [uzytkownikId], references: [id])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Uzytkownik {
|
model Uzytkownik {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
imie String
|
imie String
|
||||||
nazwisko String
|
nazwisko String
|
||||||
adres String
|
adres String
|
||||||
Historia_zamowienId Int @unique
|
|
||||||
recenzjas Recenzja[] @relation("UzytkownikRecenzja")
|
|
||||||
historia_zamowien Historia_zamowien @relation("HistoriaRelation", fields: [Historia_zamowienId], references: [id])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Historia_zamowien {
|
model Historia_zamowien {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
data_zamowienia DateTime
|
data_zamowienia DateTime
|
||||||
HistoriaUzytkownik Uzytkownik? @relation("HistoriaRelation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Danie {
|
model Danie {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
cena Int
|
cena Int
|
||||||
kategoria String
|
kategoria String
|
||||||
nazwa String
|
nazwa String
|
||||||
zamowioneDanias Zamowione_danie[] @relation("DanieZamowione_danie")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Zamowione_danie {
|
model Zamowione_danie {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
zamowienie Zamowienie @relation(fields: [zamowienieId], references: [id])
|
|
||||||
zamowienieId Int @unique
|
|
||||||
danias Danie[] @relation("DanieZamowione_danie")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Zamowienie {
|
model Zamowienie {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
status String
|
status String
|
||||||
zamowioneDanie Zamowione_danie?
|
|
||||||
}
|
|
||||||
|
|
||||||
model Znizka {
|
|
||||||
id Int @id @default(autoincrement())
|
|
||||||
kod String
|
|
||||||
wartosc Int
|
|
||||||
czy_dostepna Boolean
|
|
||||||
restauracjaId Int
|
|
||||||
restauracja Restauracja @relation("RestauracjaZnizka", fields: [restauracjaId], references: [id])
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,10 @@ import { Module } from '@nestjs/common';
|
|||||||
|
|
||||||
import { AppController } from './app.controller';
|
import { AppController } from './app.controller';
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
|
import { DatabaseModule } from './database/database.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [],
|
imports: [DatabaseModule],
|
||||||
controllers: [AppController],
|
controllers: [AppController],
|
||||||
providers: [AppService],
|
providers: [AppService],
|
||||||
})
|
})
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { DatabaseController } from './database.controller';
|
||||||
|
|
||||||
|
describe('DatabaseController', () => {
|
||||||
|
let controller: DatabaseController;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
controllers: [DatabaseController],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
controller = module.get<DatabaseController>(DatabaseController);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(controller).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
import { Controller } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Controller('database')
|
||||||
|
export class DatabaseController {}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { DatabaseController } from './database.controller';
|
||||||
|
import { DatabaseService } from './database.service';
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
controllers: [DatabaseController],
|
||||||
|
providers: [DatabaseService],
|
||||||
|
})
|
||||||
|
export class DatabaseModule {}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { DatabaseService } from './database.service';
|
||||||
|
|
||||||
|
describe('DatabaseService', () => {
|
||||||
|
let service: DatabaseService;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
providers: [DatabaseService],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
service = module.get<DatabaseService>(DatabaseService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(service).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
import { Injectable } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class DatabaseService {}
|
||||||
37
monorepo/migrations.json
Normal file
37
monorepo/migrations.json
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"migrations": [
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "19.1.0-beta.6",
|
||||||
|
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
|
||||||
|
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi",
|
||||||
|
"package": "@nx/eslint-plugin",
|
||||||
|
"name": "update-19-1-0-rename-no-extra-semi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cli": "nx",
|
||||||
|
"version": "19.1.0-beta.2",
|
||||||
|
"requires": {
|
||||||
|
"@angular/core": ">=18.0.0"
|
||||||
|
},
|
||||||
|
"description": "Update the @angular/cli package version to ~18.0.0.",
|
||||||
|
"factory": "./src/migrations/update-19-1-0/update-angular-cli",
|
||||||
|
"package": "@nx/angular",
|
||||||
|
"name": "update-angular-cli-version-18-0-0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "18.0.0",
|
||||||
|
"description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.",
|
||||||
|
"factory": "./migrations/invalid-two-way-bindings/bundle",
|
||||||
|
"package": "@angular/core",
|
||||||
|
"name": "invalid-two-way-bindings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "18.0.0",
|
||||||
|
"description": "Replace deprecated HTTP related modules with provider functions",
|
||||||
|
"factory": "./migrations/http-providers/bundle",
|
||||||
|
"package": "@angular/core",
|
||||||
|
"name": "migration-http-providers"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,10 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
"$schema": "./node_modules/nx/schemas/nx-schema.json",
|
||||||
"namedInputs": {
|
"namedInputs": {
|
||||||
"default": [
|
"default": ["{projectRoot}/**/*", "sharedGlobals"],
|
||||||
"{projectRoot}/**/*",
|
|
||||||
"sharedGlobals"
|
|
||||||
],
|
|
||||||
"production": [
|
"production": [
|
||||||
"default",
|
"default",
|
||||||
"!{projectRoot}/.eslintrc.json",
|
"!{projectRoot}/.eslintrc.json",
|
||||||
@ -37,28 +34,17 @@
|
|||||||
"options": {
|
"options": {
|
||||||
"targetName": "test"
|
"targetName": "test"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": ["apps/my-workspace-e2e/**/*", "apps/my-nest-app-e2e/**/*"]
|
||||||
"apps/my-workspace-e2e/**/*",
|
|
||||||
"apps/my-nest-app-e2e/**/*"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"targetDefaults": {
|
"targetDefaults": {
|
||||||
"@angular-devkit/build-angular:browser": {
|
"@angular-devkit/build-angular:browser": {
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"dependsOn": [
|
"dependsOn": ["^build"],
|
||||||
"^build"
|
"inputs": ["production", "^production"]
|
||||||
],
|
|
||||||
"inputs": [
|
|
||||||
"production",
|
|
||||||
"^production"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"inputs": [
|
"inputs": ["production", "^production"]
|
||||||
"production",
|
|
||||||
"^production"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"generators": {
|
"generators": {
|
||||||
@ -68,5 +54,6 @@
|
|||||||
"style": "scss",
|
"style": "scss",
|
||||||
"unitTestRunner": "jest"
|
"unitTestRunner": "jest"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"nxCloudAccessToken": "YzgzODI0YjQtOTZlNi00NjRhLTk5ODEtNmQ1NTAwZmY3YWU2fHJlYWQtd3JpdGU="
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,18 +5,18 @@
|
|||||||
"scripts": {},
|
"scripts": {},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "~17.3.0",
|
"@angular/animations": "18.0.1",
|
||||||
"@angular/common": "~17.3.0",
|
"@angular/common": "18.0.1",
|
||||||
"@angular/compiler": "~17.3.0",
|
"@angular/compiler": "18.0.1",
|
||||||
"@angular/core": "~17.3.0",
|
"@angular/core": "18.0.1",
|
||||||
"@angular/forms": "~17.3.0",
|
"@angular/forms": "18.0.1",
|
||||||
"@angular/platform-browser": "~17.3.0",
|
"@angular/platform-browser": "18.0.1",
|
||||||
"@angular/platform-browser-dynamic": "~17.3.0",
|
"@angular/platform-browser-dynamic": "18.0.1",
|
||||||
"@angular/router": "~17.3.0",
|
"@angular/router": "18.0.1",
|
||||||
"@nestjs/common": "^10.3.8",
|
"@nestjs/common": "^10.3.8",
|
||||||
"@nestjs/core": "^10.3.8",
|
"@nestjs/core": "^10.3.8",
|
||||||
"@nestjs/platform-express": "^10.3.8",
|
"@nestjs/platform-express": "^10.3.8",
|
||||||
"@nrwl/workspace": "^19.0.4",
|
"@nrwl/workspace": "19.1.1",
|
||||||
"@prisma/client": "^5.14.0",
|
"@prisma/client": "^5.14.0",
|
||||||
"axios": "^1.6.0",
|
"axios": "^1.6.0",
|
||||||
"prisma": "^5.14.0",
|
"prisma": "^5.14.0",
|
||||||
@ -26,28 +26,28 @@
|
|||||||
"zone.js": "~0.14.3"
|
"zone.js": "~0.14.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/build-angular": "~17.3.0",
|
"@angular-devkit/build-angular": "18.0.2",
|
||||||
"@angular-devkit/core": "~17.3.0",
|
"@angular-devkit/core": "18.0.2",
|
||||||
"@angular-devkit/schematics": "~17.3.0",
|
"@angular-devkit/schematics": "18.0.2",
|
||||||
"@angular-eslint/eslint-plugin": "~17.3.0",
|
"@angular-eslint/eslint-plugin": "~17.3.0",
|
||||||
"@angular-eslint/eslint-plugin-template": "~17.3.0",
|
"@angular-eslint/eslint-plugin-template": "~17.3.0",
|
||||||
"@angular-eslint/template-parser": "~17.3.0",
|
"@angular-eslint/template-parser": "~17.3.0",
|
||||||
"@angular/cli": "~17.3.0",
|
"@angular/cli": "~17.3.0",
|
||||||
"@angular/compiler-cli": "~17.3.0",
|
"@angular/compiler-cli": "18.0.1",
|
||||||
"@angular/language-service": "~17.3.0",
|
"@angular/language-service": "18.0.1",
|
||||||
"@nestjs/schematics": "^10.0.1",
|
"@nestjs/schematics": "^10.0.1",
|
||||||
"@nestjs/testing": "^10.0.2",
|
"@nestjs/testing": "^10.0.2",
|
||||||
"@nx/angular": "^18.3.4",
|
"@nx/angular": "19.1.1",
|
||||||
"@nx/eslint": "18.3.4",
|
"@nx/eslint": "19.1.1",
|
||||||
"@nx/eslint-plugin": "18.3.4",
|
"@nx/eslint-plugin": "19.1.1",
|
||||||
"@nx/jest": "18.3.4",
|
"@nx/jest": "19.1.1",
|
||||||
"@nx/js": "18.3.4",
|
"@nx/js": "19.1.1",
|
||||||
"@nx/nest": "18.3.4",
|
"@nx/nest": "19.1.1",
|
||||||
"@nx/node": "18.3.4",
|
"@nx/node": "19.1.1",
|
||||||
"@nx/web": "18.3.4",
|
"@nx/web": "19.1.1",
|
||||||
"@nx/webpack": "18.3.4",
|
"@nx/webpack": "19.1.1",
|
||||||
"@nx/workspace": "18.3.4",
|
"@nx/workspace": "19.1.1",
|
||||||
"@schematics/angular": "~17.3.0",
|
"@schematics/angular": "18.0.2",
|
||||||
"@swc-node/register": "~1.8.0",
|
"@swc-node/register": "~1.8.0",
|
||||||
"@swc/core": "~1.3.85",
|
"@swc/core": "~1.3.85",
|
||||||
"@swc/helpers": "~0.5.2",
|
"@swc/helpers": "~0.5.2",
|
||||||
@ -60,8 +60,8 @@
|
|||||||
"jest": "^29.4.1",
|
"jest": "^29.4.1",
|
||||||
"jest-environment-jsdom": "^29.4.1",
|
"jest-environment-jsdom": "^29.4.1",
|
||||||
"jest-environment-node": "^29.4.1",
|
"jest-environment-node": "^29.4.1",
|
||||||
"jest-preset-angular": "~14.0.3",
|
"jest-preset-angular": "14.1.0",
|
||||||
"nx": "18.3.4",
|
"nx": "19.1.1",
|
||||||
"prettier": "^2.6.2",
|
"prettier": "^2.6.2",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.1",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user