flaschengeist-frontend/src/flaschengeist.d.ts

59 lines
1.0 KiB
TypeScript
Raw Normal View History

2020-10-21 15:39:04 +00:00
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<Role>;
}
type Permission = string;
interface Role {
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;
}
}