Initial TicketTracker release

This commit is contained in:
michael committed 2026-08-05 10:55:30 +02:00
commit 125b1d22ff
128 files changed
+26208

No files matched your search

+193
View File
@@ -0,0 +1,193 @@
export type WorkType = "support" | "consulting";
export type BillingStatus = "billed" | "non_billable" | null;
export type PeriodType = "month" | "day";
export type UserRole = "admin" | "user";
export type AuthUser = {
id: string;
username: string;
display_name: string;
role: UserRole;
active: boolean;
};
export type AdminUser = AuthUser & {
created_at: string;
updated_at: string;
};
export type AdminSession = {
id: string;
ticket_id: string;
user_id: string;
owner_username: string;
owner_display_name: string;
ticket_number: string;
organization_id: string | null;
organization_name: string | null;
customer_name: string;
activity: string;
work_type: WorkType;
started_at: string;
ended_at: string;
duration_seconds: number;
rounded_minutes: number;
billing_status: BillingStatus;
created_at: string;
recurring_billing_id: string | null;
recurring_billing_slot_id: string | null;
recurring_occurrence_date: string | null;
};
export type Organization = {
id: string;
zammad_id: string;
name: string;
synced_at: string;
};
export type RecurringBillingSlot = {
id?: string;
weekday: number | null;
start_time: string | null;
duration_minutes: number;
};
export type RecurringBilling = {
id: string;
user_id: string;
owner_username: string;
owner_display_name: string;
ticket_number: string;
configured_ticket_number: string | null;
organization_id: string;
organization_name: string;
activity: string;
work_type: WorkType;
recurrence_type: "weekly" | "every_n_weeks";
interval_value: number;
valid_from: string;
valid_until: string | null;
start_time: string;
active: boolean;
created_at: string;
updated_at: string;
slots: RecurringBillingSlot[];
};
export type TicketMeta = {
id: string;
ticket_number: string;
organization_id: string | null;
organization_name: string | null;
customer_name: string | null;
work_type: WorkType | null;
};
export type TicketSummary = {
id: string;
ticket_number: string;
organization_id: string | null;
organization_name: string | null;
customer_name: string | null;
work_type: WorkType | null;
session_count: number;
total_minutes: number;
open_count: number;
ticket_open_count: number;
billed_count: number;
non_billable_count: number;
recurring_session_count: number;
manual_session_count: number;
requires_closure: boolean;
closed: boolean;
closed_at: string | null;
};
export type OpenSession = {
id: string;
ticket_id: string;
ticket_number: string;
organization_id: string | null;
organization_name: string | null;
customer_name: string;
activity: string;
work_type: WorkType;
started_at: string;
rounded_minutes: number;
};
export type ActivityBucket = {
bucket_key: string;
session_count: number;
total_minutes: number;
};
export type PeriodOverview = {
periodType: PeriodType;
period: string;
closed: boolean;
closedAt: string | null;
canClose: boolean;
totals: {
tickets: number;
sessions: number;
minutes: number;
crmBilledMinutes: number;
openSessions: number;
};
tickets: TicketSummary[];
openSessions: OpenSession[];
activitySeries: ActivityBucket[];
};
export type TicketDayBilling = {
day: string;
billed_minutes: number;
};
export type SessionEntry = {
id: string;
organization_id: string | null;
organization_name: string | null;
customer_name: string;
activity: string;
work_type: WorkType;
started_at: string;
ended_at: string;
duration_seconds: number;
rounded_minutes: number;
billing_status: BillingStatus;
billing_updated_at: string | null;
created_at: string;
recurring_billing_id: string | null;
recurring_billing_slot_id: string | null;
recurring_occurrence_date: string | null;
};
export type TicketPeriod = {
periodType: PeriodType;
period: string;
closed: boolean;
closedAt: string | null;
ticket: {
id: string;
ticket_number: string;
organization_id: string | null;
organization_name: string | null;
customer_name: string | null;
work_type: WorkType | null;
closed_at: string | null;
requires_closure: boolean;
recurring_session_count: number;
manual_session_count: number;
};
sessions: SessionEntry[];
dayBillings: TicketDayBilling[];
canClose: boolean;
openCount: number;
ticketOpenCount: number;
};
export type MonthOverview = PeriodOverview;
export type TicketMonth = TicketPeriod;