flaschengeist-frontend/src/flaschengeist.d.ts

60 lines
1.1 KiB
TypeScript

declare namespace FG {
interface Session {
expires: Date;
token: string;
lifetime: number;
browser: string;
platform: string;
userid: string;
}
interface User {
userid: string;
display_name: string;
firstname: string;
lastname: string;
mail: string;
roles: Array<string>;
}
type Permission = string;
interface Role {
id: number;
name: string;
permissions: Array<Permission>;
}
interface Transaction {
id: number;
time: Date;
amount: number;
sender_id: string;
receiver_id: string;
author_id: string;
}
interface Event {
id: number;
start: Date;
description?: any;
type: EventType;
slots: Array<EventSlot>;
}
interface EventSlot {
id: number;
start: Date;
end?: any;
jobs: Array<JobSlot>;
}
type EventType = string;
interface Job {
userid: string;
value: number;
}
interface JobSlot {
type: JobType;
users: Array<Job>;
required_jobs: number;
}
interface JobType {
id: number;
name: string;
}
}