flaschengeist-frontend/src/flaschengeist.d.ts

57 lines
952 B
TypeScript
Raw Normal View History

2020-10-21 15:39:04 +00:00
declare namespace FG {
2020-11-02 03:42:19 +00:00
interface Session {
expires: Date;
token: string;
lifetime: number;
browser: string;
platform: 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;
}
2020-10-21 15:39:04 +00:00
interface Event {
id: number;
begin: Date;
2020-11-02 03:42:19 +00:00
end: Date;
2020-10-21 15:39:04 +00:00
description: string;
2020-11-02 03:42:19 +00:00
type: EventType;
2020-10-21 15:39:04 +00:00
slots: Array<EventSlot>;
}
interface EventSlot {
id: number;
start: Date;
end?: any;
2020-11-02 03:42:19 +00:00
jobs: Array<JobSlot>;
2020-10-21 15:39:04 +00:00
}
2020-11-02 03:42:19 +00:00
type EventType = string;
2020-10-21 15:39:04 +00:00
interface Job {
userid: string;
value: number;
}
interface JobSlot {
id: number;
2020-11-02 03:42:19 +00:00
type: JobType;
users: Array<Job>;
required_jobs: number;
2020-10-21 15:39:04 +00:00
}
2020-11-02 03:42:19 +00:00
type JobType = string;
}