Current state

This commit is contained in:
2023-05-15 00:21:53 +02:00
parent 6344134a9e
commit 1f2eb78333
14 changed files with 124 additions and 72 deletions

View File

@ -25,7 +25,7 @@ generator dbml {
projectName = "AssetFlow"
}
enum Status {
enum itemStatus {
normal
borrowed
stolen
@ -33,16 +33,16 @@ enum Status {
}
model Item {
id Int @id @unique @default(autoincrement())
SKU String? @unique
amount Int @default(1)
id Int @id @unique @default(autoincrement())
SKU String? @unique
amount Int @default(1)
name String
Comment String?
status Status @default(normal) /// TODO: Would it be better to create a separate model for this as well instead of providing several static statuses to choose from(enum)?
comment String?
status itemStatus @default(normal) /// TODO: Would it be better to create a separate model for this as well instead of providing several static statuses to choose from(enum)?
manufacturer String /// TODO: Do we need this as a mandatory field? Probably we can add another model for manufacturer.
manufacturer String
category Category @relation(fields: [categoryId], references: [id])
category itemCategory @relation(fields: [categoryId], references: [id])
categoryId Int
items Item[] @relation("items") /// Item beinhaltet..
@ -66,17 +66,16 @@ model StorageLocation {
/// A StorageUnit is the base and can hold multiple StorageLocations.
model StorageUnit {
id Int @id @default(autoincrement())
name String
street String
houseNumber String
zipCode String
city String
country String
id Int @id @default(autoincrement())
name String
contactInfo contactInfo? @relation(fields: [contactInfoId], references: [id])
contactInfoId Int?
StorageLocation StorageLocation[]
}
model Category {
model itemCategory {
id Int @id @default(autoincrement())
name String @unique
description String?
@ -84,20 +83,24 @@ model Category {
}
/// TODO: Add relationship to StorageUnit, Item and if necessary to StorageLocation.
model Owner {
id Int @id @default(autoincrement())
type OwnerType @default(person)
name String
model contactInfo {
id Int @id @default(autoincrement())
type contactType @default(person)
name String?
lastName String?
street String
houseNumber String
zipCode String
city String
country String
StorageUnit StorageUnit[]
}
enum OwnerType {
enum contactType {
person
customer
company
partner
enemy
}