- Database: kanzlai.document_templates table with RLS policies
- Seed: 4 system templates (Klageerwiderung UPC, Berufungsschrift,
Mandatsbestätigung, Kostenrechnung)
- Backend: TemplateService (CRUD + render), TemplateHandler with
endpoints: GET/POST /api/templates, GET/PUT/DELETE /api/templates/{id},
POST /api/templates/{id}/render?case_id=X
- Template variables: case.*, party.*, tenant.*, user.*, date.*, deadline.*
- Frontend: /vorlagen page with category filters, template detail/editor,
render flow (select case -> preview -> copy/download), variable toolbar
- Quick action: "Schriftsatz erstellen" button on case detail page
- Also: resolved merge conflicts between audit-trail and role-based branches,
added missing Notification/AuditLog types to frontend
22 lines
741 B
Go
22 lines
741 B
Go
package models
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type DocumentTemplate struct {
|
|
ID uuid.UUID `db:"id" json:"id"`
|
|
TenantID *uuid.UUID `db:"tenant_id" json:"tenant_id,omitempty"`
|
|
Name string `db:"name" json:"name"`
|
|
Description *string `db:"description" json:"description,omitempty"`
|
|
Category string `db:"category" json:"category"`
|
|
Content string `db:"content" json:"content"`
|
|
Variables json.RawMessage `db:"variables" json:"variables"`
|
|
IsSystem bool `db:"is_system" json:"is_system"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
|
}
|