thai-uxui
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { getProjectPartyRoleThaiLabel } from './terminology';
|
||||
|
||||
export const PROJECT_PARTY_OPTION_CATEGORY = 'crm_project_party_role';
|
||||
|
||||
const LEGACY_PROJECT_PARTY_ROLE_CODE_MAP = {
|
||||
@@ -8,12 +10,12 @@ const LEGACY_PROJECT_PARTY_ROLE_CODE_MAP = {
|
||||
} as const;
|
||||
|
||||
export const PROJECT_PARTY_CODE_LABELS: Record<string, string> = {
|
||||
billing_customer: 'Billing Customer',
|
||||
customer: 'Customer',
|
||||
consultant: 'Consultant',
|
||||
contractor: 'Contractor',
|
||||
end_customer: 'End Customer',
|
||||
other: 'Other'
|
||||
billing_customer: getProjectPartyRoleThaiLabel('billing_customer'),
|
||||
customer: getProjectPartyRoleThaiLabel('customer'),
|
||||
consultant: getProjectPartyRoleThaiLabel('consultant'),
|
||||
contractor: getProjectPartyRoleThaiLabel('contractor'),
|
||||
end_customer: getProjectPartyRoleThaiLabel('end_customer'),
|
||||
other: getProjectPartyRoleThaiLabel('other')
|
||||
};
|
||||
|
||||
export interface ProjectPartyRoleOptionLike {
|
||||
|
||||
51
src/features/crm/shared/terminology.ts
Normal file
51
src/features/crm/shared/terminology.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
export const CRM_TERMS = {
|
||||
crm: 'CRM',
|
||||
dashboard: 'Dashboard',
|
||||
lead: 'ลีด',
|
||||
leads: 'ลีด',
|
||||
enquiry: 'โอกาสขาย',
|
||||
enquiries: 'โอกาสขาย',
|
||||
quotation: 'ใบเสนอราคา',
|
||||
quotations: 'ใบเสนอราคา',
|
||||
approval: 'อนุมัติเอกสาร',
|
||||
approvals: 'อนุมัติเอกสาร',
|
||||
customer: 'ลูกค้า',
|
||||
customers: 'ลูกค้า',
|
||||
contact: 'ผู้ติดต่อ',
|
||||
contacts: 'ผู้ติดต่อ',
|
||||
billingCustomer: 'ลูกค้าผู้รับใบเสนอราคา',
|
||||
projectParties: 'ผู้เกี่ยวข้องในโครงการ',
|
||||
crmSettings: 'ตั้งค่า CRM',
|
||||
leadCount: 'จำนวนลีด',
|
||||
enquiryCount: 'จำนวนโอกาสขาย',
|
||||
wonCount: 'จำนวนงานที่ชนะ',
|
||||
lostCount: 'จำนวนงานที่แพ้',
|
||||
revenue: 'มูลค่าใบเสนอราคา',
|
||||
conversionRate: 'อัตราการเปลี่ยนสถานะ'
|
||||
} as const;
|
||||
|
||||
export const PIPELINE_STAGE_THAI_LABELS = {
|
||||
lead: 'ลีด',
|
||||
enquiry: 'โอกาสขาย',
|
||||
closed_won: 'ชนะ',
|
||||
closed_lost: 'แพ้'
|
||||
} as const;
|
||||
|
||||
export const PROJECT_PARTY_ROLE_THAI_LABELS: Record<string, string> = {
|
||||
billing_customer: 'ลูกค้าผู้รับใบเสนอราคา',
|
||||
customer: 'ลูกค้า',
|
||||
consultant: 'ที่ปรึกษา',
|
||||
contractor: 'ผู้รับเหมา',
|
||||
end_customer: 'เจ้าของโครงการ',
|
||||
other: 'อื่น ๆ'
|
||||
};
|
||||
|
||||
export function getProjectPartyRoleThaiLabel(roleCode: string, fallback?: string | null) {
|
||||
return PROJECT_PARTY_ROLE_THAI_LABELS[roleCode] ?? fallback ?? roleCode;
|
||||
}
|
||||
|
||||
export function getPipelineStageThaiLabel(
|
||||
stage: keyof typeof PIPELINE_STAGE_THAI_LABELS | string
|
||||
) {
|
||||
return PIPELINE_STAGE_THAI_LABELS[stage as keyof typeof PIPELINE_STAGE_THAI_LABELS] ?? stage;
|
||||
}
|
||||
Reference in New Issue
Block a user