- Introduced DTO for file attachments with metadata (objectKey, originalFileName, contentType, sizeBytes, downloadUrl). - Updated Equipment DTO to include an optional attachment field. - Implemented endpoints for uploading and deleting equipment attachments. - Enhanced Equipment service to handle file storage and retrieval using S3. - Updated EquipmentEdit, EquipmentList, and EquipmentShow components to support file attachment input and display. - Configured S3 settings in docker-compose and environment files.
37 lines
912 B
Plaintext
37 lines
912 B
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
enum EquipmentStatus {
|
|
Active
|
|
Repair
|
|
Reserve
|
|
WriteOff
|
|
}
|
|
|
|
model Equipment {
|
|
id String @id @default(uuid())
|
|
name String
|
|
serialNumber String
|
|
dateOfInspection DateTime?
|
|
commissionedAt DateTime?
|
|
status EquipmentStatus @default(Active)
|
|
/// JSON: { objectKey, originalFileName, contentType, sizeBytes } — файл в MinIO/S3
|
|
attachment Json?
|
|
changeEquipmentStatuses ChangeEquipmentStatus[]
|
|
}
|
|
|
|
model ChangeEquipmentStatus {
|
|
id String @id @default(uuid())
|
|
equipmentId String?
|
|
equipment Equipment? @relation(fields: [equipmentId], references: [id])
|
|
newStatus EquipmentStatus
|
|
number String?
|
|
date DateTime
|
|
responsible String?
|
|
}
|