feat: order revision, rial wage from variant, product tags; drop user-app-v2
Admin order edit with category chips and timeline; customer checkout charges variant rialWage; product tags; retire the unused user-app-v2 tree. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
// Mirrors apps/user-app/src/utils/orderStatus.ts — same labels, blurbs and
|
||||
// colors so the admin status modal feels like the customer timeline sheet.
|
||||
import type { Component } from 'vue';
|
||||
import {
|
||||
CarOutlined,
|
||||
CheckCircleOutlined,
|
||||
CloseCircleOutlined,
|
||||
FileDoneOutlined,
|
||||
GiftOutlined,
|
||||
InboxOutlined,
|
||||
PauseCircleOutlined,
|
||||
SafetyCertificateOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
|
||||
export const ORDER_STATUS_LABELS: Record<string, string> = {
|
||||
SUSPENDED: 'معلق',
|
||||
PLACED: 'ثبت سفارش',
|
||||
ADMIN_APPROVED: 'تایید مدیر',
|
||||
SOURCING: 'در حال تامین',
|
||||
PREPARING: 'آمادهسازی',
|
||||
DELIVERED_TO_AGENT: 'تحویل نماینده',
|
||||
DELIVERED_TO_CUSTOMER: 'تحویل مشتری',
|
||||
CANCELLED: 'لغو شده',
|
||||
};
|
||||
|
||||
export const ORDER_STATUS_BLURBS: Record<string, string> = {
|
||||
SUSPENDED: 'سفارش بهدلیل سقف اعتبار معلق شد',
|
||||
PLACED: 'سفارش ثبت و دریافت شد',
|
||||
ADMIN_APPROVED: 'سفارش توسط مدیر تایید شد',
|
||||
SOURCING: 'کالا در حال تامین است',
|
||||
PREPARING: 'سفارش در حال آمادهسازی است',
|
||||
DELIVERED_TO_AGENT: 'تحویل به نماینده فروش انجام شد',
|
||||
DELIVERED_TO_CUSTOMER: 'سفارش به مشتری تحویل شد',
|
||||
CANCELLED: 'سفارش لغو شده است',
|
||||
};
|
||||
|
||||
export const ORDER_STATUS_COLORS: Record<string, { font: string; background: string }> = {
|
||||
SUSPENDED: { font: '#A16207', background: '#A162071F' },
|
||||
PLACED: { font: '#3B82F6', background: '#3B82F61F' },
|
||||
ADMIN_APPROVED: { font: '#6366F1', background: '#6366F11F' },
|
||||
SOURCING: { font: '#EAB308', background: '#EAB3081F' },
|
||||
PREPARING: { font: '#F97316', background: '#F973161F' },
|
||||
DELIVERED_TO_AGENT: { font: '#06B6D4', background: '#06B6D41F' },
|
||||
DELIVERED_TO_CUSTOMER: { font: '#22C55E', background: '#22C55E1F' },
|
||||
CANCELLED: { font: '#DC2626', background: '#DC26261F' },
|
||||
};
|
||||
|
||||
export const ORDER_STATUS_ICONS: Record<string, Component> = {
|
||||
SUSPENDED: PauseCircleOutlined,
|
||||
PLACED: FileDoneOutlined,
|
||||
ADMIN_APPROVED: SafetyCertificateOutlined,
|
||||
SOURCING: InboxOutlined,
|
||||
PREPARING: GiftOutlined,
|
||||
DELIVERED_TO_AGENT: CarOutlined,
|
||||
DELIVERED_TO_CUSTOMER: CheckCircleOutlined,
|
||||
CANCELLED: CloseCircleOutlined,
|
||||
};
|
||||
|
||||
const FALLBACK_COLOR = { font: '#64748B', background: '#64748B1F' };
|
||||
|
||||
export function orderStatusColor(status: string) {
|
||||
return ORDER_STATUS_COLORS[status] ?? FALLBACK_COLOR;
|
||||
}
|
||||
|
||||
export function orderStatusLabel(status: string) {
|
||||
return ORDER_STATUS_LABELS[status] ?? status;
|
||||
}
|
||||
|
||||
export function orderStatusBlurb(status: string) {
|
||||
return ORDER_STATUS_BLURBS[status] ?? '';
|
||||
}
|
||||
|
||||
export function orderStatusIcon(status: string) {
|
||||
return ORDER_STATUS_ICONS[status] ?? FileDoneOutlined;
|
||||
}
|
||||
Reference in New Issue
Block a user