Fix: estimates geo v2

This commit is contained in:
Arsen
2026-02-04 00:11:19 +05:00
commit 3f0086f88e
22567 changed files with 4348823 additions and 0 deletions

1
backend/node_modules/.prisma/client/default.d.ts generated vendored Executable file
View File

@@ -0,0 +1 @@
export * from "./index"

1
backend/node_modules/.prisma/client/default.js generated vendored Executable file
View File

@@ -0,0 +1 @@
module.exports = { ...require('.') }

9
backend/node_modules/.prisma/client/deno/edge.d.ts generated vendored Executable file
View File

@@ -0,0 +1,9 @@
class PrismaClient {
constructor() {
throw new Error(
'@prisma/client/deno/edge did not initialize yet. Please run "prisma generate" and try to import it again.',
)
}
}
export { PrismaClient }

1
backend/node_modules/.prisma/client/edge.d.ts generated vendored Executable file
View File

@@ -0,0 +1 @@
export * from "./default"

402
backend/node_modules/.prisma/client/edge.js generated vendored Executable file

File diff suppressed because one or more lines are too long

394
backend/node_modules/.prisma/client/index-browser.js generated vendored Executable file
View File

@@ -0,0 +1,394 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime,
skip
} = require('@prisma/client/runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.22.0
* Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
*/
Prisma.prismaVersion = {
client: "5.22.0",
engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.NotFoundError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.PriceBookScalarFieldEnum = {
id: 'id',
code: 'code',
name: 'name',
baseDate: 'baseDate',
approvedBy: 'approvedBy',
effectiveDate: 'effectiveDate',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.PriceTableScalarFieldEnum = {
id: 'id',
priceBookId: 'priceBookId',
tableNumber: 'tableNumber',
name: 'name',
unit: 'unit',
notes: 'notes',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.PriceItemScalarFieldEnum = {
id: 'id',
priceBookId: 'priceBookId',
priceTableId: 'priceTableId',
paragraph: 'paragraph',
workType: 'workType',
description: 'description',
priceField1: 'priceField1',
priceOffice1: 'priceOffice1',
priceField2: 'priceField2',
priceOffice2: 'priceOffice2',
priceField3: 'priceField3',
priceOffice3: 'priceOffice3',
priceSimple: 'priceSimple',
attributes: 'attributes',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CoefficientScalarFieldEnum = {
id: 'id',
type: 'type',
code: 'code',
name: 'name',
value: 'value',
description: 'description',
conditions: 'conditions',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.InflationIndexScalarFieldEnum = {
id: 'id',
baseDate: 'baseDate',
effectiveFrom: 'effectiveFrom',
effectiveTo: 'effectiveTo',
indexValue: 'indexValue',
documentRef: 'documentRef',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.UserScalarFieldEnum = {
id: 'id',
email: 'email',
passwordHash: 'passwordHash',
name: 'name',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.SurveyDirectionScalarFieldEnum = {
id: 'id',
code: 'code',
name: 'name',
shortName: 'shortName',
isActive: 'isActive'
};
exports.Prisma.EstimateScalarFieldEnum = {
id: 'id',
number: 'number',
directionId: 'directionId',
ownerId: 'ownerId',
objectName: 'objectName',
customer: 'customer',
executor: 'executor',
totalFieldWorks: 'totalFieldWorks',
totalOfficeWorks: 'totalOfficeWorks',
totalLaboratory: 'totalLaboratory',
subtotal: 'subtotal',
regionalCoef: 'regionalCoef',
inflationIndex: 'inflationIndex',
inflationDocRef: 'inflationDocRef',
companyCoef: 'companyCoef',
executorCoef: 'executorCoef',
withVat: 'withVat',
totalWithoutVat: 'totalWithoutVat',
vatRate: 'vatRate',
vatAmount: 'vatAmount',
totalWithVat: 'totalWithVat',
status: 'status',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EstimateVersionScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
versionNumber: 'versionNumber',
snapshot: 'snapshot',
createdAt: 'createdAt'
};
exports.Prisma.EstimateShareScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
ownerId: 'ownerId',
sharedWithId: 'sharedWithId',
createdAt: 'createdAt'
};
exports.Prisma.EstimateItemScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
orderNumber: 'orderNumber',
sectionType: 'sectionType',
priceItemId: 'priceItemId',
workName: 'workName',
justification: 'justification',
basePrice: 'basePrice',
quantity: 'quantity',
unit: 'unit',
coef1: 'coef1',
coef1Desc: 'coef1Desc',
coef2: 'coef2',
coef2Desc: 'coef2Desc',
coef3: 'coef3',
coef3Desc: 'coef3Desc',
totalPrice: 'totalPrice',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EstimateTotalScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
orderNumber: 'orderNumber',
label: 'label',
description: 'description',
baseValue: 'baseValue',
coefficient: 'coefficient',
resultValue: 'resultValue',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.SettingScalarFieldEnum = {
id: 'id',
key: 'key',
value: 'value',
type: 'type',
category: 'category',
label: 'label',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ChatSessionScalarFieldEnum = {
id: 'id',
userId: 'userId',
estimateId: 'estimateId',
status: 'status',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ChatMessageScalarFieldEnum = {
id: 'id',
sessionId: 'sessionId',
role: 'role',
content: 'content',
metadata: 'metadata',
createdAt: 'createdAt'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullableJsonNullValueInput = {
DbNull: Prisma.DbNull,
JsonNull: Prisma.JsonNull
};
exports.Prisma.JsonNullValueInput = {
JsonNull: Prisma.JsonNull
};
exports.Prisma.QueryMode = {
default: 'default',
insensitive: 'insensitive'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.JsonNullValueFilter = {
DbNull: Prisma.DbNull,
JsonNull: Prisma.JsonNull,
AnyNull: Prisma.AnyNull
};
exports.Prisma.ModelName = {
PriceBook: 'PriceBook',
PriceTable: 'PriceTable',
PriceItem: 'PriceItem',
Coefficient: 'Coefficient',
InflationIndex: 'InflationIndex',
User: 'User',
SurveyDirection: 'SurveyDirection',
Estimate: 'Estimate',
EstimateVersion: 'EstimateVersion',
EstimateShare: 'EstimateShare',
EstimateItem: 'EstimateItem',
EstimateTotal: 'EstimateTotal',
Setting: 'Setting',
ChatSession: 'ChatSession',
ChatMessage: 'ChatMessage'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

26001
backend/node_modules/.prisma/client/index.d.ts generated vendored Executable file

File diff suppressed because it is too large Load Diff

423
backend/node_modules/.prisma/client/index.js generated vendored Executable file

File diff suppressed because one or more lines are too long

97
backend/node_modules/.prisma/client/package.json generated vendored Executable file
View File

@@ -0,0 +1,97 @@
{
"name": "prisma-client-4b58c981519ea022802510544edb111bbd4ef5e4d3b50b2269f96083d9bf4ae3",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",
"exports": {
"./package.json": "./package.json",
".": {
"require": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./edge": {
"types": "./edge.d.ts",
"require": "./edge.js",
"import": "./edge.js",
"default": "./edge.js"
},
"./react-native": {
"types": "./react-native.d.ts",
"require": "./react-native.js",
"import": "./react-native.js",
"default": "./react-native.js"
},
"./extension": {
"types": "./extension.d.ts",
"require": "./extension.js",
"import": "./extension.js",
"default": "./extension.js"
},
"./index-browser": {
"types": "./index.d.ts",
"require": "./index-browser.js",
"import": "./index-browser.js",
"default": "./index-browser.js"
},
"./index": {
"types": "./index.d.ts",
"require": "./index.js",
"import": "./index.js",
"default": "./index.js"
},
"./wasm": {
"types": "./wasm.d.ts",
"require": "./wasm.js",
"import": "./wasm.js",
"default": "./wasm.js"
},
"./runtime/library": {
"types": "./runtime/library.d.ts",
"require": "./runtime/library.js",
"import": "./runtime/library.js",
"default": "./runtime/library.js"
},
"./runtime/binary": {
"types": "./runtime/binary.d.ts",
"require": "./runtime/binary.js",
"import": "./runtime/binary.js",
"default": "./runtime/binary.js"
},
"./generator-build": {
"require": "./generator-build/index.js",
"import": "./generator-build/index.js",
"default": "./generator-build/index.js"
},
"./sql": {
"require": {
"types": "./sql.d.ts",
"node": "./sql.js",
"default": "./sql.js"
},
"import": {
"types": "./sql.d.ts",
"node": "./sql.mjs",
"default": "./sql.mjs"
},
"default": "./sql.js"
},
"./*": "./*"
},
"version": "5.22.0",
"sideEffects": false
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

280
backend/node_modules/.prisma/client/schema.prisma generated vendored Executable file
View File

@@ -0,0 +1,280 @@
// Prisma schema for Estimate Assistant
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
// Справочники базовых цен
model PriceBook {
id String @id @default(uuid())
code String @unique // SBC-GEODESY-2004, SBC-GEOLOGY-1999
name String // Полное название справочника
baseDate DateTime // Дата базовых цен (01.01.2001, 01.01.1991)
approvedBy String? // Кем утвержден
effectiveDate DateTime? // Дата введения в действие
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tables PriceTable[]
items PriceItem[]
}
// Таблицы справочников
model PriceTable {
id String @id @default(uuid())
priceBookId String
tableNumber Int // Номер таблицы (8, 9, 13, и т.д.)
name String // Название таблицы
unit String // Единица измерения (1 пункт, 1 га, 1 км и т.д.)
notes Json? // Примечания к таблице
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
priceBook PriceBook @relation(fields: [priceBookId], references: [id], onDelete: Cascade)
items PriceItem[]
@@unique([priceBookId, tableNumber])
}
// Позиции справочников (расценки)
model PriceItem {
id String @id @default(uuid())
priceBookId String
priceTableId String
paragraph String // Номер параграфа (8-1, 9-4-1 и т.д.)
workType String // Тип работы / наименование
description String? // Дополнительное описание
// Цены (полевые/камеральные для разных категорий)
priceField1 Decimal? @db.Decimal(12, 2) // Полевые работы, категория 1
priceOffice1 Decimal? @db.Decimal(12, 2) // Камеральные работы, категория 1
priceField2 Decimal? @db.Decimal(12, 2) // Полевые работы, категория 2
priceOffice2 Decimal? @db.Decimal(12, 2) // Камеральные работы, категория 2
priceField3 Decimal? @db.Decimal(12, 2) // Полевые работы, категория 3
priceOffice3 Decimal? @db.Decimal(12, 2) // Камеральные работы, категория 3
priceSimple Decimal? @db.Decimal(12, 2) // Простая цена (без категорий)
// Дополнительные параметры
attributes Json? // Доп. атрибуты (масштаб, глубина, диаметр и т.д.)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
priceBook PriceBook @relation(fields: [priceBookId], references: [id], onDelete: Cascade)
priceTable PriceTable @relation(fields: [priceTableId], references: [id], onDelete: Cascade)
estimateItems EstimateItem[]
@@index([paragraph])
@@index([workType])
}
// Коэффициенты
model Coefficient {
id String @id @default(uuid())
type String // regional, transport_internal, transport_external, seasonal, special
code String // Уникальный код коэффициента
name String // Название
value Decimal @db.Decimal(6, 4) // Значение коэффициента
description String? // Описание
conditions Json? // Условия применения
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([type, code])
}
// Индексы инфляции (перевод в текущие цены)
model InflationIndex {
id String @id @default(uuid())
baseDate DateTime // Базовая дата цен
effectiveFrom DateTime // Дата начала действия индекса
effectiveTo DateTime? // Дата окончания (null = текущий)
indexValue Decimal @db.Decimal(10, 4) // Значение индекса
documentRef String? // Ссылка на документ (Письмо Минстроя и т.д.)
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// Пользователи
model User {
id String @id @default(uuid())
email String @unique
passwordHash String
name String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
estimates Estimate[]
chatSessions ChatSession[]
ownedShares EstimateShare[] @relation("ShareOwner")
receivedShares EstimateShare[] @relation("ShareReceiver")
}
// Направления изысканий
model SurveyDirection {
id String @id @default(uuid())
code String @unique // geodesy, geology, ecology, hydrology
name String // Инженерно-геодезические изыскания
shortName String // Геодезия
isActive Boolean @default(true)
estimates Estimate[]
}
// Сметы
model Estimate {
id String @id @default(uuid())
number String // Номер сметы
directionId String
ownerId String // Владелец сметы
objectName String // Название объекта
customer String // Заказчик
executor String // Исполнитель
// Итоговые значения
totalFieldWorks Decimal? @db.Decimal(14, 2) // Итого полевые работы
totalOfficeWorks Decimal? @db.Decimal(14, 2) // Итого камеральные работы
totalLaboratory Decimal? @db.Decimal(14, 2) // Итого лабораторные
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) // Коэффициент исполнителя
// Итоги
totalWithoutVat Decimal? @db.Decimal(14, 2) // Итого без НДС
vatRate Decimal? @db.Decimal(4, 2) // Ставка НДС (18, 20, 7)
vatAmount Decimal? @db.Decimal(14, 2) // Сумма НДС
totalWithVat Decimal? @db.Decimal(14, 2) // Всего с НДС
status String @default("draft") // draft, completed, approved
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
direction SurveyDirection @relation(fields: [directionId], references: [id])
items EstimateItem[]
totals EstimateTotal[]
shares EstimateShare[]
}
// Шаринг сметы с другим пользователем
model EstimateShare {
id String @id @default(uuid())
estimateId String
ownerId String // Кто поделился
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)
@@unique([estimateId, sharedWithId])
@@index([sharedWithId])
}
// Позиции сметы
model EstimateItem {
id String @id @default(uuid())
estimateId String
orderNumber Int // Порядковый номер
sectionType String // field, office, laboratory, transport, other
priceItemId String? // Ссылка на позицию справочника
workName String // Наименование работы
justification String? // Обоснование (ссылка на СБЦ)
basePrice Decimal @db.Decimal(12, 2) // Базовая цена
quantity Decimal @db.Decimal(12, 4) // Объем
unit String? // Единица измерения
// Коэффициенты
coef1 Decimal? @db.Decimal(6, 4) // Коэффициент 1
coef1Desc String? // Описание коэффициента 1
coef2 Decimal? @db.Decimal(6, 4) // Коэффициент 2
coef2Desc String? // Описание коэффициента 2
coef3 Decimal? @db.Decimal(6, 4) // Коэффициент 3
coef3Desc String? // Описание коэффициента 3
totalPrice Decimal @db.Decimal(14, 2) // Итоговая стоимость
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
estimate Estimate @relation(fields: [estimateId], references: [id], onDelete: Cascade)
priceItem PriceItem? @relation(fields: [priceItemId], references: [id])
@@index([estimateId, orderNumber])
}
// Итоговая часть сметы (нижняя часть)
model EstimateTotal {
id String @id @default(uuid())
estimateId String
orderNumber Int // Порядок строки
label String // Название строки (Перевод в текущие цены, НДС и т.д.)
description String? // Дополнительное описание
baseValue Decimal? @db.Decimal(14, 2) // Базовое значение
coefficient Decimal? @db.Decimal(10, 4) // Коэффициент/процент
resultValue Decimal @db.Decimal(14, 2) // Результат
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
estimate Estimate @relation(fields: [estimateId], references: [id], onDelete: Cascade)
@@index([estimateId, orderNumber])
}
// Настройки приложения
model Setting {
id String @id @default(uuid())
key String @unique
value String
type String @default("string") // string, number, boolean, json
category String // general, company, ai, display
label String? // Человекочитаемое название
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// Сессии чата (у каждого пользователя свои контексты ИИ)
model ChatSession {
id String @id @default(uuid())
userId String // Владелец сессии
estimateId String? // Связанная смета (опционально)
status String @default("active") // active, completed
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
messages ChatMessage[]
@@index([userId])
@@index([userId, estimateId])
}
// Сообщения чата
model ChatMessage {
id String @id @default(uuid())
sessionId String
role String // user, assistant, system
content String
metadata Json? // Доп. данные (извлеченные сущности и т.д.)
createdAt DateTime @default(now())
session ChatSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
@@index([sessionId, createdAt])
}

1
backend/node_modules/.prisma/client/wasm.d.ts generated vendored Executable file
View File

@@ -0,0 +1 @@
export * from "./index"

394
backend/node_modules/.prisma/client/wasm.js generated vendored Executable file
View File

@@ -0,0 +1,394 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime,
skip
} = require('@prisma/client/runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.22.0
* Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
*/
Prisma.prismaVersion = {
client: "5.22.0",
engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.NotFoundError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.PriceBookScalarFieldEnum = {
id: 'id',
code: 'code',
name: 'name',
baseDate: 'baseDate',
approvedBy: 'approvedBy',
effectiveDate: 'effectiveDate',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.PriceTableScalarFieldEnum = {
id: 'id',
priceBookId: 'priceBookId',
tableNumber: 'tableNumber',
name: 'name',
unit: 'unit',
notes: 'notes',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.PriceItemScalarFieldEnum = {
id: 'id',
priceBookId: 'priceBookId',
priceTableId: 'priceTableId',
paragraph: 'paragraph',
workType: 'workType',
description: 'description',
priceField1: 'priceField1',
priceOffice1: 'priceOffice1',
priceField2: 'priceField2',
priceOffice2: 'priceOffice2',
priceField3: 'priceField3',
priceOffice3: 'priceOffice3',
priceSimple: 'priceSimple',
attributes: 'attributes',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.CoefficientScalarFieldEnum = {
id: 'id',
type: 'type',
code: 'code',
name: 'name',
value: 'value',
description: 'description',
conditions: 'conditions',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.InflationIndexScalarFieldEnum = {
id: 'id',
baseDate: 'baseDate',
effectiveFrom: 'effectiveFrom',
effectiveTo: 'effectiveTo',
indexValue: 'indexValue',
documentRef: 'documentRef',
isActive: 'isActive',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.UserScalarFieldEnum = {
id: 'id',
email: 'email',
passwordHash: 'passwordHash',
name: 'name',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.SurveyDirectionScalarFieldEnum = {
id: 'id',
code: 'code',
name: 'name',
shortName: 'shortName',
isActive: 'isActive'
};
exports.Prisma.EstimateScalarFieldEnum = {
id: 'id',
number: 'number',
directionId: 'directionId',
ownerId: 'ownerId',
objectName: 'objectName',
customer: 'customer',
executor: 'executor',
totalFieldWorks: 'totalFieldWorks',
totalOfficeWorks: 'totalOfficeWorks',
totalLaboratory: 'totalLaboratory',
subtotal: 'subtotal',
regionalCoef: 'regionalCoef',
inflationIndex: 'inflationIndex',
inflationDocRef: 'inflationDocRef',
companyCoef: 'companyCoef',
executorCoef: 'executorCoef',
withVat: 'withVat',
totalWithoutVat: 'totalWithoutVat',
vatRate: 'vatRate',
vatAmount: 'vatAmount',
totalWithVat: 'totalWithVat',
status: 'status',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EstimateVersionScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
versionNumber: 'versionNumber',
snapshot: 'snapshot',
createdAt: 'createdAt'
};
exports.Prisma.EstimateShareScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
ownerId: 'ownerId',
sharedWithId: 'sharedWithId',
createdAt: 'createdAt'
};
exports.Prisma.EstimateItemScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
orderNumber: 'orderNumber',
sectionType: 'sectionType',
priceItemId: 'priceItemId',
workName: 'workName',
justification: 'justification',
basePrice: 'basePrice',
quantity: 'quantity',
unit: 'unit',
coef1: 'coef1',
coef1Desc: 'coef1Desc',
coef2: 'coef2',
coef2Desc: 'coef2Desc',
coef3: 'coef3',
coef3Desc: 'coef3Desc',
totalPrice: 'totalPrice',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.EstimateTotalScalarFieldEnum = {
id: 'id',
estimateId: 'estimateId',
orderNumber: 'orderNumber',
label: 'label',
description: 'description',
baseValue: 'baseValue',
coefficient: 'coefficient',
resultValue: 'resultValue',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.SettingScalarFieldEnum = {
id: 'id',
key: 'key',
value: 'value',
type: 'type',
category: 'category',
label: 'label',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ChatSessionScalarFieldEnum = {
id: 'id',
userId: 'userId',
estimateId: 'estimateId',
status: 'status',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};
exports.Prisma.ChatMessageScalarFieldEnum = {
id: 'id',
sessionId: 'sessionId',
role: 'role',
content: 'content',
metadata: 'metadata',
createdAt: 'createdAt'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullableJsonNullValueInput = {
DbNull: Prisma.DbNull,
JsonNull: Prisma.JsonNull
};
exports.Prisma.JsonNullValueInput = {
JsonNull: Prisma.JsonNull
};
exports.Prisma.QueryMode = {
default: 'default',
insensitive: 'insensitive'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.JsonNullValueFilter = {
DbNull: Prisma.DbNull,
JsonNull: Prisma.JsonNull,
AnyNull: Prisma.AnyNull
};
exports.Prisma.ModelName = {
PriceBook: 'PriceBook',
PriceTable: 'PriceTable',
PriceItem: 'PriceItem',
Coefficient: 'Coefficient',
InflationIndex: 'InflationIndex',
User: 'User',
SurveyDirection: 'SurveyDirection',
Estimate: 'Estimate',
EstimateVersion: 'EstimateVersion',
EstimateShare: 'EstimateShare',
EstimateItem: 'EstimateItem',
EstimateTotal: 'EstimateTotal',
Setting: 'Setting',
ChatSession: 'ChatSession',
ChatMessage: 'ChatMessage'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)