feat: L'Ami Fiduciaire V1.0.0 — full codebase with Story 0.1 complete
Initial commit of the L'Ami Fiduciaire SaaS platform built on Laravel 12, Vue 3, Inertia.js 2, and Tailwind CSS 4. Story 0.1 (rename folders to declarations in database) is implemented and code-reviewed: migration, rollback, and 6 Pest tests all passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
52
resources/js/pages/workspaces/Create.vue
Normal file
52
resources/js/pages/workspaces/Create.vue
Normal file
@@ -0,0 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import WorkspaceForm from '@/components/WorkspaceForm.vue';
|
||||
import type { WorkspaceFormData } from '@/components/WorkspaceForm.vue';
|
||||
import Heading from '@/components/Heading.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
type Props = {
|
||||
indexUrl: string;
|
||||
storeUrl: string;
|
||||
users: Array<{ id: number; name: string; email: string }>;
|
||||
workspaceUserRoles: Record<string, string>;
|
||||
};
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const form = useForm<WorkspaceFormData>({
|
||||
name: '',
|
||||
slug: '',
|
||||
user_ids: [],
|
||||
user_roles: {},
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.post(props.storeUrl);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout
|
||||
:breadcrumbs="[
|
||||
{ title: 'Workspaces', href: props.indexUrl },
|
||||
{ title: 'Create workspace' },
|
||||
]"
|
||||
>
|
||||
<Head title="Create workspace" />
|
||||
|
||||
<div class="flex flex-col space-y-6 p-4">
|
||||
<Heading
|
||||
title="Create workspace"
|
||||
description="Add a new accounting firm workspace (cabinet comptable)"
|
||||
/>
|
||||
<WorkspaceForm
|
||||
:form="form"
|
||||
:users="props.users ?? []"
|
||||
:workspace-user-roles="props.workspaceUserRoles ?? {}"
|
||||
submit-label="Create workspace"
|
||||
@submit="submit"
|
||||
/>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
61
resources/js/pages/workspaces/Edit.vue
Normal file
61
resources/js/pages/workspaces/Edit.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<script setup lang="ts">
|
||||
import { Head, useForm } from '@inertiajs/vue3';
|
||||
import WorkspaceForm from '@/components/WorkspaceForm.vue';
|
||||
import type { WorkspaceFormData } from '@/components/WorkspaceForm.vue';
|
||||
import Heading from '@/components/Heading.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
type Workspace = {
|
||||
id: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
user_ids: number[];
|
||||
user_roles: Record<number, string>;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
workspace: Workspace;
|
||||
indexUrl: string;
|
||||
updateUrl: string;
|
||||
users: Array<{ id: number; name: string; email: string }>;
|
||||
workspaceUserRoles: Record<string, string>;
|
||||
};
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
const form = useForm<WorkspaceFormData>({
|
||||
name: props.workspace.name,
|
||||
slug: props.workspace.slug,
|
||||
user_ids: props.workspace.user_ids ?? [],
|
||||
user_roles: props.workspace.user_roles ?? {},
|
||||
});
|
||||
|
||||
function submit() {
|
||||
form.put(props.updateUrl);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout
|
||||
:breadcrumbs="[
|
||||
{ title: 'Workspaces', href: props.indexUrl },
|
||||
{ title: 'Edit workspace' },
|
||||
]"
|
||||
>
|
||||
<Head :title="`Edit ${props.workspace.name}`" />
|
||||
|
||||
<div class="flex flex-col space-y-6 p-4">
|
||||
<Heading
|
||||
:title="`Edit ${props.workspace.name}`"
|
||||
description="Update the workspace information"
|
||||
/>
|
||||
<WorkspaceForm
|
||||
:form="form"
|
||||
:users="props.users ?? []"
|
||||
:workspace-user-roles="props.workspaceUserRoles ?? {}"
|
||||
submit-label="Update workspace"
|
||||
@submit="submit"
|
||||
/>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
181
resources/js/pages/workspaces/Index.vue
Normal file
181
resources/js/pages/workspaces/Index.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<script setup lang="ts">
|
||||
import { Head, Link, router } from '@inertiajs/vue3';
|
||||
import { Building2 } from 'lucide-vue-next';
|
||||
import Heading from '@/components/Heading.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import Pagination from '@/components/Pagination.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
|
||||
type Workspace = {
|
||||
id: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
users_count: number;
|
||||
showUrl: string;
|
||||
editUrl: string;
|
||||
destroyUrl: string;
|
||||
};
|
||||
|
||||
type PaginatedData<T> = {
|
||||
data: T[];
|
||||
from: number | null;
|
||||
to: number | null;
|
||||
total: number;
|
||||
current_page: number;
|
||||
last_page: number;
|
||||
per_page: number;
|
||||
path: string;
|
||||
first_page_url: string;
|
||||
prev_page_url: string | null;
|
||||
next_page_url: string | null;
|
||||
last_page_url: string;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
workspaces: PaginatedData<Workspace>;
|
||||
createUrl: string;
|
||||
};
|
||||
|
||||
defineProps<Props>();
|
||||
|
||||
function destroy(workspace: Workspace) {
|
||||
if (
|
||||
window.confirm(
|
||||
`Are you sure you want to delete "${workspace.name}"? All users will be unassigned.`,
|
||||
)
|
||||
) {
|
||||
router.delete(workspace.destroyUrl);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout
|
||||
:breadcrumbs="[
|
||||
{ title: 'Workspaces' },
|
||||
]"
|
||||
>
|
||||
<Head title="Workspaces" />
|
||||
|
||||
<div class="flex flex-col space-y-6 p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<Heading
|
||||
variant="small"
|
||||
title="Workspaces"
|
||||
description="Manage accounting firm workspaces (cabinets comptables)"
|
||||
/>
|
||||
<Button as-child>
|
||||
<Link :href="createUrl">Create workspace</Link>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="rounded-xl border border-sidebar-border/70 dark:border-sidebar-border overflow-hidden"
|
||||
>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="border-b border-sidebar-border/70 bg-muted/50">
|
||||
<tr>
|
||||
<th
|
||||
class="h-10 px-4 text-left font-medium align-middle"
|
||||
>
|
||||
Name
|
||||
</th>
|
||||
<th
|
||||
class="h-10 px-4 text-left font-medium align-middle"
|
||||
>
|
||||
Slug
|
||||
</th>
|
||||
<th
|
||||
class="h-10 px-4 text-left font-medium align-middle"
|
||||
>
|
||||
Users
|
||||
</th>
|
||||
<th
|
||||
class="h-10 px-4 text-right font-medium align-middle"
|
||||
>
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="workspace in workspaces.data"
|
||||
:key="workspace.id"
|
||||
class="border-b border-sidebar-border/50 last:border-0"
|
||||
>
|
||||
<td class="px-4 py-3 font-medium">
|
||||
<Link
|
||||
:href="workspace.showUrl"
|
||||
class="hover:underline"
|
||||
>
|
||||
{{ workspace.name }}
|
||||
</Link>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-muted-foreground">
|
||||
{{ workspace.slug }}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<Badge variant="secondary">
|
||||
{{ workspace.users_count }} user{{
|
||||
workspace.users_count !== 1
|
||||
? 's'
|
||||
: ''
|
||||
}}
|
||||
</Badge>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right space-x-2">
|
||||
<Button variant="outline" size="sm" as-child>
|
||||
<Link :href="workspace.showUrl"
|
||||
>View</Link
|
||||
>
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" as-child>
|
||||
<Link :href="workspace.editUrl"
|
||||
>Edit</Link
|
||||
>
|
||||
</Button>
|
||||
<Button
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
@click="destroy(workspace)"
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!workspaces.data.length">
|
||||
<td
|
||||
colspan="4"
|
||||
class="px-4 py-8 text-center text-muted-foreground"
|
||||
>
|
||||
<div class="flex flex-col items-center gap-2">
|
||||
<Building2 class="h-10 w-10" />
|
||||
<p>No workspaces yet.</p>
|
||||
<Button as-child>
|
||||
<Link :href="createUrl"
|
||||
>Create your first
|
||||
workspace</Link
|
||||
>
|
||||
</Button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<Pagination
|
||||
:pagination="{
|
||||
from: workspaces.from ?? 0,
|
||||
to: workspaces.to ?? 0,
|
||||
total: workspaces.total,
|
||||
current_page: workspaces.current_page,
|
||||
last_page: workspaces.last_page,
|
||||
per_page: workspaces.per_page,
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
204
resources/js/pages/workspaces/Show.vue
Normal file
204
resources/js/pages/workspaces/Show.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { Head, Link } from '@inertiajs/vue3';
|
||||
import { User, FolderOpen, Building2, Calendar, AlertCircle } from 'lucide-vue-next';
|
||||
import Heading from '@/components/Heading.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
|
||||
type WorkspaceUser = {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
role: string;
|
||||
};
|
||||
|
||||
type Workspace = {
|
||||
id: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
users: WorkspaceUser[];
|
||||
};
|
||||
|
||||
type Stats = {
|
||||
clients: number;
|
||||
folders: number;
|
||||
folders_by_status: Record<string, number>;
|
||||
folders_this_month: number;
|
||||
folders_needing_attention: number;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
workspace: Workspace;
|
||||
stats: Stats;
|
||||
indexUrl: string;
|
||||
editUrl: string;
|
||||
};
|
||||
|
||||
const props = defineProps<Props>();
|
||||
|
||||
function roleLabel(role: string): string {
|
||||
return role.charAt(0).toUpperCase() + role.slice(1);
|
||||
}
|
||||
|
||||
const inProgressCount = computed(
|
||||
() =>
|
||||
(props.stats.folders_by_status?.processing ?? 0) +
|
||||
(props.stats.folders_by_status?.additional_documents_requested ?? 0) +
|
||||
(props.stats.folders_by_status?.documents_received ?? 0),
|
||||
);
|
||||
|
||||
const validatedCount = computed(
|
||||
() => props.stats.folders_by_status?.validated ?? 0,
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout
|
||||
:breadcrumbs="[
|
||||
{ title: 'Workspaces', href: props.indexUrl },
|
||||
{ title: props.workspace.name },
|
||||
]"
|
||||
>
|
||||
<Head :title="props.workspace.name" />
|
||||
|
||||
<div class="flex flex-col space-y-6 p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<Heading
|
||||
:title="props.workspace.name"
|
||||
:description="`Workspace ${props.workspace.slug}`"
|
||||
/>
|
||||
<Button variant="outline" as-child>
|
||||
<Link :href="props.editUrl">Edit workspace</Link>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-6">
|
||||
<Card>
|
||||
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle class="text-sm font-medium">
|
||||
Clients
|
||||
</CardTitle>
|
||||
<Building2 class="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-2xl font-bold">{{ props.stats.clients }}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle class="text-sm font-medium">
|
||||
Dossiers
|
||||
</CardTitle>
|
||||
<FolderOpen class="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-2xl font-bold">{{ props.stats.folders }}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle class="text-sm font-medium">
|
||||
En cours
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-2xl font-bold">{{ inProgressCount }}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle class="text-sm font-medium">
|
||||
Validés
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-2xl font-bold">{{ validatedCount }}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle class="text-sm font-medium">
|
||||
Ce mois
|
||||
</CardTitle>
|
||||
<Calendar class="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-2xl font-bold">{{ props.stats.folders_this_month }}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Card>
|
||||
<CardHeader class="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle class="text-sm font-medium">
|
||||
À traiter
|
||||
</CardTitle>
|
||||
<AlertCircle class="h-4 w-4 text-muted-foreground" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div class="text-2xl font-bold">{{ props.stats.folders_needing_attention }}</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="rounded-xl border border-sidebar-border/70 dark:border-sidebar-border overflow-hidden"
|
||||
>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="border-b border-sidebar-border/70 bg-muted/50">
|
||||
<tr>
|
||||
<th
|
||||
class="h-10 px-4 text-left font-medium align-middle"
|
||||
>
|
||||
User
|
||||
</th>
|
||||
<th
|
||||
class="h-10 px-4 text-left font-medium align-middle"
|
||||
>
|
||||
Role
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="user in props.workspace.users"
|
||||
:key="user.id"
|
||||
class="border-b border-sidebar-border/50 last:border-0"
|
||||
>
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex flex-col">
|
||||
<span class="font-medium">{{
|
||||
user.name
|
||||
}}</span>
|
||||
<span
|
||||
class="text-xs text-muted-foreground"
|
||||
>{{ user.email }}</span
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<Badge variant="secondary">
|
||||
{{ roleLabel(user.role) }}
|
||||
</Badge>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!props.workspace.users.length">
|
||||
<td
|
||||
colspan="2"
|
||||
class="px-4 py-8 text-center text-muted-foreground"
|
||||
>
|
||||
<div class="flex flex-col items-center gap-2">
|
||||
<User class="h-10 w-10" />
|
||||
<p>No users in this workspace.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AppLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user