feat: migrate setup visibility from boolean to three-tier system

Replace isPublic boolean with visibility enum (private/link/public) across
the full stack. Add shares table to schema for future share link support.
Update all services, routes, schemas, hooks, components, and tests.

Plan: 32-01 (Setup Sharing System - Schema Migration)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 17:55:46 +02:00
parent 727abf1528
commit edc9793c2d
20 changed files with 1556 additions and 81 deletions

View File

@@ -4,7 +4,7 @@ import { useFormatters } from "../hooks/useFormatters";
interface SetupCardProps {
id: number;
name: string;
isPublic?: boolean;
visibility?: "private" | "link" | "public";
itemCount: number;
totalWeight: number;
totalCost: number;
@@ -13,7 +13,7 @@ interface SetupCardProps {
export function SetupCard({
id,
name,
isPublic,
visibility,
itemCount,
totalWeight,
totalCost,
@@ -30,9 +30,15 @@ export function SetupCard({
<h3 className="text-sm font-semibold text-gray-900 truncate">
{name}
</h3>
{isPublic && (
<span className="inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium bg-green-50 text-green-600 shrink-0">
Public
{visibility && visibility !== "private" && (
<span
className={`inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium shrink-0 ${
visibility === "public"
? "bg-green-50 text-green-600"
: "bg-blue-50 text-blue-600"
}`}
>
{visibility === "public" ? "Public" : "Link"}
</span>
)}
</div>