feat(app): application on the canonical sheet — report v3 store with v2 draft migration, bundled SheetProvider (SHEET_BUNDLE), annotation layer rendered from the document, zone interaction service, pickers and cards on the sheet index, PDF v3 export with v2 archive import; legacy registry, matchers, editors and assets removed

This commit is contained in:
bchanot committed 2026-10-10 11:36:14 +02:00
1 parent 0a17e390cf
commit ce2ec26112
114 files changed
+3560 -14637

No files matched your search

+43 -10
View File
@@ -1,23 +1,36 @@
import type { Animal, Owner } from '@/domain/schema/animal'
import type { Animal, LocalizedText, Owner } from '@faunosteo/domain'
import Label from '@/components/ui/Label'
import Input from '@/components/ui/Input'
import Select from '@/components/ui/Select'
import { getAllSpecies, speciesLabel } from '@/domain/species/registry'
import { pickLabel } from '@/services/sheetIndex'
import { useT } from '@/i18n/useT'
import { useLocaleStore } from '@/state/localeStore'
export interface SpeciesOption {
id: string
name: LocalizedText
}
export interface AnimalFormProps {
animal: Animal
owner: Owner
/** Species that have a sheet in this build (one today). */
species: readonly SpeciesOption[]
onChangeAnimal: (next: Animal) => void
onChangeOwner: (next: Owner) => void
}
export default function AnimalForm({ animal, owner, onChangeAnimal, onChangeOwner }: AnimalFormProps) {
export default function AnimalForm({
animal,
owner,
species,
onChangeAnimal,
onChangeOwner,
}: AnimalFormProps) {
const t = useT()
const locale = useLocaleStore((s) => s.locale)
const species = getAllSpecies()
const setA = (patch: Partial<Animal>) => onChangeAnimal({ ...animal, ...patch })
const setA = (patch: Partial<Animal>) =>
onChangeAnimal({ ...animal, ...patch })
return (
<fieldset className="space-y-3">
<legend className="font-serif text-xl mb-2 text-[var(--color-ink)]">
@@ -31,25 +44,45 @@ export default function AnimalForm({ animal, owner, onChangeAnimal, onChangeOwne
onChange={(e) => setA({ speciesId: e.target.value })}
>
{species.map((s) => (
<option key={s.id} value={s.id}>{speciesLabel(s, locale)}</option>
<option key={s.id} value={s.id}>
{pickLabel(s.name, locale)}
</option>
))}
</Select>
</div>
<div>
<Label htmlFor="an-name">{t('form.animal.name')}</Label>
<Input id="an-name" required value={animal.name} onChange={(e) => setA({ name: e.target.value })} />
<Input
id="an-name"
required
value={animal.name}
onChange={(e) => setA({ name: e.target.value })}
/>
</div>
<div>
<Label htmlFor="an-breed">{t('form.animal.breed')}</Label>
<Input id="an-breed" value={animal.breed ?? ''} onChange={(e) => setA({ breed: e.target.value || undefined })} />
<Input
id="an-breed"
value={animal.breed ?? ''}
onChange={(e) => setA({ breed: e.target.value || undefined })}
/>
</div>
<div>
<Label htmlFor="an-age">{t('form.animal.age')}</Label>
<Input id="an-age" value={animal.age ?? ''} onChange={(e) => setA({ age: e.target.value || undefined })} />
<Input
id="an-age"
value={animal.age ?? ''}
onChange={(e) => setA({ age: e.target.value || undefined })}
/>
</div>
<div>
<Label htmlFor="own-name">{t('form.owner.name')}</Label>
<Input id="own-name" required value={owner.name} onChange={(e) => onChangeOwner({ name: e.target.value })} />
<Input
id="own-name"
required
value={owner.name}
onChange={(e) => onChangeOwner({ name: e.target.value })}
/>
</div>
</fieldset>
)
@@ -1,4 +1,4 @@
import type { Report } from '@/domain/schema/report'
import type { Report } from '@faunosteo/domain'
import Label from '@/components/ui/Label'
import Textarea from '@/components/ui/Textarea'
import NextAppointmentPicker from './NextAppointmentPicker'
@@ -29,13 +29,26 @@ export default function ConclusionPanel({
</h2>
<div>
<Label htmlFor="conclusion">{t('conclusion.conclusion')}</Label>
<Textarea id="conclusion" value={conclusion} onChange={(e) => onChangeConclusion(e.target.value)} />
<Textarea
id="conclusion"
value={conclusion}
onChange={(e) => onChangeConclusion(e.target.value)}
/>
</div>
<div>
<Label htmlFor="recommendations">{t('conclusion.recommendations')}</Label>
<Textarea id="recommendations" value={recommendations} onChange={(e) => onChangeRecommendations(e.target.value)} />
<Label htmlFor="recommendations">
{t('conclusion.recommendations')}
</Label>
<Textarea
id="recommendations"
value={recommendations}
onChange={(e) => onChangeRecommendations(e.target.value)}
/>
</div>
<NextAppointmentPicker value={nextAppointment} onChange={onChangeNextAppointment} />
<NextAppointmentPicker
value={nextAppointment}
onChange={onChangeNextAppointment}
/>
</section>
)
}
@@ -1,4 +1,4 @@
import type { Report } from '@/domain/schema/report'
import type { Report } from '@faunosteo/domain'
import Input from '@/components/ui/Input'
import Label from '@/components/ui/Label'
import { useT } from '@/i18n/useT'
@@ -1,4 +1,4 @@
import type { Practitioner } from '@/domain/schema/practitioner'
import type { Practitioner } from '@faunosteo/domain'
import Label from '@/components/ui/Label'
import Input from '@/components/ui/Input'
import { useT } from '@/i18n/useT'
@@ -8,7 +8,10 @@ export interface PractitionerFormProps {
onChange: (next: Practitioner) => void
}
export default function PractitionerForm({ value, onChange }: PractitionerFormProps) {
export default function PractitionerForm({
value,
onChange,
}: PractitionerFormProps) {
const t = useT()
const set = (patch: Partial<Practitioner>) => onChange({ ...value, ...patch })
return (
@@ -18,19 +21,36 @@ export default function PractitionerForm({ value, onChange }: PractitionerFormPr
</legend>
<div>
<Label htmlFor="prac-name">{t('form.practitioner.name')}</Label>
<Input id="prac-name" required value={value.name} onChange={(e) => set({ name: e.target.value })} />
<Input
id="prac-name"
required
value={value.name}
onChange={(e) => set({ name: e.target.value })}
/>
</div>
<div>
<Label htmlFor="prac-cabinet">{t('form.practitioner.cabinet')}</Label>
<Input id="prac-cabinet" value={value.cabinet ?? ''} onChange={(e) => set({ cabinet: e.target.value || undefined })} />
<Input
id="prac-cabinet"
value={value.cabinet ?? ''}
onChange={(e) => set({ cabinet: e.target.value || undefined })}
/>
</div>
<div>
<Label htmlFor="prac-contact">{t('form.practitioner.contact')}</Label>
<Input id="prac-contact" value={value.contact ?? ''} onChange={(e) => set({ contact: e.target.value || undefined })} />
<Input
id="prac-contact"
value={value.contact ?? ''}
onChange={(e) => set({ contact: e.target.value || undefined })}
/>
</div>
<div>
<Label htmlFor="prac-siret">{t('form.practitioner.siret')}</Label>
<Input id="prac-siret" value={value.siret ?? ''} onChange={(e) => set({ siret: e.target.value || undefined })} />
<Input
id="prac-siret"
value={value.siret ?? ''}
onChange={(e) => set({ siret: e.target.value || undefined })}
/>
</div>
</fieldset>
)
@@ -1,4 +1,4 @@
import type { Report } from '@/domain/schema/report'
import type { Report } from '@faunosteo/domain'
import AppHeader from '@/components/brand/AppHeader'
import Button from '@/components/ui/Button'
import { formatDate } from '@/lib/dates'
@@ -10,7 +10,10 @@ export interface ReportHeaderProps {
onEditInfos?: () => void
}
export default function ReportHeader({ report, onEditInfos }: ReportHeaderProps) {
export default function ReportHeader({
report,
onEditInfos,
}: ReportHeaderProps) {
const t = useT()
const locale = useLocaleStore((s) => s.locale)
return (