flaschengeist-frontend/src/flaschengeist.d.ts

98 lines
1.8 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;
birthday?: Date;
roles: Array<string>;
permissions?: Array<Permission>;
avatar_url?: string;
}
type Permission = string;
interface Role {
id: number;
name: string;
permissions: Array<Permission>;
}
interface Transaction {
id: number;
time: Date;
amount: number;
reversal_id: number;
sender_id?: string;
receiver_id?: string;
author_id?: string;
original_id?: number;
}
interface Event {
id: number;
start: Date;
end: Date;
description?: string;
type: EventType;
jobs: Array<Job>;
}
interface EventType {
id: number;
name: string;
}
interface Job {
id: number;
start: Date;
end?: Date;
comment: string;
type: JobType;
services: Array<Service>;
required_services: number;
}
interface JobType {
id: number;
name: string;
}
interface Service {
userid: string;
value: number;
}
interface Drink {
id: number;
name: string;
volume: number;
cost_price: number;
discount: number;
extra_charge?: any;
prices: Array<DrinkPrice>;
ingredients: Array<Ingredient>;
}
interface DrinkPrice {
id: number;
volume: number;
price: number;
description?: any;
round_step: number;
}
interface DrinkType {
id: number;
name: string;
}
interface Ingredient {
id: number;
volume: number;
parent_id: number;
ingredient_id: number;
}
interface Tag {
id: number;
name: string;
}
}