Skip to content

Open-source personal finance manager. Self-hosted, privacy-first.

feat: choose workspace type at creation (#569)

Tássio Noronha3757390617e4
diff --git a/backend/alembic/versions/068_workspace_kind_normalize.py b/backend/alembic/versions/068_workspace_kind_normalize.py
new file mode 100644
index 00000000..d3d7c458
--- /dev/null
+++ b/backend/alembic/versions/068_workspace_kind_normalize.py
@@ -0,0 +1,44 @@
+"""normalize workspaces.kind to the supported set
+
+Revision ID: 068
+Revises: 067
+Create Date: 2026-08-12
+
+`kind` is now two values, personal and business. The three retired ones
+all described work rather than a household, so they fold into
+`business`:
+
+ - `freelancer` and `small_business` split work by size, which the data
+ model never acted on.
+ - `accountant_firm` described an edge between two workspaces, not an
+ attribute of one, and that relationship is already carried by
+ `workspaces.managed_by_user_id`.
+
+The column has no DB-level constraint, so without this a row would keep
+reading back a kind the app no longer offers. Data-only, and a no-op on
+most installs: the retired values were never selectable in the UI.
+"""
+from typing import Sequence, Union
+
+from alembic import op
+
+revision: str = "068"
+down_revision: Union[str, None] = "067"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.execute(
+ """
+ UPDATE workspaces
+ SET kind = 'business'
+ WHERE kind IN ('freelancer', 'small_business', 'accountant_firm')
+ """
+ )
+
+
+def downgrade() -> None:
+ # Not reversible: the rows are indistinguishable from workspaces that
+ # were always business.
+ pass
diff --git a/backend/app/api/workspaces.py b/backend/app/api/workspaces.py
index 57ad20cf..7b7b405c 100644
--- a/backend/app/api/workspaces.py
+++ b/backend/app/api/workspaces.py
@@ -1,9 +1,9 @@
"""Workspace + member management endpoints.
-Note: there's intentionally NO `POST /api/workspaces` endpoint here.
-Workspaces are auto-created at user registration; additional workspaces
-(Freelancer / Small Business / Accountant Firm) ship as part of the
-templates feature in a later phase.
+Every user gets a Personal workspace at registration. `POST` here
+creates the additional ones and is the only place `kind` is ever set;
+`PATCH` edits the rest of the workspace and deliberately cannot touch
+it.
"""
import uuid
diff --git a/backend/app/models/workspace.py b/backend/app/models/workspace.py
index b0c9dce8..7cb77f03 100644
--- a/backend/app/models/workspace.py
+++ b/backend/app/models/workspace.py
@@ -1,6 +1,6 @@
import uuid
from datetime import datetime, timezone
-from typing import TYPE_CHECKING, Optional
+from typing import TYPE_CHECKING, Literal, Optional, get_args
from sqlalchemy import Boolean, DateTime, ForeignKey, String, UniqueConstraint
from sqlalchemy.dialects.postgresql import UUID
@@ -14,7 +14,17 @@ if TYPE_CHECKING:
# Allowed values for Workspace.kind. Drives template defaults + module
# visibility. New kinds get added here; the data model is identical.
-WORKSPACE_KINDS = ("personal", "freelancer", "small_business", "accountant_firm")
+#
+# Two values, both describing what the container holds: a household's
+# money or a work's money. `kind` never describes how a workspace is
+# accessed; operating one on someone else's behalf is the separate
+# `managed_by_user_id` primitive below.
+#
+# Set once, at creation, and never edited: it is the premise the
+# workspace's accounts and categories were built on, not a label. A
+# workspace that turns out to be the wrong kind is a new workspace.
+WorkspaceKind = Literal["personal", "business"]
+WORKSPACE_KINDS: tuple[str, ...] = get_args(WorkspaceKind)
# Roles a member can hold inside a workspace. `owner` is the
# member-management + workspace-config role; `editor` can read/write
diff --git a/backend/app/schemas/workspace.py b/backend/app/schemas/workspace.py
index 2ff2e6fd..988ffb6f 100644
--- a/backend/app/schemas/workspace.py
+++ b/backend/app/schemas/workspace.py
@@ -4,9 +4,14 @@ from typing import Optional
from pydantic import BaseModel, EmailStr, Field
+from app.models.workspace import WorkspaceKind
+
+
class WorkspaceRead(BaseModel):
id: uuid.UUID
name: str
+ # Deliberately a bare `str` on the way out: reads must not blow up on
+ # a row that predates the current kind list. Writes are validated.
kind: str
is_archived: bool
default_currency: str
@@ -27,7 +32,7 @@ class WorkspaceRead(BaseModel):
class WorkspaceCreate(BaseModel):
name: str = Field(min_length=1, max_length=100)
- kind: str = "personal"
+ kind: WorkspaceKind = "personal"
default_currency: Optional[str] = Field(default=None, min_length=3, max_length=3)
locale: Optional[str] = Field(default=None, max_length=10)
icon: Optional[str] = Field(default=None, max_length=50)
@@ -40,6 +45,8 @@ class WorkspaceCreate(BaseModel):
class WorkspaceUpdate(BaseModel):
+ # No `kind` here on purpose: it is fixed at creation. See
+ # `models.workspace.WorkspaceKind`.
name: Optional[str] = Field(default=None, min_length=1, max_length=100)
icon: Optional[str] = Field(default=None, max_length=50)
color: Optional[str] = Field(default=None, max_length=7)
diff --git a/backend/app/services/workspace_service.py b/backend/app/services/workspace_service.py
index 871afb76..a7ddce7f 100644
--- a/backend/app/services/workspace_service.py
+++ b/backend/app/services/workspace_service.py
@@ -36,8 +36,14 @@ async def create_personal_workspace_for_user(
) -> Workspace:
"""Create the user's auto-default Personal workspace + owner membership.
- Idempotent: if the user already owns a personal workspace (e.g. the
- migration ran), returns the existing one.
+ Idempotent: if the user already has a workspace they created and
+ belong to (e.g. the migration ran), returns the oldest one.
+
+ The guard matches on identity, not on `kind`: the bootstrap
+ workspace is the first one the user created and belongs to. Keying
+ off `kind == "personal"` would also match a second personal
+ workspace they made by hand, and which of the two came back would
+ depend on row order.
Caller is responsible for committing unless `commit=True`. Defaults
to flush-only because callers often want to bundle this with the
@@ -48,9 +54,9 @@ async def create_personal_workspace_for_user(
.join(WorkspaceMember, WorkspaceMember.workspace_id == Workspace.id)
.where(
WorkspaceMember.user_id == user.id,
- Workspace.kind == "personal",
Workspace.created_by_user_id == user.id,
)
+ .order_by(Workspace.created_at.asc())
.limit(1)
)
found = existing.scalar_one_or_none()
diff --git a/backend/tests/test_workspace_kind.py b/backend/tests/test_workspace_kind.py
new file mode 100644
index 00000000..7d237732
--- /dev/null
+++ b/backend/tests/test_workspace_kind.py
@@ -0,0 +1,172 @@
+"""Workspace.kind as a real, validated, write-once field.
+
+`kind` is chosen at creation and never edited afterwards, so the tests
+cover the create-side validation, the fact that update cannot touch it,
+and the bootstrap idempotency guard that identifies the first workspace
+by who made it rather than by its kind.
+"""
+import pytest
+from httpx import AsyncClient
+from sqlalchemy import select
+
+from app.models.user import User
+from app.models.workspace import WORKSPACE_KINDS, Workspace, WorkspaceMember
+from app.services import workspace_service
+
+
+# ---------------------------------------------------------------------------
+# create
+# ---------------------------------------------------------------------------
+def test_only_two_kinds_exist():
+ assert WORKSPACE_KINDS == ("personal", "business")
+
+
+async def test_create_rejects_unknown_kind(client: AsyncClient, auth_headers, test_user):
+ resp = await client.post(
+ "/api/workspaces",
+ headers=auth_headers,
+ json={"name": "Nonsense", "kind": "nonsense", "self_membership": True},
+ )
+ assert resp.status_code == 422, resp.text
+
+
[email protected]("retired", ["freelancer", "small_business", "accountant_firm"])
+async def test_create_rejects_retired_kinds(
+ client: AsyncClient, auth_headers, test_user, retired: str
+):
+ """The work kinds collapsed into `business`; accountant_firm was an
+ edge between workspaces, which `managed_by_user_id` already covers."""
+ resp = await client.post(
+ "/api/workspaces",
+ headers=auth_headers,
+ json={"name": "Old kind", "kind": retired, "self_membership": True},
+ )
+ assert resp.status_code == 422, resp.text
+
+
+async def test_create_persists_selected_kind(client: AsyncClient, auth_headers, test_user):
+ resp = await client.post(
+ "/api/workspaces",
+ headers=auth_headers,
+ json={"name": "Consultoria", "kind": "business", "self_membership": True},
+ )
+ assert resp.status_code == 201, resp.text
+ assert resp.json()["kind"] == "business"
+
+ # And it survives the round trip through the listing.
+ listing = await client.get("/api/workspaces", headers=auth_headers)
+ created = next(w for w in listing.json() if w["name"] == "Consultoria")
+ assert created["kind"] == "business"
+
+
+async def test_create_defaults_to_personal(client: AsyncClient, auth_headers, test_user):
+ resp = await client.post(
+ "/api/workspaces",
+ headers=auth_headers,
+ json={"name": "Unspecified", "self_membership": True},
+ )
+ assert resp.status_code == 201, resp.text
+ assert resp.json()["kind"] == "personal"
+
+
+# ---------------------------------------------------------------------------
+# update — kind is write-once
+# ---------------------------------------------------------------------------
+async def test_update_cannot_change_kind(client: AsyncClient, auth_headers, test_workspace):
+ """`kind` is not part of WorkspaceUpdate, so a client that sends it
+ gets everything else applied and the kind left alone."""
+ resp = await client.patch(
+ f"/api/workspaces/{test_workspace.id}",
+ headers=auth_headers,
+ json={"name": "Renamed", "kind": "business"},
+ )
+ assert resp.status_code == 200, resp.text
+ body = resp.json()
+ assert body["name"] == "Renamed"
+ assert body["kind"] == "personal"
+
+ # Not just the response shape — the row itself is untouched.
+ current = await client.get("/api/workspaces/current", headers=auth_headers)
+ assert current.json()["kind"] == "personal"
+
+
+# ---------------------------------------------------------------------------
+# bootstrap idempotency
+# ---------------------------------------------------------------------------
+async def test_bootstrap_is_idempotent(session, test_user: User, test_workspace: Workspace):
+ again = await workspace_service.create_personal_workspace_for_user(session, test_user)
+ await session.commit()
+ assert again.id == test_workspace.id
+
+ rows = await session.execute(
+ select(Workspace)
+ .join(WorkspaceMember, WorkspaceMember.workspace_id == Workspace.id)
+ .where(WorkspaceMember.user_id == test_user.id)
+ )
+ assert len(list(rows.scalars().all())) == 1
+
+
+async def test_bootstrap_returns_the_oldest_workspace(
+ session, test_user: User, test_workspace: Workspace
+):
+ """A second self-owned workspace doesn't shadow the bootstrap one,
+ whatever kind either of them has."""
+ await workspace_service.create_workspace(
+ session,
+ name="Second",
+ creator=test_user,
+ kind="business",
+ self_membership=True,
+ seed_defaults=False,
+ )
+ await session.commit()
+
+ found = await workspace_service.create_personal_workspace_for_user(session, test_user)
+ await session.commit()
+ assert found.id == test_workspace.id
+
+
+async def test_bootstrap_ignores_a_hand_made_personal_workspace(
+ session, test_user: User, test_workspace: Workspace
+):
+ """Matching on `kind == "personal"` would have made this ambiguous."""
+ await workspace_service.create_workspace(
+ session,
+ name="Second home",
+ creator=test_user,
+ kind="personal",
+ self_membership=True,
+ seed_defaults=False,
+ )
+ await session.commit()
+
+ found = await workspace_service.create_personal_workspace_for_user(session, test_user)
+ await session.commit()
+ assert found.id == test_workspace.id
+
+
+async def test_fresh_signup_lands_in_a_personal_workspace(client: AsyncClient, clean_db):
+ """First run is untouched: no question asked, kind is personal."""
+ resp = await client.post(
+ "/api/auth/register",
+ json={"email": "[email protected]", "password": "newpass123"},
+ )
+ assert resp.status_code == 201, resp.text
+
+ login = await client.post(
+ "/api/auth/login",
+ data={"username": "[email protected]", "password": "newpass123"},
+ )
+ headers = {"Authorization": f"Bearer {login.json()['access_token']}"}
+ current = await client.get("/api/workspaces/current", headers=headers)
+ assert current.status_code == 200, current.text
+ assert current.json()["kind"] == "personal"
diff --git a/backend/tests/test_workspaces_api_coverage.py b/backend/tests/test_workspaces_api_coverage.py
index ef631a21..f1a0136b 100644
--- a/backend/tests/test_workspaces_api_coverage.py
+++ b/backend/tests/test_workspaces_api_coverage.py
@@ -36,7 +36,7 @@ async def test_create_workspace_with_self_membership(client: AsyncClient, auth_h
headers=auth_headers,
json={
"name": "Side Business",
- "kind": "small_business",
+ "kind": "business",
"default_currency": "EUR",
"self_membership": True,
},
diff --git a/frontend/src/components/workspace-switcher.tsx b/frontend/src/components/workspace-switcher.tsx
index e573abed..10dc21c2 100644
--- a/frontend/src/components/workspace-switcher.tsx
+++ b/frontend/src/components/workspace-switcher.tsx
@@ -46,7 +46,12 @@ import {
Fingerprint,
} from 'lucide-react'
import { CategoryIcon } from '@/components/category-icon'
-import type { Workspace } from '@/types'
+import {
+ WORKSPACE_KINDS,
+ WORKSPACE_KIND_ICON,
+ WORKSPACE_KIND_LABEL_KEY,
+} from '@/lib/workspace-kinds'
+import type { Workspace, WorkspaceKind } from '@/types'
const ROLE_LABEL_KEY: Record<string, string> = {
owner: 'workspace.roleOwner',
@@ -55,17 +60,11 @@ const ROLE_LABEL_KEY: Record<string, string> = {
manager: 'workspace.roleManager',
}
-// Fallbacks when a workspace hasn't set its own icon/color yet.
-const DEFAULT_ICON_BY_KIND: Record<string, string> = {
- personal: 'user',
- freelancer: 'briefcase',
- small_business: 'building-2',
- accountant_firm: 'landmark',
-}
+// Fallback when a workspace hasn't set its own color yet.
const DEFAULT_COLOR = '#6366F1'
function workspaceIcon(w: Workspace): string {
- return w.icon || DEFAULT_ICON_BY_KIND[w.kind] || 'briefcase'
+ return w.icon || WORKSPACE_KIND_ICON[w.kind as WorkspaceKind] || 'briefcase'
}
function workspaceColor(w: Workspace): string {
return w.color || DEFAULT_COLOR
@@ -112,6 +111,7 @@ export function WorkspaceSwitcher({
const { user, logout } = useAuth()
const [createOpen, setCreateOpen] = useState(false)
const [newName, setNewName] = useState('')
+ const [newKind, setNewKind] = useState<WorkspaceKind>('personal')
const currentLang = resolveSupportedLang(i18n.resolvedLanguage ?? i18n.language)
@@ -119,6 +119,7 @@ export function WorkspaceSwitcher({
mutationFn: () =>
workspacesApi.create({
name: newName.trim(),
+ kind: newKind,
self_membership: true,
locale: currentLang,
}),
@@ -128,6 +129,7 @@ export function WorkspaceSwitcher({
await switchWorkspace(ws.id)
setCreateOpen(false)
setNewName('')
+ setNewKind('personal')
navigate('/workspace/settings')
},
onError: (e: unknown) => {
@@ -406,6 +408,43 @@ export function WorkspaceSwitcher({
maxLength={100}
/>
</div>
+ <div className="space-y-1.5">
+ <Label className="text-[13px]">{t('workspace.kind', 'Type')}</Label>
+ <div className="grid grid-cols-2 gap-2">
+ {WORKSPACE_KINDS.map((kind) => {
+ const isSelected = kind === newKind
+ return (
+ <button
+ key={kind}
+ type="button"
+ onClick={() => setNewKind(kind)}
+ aria-pressed={isSelected}
+ className={`flex items-center gap-2.5 rounded-lg border p-3 text-left transition-colors ${
+ isSelected
+ ? 'border-primary bg-primary/5'
+ : 'border-input hover:bg-muted/40'
+ }`}
+ >
+ <CategoryIcon
+ icon={WORKSPACE_KIND_ICON[kind]}
+ color={isSelected ? DEFAULT_COLOR : '#94A3B8'}
+ size="sm"
+ className="shrink-0"
+ />
+ <span className="text-[13px] font-medium leading-tight">
+ {t(WORKSPACE_KIND_LABEL_KEY[kind])}
+ </span>
+ </button>
+ )
+ })}
+ </div>
+ <p className="text-[11px] text-muted-foreground leading-relaxed">
+ {t(
+ 'workspace.kindHint',
+ "Pick what this workspace tracks. This can't be changed later.",
+ )}
+ </p>
+ </div>
</div>
<DialogFooter className="mt-2">
<Button
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
index f91d0c19..19094d25 100644
--- a/frontend/src/lib/api.ts
+++ b/frontend/src/lib/api.ts
@@ -29,6 +29,7 @@ import type {
ImportLog,
ImportPreviewTransaction,
Workspace,
+ WorkspaceKind,
WorkspaceMember,
WorkspaceRole,
Asset,
@@ -100,7 +101,7 @@ export const workspaces = {
},
create: async (payload: {
name: string
- kind?: string
+ kind?: WorkspaceKind
default_currency?: string
locale?: string
icon?: string
@@ -110,6 +111,7 @@ export const workspaces = {
const { data } = await api.post('/workspaces', payload)
return data
},
+ // `kind` is absent on purpose: it is fixed when the workspace is created.
update: async (id: string, payload: Partial<Pick<Workspace, 'name' | 'icon' | 'color' | 'default_currency' | 'locale'>>): Promise<Workspace> => {
const { data } = await api.patch(`/workspaces/${id}`, payload)
return data
diff --git a/frontend/src/lib/workspace-kinds.ts b/frontend/src/lib/workspace-kinds.ts
new file mode 100644
index 00000000..41b5f3ac
--- /dev/null
+++ b/frontend/src/lib/workspace-kinds.ts
@@ -0,0 +1,19 @@
+import type { WorkspaceKind } from '@/types'
+
+/**
+ * The workspace kinds, in the order they're offered at creation. Set
+ * once and never edited, so this list only ever feeds the create dialog
+ * and read-only labels.
+ */
+export const WORKSPACE_KINDS: readonly WorkspaceKind[] = ['personal', 'business']
+
+export const WORKSPACE_KIND_LABEL_KEY: Record<WorkspaceKind, string> = {
+ personal: 'workspace.kindPersonal',
+ business: 'workspace.kindBusiness',
+}
+
+/** Fallback icon when a workspace hasn't picked its own. */
+export const WORKSPACE_KIND_ICON: Record<WorkspaceKind, string> = {
+ personal: 'user',
+ business: 'building-2',
+}
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index bca9fa34..54b1c343 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -7,9 +7,8 @@
"name": "Name",
"kind": "Typ",
"kindPersonal": "Persönlich",
- "kindFreelancer": "Freiberufler",
- "kindSmallBusiness": "Kleines Unternehmen",
- "kindAccountantFirm": "Steuerberatungskanzlei",
+ "kindBusiness": "Geschäftlich",
+ "kindHint": "Wähle, was dieser Workspace erfasst. Das lässt sich später nicht ändern.",
"defaultCurrency": "Standardwährung",
"locale": "Sprache",
"members": "Mitglieder",
@@ -1290,7 +1289,8 @@
"emptyHint": "Erstelle eine Gruppe, um Ausgaben mit anderen Personen, Abteilungen oder Projekten aufzuteilen.",
"name": "Name",
"kindLabel": "Typ",
- "kindHint": "Bestimmt die Beschriftungen und Berichte — wähle die am besten passende Option.",
+ "kindBusiness": "Geschäftlich",
+ "kindHint": "Wähle, was dieser Workspace erfasst. Das lässt sich später nicht ändern.",
"defaultCurrency": "Standardwährung",
"notes": "Notizen",
"archived": "Archiviert",
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index c238eab3..a9008cea 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -7,9 +7,8 @@
"name": "Name",
"kind": "Type",
"kindPersonal": "Personal",
- "kindFreelancer": "Freelancer",
- "kindSmallBusiness": "Small business",
- "kindAccountantFirm": "Accountant firm",
+ "kindBusiness": "Business",
+ "kindHint": "Pick what this workspace tracks. This can't be changed later.",
"defaultCurrency": "Default currency",
"locale": "Language",
"members": "Members",
@@ -1290,7 +1289,8 @@
"emptyHint": "Create a group to split expenses with people, departments, or projects.",
"name": "Name",
"kindLabel": "Type",
- "kindHint": "Drives the labels and reports — pick the closest fit.",
+ "kindBusiness": "Business",
+ "kindHint": "Pick what this workspace tracks. This can't be changed later.",
"defaultCurrency": "Default currency",
"notes": "Notes",
"archived": "Archived",
diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json
index 4db7c019..b31a7550 100644
--- a/frontend/src/locales/es.json
+++ b/frontend/src/locales/es.json
@@ -7,9 +7,8 @@
"name": "Nombre",
"kind": "Tipo",
"kindPersonal": "Personal",
- "kindFreelancer": "Freelancer",
- "kindSmallBusiness": "Pequeña empresa",
- "kindAccountantFirm": "Despacho contable",
+ "kindBusiness": "Negocios",
+ "kindHint": "Elige qué registra este espacio de trabajo. Esto no se puede cambiar después.",
"defaultCurrency": "Moneda por defecto",
"locale": "Idioma",
"members": "Miembros",
@@ -1290,7 +1289,8 @@
"emptyHint": "Crea un grupo para dividir gastos con personas, departamentos o proyectos.",
"name": "Nombre",
"kindLabel": "Tipo",
- "kindHint": "Define las etiquetas y los informes — elige la opción más cercana.",
+ "kindBusiness": "Negocios",
+ "kindHint": "Elige qué registra este espacio de trabajo. Esto no se puede cambiar después.",
"defaultCurrency": "Moneda predeterminada",
"notes": "Notas",
"archived": "Archivado",
diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json
index a5c60cce..c8391bb9 100644
--- a/frontend/src/locales/fr.json
+++ b/frontend/src/locales/fr.json
@@ -7,9 +7,8 @@
"name": "Nom",
"kind": "Type",
"kindPersonal": "Personnel",
- "kindFreelancer": "Indépendant",
- "kindSmallBusiness": "Petite entreprise",
- "kindAccountantFirm": "Cabinet comptable",
+ "kindBusiness": "Professionnel",
+ "kindHint": "Choisissez ce que suit cet espace de travail. Ce choix est définitif.",
"defaultCurrency": "Devise par défaut",
"locale": "Langue",
"members": "Membres",
@@ -1290,7 +1289,8 @@
"emptyHint": "Créez un groupe pour partager des dépenses avec des personnes, des services ou des projets.",
"name": "Nom",
"kindLabel": "Type",
- "kindHint": "Détermine les libellés et les rapports — choisissez le plus proche.",
+ "kindBusiness": "Professionnel",
+ "kindHint": "Choisissez ce que suit cet espace de travail. Ce choix est définitif.",
"defaultCurrency": "Devise par défaut",
"notes": "Notes",
"archived": "Archivé",
diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json
index c5c6b672..688b0102 100644
--- a/frontend/src/locales/it.json
+++ b/frontend/src/locales/it.json
@@ -7,9 +7,8 @@
"name": "Nome",
"kind": "Tipo",
"kindPersonal": "Personale",
- "kindFreelancer": "Libero professionista",
- "kindSmallBusiness": "Piccola impresa",
- "kindAccountantFirm": "Studio contabile",
+ "kindBusiness": "Attività",
+ "kindHint": "Scegli cosa traccia quest'area di lavoro. Non è modificabile in seguito.",
"defaultCurrency": "Valuta predefinita",
"locale": "Lingua",
"members": "Membri",
@@ -1290,7 +1289,8 @@
"emptyHint": "Crea un gruppo per dividere le spese con persone, reparti o progetti.",
"name": "Nome",
"kindLabel": "Tipo",
- "kindHint": "Determina le etichette e i report — scegli l'opzione più adatta.",
+ "kindBusiness": "Attività",
+ "kindHint": "Scegli cosa traccia quest'area di lavoro. Non è modificabile in seguito.",
"defaultCurrency": "Valuta predefinita",
"notes": "Note",
"archived": "Archiviato",
diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json
index 35151d10..228b1604 100644
--- a/frontend/src/locales/pl.json
+++ b/frontend/src/locales/pl.json
@@ -7,9 +7,8 @@
"name": "Nazwa",
"kind": "Typ",
"kindPersonal": "Osobisty",
- "kindFreelancer": "Freelancer",
- "kindSmallBusiness": "Mała firma",
- "kindAccountantFirm": "Biuro rachunkowe",
+ "kindBusiness": "Firmowy",
+ "kindHint": "Wybierz, co śledzi ten obszar roboczy. Tego nie można później zmienić.",
"defaultCurrency": "Waluta domyślna",
"locale": "Język",
"members": "Członkowie",
@@ -1374,7 +1373,8 @@
"emptyHint": "Utwórz grupę, aby dzielić wydatki z osobami, działami lub projektami.",
"name": "Nazwa",
"kindLabel": "Typ",
- "kindHint": "Wpływa na etykiety i raporty — wybierz najbliższe dopasowanie.",
+ "kindBusiness": "Firmowy",
+ "kindHint": "Wybierz, co śledzi ten obszar roboczy. Tego nie można później zmienić.",
"defaultCurrency": "Waluta domyślna",
"notes": "Notatki",
"archived": "Zarchiwizowane",
diff --git a/frontend/src/locales/pt-BR.json b/frontend/src/locales/pt-BR.json
index ebed7c51..cbed929d 100644
--- a/frontend/src/locales/pt-BR.json
+++ b/frontend/src/locales/pt-BR.json
@@ -7,9 +7,8 @@
"name": "Nome",
"kind": "Tipo",
"kindPersonal": "Pessoal",
- "kindFreelancer": "Freelancer",
- "kindSmallBusiness": "Pequena empresa",
- "kindAccountantFirm": "Escritório contábil",
+ "kindBusiness": "Negócios",
+ "kindHint": "Escolha o que este workspace vai acompanhar. Isso não pode ser alterado depois.",
"defaultCurrency": "Moeda padrão",
"locale": "Idioma",
"members": "Membros",
@@ -1290,7 +1289,8 @@
"emptyHint": "Crie um grupo para dividir despesas com pessoas, departamentos ou projetos.",
"name": "Nome",
"kindLabel": "Tipo",
- "kindHint": "Define os rótulos e relatórios — escolha o que mais se aproxima.",
+ "kindBusiness": "Negócios",
+ "kindHint": "Escolha o que este workspace vai acompanhar. Isso não pode ser alterado depois.",
"defaultCurrency": "Moeda padrão",
"notes": "Notas",
"archived": "Arquivado",
diff --git a/frontend/src/locales/pt-PT.json b/frontend/src/locales/pt-PT.json
index e601cdde..a75f6e49 100644
--- a/frontend/src/locales/pt-PT.json
+++ b/frontend/src/locales/pt-PT.json
@@ -7,9 +7,8 @@
"name": "Nome",
"kind": "Tipo",
"kindPersonal": "Pessoal",
- "kindFreelancer": "Trabalhador independente",
- "kindSmallBusiness": "Pequena empresa",
- "kindAccountantFirm": "Gabinete de contabilidade",
+ "kindBusiness": "Negócios",
+ "kindHint": "Escolhe o que este espaço de trabalho vai acompanhar. Isto não pode ser alterado depois.",
"defaultCurrency": "Moeda predefinida",
"locale": "Idioma",
"members": "Membros",
@@ -1290,7 +1289,8 @@
"emptyHint": "Cria um grupo para dividir despesas com pessoas, departamentos ou projetos.",
"name": "Nome",
"kindLabel": "Tipo",
- "kindHint": "Define os rótulos e relatórios — escolhe o que mais se aproxima.",
+ "kindBusiness": "Negócios",
+ "kindHint": "Escolhe o que este espaço de trabalho vai acompanhar. Isto não pode ser alterado depois.",
"defaultCurrency": "Moeda padrão",
"notes": "Notas",
"archived": "Arquivado",
diff --git a/frontend/src/locales/ru.json b/frontend/src/locales/ru.json
index da014fe5..bccc5d03 100644
--- a/frontend/src/locales/ru.json
+++ b/frontend/src/locales/ru.json
@@ -7,9 +7,8 @@
"name": "Название",
"kind": "Тип",
"kindPersonal": "Личное",
- "kindFreelancer": "Фрилансер",
- "kindSmallBusiness": "Малый бизнес",
- "kindAccountantFirm": "Бухгалтерская фирма",
+ "kindBusiness": "Бизнес",
+ "kindHint": "Выберите, что будет вести это рабочее пространство. Изменить позже нельзя.",
"defaultCurrency": "Валюта по умолчанию",
"locale": "Язык",
"members": "Участники",
@@ -1296,7 +1295,8 @@
"emptyHint": "Создайте группу, чтобы разделять расходы с людьми, отделами или проектами.",
"name": "Название",
"kindLabel": "Тип",
- "kindHint": "Определяет метки и отчёты — выберите наиболее подходящий.",
+ "kindBusiness": "Бизнес",
+ "kindHint": "Выберите, что будет вести это рабочее пространство. Изменить позже нельзя.",
"defaultCurrency": "Валюта по умолчанию",
"notes": "Примечания",
"archived": "Архивирована",
diff --git a/frontend/src/locales/uk.json b/frontend/src/locales/uk.json
index 393d27fc..3028c346 100644
--- a/frontend/src/locales/uk.json
+++ b/frontend/src/locales/uk.json
@@ -7,9 +7,8 @@
"name": "Назва",
"kind": "Тип",
"kindPersonal": "Особистий",
- "kindFreelancer": "Фрилансер",
- "kindSmallBusiness": "Малий бізнес",
- "kindAccountantFirm": "Бухгалтерська фірма",
+ "kindBusiness": "Бізнес",
+ "kindHint": "Виберіть, що вестиме цей робочий простір. Змінити пізніше не можна.",
"defaultCurrency": "Валюта за замовчуванням",
"locale": "Мова",
"members": "Учасники",
@@ -1296,7 +1295,8 @@
"emptyHint": "Створіть групу, щоб розділяти витрати з людьми, відділами або проєктами.",
"name": "Назва",
"kindLabel": "Тип",
- "kindHint": "Визначає мітки та звіти — оберіть найбільш відповідний.",
+ "kindBusiness": "Бізнес",
+ "kindHint": "Виберіть, що вестиме цей робочий простір. Змінити пізніше не можна.",
"defaultCurrency": "Валюта за замовчуванням",
"notes": "Примітки",
"archived": "Архівована",
diff --git a/frontend/src/pages/workspace-settings.tsx b/frontend/src/pages/workspace-settings.tsx
index 819f1dcc..0a246fd3 100644
--- a/frontend/src/pages/workspace-settings.tsx
+++ b/frontend/src/pages/workspace-settings.tsx
@@ -36,7 +36,8 @@ import {
DialogTitle,
} from '@/components/ui/dialog'
import { AlertTriangle, Archive, Plus, Save, Trash2, Users } from 'lucide-react'
-import type { WorkspaceMember, WorkspaceRole } from '@/types'
+import { WORKSPACE_KIND_LABEL_KEY } from '@/lib/workspace-kinds'
+import type { WorkspaceKind, WorkspaceMember, WorkspaceRole } from '@/types'
function labelForRole(role: WorkspaceRole, t: (key: string) => string): string {
return {
@@ -246,6 +247,7 @@ export default function WorkspaceSettingsPage() {
const stats = statsQuery.data ?? { members: 1, accounts: 0, transactions: 0 }
const isManaged = !!current.managed_by_user_id
const isManagerSelf = isManaged && current.managed_by_user_id === currentUser?.id
+ const kindLabelKey = WORKSPACE_KIND_LABEL_KEY[current.kind as WorkspaceKind]
return (
<div className="container max-w-5xl py-8 space-y-6">
@@ -261,6 +263,12 @@ export default function WorkspaceSettingsPage() {
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2 flex-wrap">
<h1 className="text-xl font-semibold truncate">{current.name}</h1>
+ {/* Fixed at creation, so it reads as identity, not a control. */}
+ {kindLabelKey && (
+ <Badge variant="outline" className="text-[11px]">
+ {t(kindLabelKey)}
+ </Badge>
+ )}
{current.role && (
<Badge variant="secondary" className="text-[11px]">
{labelForRole(current.role, t)}
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
index d59ab650..ca47c8f0 100644
--- a/frontend/src/types/index.ts
+++ b/frontend/src/types/index.ts
@@ -45,9 +45,13 @@ export interface AppSetting {
export type WorkspaceRole = 'owner' | 'editor' | 'viewer' | 'manager'
+export type WorkspaceKind = 'personal' | 'business'
+
export interface Workspace {
id: string
name: string
+ // Widened on purpose: a workspace stored before the current kind list
+ // still has to render. Writes are narrowed to WorkspaceKind.
kind: string
is_archived: boolean
default_currency: string