mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
Initial public release
Aurum — a self-hosted personal finance operating system: cash flow, net worth tracking, budgets, goals, recurring payments, reports, proactive alerts, and a compound-interest returns calculator, all bilingual (RU/EN) and mobile-first. Ships as a three-container Docker Compose stack (Postgres + FastAPI + nginx-served React frontend). See README.md for setup and CONTRIBUTING.md for development.
This commit is contained in:
29
backend/app/schemas/category.py
Normal file
29
backend/app/schemas/category.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from app.models.enums import CategoryKind
|
||||
|
||||
|
||||
class CategoryBase(BaseModel):
|
||||
name: str = Field(min_length=1, max_length=100)
|
||||
kind: CategoryKind
|
||||
icon: str | None = None
|
||||
color: str = Field(pattern=r"^#[0-9a-fA-F]{6}$")
|
||||
sort_order: int = 0
|
||||
|
||||
|
||||
class CategoryCreate(CategoryBase):
|
||||
pass
|
||||
|
||||
|
||||
class CategoryUpdate(BaseModel):
|
||||
name: str | None = Field(default=None, min_length=1, max_length=100)
|
||||
icon: str | None = None
|
||||
color: str | None = Field(default=None, pattern=r"^#[0-9a-fA-F]{6}$")
|
||||
sort_order: int | None = None
|
||||
|
||||
|
||||
class CategoryRead(CategoryBase):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
is_default: bool
|
||||
Reference in New Issue
Block a user