first commit
This commit is contained in:
@ -84,7 +84,7 @@ const autoCreateWarehouseEntry = async (sellerId: string, fulfillmentId: string)
|
||||
products: [], // Пустой массив продуктов
|
||||
}
|
||||
|
||||
console.warn(`✅ AUTO WAREHOUSE ENTRY CREATED:`, {
|
||||
console.warn('✅ AUTO WAREHOUSE ENTRY CREATED:', {
|
||||
sellerId,
|
||||
storeName: warehouseEntry.storeName,
|
||||
storeOwner: warehouseEntry.storeOwner,
|
||||
@ -933,7 +933,7 @@ export const resolvers = {
|
||||
userId: context.user.id,
|
||||
organizationType: currentUser.organization.type,
|
||||
organizationId: currentUser.organization.id,
|
||||
organizationName: currentUser.organization.name
|
||||
organizationName: currentUser.organization.name,
|
||||
})
|
||||
|
||||
try {
|
||||
@ -990,7 +990,7 @@ export const resolvers = {
|
||||
acc[order.status] = (acc[order.status] || 0) + 1
|
||||
return acc
|
||||
}, {}),
|
||||
orderIds: orders.map(o => o.id)
|
||||
orderIds: orders.map(o => o.id),
|
||||
})
|
||||
|
||||
return orders
|
||||
@ -1770,7 +1770,7 @@ export const resolvers = {
|
||||
// Получаем всех партнеров-селлеров
|
||||
const counterparties = await prisma.counterparty.findMany({
|
||||
where: {
|
||||
organizationId: currentUser.organization.id
|
||||
organizationId: currentUser.organization.id,
|
||||
},
|
||||
include: {
|
||||
counterparty: true,
|
||||
@ -2678,14 +2678,14 @@ export const resolvers = {
|
||||
...item,
|
||||
recipe,
|
||||
}
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
return {
|
||||
...order,
|
||||
items: processedItems,
|
||||
}
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
console.warn('✅ Данные обработаны для многоуровневой таблицы')
|
||||
@ -3868,7 +3868,7 @@ export const resolvers = {
|
||||
await autoCreateWarehouseEntry(request.senderId, request.receiverId)
|
||||
console.warn(`✅ AUTO WAREHOUSE ENTRY: Created for seller ${request.senderId} with fulfillment ${request.receiverId}`)
|
||||
} catch (error) {
|
||||
console.error(`❌ AUTO WAREHOUSE ENTRY ERROR:`, error)
|
||||
console.error('❌ AUTO WAREHOUSE ENTRY ERROR:', error)
|
||||
// Не прерываем основной процесс, если не удалось создать запись склада
|
||||
}
|
||||
} else if (request.sender.type === 'FULFILLMENT' && request.receiver.type === 'SELLER') {
|
||||
@ -3877,7 +3877,7 @@ export const resolvers = {
|
||||
await autoCreateWarehouseEntry(request.receiverId, request.senderId)
|
||||
console.warn(`✅ AUTO WAREHOUSE ENTRY: Created for seller ${request.receiverId} with fulfillment ${request.senderId}`)
|
||||
} catch (error) {
|
||||
console.error(`❌ AUTO WAREHOUSE ENTRY ERROR:`, error)
|
||||
console.error('❌ AUTO WAREHOUSE ENTRY ERROR:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5089,7 +5089,7 @@ export const resolvers = {
|
||||
console.warn('🔍 Автоматическое определение типа расходников:', {
|
||||
organizationType: currentUser.organization.type,
|
||||
consumableType: consumableType,
|
||||
inputType: args.input.consumableType // Для отладки
|
||||
inputType: args.input.consumableType, // Для отладки
|
||||
})
|
||||
|
||||
// Подготавливаем данные для создания заказа
|
||||
@ -5188,7 +5188,7 @@ export const resolvers = {
|
||||
toAddress: fulfillmentCenterId ?
|
||||
(await prisma.organization.findUnique({
|
||||
where: { id: fulfillmentCenterId },
|
||||
select: { addressFull: true, address: true }
|
||||
select: { addressFull: true, address: true },
|
||||
}))?.addressFull || null : null,
|
||||
status: 'pending',
|
||||
createdDate: new Date(),
|
||||
|
Reference in New Issue
Block a user