690329:1250 Fixing bugs uuid by Kimi K2.5 #04
CI / CD Pipeline / build (push) Successful in 12m8s
CI / CD Pipeline / deploy (push) Successful in 8m52s

This commit is contained in:
2026-03-29 12:50:14 +07:00
parent e8965658b1
commit 06b897ec8e
7 changed files with 200 additions and 127 deletions
+75 -75
View File
@@ -439,81 +439,6 @@ export function CorrespondenceForm({ initialData, uuid }: { initialData?: Initia
</div>
</div>
{/* Subject */}
<div className="space-y-2">
<Label htmlFor="subject">Subject *</Label>
<Input id="subject" {...register('subject')} placeholder="Enter subject" />
{errors.subject && <p className="text-sm text-destructive">{errors.subject.message}</p>}
</div>
{/* Body */}
<div className="space-y-2">
<Label htmlFor="body">Body (Content)</Label>
<Textarea id="body" {...register('body')} rows={6} placeholder="Enter letter content..." />
</div>
{/* Date Fields */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<div className="space-y-2">
<Label htmlFor="documentDate">Document Date</Label>
<Input
id="documentDate"
type="date"
{...register('documentDate')}
onChange={(e) => {
const val = e.target.value;
setValue('documentDate', val, { shouldValidate: true, shouldDirty: true });
if (val) {
setValue('issuedDate', val, { shouldValidate: true, shouldDirty: true });
setValue('receivedDate', val, { shouldValidate: true, shouldDirty: true });
const d = new Date(val);
d.setDate(d.getDate() + 7);
setValue('dueDate', d.toISOString().split('T')[0], { shouldValidate: true, shouldDirty: true });
}
}}
/>
</div>
<div className="space-y-2">
<Label htmlFor="issuedDate">Issued Date</Label>
<Input id="issuedDate" type="date" {...register('issuedDate')} />
</div>
<div className="space-y-2">
<Label htmlFor="receivedDate">Received Date</Label>
<Input
id="receivedDate"
type="date"
{...register('receivedDate')}
onChange={(e) => {
const val = e.target.value;
setValue('receivedDate', val, { shouldValidate: true, shouldDirty: true });
if (val) {
const d = new Date(val);
d.setDate(d.getDate() + 7);
setValue('dueDate', d.toISOString().split('T')[0], { shouldValidate: true, shouldDirty: true });
}
}}
/>
</div>
<div className="space-y-2">
<Label htmlFor="dueDate">Due Date</Label>
<Input id="dueDate" type="date" {...register('dueDate')} />
</div>
</div>
{/* Remarks */}
<div className="grid grid-cols-1 gap-4">
<div className="space-y-2">
<Label htmlFor="remarks">Remarks</Label>
<Input id="remarks" {...register('remarks')} placeholder="Optional remarks" />
</div>
</div>
{/* Description */}
<div className="space-y-2">
<Label htmlFor="description">Description (Internal Note)</Label>
<Textarea id="description" {...register('description')} rows={2} placeholder="Enter description..." />
</div>
{/* Organizations */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="space-y-2">
@@ -589,6 +514,81 @@ export function CorrespondenceForm({ initialData, uuid }: { initialData?: Initia
</div>
</div>
{/* Subject */}
<div className="space-y-2">
<Label htmlFor="subject">Subject *</Label>
<Input id="subject" {...register('subject')} placeholder="Enter subject" />
{errors.subject && <p className="text-sm text-destructive">{errors.subject.message}</p>}
</div>
{/* Body */}
<div className="space-y-2">
<Label htmlFor="body">Body (Content)</Label>
<Textarea id="body" {...register('body')} rows={6} placeholder="Enter letter content..." />
</div>
{/* Date Fields */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<div className="space-y-2">
<Label htmlFor="documentDate">Document Date</Label>
<Input
id="documentDate"
type="date"
{...register('documentDate')}
onChange={(e) => {
const val = e.target.value;
setValue('documentDate', val, { shouldValidate: true, shouldDirty: true });
if (val) {
setValue('issuedDate', val, { shouldValidate: true, shouldDirty: true });
setValue('receivedDate', val, { shouldValidate: true, shouldDirty: true });
const d = new Date(val);
d.setDate(d.getDate() + 7);
setValue('dueDate', d.toISOString().split('T')[0], { shouldValidate: true, shouldDirty: true });
}
}}
/>
</div>
<div className="space-y-2">
<Label htmlFor="issuedDate">Issued Date</Label>
<Input id="issuedDate" type="date" {...register('issuedDate')} />
</div>
<div className="space-y-2">
<Label htmlFor="receivedDate">Received Date</Label>
<Input
id="receivedDate"
type="date"
{...register('receivedDate')}
onChange={(e) => {
const val = e.target.value;
setValue('receivedDate', val, { shouldValidate: true, shouldDirty: true });
if (val) {
const d = new Date(val);
d.setDate(d.getDate() + 7);
setValue('dueDate', d.toISOString().split('T')[0], { shouldValidate: true, shouldDirty: true });
}
}}
/>
</div>
<div className="space-y-2">
<Label htmlFor="dueDate">Due Date</Label>
<Input id="dueDate" type="date" {...register('dueDate')} />
</div>
</div>
{/* Remarks */}
<div className="grid grid-cols-1 gap-4">
<div className="space-y-2">
<Label htmlFor="remarks">Remarks</Label>
<Input id="remarks" {...register('remarks')} placeholder="Optional remarks" />
</div>
</div>
{/* Description */}
<div className="space-y-2">
<Label htmlFor="description">Description (Internal Note)</Label>
<Textarea id="description" {...register('description')} rows={2} placeholder="Enter description..." />
</div>
{/* Importance */}
<div className="space-y-2">
<Label>Importance</Label>