- property-card.tsx: add ward between address and district in both
card (line 189) and list (line 95) layouts
- transfer-listing-card.tsx: conditionally prepend ward to
district/city when ward is non-null
- property-card.spec.tsx: update address test to assert ward is shown,
add list-layout ward regression test (21/21 pass)
Standard format: {address}, {ward}, {district}, {city}
Compact (project-card, industrial-listing-card): district/city only —
intentional; ProjectSummary has no ward field.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
19 lines
637 B
TypeScript
19 lines
637 B
TypeScript
import { z } from 'zod';
|
|
|
|
import { VN_PHONE_REGEX as PHONE_REGEX } from '@/lib/phone';
|
|
|
|
export const inquiryFormSchema = z.object({
|
|
message: z
|
|
.string({ error: 'Vui lòng nhập nội dung tin nhắn' })
|
|
.trim()
|
|
.min(1, 'Vui lòng nhập nội dung tin nhắn')
|
|
.max(2000, 'Tin nhắn không được vượt quá 2000 ký tự'),
|
|
phone: z
|
|
.string({ error: 'Vui lòng nhập số điện thoại' })
|
|
.trim()
|
|
.min(9, 'Vui lòng nhập số điện thoại hợp lệ')
|
|
.regex(PHONE_REGEX, 'Số điện thoại không hợp lệ'),
|
|
});
|
|
|
|
export type InquiryFormData = z.infer<typeof inquiryFormSchema>;
|