release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
2 changed files with 59 additions and 40 deletions
Showing only changes of commit 42b43aa56c - Show all commits

View File

@ -15,7 +15,7 @@ declare namespace FG {
mail: string; mail: string;
birthday?: Date; birthday?: Date;
roles: Array<string>; roles: Array<string>;
permissions?: Array<Permission>; permissions?: Array<string>;
avatar_url?: string; avatar_url?: string;
} }
type Permission = string; type Permission = string;
@ -34,10 +34,62 @@ declare namespace FG {
author_id?: string; author_id?: string;
original_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: Array<DrinkPriceVolume>;
}
interface DrinkIngredient {
id: number;
volume: number;
drink_ingredient_id: number;
}
interface DrinkPrice {
id: number;
price: number;
public: boolean;
description?: string;
}
interface DrinkPriceVolume {
id: number;
volume: number;
min_prices: Array<MinPrices>;
prices: Array<DrinkPrice>;
ingredients: Array<Ingredient>;
}
interface DrinkType {
id: number;
name: string;
}
interface ExtraIngredient {
id: number;
name: string;
price: number;
}
interface Ingredient {
id: number;
drink_ingredient?: DrinkIngredient;
extra_ingredient?: ExtraIngredient;
}
interface MinPrices {
percentage: number;
price: number;
}
interface Tag {
id: number;
name: string;
}
interface Event { interface Event {
id: number; id: number;
start: Date; start: Date;
end: Date; end?: Date;
description?: string; description?: string;
type: EventType; type: EventType;
jobs: Array<Job>; jobs: Array<Job>;
@ -63,35 +115,4 @@ declare namespace FG {
userid: string; userid: string;
value: number; 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;
}
} }

View File

@ -130,10 +130,8 @@ export default defineComponent({
id: -1, id: -1,
name: '', name: '',
volume: -1, volume: -1,
cost_price: -1, tags: [],
discount: -1, volumes: [],
prices: [],
ingredients: [],
}); });
const emptyPrice = { const emptyPrice = {
volume: '', volume: '',
@ -149,9 +147,9 @@ export default defineComponent({
} }
async function save() { async function save() {
console.log(drink); console.log(drink);
drink.value.prices.forEach((price: FG.DrinkPrice) => { /*drink.value.prices.forEach((price: FG.DrinkPrice) => {
//price.no_auto = !price.no_auto; price.no_auto = !price.no_auto;
}); });*/
await store.createDrink(drink.value); await store.createDrink(drink.value);
} }
return { drink, addPrice, save }; return { drink, addPrice, save };