diff --git a/src/components/messenger/messenger-attachments.tsx b/src/components/messenger/messenger-attachments.tsx
index b841ef9..967d84d 100644
--- a/src/components/messenger/messenger-attachments.tsx
+++ b/src/components/messenger/messenger-attachments.tsx
@@ -137,7 +137,7 @@ export function MessengerAttachments({ counterparty, onViewChange }: MessengerAt
const renderFileIcon = (fileType?: string) => {
if (!fileType) return
- if (fileType.startsWith('image/')) return
+ if (fileType.startsWith('image/')) return
if (fileType.startsWith('audio/')) return
if (fileType.startsWith('video/')) return
return
@@ -207,7 +207,7 @@ export function MessengerAttachments({ counterparty, onViewChange }: MessengerAt
className="w-full h-full object-cover"
/>
diff --git a/src/components/supplies/create-supply-form.tsx b/src/components/supplies/create-supply-form.tsx
index 61a6a38..81dcf6b 100644
--- a/src/components/supplies/create-supply-form.tsx
+++ b/src/components/supplies/create-supply-form.tsx
@@ -16,6 +16,7 @@ import {
Star
} from 'lucide-react'
import { WBProductCards } from './wb-product-cards'
+import { SelectedCard, WildberriesCard } from '@/types/supplies'
// import { WholesalerSelection } from './wholesaler-selection'
interface Wholesaler {
@@ -32,33 +33,7 @@ interface Wholesaler {
specialization: string[]
}
-interface WildberriesCard {
- nmID: number
- vendorCode: string
- title: string
- description: string
- brand: string
- mediaFiles: string[]
- sizes: Array<{
- chrtID: number
- techSize: string
- wbSize: string
- price: number
- discountedPrice: number
- quantity: number
- }>
-}
-interface SelectedCard {
- card: WildberriesCard
- selectedQuantity: number
- selectedMarket: string
- selectedPlace: string
- sellerName: string
- sellerPhone: string
- deliveryDate: string
- selectedServices: string[]
-}
interface CreateSupplyFormProps {
onClose: () => void
diff --git a/src/components/supplies/wb-product-cards.tsx b/src/components/supplies/wb-product-cards.tsx
index eba7330..1aa451d 100644
--- a/src/components/supplies/wb-product-cards.tsx
+++ b/src/components/supplies/wb-product-cards.tsx
@@ -34,46 +34,9 @@ import { apolloClient } from '@/lib/apollo-client'
import { GET_MY_COUNTERPARTIES, GET_COUNTERPARTY_SERVICES, GET_COUNTERPARTY_SUPPLIES } from '@/graphql/queries'
import { CREATE_WILDBERRIES_SUPPLY } from '@/graphql/mutations'
import { toast } from 'sonner'
+import { SelectedCard, FulfillmentService, ConsumableService, WildberriesCard } from '@/types/supplies'
-interface WildberriesCard {
- nmID: number
- vendorCode: string
- sizes: Array<{
- chrtID: number
- techSize: string
- wbSize: string
- price: number
- discountedPrice: number
- quantity: number
- }>
- mediaFiles: string[]
- object: string
- parent: string
- countryProduction: string
- supplierVendorCode: string
- brand: string
- title: string
- description: string
-}
-interface SelectedCard {
- card: WildberriesCard
- selectedQuantity: number
- customPrice: number // Пользовательская цена за все количество
- selectedFulfillmentOrg: string // ID выбранной FF организации
- selectedFulfillmentServices: string[] // ID выбранных услуг FF (множественный выбор)
- selectedConsumableOrg: string // ID выбранной организации расходников
- selectedConsumableServices: string[] // ID выбранных расходников (множественный выбор)
- deliveryDate: string
-}
-
-interface FulfillmentService {
- id: string
- name: string
- description?: string
- price: number
- organizationName: string
-}
interface Organization {
id: string
@@ -519,7 +482,12 @@ export function WBProductCards({ onBack, onComplete }: WBProductCardsProps) {
selectedFulfillmentServices: [],
selectedConsumableOrg: '',
selectedConsumableServices: [],
- deliveryDate: ''
+ deliveryDate: '',
+ selectedMarket: '',
+ selectedPlace: '',
+ sellerName: '',
+ sellerPhone: '',
+ selectedServices: []
}
return [...prev, newSelectedCard]
}
diff --git a/src/types/supplies.ts b/src/types/supplies.ts
new file mode 100644
index 0000000..4da63a7
--- /dev/null
+++ b/src/types/supplies.ts
@@ -0,0 +1,55 @@
+export interface WildberriesCard {
+ nmID: number
+ vendorCode: string
+ sizes: Array<{
+ chrtID: number
+ techSize: string
+ wbSize: string
+ price: number
+ discountedPrice: number
+ quantity: number
+ }>
+ mediaFiles: string[]
+ object: string
+ parent: string
+ countryProduction: string
+ supplierVendorCode: string
+ brand: string
+ title: string
+ description: string
+}
+
+export interface SelectedCard {
+ card: WildberriesCard
+ selectedQuantity: number
+ customPrice: number // Пользовательская цена за все количество
+ selectedFulfillmentOrg: string // ID выбранной FF организации
+ selectedFulfillmentServices: string[] // ID выбранных услуг FF (множественный выбор)
+ selectedConsumableOrg: string // ID выбранной организации расходников
+ selectedConsumableServices: string[] // ID выбранных расходников (множественный выбор)
+ deliveryDate: string
+ selectedMarket: string
+ selectedPlace: string
+ sellerName: string
+ sellerPhone: string
+ selectedServices: string[]
+}
+
+export interface FulfillmentService {
+ id: string
+ name: string
+ description?: string
+ price: number
+ organizationName: string
+ organizationId: string
+}
+
+export interface ConsumableService {
+ id: string
+ name: string
+ description?: string
+ price: number
+ unit: string
+ organizationName: string
+ organizationId: string
+}
\ No newline at end of file