Добавлены модели WildberriesSupply и WildberriesSupplyCard в схему Prisma, а также соответствующие мутации и запросы в GraphQL для управления поставками Wildberries. Обновлены компоненты создания поставки для поддержки выбора карточек товаров и улучшен интерфейс. Реализована логика обработки карточек товаров и их отображения.

This commit is contained in:
Bivekich
2025-07-21 12:45:03 +03:00
parent 39c1499f72
commit d74b4c1266
9 changed files with 1115 additions and 7 deletions

View File

@ -97,6 +97,7 @@ model Organization {
supplies Supply[]
users User[]
logistics Logistics[]
wildberriesSupplies WildberriesSupply[]
@@map("organizations")
}
@ -322,6 +323,46 @@ model EmployeeSchedule {
@@map("employee_schedules")
}
model WildberriesSupply {
id String @id @default(cuid())
organizationId String
deliveryDate DateTime?
status WildberriesSupplyStatus @default(DRAFT)
totalAmount Decimal @db.Decimal(12, 2)
totalItems Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
cards WildberriesSupplyCard[]
@@map("wildberries_supplies")
}
model WildberriesSupplyCard {
id String @id @default(cuid())
supplyId String
nmId String
vendorCode String
title String
brand String?
price Decimal @db.Decimal(12, 2)
discountedPrice Decimal? @db.Decimal(12, 2)
quantity Int
selectedQuantity Int
selectedMarket String?
selectedPlace String?
sellerName String?
sellerPhone String?
deliveryDate DateTime?
mediaFiles Json @default("[]")
selectedServices Json @default("[]")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
supply WildberriesSupply @relation(fields: [supplyId], references: [id], onDelete: Cascade)
@@map("wildberries_supply_cards")
}
enum OrganizationType {
FULFILLMENT
SELLER
@ -363,6 +404,14 @@ enum ScheduleStatus {
ABSENT
}
enum WildberriesSupplyStatus {
DRAFT
CREATED
IN_PROGRESS
DELIVERED
CANCELLED
}
model Logistics {
id String @id @default(cuid())
fromLocation String