flaschengeist-frontend/src/flaschengeist.d.ts

124 lines
2.4 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?: string[];
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?: number;
receiver_id?: number;
author_id?: number;
original_id?: number;
}
interface Drink {
id: number;
article_id?: string;
package_size?: number;
name: string;
volume?: number;
cost_price_pro_volume?: number;
cost_price_package_netto?: number;
tags: Array<Tag>;
type: DrinkType;
volumes: DrinkPriceVolume[];
}
interface DrinkIngredient {
id: number;
volume: number;
drink_ingredient_id: number;
drink_ingredient?: Drink;
price: number;
}
interface DrinkPrice {
id: number;
price: number;
public: boolean;
description?: string;
}
interface DrinkMinPrice {
percentage: number;
//price: ComputedRef<number>;
price: number;
}
interface DrinkPriceVolume {
id: number;
volume: number;
//computed_volume: ComputedRef<number>;
min_prices: DrinkMinPrice[];
prices: Array<DrinkPrice>;
ingredients: Array<DrinkIngredient & ExtraIngredient>;
}
interface DrinkType {
id: number;
name: string;
}
interface ExtraIngredient {
id: number;
name: string;
price: number;
}
interface Ingredient {
id: number;
volume_id: number;
drink_ingredient: DrinkIngredient | null;
extra_ingredient: ExtraIngredient | null;
}
interface Tag {
id: number;
name: string;
}
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;
}
}