Добавлена возможность подключаться из вне
This commit is contained in:
+4
@@ -276,6 +276,7 @@
|
||||
"integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@types/body-parser": "*",
|
||||
"@types/express-serve-static-core": "^4.17.33",
|
||||
@@ -344,6 +345,7 @@
|
||||
"integrity": "sha512-WJtwWJu7UdlvzEAUm484QNg5eAoq5QR08KDNx7g45Usrs2NtOPiX8ugDqmKdXkyL03rBqU5dYNYVQetEpBHq2g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~6.21.0"
|
||||
}
|
||||
@@ -2633,6 +2635,7 @@
|
||||
"devOptional": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@prisma/engines": "5.22.0"
|
||||
},
|
||||
@@ -3374,6 +3377,7 @@
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
|
||||
+18
-7
File diff suppressed because one or more lines are too long
+12
@@ -219,10 +219,13 @@ exports.Prisma.EstimateScalarFieldEnum = {
|
||||
totalLaboratory: 'totalLaboratory',
|
||||
subtotal: 'subtotal',
|
||||
regionalCoef: 'regionalCoef',
|
||||
regionalCoefDocRef: 'regionalCoefDocRef',
|
||||
inflationIndex: 'inflationIndex',
|
||||
inflationDocRef: 'inflationDocRef',
|
||||
companyCoef: 'companyCoef',
|
||||
companyCoefDocRef: 'companyCoefDocRef',
|
||||
executorCoef: 'executorCoef',
|
||||
executorCoefDocRef: 'executorCoefDocRef',
|
||||
withVat: 'withVat',
|
||||
totalWithoutVat: 'totalWithoutVat',
|
||||
vatRate: 'vatRate',
|
||||
@@ -249,6 +252,14 @@ exports.Prisma.EstimateShareScalarFieldEnum = {
|
||||
createdAt: 'createdAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EstimateShareNoteScalarFieldEnum = {
|
||||
id: 'id',
|
||||
shareId: 'shareId',
|
||||
authorId: 'authorId',
|
||||
content: 'content',
|
||||
createdAt: 'createdAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EstimateItemScalarFieldEnum = {
|
||||
id: 'id',
|
||||
estimateId: 'estimateId',
|
||||
@@ -355,6 +366,7 @@ exports.Prisma.ModelName = {
|
||||
Estimate: 'Estimate',
|
||||
EstimateVersion: 'EstimateVersion',
|
||||
EstimateShare: 'EstimateShare',
|
||||
EstimateShareNote: 'EstimateShareNote',
|
||||
EstimateItem: 'EstimateItem',
|
||||
EstimateTotal: 'EstimateTotal',
|
||||
Setting: 'Setting',
|
||||
|
||||
+1874
-1
File diff suppressed because it is too large
Load Diff
+20
-9
File diff suppressed because one or more lines are too long
Generated
Vendored
Executable
BIN
Binary file not shown.
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "prisma-client-4b58c981519ea022802510544edb111bbd4ef5e4d3b50b2269f96083d9bf4ae3",
|
||||
"name": "prisma-client-aa42ad392173f3ebbcce688c9d47fd7d65145cf816fa2f07c9d3255147711e22",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"browser": "index-browser.js",
|
||||
|
||||
+48
-13
@@ -9,7 +9,7 @@ datasource db {
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
// Справочники базовых цен
|
||||
// Справочники базовых цен (СБЦ)
|
||||
model PriceBook {
|
||||
id String @id @default(uuid())
|
||||
code String @unique // SBC-GEODESY-2004, SBC-GEOLOGY-1999
|
||||
@@ -114,8 +114,9 @@ model User {
|
||||
|
||||
estimates Estimate[]
|
||||
chatSessions ChatSession[]
|
||||
ownedShares EstimateShare[] @relation("ShareOwner")
|
||||
receivedShares EstimateShare[] @relation("ShareReceiver")
|
||||
ownedShares EstimateShare[] @relation("ShareOwner")
|
||||
receivedShares EstimateShare[] @relation("ShareReceiver")
|
||||
shareNotes EstimateShareNote[]
|
||||
}
|
||||
|
||||
// Направления изысканий
|
||||
@@ -146,13 +147,17 @@ model Estimate {
|
||||
subtotal Decimal? @db.Decimal(14, 2) // Итого по изысканиям
|
||||
|
||||
// Коэффициенты и пересчет
|
||||
regionalCoef Decimal? @db.Decimal(6, 4) // Районный коэффициент
|
||||
inflationIndex Decimal? @db.Decimal(10, 4) // Индекс перевода в текущие цены
|
||||
inflationDocRef String? // Ссылка на документ с индексом
|
||||
companyCoef Decimal? @db.Decimal(6, 4) // Коэффициент компании (Газпром и т.д.)
|
||||
executorCoef Decimal? @db.Decimal(6, 4) // Коэффициент исполнителя
|
||||
regionalCoef Decimal? @db.Decimal(6, 4) // Районный коэффициент
|
||||
regionalCoefDocRef String? // Описание (С районным коэффициентом и т.д.)
|
||||
inflationIndex Decimal? @db.Decimal(10, 4) // Индекс перевода в текущие цены
|
||||
inflationDocRef String? // Ссылка на документ (Письмо Минстроя и т.д.)
|
||||
companyCoef Decimal? @db.Decimal(6, 4) // Коэффициент компании (Газпром и т.д.)
|
||||
companyCoefDocRef String? // Описание (Коэффициент ОАО «Газпром» №544 и т.д.)
|
||||
executorCoef Decimal? @db.Decimal(6, 4) // Коэффициент исполнителя
|
||||
executorCoefDocRef String? // Описание (Коэффициент ООО «ГеоВектор» и т.д.)
|
||||
|
||||
// Итоги
|
||||
withVat Boolean @default(true) // Смета с НДС (true) или без НДС (false)
|
||||
totalWithoutVat Decimal? @db.Decimal(14, 2) // Итого без НДС
|
||||
vatRate Decimal? @db.Decimal(4, 2) // Ставка НДС (18, 20, 7)
|
||||
vatAmount Decimal? @db.Decimal(14, 2) // Сумма НДС
|
||||
@@ -162,11 +167,26 @@ model Estimate {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
direction SurveyDirection @relation(fields: [directionId], references: [id])
|
||||
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
direction SurveyDirection @relation(fields: [directionId], references: [id])
|
||||
items EstimateItem[]
|
||||
totals EstimateTotal[]
|
||||
shares EstimateShare[]
|
||||
versions EstimateVersion[]
|
||||
}
|
||||
|
||||
// История версий сметы (снимок при сохранении/пересчёте)
|
||||
model EstimateVersion {
|
||||
id String @id @default(uuid())
|
||||
estimateId String
|
||||
versionNumber Int // Порядковый номер версии по смете
|
||||
snapshot Json // Полный снимок: estimate + items + totals
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
estimate Estimate @relation(fields: [estimateId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([estimateId])
|
||||
@@index([estimateId, createdAt])
|
||||
}
|
||||
|
||||
// Шаринг сметы с другим пользователем
|
||||
@@ -177,14 +197,29 @@ model EstimateShare {
|
||||
sharedWithId String // С кем поделились
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
estimate Estimate @relation(fields: [estimateId], references: [id], onDelete: Cascade)
|
||||
sharedWith User @relation("ShareReceiver", fields: [sharedWithId], references: [id], onDelete: Cascade)
|
||||
owner User @relation("ShareOwner", fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
estimate Estimate @relation(fields: [estimateId], references: [id], onDelete: Cascade)
|
||||
sharedWith User @relation("ShareReceiver", fields: [sharedWithId], references: [id], onDelete: Cascade)
|
||||
owner User @relation("ShareOwner", fields: [ownerId], references: [id], onDelete: Cascade)
|
||||
notes EstimateShareNote[]
|
||||
|
||||
@@unique([estimateId, sharedWithId])
|
||||
@@index([sharedWithId])
|
||||
}
|
||||
|
||||
// Заметки к шарингу сметы (кто что написал)
|
||||
model EstimateShareNote {
|
||||
id String @id @default(uuid())
|
||||
shareId String
|
||||
authorId String
|
||||
content String @db.Text
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
share EstimateShare @relation(fields: [shareId], references: [id], onDelete: Cascade)
|
||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([shareId])
|
||||
}
|
||||
|
||||
// Позиции сметы
|
||||
model EstimateItem {
|
||||
id String @id @default(uuid())
|
||||
|
||||
+12
@@ -219,10 +219,13 @@ exports.Prisma.EstimateScalarFieldEnum = {
|
||||
totalLaboratory: 'totalLaboratory',
|
||||
subtotal: 'subtotal',
|
||||
regionalCoef: 'regionalCoef',
|
||||
regionalCoefDocRef: 'regionalCoefDocRef',
|
||||
inflationIndex: 'inflationIndex',
|
||||
inflationDocRef: 'inflationDocRef',
|
||||
companyCoef: 'companyCoef',
|
||||
companyCoefDocRef: 'companyCoefDocRef',
|
||||
executorCoef: 'executorCoef',
|
||||
executorCoefDocRef: 'executorCoefDocRef',
|
||||
withVat: 'withVat',
|
||||
totalWithoutVat: 'totalWithoutVat',
|
||||
vatRate: 'vatRate',
|
||||
@@ -249,6 +252,14 @@ exports.Prisma.EstimateShareScalarFieldEnum = {
|
||||
createdAt: 'createdAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EstimateShareNoteScalarFieldEnum = {
|
||||
id: 'id',
|
||||
shareId: 'shareId',
|
||||
authorId: 'authorId',
|
||||
content: 'content',
|
||||
createdAt: 'createdAt'
|
||||
};
|
||||
|
||||
exports.Prisma.EstimateItemScalarFieldEnum = {
|
||||
id: 'id',
|
||||
estimateId: 'estimateId',
|
||||
@@ -355,6 +366,7 @@ exports.Prisma.ModelName = {
|
||||
Estimate: 'Estimate',
|
||||
EstimateVersion: 'EstimateVersion',
|
||||
EstimateShare: 'EstimateShare',
|
||||
EstimateShareNote: 'EstimateShareNote',
|
||||
EstimateItem: 'EstimateItem',
|
||||
EstimateTotal: 'EstimateTotal',
|
||||
Setting: 'Setting',
|
||||
|
||||
Generated
Vendored
Executable
BIN
Binary file not shown.
Generated
Vendored
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
Generated
Vendored
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user