mandant-crm/frontend/types/index.ts
Tim Stollberg 570f17e8b8 feat(frontend): commit uncommitted settings, custom fields, and import work
This local working tree had accumulated a substantial amount of
finished-but-never-committed frontend work: custom client fields
(replacing the old static ClientFields with a dynamic
ClientCustomFieldCard + useCustomFields), CSV import
(useImport + settings/import page), history type management
(useHistoryTypes + settings/history-types page), an admin-only route
middleware, several new icon components, a shared useApiFetch
composable, and a client detail page restructure ([id].vue ->
[id]/index.vue). None of it had ever been pushed, so production was
running a stale build that was already linking to routes/components
that didn't exist server-side (missing IconSettings, 404s on
/settings/import, etc). This commit brings the repo in line with
local state.
2026-07-18 16:27:19 +07:00

92 lines
1.8 KiB
TypeScript

export interface User {
id: number
name: string
email: string
role: 'admin' | 'staff'
}
export type CustomFieldType = 'text' | 'textarea' | 'number' | 'date' | 'select'
export interface CustomFieldDefinition {
id: number
label: string
key: string
type: CustomFieldType
options: string[]
is_required: boolean
sort_order: number
}
export interface ClientCustomField {
definition_id: number
key: string
label: string
type: CustomFieldType
options: string[]
is_required: boolean
value: string | null
author_name: string | null
updated_at: string | null
}
export interface Client {
id: number
client_number: string
name: string
notes: Record<string, string>
custom_fields?: ClientCustomField[]
// Present on list/search responses only.
history_count?: number
last_history_at?: string | null
created_at: string
updated_at: string
}
export interface HistoryType {
id: number
name: string
requires_datetime: boolean
sort_order: number
}
export interface HistoryEntry {
id: number
client_id: number
is_field_change: boolean
history_entry_type_id: number | null
type_name: string | null
requires_datetime: boolean
occurred_at: string | null
body: string
custom_field_definition_id: number | null
author_id: number
author_name: string | null
updated_by: number | null
updated_by_name: string | null
created_at: string
updated_at: string
}
export interface ImportError {
row: number
client_number: string | null
message: string
}
export interface ImportResult {
total: number
created: number
updated: number
skipped: number
errors: ImportError[]
}
export interface PaginatedResponse<T> {
data: T[]
meta: {
current_page: number
last_page: number
total: number
per_page: number
}
}