Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- generator client {
- provider = "prisma-client-js"
- previewFeatures = ["fieldReference", "fullTextIndex"]
- }
- datasource db {
- provider = "mongodb"
- url = env("MONGODB_URI")
- }
- model TagSetting {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- data String
- operator TagSettingsOperator
- }
- enum TagSettingsOperator {
- StartsWith
- EndsWith
- Includes
- }
- model Product {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- productName String
- barcode String @unique
- size String
- productImage ProductImage
- collectionId String @db.ObjectId
- collection Collection @relation(fields: [collectionId], references: [id], onDelete: Restrict, onUpdate: Cascade)
- tags Tag[]
- createdAt DateTime? @default(now())
- updatedAt DateTime? @default(now()) @updatedAt
- slug String
- tagReports TagReport[]
- }
- model Collection {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- collectionName String @unique
- parent Collection? @relation("Categories", fields: [parentId], references: [id], onDelete: NoAction, onUpdate: NoAction)
- parentId String? @db.ObjectId
- children Collection[] @relation("Categories")
- products Product[]
- posCollection PosCollection[]
- sizes String[]
- updatedAt DateTime? @default(now()) @updatedAt
- tags Tag[]
- tagReports TagReport[]
- }
- model Tag {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- tagId String @unique
- status TagStatus
- level Int?
- createdAt DateTime? @default(now())
- updatedAt DateTime? @default(now()) @updatedAt
- tagReports TagReport[]
- pos Pos? @relation(fields: [posSerialNumber], references: [serialNumber])
- product Product? @relation(fields: [productId], references: [id])
- collection Collection? @relation(fields: [collectionId], references: [id])
- posCollection PosCollection? @relation(fields: [posCollectionId], references: [id])
- productId String? @db.ObjectId
- collectionId String? @db.ObjectId
- posSerialNumber String?
- posCollectionId String? @db.ObjectId
- slug String?
- }
- model Pos {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- posStatus PosStatus @default(CREATED)
- serialNumber String @unique
- posName String @unique
- address Address?
- contactPerson ContactPerson?
- posBatteryCapacity Int @default(0)
- lastScan DateTime @default(now()) @updatedAt
- comment String?
- updatedAt DateTime? @default(now()) @updatedAt
- config PosConfig?
- posReports PosReport[]
- tagReports TagReport[]
- posServices PosService[]
- tags Tag[]
- logs Log[]
- collections PosCollection[]
- }
- model LinkPosQRCode {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- serialNumber String @unique
- createdAt DateTime? @default(now())
- updatedAt DateTime? @default(now()) @updatedAt
- }
- model PosCollection {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- pos Pos @relation(fields: [posId], references: [id], onUpdate: Cascade, onDelete: Cascade)
- posId String @db.ObjectId
- collection Collection @relation(fields: [collectionId], references: [id])
- collectionId String @db.ObjectId
- posSerialNumber String
- size String
- capacity Int
- updatedAt DateTime? @default(now()) @updatedAt
- tags Tag[]
- tagReports TagReport[]
- }
- model PosService {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- posSerialNumber String
- pos Pos @relation(fields: [posSerialNumber], references: [serialNumber], onUpdate: Cascade, onDelete: Cascade)
- name String
- status PosServiceStatus
- comment String?
- updatedAt DateTime? @default(now()) @updatedAt
- }
- model PosReport {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- posSerialNumber String
- pos Pos @relation(fields: [posSerialNumber], references: [serialNumber])
- posName String?
- displayState Int @default(0)
- collectionStates Json?
- batteryState Int
- posStatus PosStatus
- tagReports TagReport[]
- updatedAt DateTime? @default(now()) @updatedAt
- }
- model TagReport {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- tagId String
- productId String? @db.ObjectId
- collectionId String? @db.ObjectId
- status TagStatus
- tag Tag @relation(fields: [tagId], references: [tagId])
- product Product? @relation(fields: [productId], references: [id])
- collection Collection? @relation(fields: [collectionId], references: [id])
- posReportId String? @db.ObjectId
- posSerialNumber String?
- posCollectionId String? @db.ObjectId
- posReport PosReport? @relation(fields: [posReportId], references: [id])
- pos Pos? @relation(fields: [posSerialNumber], references: [serialNumber])
- posCollection PosCollection? @relation(fields: [posCollectionId], references: [id])
- productName String?
- collectionName String?
- barcode String?
- falsePositive Boolean @default(false)
- visible Boolean @default(true)
- updatedAt DateTime? @default(now()) @updatedAt
- }
- model Log {
- id String @id @default(auto()) @map("_id") @db.ObjectId
- bat String?
- time String?
- cnt String?
- all String?
- tags LogTag[]
- pos Pos? @relation(fields: [serialNumber], references: [serialNumber], onDelete: Cascade)
- serialNumber String
- updatedAt DateTime? @default(now()) @updatedAt
- rest Json?
- }
- type LogTag {
- I String?
- S String?
- }
- type ContactPerson {
- personName String
- email String
- phoneNumber String
- }
- type PosConfig {
- refreshInterval Int @default(14400) //14400 - 4 hours interval in seconds
- }
- type ProductImage {
- name String
- type String
- path String
- size Int
- }
- type Address {
- formattedAddress String // Full address in one string
- country String
- city String
- state String
- county String
- postalCode String
- streetName String
- streetNumber String
- coordinates Coordinates
- }
- type Coordinates {
- latitude Float
- longitude Float
- }
- enum ProductSize {
- REGULAR
- MEDIUM
- LARGE
- SMALL
- XS
- ONE_SIZE
- BEANIE_BOOS
- MINI_BOOS
- SAB
- }
- enum PosStatus {
- ONLINE
- CONNECTION_LOST
- CREATED
- }
- enum PosServiceStatus {
- SALE
- SALE_ADD
- MERCHANDISE
- ADDED_PRODUCTS
- }
- enum TagStatus {
- IN_TRANSIT
- ON_POS
- SOLD
- DELETED
- UNASSIGNED
- WRONG_ITEM
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement