feat: complete Epic 0 — foundation migration & infrastructure setup
Stories 0.2-0.5: rename folders→declarations (backend+frontend), configure Redis for cache/queue/sessions, add foundation database migrations (permissions, archived_at), replace DeclarationStatus enum with architecture lifecycle values, create DeclarationObserver for status transition validation and auto-archive, fix controller status transitions to respect observer rules. 93 tests pass (240 assertions). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,14 +7,14 @@ import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
|
||||
type Folder = {
|
||||
type Declaration = {
|
||||
id: number;
|
||||
title: string;
|
||||
client_name: string;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
folder: Folder;
|
||||
declaration: Declaration;
|
||||
token: string;
|
||||
submitUrl: string;
|
||||
};
|
||||
@@ -27,31 +27,44 @@ const flash = computed(() => page.props.flash);
|
||||
|
||||
<template>
|
||||
<div class="flex min-h-svh flex-col bg-background">
|
||||
<Head :title="`Confirmation - ${folder.title}`" />
|
||||
<Head :title="`Confirmation - ${declaration.title}`" />
|
||||
|
||||
<header class="border-b border-sidebar-border/70 px-4 py-4">
|
||||
<div class="mx-auto flex max-w-2xl items-center gap-3">
|
||||
<AppLogoIcon class="size-8 fill-current text-[var(--foreground)]" />
|
||||
<AppLogoIcon
|
||||
class="size-8 fill-current text-[var(--foreground)]"
|
||||
/>
|
||||
<div>
|
||||
<h1 class="font-medium">{{ folder.title }}</h1>
|
||||
<p class="text-sm text-muted-foreground">{{ folder.client_name }}</p>
|
||||
<h1 class="font-medium">{{ declaration.title }}</h1>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
{{ declaration.client_name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="mx-auto w-full max-w-2xl flex-1 p-4">
|
||||
<div v-if="flash?.message" class="mb-4 rounded-lg bg-green-100 p-3 text-sm text-green-800 dark:bg-green-900/30 dark:text-green-300">
|
||||
<div
|
||||
v-if="flash?.message"
|
||||
class="mb-4 rounded-lg bg-green-100 p-3 text-sm text-green-800 dark:bg-green-900/30 dark:text-green-300"
|
||||
>
|
||||
{{ flash.message }}
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<h2 class="text-lg font-medium">Confirmer la situation</h2>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
Veuillez signer ci-dessous pour confirmer la situation présentée par votre cabinet.
|
||||
Veuillez signer ci-dessous pour confirmer la situation
|
||||
présentée par votre cabinet.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Form :action="submitUrl" method="post" class="space-y-4" v-slot="{ processing }">
|
||||
<Form
|
||||
:action="submitUrl"
|
||||
method="post"
|
||||
class="space-y-4"
|
||||
v-slot="{ processing }"
|
||||
>
|
||||
<div class="space-y-2">
|
||||
<Label for="signature">Signature (nom complet)</Label>
|
||||
<Input
|
||||
|
||||
@@ -6,14 +6,14 @@ import { Button } from '@/components/ui/button';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
|
||||
type Folder = {
|
||||
type Declaration = {
|
||||
id: number;
|
||||
title: string;
|
||||
client_name: string;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
folder: Folder;
|
||||
declaration: Declaration;
|
||||
token: string;
|
||||
submitUrl: string;
|
||||
};
|
||||
@@ -26,31 +26,44 @@ const flash = computed(() => page.props.flash);
|
||||
|
||||
<template>
|
||||
<div class="flex min-h-svh flex-col bg-background">
|
||||
<Head :title="`Refus - ${folder.title}`" />
|
||||
<Head :title="`Refus - ${declaration.title}`" />
|
||||
|
||||
<header class="border-b border-sidebar-border/70 px-4 py-4">
|
||||
<div class="mx-auto flex max-w-2xl items-center gap-3">
|
||||
<AppLogoIcon class="size-8 fill-current text-[var(--foreground)]" />
|
||||
<AppLogoIcon
|
||||
class="size-8 fill-current text-[var(--foreground)]"
|
||||
/>
|
||||
<div>
|
||||
<h1 class="font-medium">{{ folder.title }}</h1>
|
||||
<p class="text-sm text-muted-foreground">{{ folder.client_name }}</p>
|
||||
<h1 class="font-medium">{{ declaration.title }}</h1>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
{{ declaration.client_name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="mx-auto w-full max-w-2xl flex-1 p-4">
|
||||
<div v-if="flash?.message" class="mb-4 rounded-lg bg-green-100 p-3 text-sm text-green-800 dark:bg-green-900/30 dark:text-green-300">
|
||||
<div
|
||||
v-if="flash?.message"
|
||||
class="mb-4 rounded-lg bg-green-100 p-3 text-sm text-green-800 dark:bg-green-900/30 dark:text-green-300"
|
||||
>
|
||||
{{ flash.message }}
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<h2 class="text-lg font-medium">Refuser la situation</h2>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
Vous pouvez indiquer la raison de votre refus (facultatif).
|
||||
Vous pouvez indiquer la raison de votre refus
|
||||
(facultatif).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Form :action="submitUrl" method="post" class="space-y-4" v-slot="{ processing }">
|
||||
<Form
|
||||
:action="submitUrl"
|
||||
method="post"
|
||||
class="space-y-4"
|
||||
v-slot="{ processing }"
|
||||
>
|
||||
<div class="space-y-2">
|
||||
<Label for="reason">Raison du refus (facultatif)</Label>
|
||||
<textarea
|
||||
@@ -59,11 +72,15 @@ const flash = computed(() => page.props.flash);
|
||||
rows="4"
|
||||
placeholder="Précisez si besoin..."
|
||||
:disabled="processing"
|
||||
class="flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
class="flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Button type="submit" variant="destructive" :disabled="processing">
|
||||
<Button
|
||||
type="submit"
|
||||
variant="destructive"
|
||||
:disabled="processing"
|
||||
>
|
||||
<Spinner v-if="processing" class="mr-2 size-4" />
|
||||
Confirmer le refus
|
||||
</Button>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
import { ref, computed } from 'vue';
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
import { FileUp } from 'lucide-vue-next';
|
||||
import { ref, computed } from 'vue';
|
||||
import AppLogoIcon from '@/components/AppLogoIcon.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Spinner } from '@/components/ui/spinner';
|
||||
import { FileUp } from 'lucide-vue-next';
|
||||
|
||||
type Folder = {
|
||||
type Declaration = {
|
||||
id: number;
|
||||
title: string;
|
||||
client_name: string;
|
||||
@@ -22,7 +22,7 @@ type Document = {
|
||||
};
|
||||
|
||||
type Props = {
|
||||
folder: Folder;
|
||||
declaration: Declaration;
|
||||
token: string;
|
||||
documents: Document[];
|
||||
uploadUrl: string;
|
||||
@@ -72,29 +72,35 @@ function submit() {
|
||||
|
||||
<template>
|
||||
<div class="flex min-h-svh flex-col bg-background">
|
||||
<Head :title="`Dépôt - ${folder.title}`" />
|
||||
<Head :title="`Dépôt - ${declaration.title}`" />
|
||||
|
||||
<header class="border-b border-sidebar-border/70 px-4 py-4">
|
||||
<div class="mx-auto flex max-w-2xl items-center justify-between">
|
||||
<div class="flex items-center gap-3">
|
||||
<AppLogoIcon class="size-8 fill-current text-foreground" />
|
||||
<div>
|
||||
<h1 class="font-medium">{{ folder.title }}</h1>
|
||||
<p class="text-sm text-muted-foreground">{{ folder.client_name }}</p>
|
||||
<h1 class="font-medium">{{ declaration.title }}</h1>
|
||||
<p class="text-sm text-muted-foreground">
|
||||
{{ declaration.client_name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="mx-auto w-full max-w-2xl flex-1 p-4">
|
||||
<div v-if="flash?.message" class="mb-4 rounded-lg bg-green-100 p-3 text-sm text-green-800 dark:bg-green-900/30 dark:text-green-300">
|
||||
<div
|
||||
v-if="flash?.message"
|
||||
class="mb-4 rounded-lg bg-green-100 p-3 text-sm text-green-800 dark:bg-green-900/30 dark:text-green-300"
|
||||
>
|
||||
{{ flash.message }}
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<h2 class="text-lg font-medium">Déposer vos documents</h2>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
Glissez-déposez vos fichiers ou cliquez pour sélectionner.
|
||||
Glissez-déposez vos fichiers ou cliquez pour
|
||||
sélectionner.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -129,23 +135,42 @@ function submit() {
|
||||
>
|
||||
<FileUp class="mx-auto size-12 text-muted-foreground" />
|
||||
<p class="mt-2 text-sm font-medium">
|
||||
{{ fileInput?.files?.length ? `${fileInput.files.length} fichier(s) sélectionné(s)` : 'Aucun fichier sélectionné' }}
|
||||
{{
|
||||
fileInput?.files?.length
|
||||
? `${fileInput.files.length} fichier(s) sélectionné(s)`
|
||||
: 'Aucun fichier sélectionné'
|
||||
}}
|
||||
</p>
|
||||
<Button type="button" variant="outline" class="mt-2" @click="triggerFileSelect">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
class="mt-2"
|
||||
@click="triggerFileSelect"
|
||||
>
|
||||
Choisir des fichiers
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<Button type="submit" :disabled="!fileInput?.files?.length || isSubmitting">
|
||||
<Button
|
||||
type="submit"
|
||||
:disabled="!fileInput?.files?.length || isSubmitting"
|
||||
>
|
||||
<Spinner v-if="isSubmitting" class="mr-2 size-4" />
|
||||
Envoyer
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
<div v-if="documents.length" class="rounded-xl border border-sidebar-border/70 p-4">
|
||||
<div
|
||||
v-if="documents.length"
|
||||
class="rounded-xl border border-sidebar-border/70 p-4"
|
||||
>
|
||||
<h3 class="font-medium">Documents déjà déposés</h3>
|
||||
<ul class="mt-2 space-y-1 text-sm text-muted-foreground">
|
||||
<li v-for="doc in documents" :key="doc.id" class="flex justify-between">
|
||||
<li
|
||||
v-for="doc in documents"
|
||||
:key="doc.id"
|
||||
class="flex justify-between"
|
||||
>
|
||||
<span>{{ doc.file_name }}</span>
|
||||
<span>{{ doc.size }} — {{ doc.created_at }}</span>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user