feat: Implement comprehensive three-party supply order workflow system

- Added logistics partner selection as mandatory requirement for fulfillment supply orders
- Implemented complete status workflow: PENDING → SUPPLIER_APPROVED → LOGISTICS_CONFIRMED → SHIPPED → DELIVERED
- Created dedicated interfaces for all three parties:
  * Fulfillment: Create orders with mandatory logistics selection and receive shipments
  * Suppliers: View, approve/reject orders, and ship approved orders via /supplies tab
  * Logistics: Confirm/reject transport requests via new /logistics-orders dashboard
- Updated Prisma schema with logisticsPartnerId (non-nullable) and new SupplyOrderStatus enum
- Added comprehensive GraphQL mutations for each party's workflow actions
- Fixed GraphQL resolver to include logistics partners in supplyOrders query
- Enhanced UI components with proper status badges and action buttons
- Added backward compatibility for legacy status handling
- Updated sidebar navigation routing for LOGIST organization type

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Bivekich
2025-07-31 12:19:19 +03:00
parent 4147d85b36
commit 772e135ad1
13 changed files with 2589 additions and 74 deletions

View File

@ -1363,3 +1363,130 @@ export const SAVE_SELLER_STATS_CACHE = gql`
}
}
`;
// Новые мутации для управления заказами поставок
export const SUPPLIER_APPROVE_ORDER = gql`
mutation SupplierApproveOrder($id: ID!) {
supplierApproveOrder(id: $id) {
success
message
order {
id
status
deliveryDate
totalAmount
totalItems
partner {
id
name
fullName
}
logisticsPartner {
id
name
fullName
}
}
}
}
`;
export const SUPPLIER_REJECT_ORDER = gql`
mutation SupplierRejectOrder($id: ID!, $reason: String) {
supplierRejectOrder(id: $id, reason: $reason) {
success
message
order {
id
status
}
}
}
`;
export const SUPPLIER_SHIP_ORDER = gql`
mutation SupplierShipOrder($id: ID!) {
supplierShipOrder(id: $id) {
success
message
order {
id
status
deliveryDate
partner {
id
name
fullName
}
logisticsPartner {
id
name
fullName
}
}
}
}
`;
export const LOGISTICS_CONFIRM_ORDER = gql`
mutation LogisticsConfirmOrder($id: ID!) {
logisticsConfirmOrder(id: $id) {
success
message
order {
id
status
deliveryDate
partner {
id
name
fullName
}
logisticsPartner {
id
name
fullName
}
}
}
}
`;
export const LOGISTICS_REJECT_ORDER = gql`
mutation LogisticsRejectOrder($id: ID!, $reason: String) {
logisticsRejectOrder(id: $id, reason: $reason) {
success
message
order {
id
status
}
}
}
`;
export const FULFILLMENT_RECEIVE_ORDER = gql`
mutation FulfillmentReceiveOrder($id: ID!) {
fulfillmentReceiveOrder(id: $id) {
success
message
order {
id
status
deliveryDate
totalAmount
totalItems
partner {
id
name
fullName
}
logisticsPartner {
id
name
fullName
}
}
}
}
`;