feat(admin): implement order and customer operations experience
Some checks failed
Architecture Governance / architecture (push) Has been cancelled

Orders dashboard (real orders-today/pending/paid/cancelled/refunded/customers/returning-customers/average-order/recent-activity/system-alerts, computed from the full order book not just the current page); orders list gains density, saved column visibility, bulk status change/archive/delete/export/print alongside existing search+status filter+pagination, sticky table header; order detail gets a visual status workflow stepper in business language (Pending/Packing/Shipping/Completed, with Cancelled/Refunded as terminal states) and a reusable OrderTimelineComponent replacing the flat text log; added a derived Customers feature (list + profile detail: statistics/lifetime value/addresses/orders/activity/notes) built entirely by grouping existing AdminOrder records by email - no new backend, no invented gateway, since no customer entity existed. Added archive/restore/delete to the orders gateway (soft-delete pattern mirroring categories) and filled in the adminOrders/adminCustomers i18n namespaces, which previously didn't exist at all (every adminOrders.* label was rendering as a raw key).
This commit is contained in:
sdarbinyan
2026-07-18 21:47:54 +04:00
parent ac615837ab
commit 097927f124
30 changed files with 1218 additions and 36 deletions

View File

@@ -1140,6 +1140,82 @@ export const en: Translations = {
optionalDataMissingDescription: 'Optional configuration data is absent.',
optionalDataMissingResolution: 'Add optional value if UX depends on it.',
},
adminOrders: {
back: 'Back to orders',
search: 'Search by order number, name, email, or phone…',
export: 'Export',
view: 'View',
orderNumber: 'Order',
customer: 'Customer',
payment: 'Payment',
delivery: 'Delivery',
trackingNumber: 'Tracking number',
createdAt: 'Placed',
items: 'Items',
timeline: 'Timeline',
notes: 'Notes to customer',
internalNotes: 'Internal notes',
addNote: 'Add note',
changeStatus: 'Change status',
applyStatus: 'Apply',
archiveSelected: 'Archive',
printSelected: 'Print',
printInvoice: 'Print invoice',
requestRefund: 'Request refund',
cancelOrder: 'Cancel order',
confirmCancel: 'Cancel this order?',
confirmRefund: 'Request a refund for this order?',
emptyTitle: 'No orders yet',
emptyDescription: 'Orders will show up here as customers check out.',
column_customer: 'Customer',
column_status: 'Status',
column_payment: 'Payment',
column_total: 'Total',
column_created: 'Placed',
status: {
pending: 'Pending',
processing: 'Packing',
shipped: 'Shipping',
delivered: 'Completed',
cancelled: 'Cancelled',
refunded: 'Refunded',
},
paymentStatus: {
unpaid: 'Unpaid',
paid: 'Paid',
refund_requested: 'Refund requested',
refunded: 'Refunded',
},
ordersToday: 'Orders today',
paidCount: 'Paid',
customersCount: 'Customers',
returningCustomers: 'Returning customers',
averageOrder: 'Average order',
recentActivity: 'Recent activity',
noRecentActivity: 'No activity yet.',
alertStuckPending: 'orders have been pending for over 48 hours',
alertRefundRequested: 'orders have a refund request waiting',
},
adminCustomers: {
search: 'Search by name, email, or phone…',
name: 'Name',
email: 'Email',
phone: 'Phone',
orderCount: 'Orders',
lifetimeValue: 'Lifetime value',
returning: 'Returning',
profile: 'Profile',
statistics: 'Statistics',
firstOrder: 'First order',
lastOrder: 'Last order',
addresses: 'Addresses',
notes: 'Notes',
notesUnavailable: 'No customer-level notes yet — add a note on one of their orders instead.',
orders: 'Orders',
activity: 'Activity',
emptyTitle: 'No customers yet',
emptyDescription: 'Customers appear here once they place their first order.',
},
mediaLibrary: {
title: 'Media Library',
upload: 'Upload',
@@ -1464,6 +1540,7 @@ export const en: Translations = {
products: 'Products',
categories: 'Categories',
orders: 'Orders',
customers: 'Customers',
transactions: 'Transactions',
reviews: 'Reviews',
reports: 'Reports',
@@ -1502,6 +1579,8 @@ export const en: Translations = {
categoryEdit: { title: 'Edit category', description: 'Change this category\'s details' },
orders: { title: 'Orders', description: 'View and process customer orders' },
orderDetail: { title: 'Order', description: 'Order details and status' },
customers: { title: 'Customers', description: 'Everyone who has placed an order' },
customerDetail: { title: 'Customer', description: 'Customer profile, orders, and activity' },
transactions: { title: 'Transactions', description: 'Payments, refunds, and fraud review' },
media: { title: 'Media Library', description: 'Images and files for products and pages' },
users: { title: 'Users', description: 'Admin team members and permissions' },