meal plan stuff

This commit is contained in:
vabene1111
2023-08-30 10:30:12 +02:00
parent 4a1ec5adf7
commit dcfb269909
9 changed files with 304 additions and 225 deletions

View File

@ -23,7 +23,7 @@ export class Models {
false: undefined,
},
},
tree: { default: undefined },
tree: {default: undefined},
},
},
delete: {
@ -50,7 +50,7 @@ export class Models {
type: "lookup",
field: "target",
list: "self",
sticky_options: [{ id: 0, name: "tree_root" }],
sticky_options: [{id: 0, name: "tree_root"}],
},
},
},
@ -71,7 +71,7 @@ export class Models {
food_onhand: true,
shopping: true,
},
tags: [{ field: "supermarket_category", label: "name", color: "info" }],
tags: [{field: "supermarket_category", label: "name", color: "info"}],
// REQUIRED: unordered array of fields that can be set during create
create: {
// if not defined partialUpdate will use the same parameters, prepending 'id'
@ -177,7 +177,7 @@ export class Models {
field: "substitute_siblings",
label: "substitute_siblings", // form.label always translated in utils.getForm()
help_text: "substitute_siblings_help", // form.help_text always translated
condition: { field: "parent", value: true, condition: "field_exists" },
condition: {field: "parent", value: true, condition: "field_exists"},
},
substitute_children: {
form_field: true,
@ -186,7 +186,7 @@ export class Models {
field: "substitute_children",
label: "substitute_children",
help_text: "substitute_children_help",
condition: { field: "numchild", value: 0, condition: "gt" },
condition: {field: "numchild", value: 0, condition: "gt"},
},
inherit_fields: {
form_field: true,
@ -196,7 +196,7 @@ export class Models {
field: "inherit_fields",
list: "FOOD_INHERIT_FIELDS",
label: "InheritFields",
condition: { field: "food_children_exist", value: true, condition: "preference_equals" },
condition: {field: "food_children_exist", value: true, condition: "preference_equals"},
help_text: "InheritFields_help",
},
child_inherit_fields: {
@ -207,7 +207,7 @@ export class Models {
field: "child_inherit_fields",
list: "FOOD_INHERIT_FIELDS",
label: "ChildInheritFields", // form.label always translated in utils.getForm()
condition: { field: "numchild", value: 0, condition: "gt" },
condition: {field: "numchild", value: 0, condition: "gt"},
help_text: "ChildInheritFields_help", // form.help_text always translated
},
reset_inherit: {
@ -217,7 +217,7 @@ export class Models {
field: "reset_inherit",
label: "reset_children",
help_text: "reset_children_help",
condition: { field: "numchild", value: 0, condition: "gt" },
condition: {field: "numchild", value: 0, condition: "gt"},
},
form_function: "FoodCreateDefault",
},
@ -304,24 +304,24 @@ export class Models {
form_field: true,
type: "choice",
options: [
{ value: "g", text: "g" },
{ value: "kg", text: "kg" },
{ value: "ounce", text: "ounce" },
{ value: "pound", text: "pound" },
{ value: "ml", text: "ml" },
{ value: "l", text: "l" },
{ value: "fluid_ounce", text: "fluid_ounce" },
{ value: "pint", text: "pint" },
{ value: "quart", text: "quart" },
{ value: "gallon", text: "gallon" },
{ value: "tbsp", text: "tbsp" },
{ value: "tsp", text: "tsp" },
{ value: "imperial_fluid_ounce", text: "imperial_fluid_ounce" },
{ value: "imperial_pint", text: "imperial_pint" },
{ value: "imperial_quart", text: "imperial_quart" },
{ value: "imperial_gallon", text: "imperial_gallon" },
{ value: "imperial_tbsp", text: "imperial_tbsp" },
{ value: "imperial_tsp", text: "imperial_tsp" },
{value: "g", text: "g"},
{value: "kg", text: "kg"},
{value: "ounce", text: "ounce"},
{value: "pound", text: "pound"},
{value: "ml", text: "ml"},
{value: "l", text: "l"},
{value: "fluid_ounce", text: "fluid_ounce"},
{value: "pint", text: "pint"},
{value: "quart", text: "quart"},
{value: "gallon", text: "gallon"},
{value: "tbsp", text: "tbsp"},
{value: "tsp", text: "tsp"},
{value: "imperial_fluid_ounce", text: "imperial_fluid_ounce"},
{value: "imperial_pint", text: "imperial_pint"},
{value: "imperial_quart", text: "imperial_quart"},
{value: "imperial_gallon", text: "imperial_gallon"},
{value: "imperial_tbsp", text: "imperial_tbsp"},
{value: "imperial_tsp", text: "imperial_tsp"},
],
field: "base_unit",
label: "Base Unit",
@ -375,7 +375,7 @@ export class Models {
name: "Recipe_Book",
apiName: "RecipeBook",
create: {
params: [["name", "description", "filter"]],
params: [["name", "description", "filter"]],
form: {
name: {
form_field: true,
@ -457,7 +457,7 @@ export class Models {
static SUPERMARKET = {
name: "Supermarket",
apiName: "Supermarket",
ordered_tags: [{ field: "category_to_supermarket", label: "category::name", color: "info" }],
ordered_tags: [{field: "category_to_supermarket", label: "category::name", color: "info"}],
create: {
params: [["name", "description", "category_to_supermarket"]],
form: {
@ -540,13 +540,13 @@ export class Models {
form_field: true,
type: "choice",
options: [
{ value: "FOOD_ALIAS", text: "Food_Alias" },
{ value: "UNIT_ALIAS", text: "Unit_Alias" },
{ value: "KEYWORD_ALIAS", text: "Keyword_Alias" },
{ value: "DESCRIPTION_REPLACE", text: "Description_Replace" },
{ value: "INSTRUCTION_REPLACE", text: "Instruction_Replace" },
{ value: "NEVER_UNIT", text: "Never_Unit" },
{ value: "TRANSPOSE_WORDS", text: "Transpose_Words" },
{value: "FOOD_ALIAS", text: "Food_Alias"},
{value: "UNIT_ALIAS", text: "Unit_Alias"},
{value: "KEYWORD_ALIAS", text: "Keyword_Alias"},
{value: "DESCRIPTION_REPLACE", text: "Description_Replace"},
{value: "INSTRUCTION_REPLACE", text: "Instruction_Replace"},
{value: "NEVER_UNIT", text: "Never_Unit"},
{value: "TRANSPOSE_WORDS", text: "Transpose_Words"},
],
field: "type",
label: "Type",
@ -830,7 +830,7 @@ export class Models {
params: ["filter_list"],
},
create: {
params: [["name"]],
params: [["name", "color", "default"]],
form: {
name: {
form_field: true,
@ -839,6 +839,20 @@ export class Models {
label: "Name",
placeholder: "",
},
color: {
form_field: true,
type: "color",
field: "color",
label: "Color",
placeholder: "",
},
default: {
form_field: true,
type: "checkbox",
field: "default",
label: "Default",
placeholder: "",
},
},
},
}
@ -995,7 +1009,7 @@ export class Actions {
},
],
},
ok_label: { function: "translate", phrase: "Save" },
ok_label: {function: "translate", phrase: "Save"},
},
}
static UPDATE = {
@ -1030,7 +1044,7 @@ export class Actions {
},
],
},
ok_label: { function: "translate", phrase: "Delete" },
ok_label: {function: "translate", phrase: "Delete"},
instruction: {
form_field: true,
type: "instruction",
@ -1057,17 +1071,17 @@ export class Actions {
suffix: "s",
params: ["query", "page", "pageSize", "options"],
config: {
query: { default: undefined },
page: { default: 1 },
pageSize: { default: 25 },
query: {default: undefined},
page: {default: 1},
pageSize: {default: 25},
},
}
static MERGE = {
function: "merge",
params: ["source", "target"],
config: {
source: { type: "string" },
target: { type: "string" },
source: {type: "string"},
target: {type: "string"},
},
form: {
title: {
@ -1082,7 +1096,7 @@ export class Actions {
},
],
},
ok_label: { function: "translate", phrase: "Merge" },
ok_label: {function: "translate", phrase: "Merge"},
instruction: {
form_field: true,
type: "instruction",
@ -1116,8 +1130,8 @@ export class Actions {
function: "move",
params: ["source", "target"],
config: {
source: { type: "string" },
target: { type: "string" },
source: {type: "string"},
target: {type: "string"},
},
form: {
title: {
@ -1132,7 +1146,7 @@ export class Actions {
},
],
},
ok_label: { function: "translate", phrase: "Move" },
ok_label: {function: "translate", phrase: "Move"},
instruction: {
form_field: true,
type: "instruction",

View File

@ -4,7 +4,7 @@
* Django Recipes
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -166,7 +166,9 @@ export enum AutomationTypeEnum {
UnitAlias = 'UNIT_ALIAS',
KeywordAlias = 'KEYWORD_ALIAS',
DescriptionReplace = 'DESCRIPTION_REPLACE',
InstructionReplace = 'INSTRUCTION_REPLACE'
InstructionReplace = 'INSTRUCTION_REPLACE',
NeverUnit = 'NEVER_UNIT',
TransposeWords = 'TRANSPOSE_WORDS'
}
/**
@ -463,6 +465,12 @@ export interface Food {
* @memberof Food
*/
recipe?: FoodRecipe | null;
/**
*
* @type {string}
* @memberof Food
*/
url?: string | null;
/**
*
* @type {Array<FoodProperties>}
@ -665,6 +673,12 @@ export interface FoodPropertiesFoodUnit {
* @memberof FoodPropertiesFoodUnit
*/
description?: string | null;
/**
*
* @type {string}
* @memberof FoodPropertiesFoodUnit
*/
base_unit?: string | null;
/**
*
* @type {string}
@ -690,12 +704,6 @@ export interface FoodPropertyType {
* @memberof FoodPropertyType
*/
name: string;
/**
*
* @type {string}
* @memberof FoodPropertyType
*/
icon?: string | null;
/**
*
* @type {string}
@ -708,6 +716,12 @@ export interface FoodPropertyType {
* @memberof FoodPropertyType
*/
description?: string | null;
/**
*
* @type {number}
* @memberof FoodPropertyType
*/
order?: number;
/**
*
* @type {string}
@ -928,12 +942,6 @@ export interface ImportLogKeyword {
* @memberof ImportLogKeyword
*/
name: string;
/**
*
* @type {string}
* @memberof ImportLogKeyword
*/
icon?: string | null;
/**
*
* @type {string}
@ -1104,6 +1112,12 @@ export interface IngredientFood {
* @memberof IngredientFood
*/
recipe?: FoodRecipe | null;
/**
*
* @type {string}
* @memberof IngredientFood
*/
url?: string | null;
/**
*
* @type {Array<FoodProperties>}
@ -1708,12 +1722,6 @@ export interface Keyword {
* @memberof Keyword
*/
name: string;
/**
*
* @type {string}
* @memberof Keyword
*/
icon?: string | null;
/**
*
* @type {string}
@ -1866,12 +1874,6 @@ export interface MealPlanMealType {
* @memberof MealPlanMealType
*/
order?: number;
/**
*
* @type {string}
* @memberof MealPlanMealType
*/
icon?: string | null;
/**
*
* @type {string}
@ -2043,12 +2045,6 @@ export interface MealType {
* @memberof MealType
*/
order?: number;
/**
*
* @type {string}
* @memberof MealType
*/
icon?: string | null;
/**
*
* @type {string}
@ -3062,12 +3058,6 @@ export interface PropertyType {
* @memberof PropertyType
*/
name: string;
/**
*
* @type {string}
* @memberof PropertyType
*/
icon?: string | null;
/**
*
* @type {string}
@ -3080,6 +3070,12 @@ export interface PropertyType {
* @memberof PropertyType
*/
description?: string | null;
/**
*
* @type {number}
* @memberof PropertyType
*/
order?: number;
/**
*
* @type {string}
@ -3262,12 +3258,6 @@ export interface RecipeBook {
* @memberof RecipeBook
*/
description?: string;
/**
*
* @type {string}
* @memberof RecipeBook
*/
icon?: string | null;
/**
*
* @type {Array<CustomFilterShared>}
@ -3514,12 +3504,6 @@ export interface RecipeKeywords {
* @memberof RecipeKeywords
*/
name: string;
/**
*
* @type {string}
* @memberof RecipeKeywords
*/
icon?: string | null;
/**
*
* @type {string}
@ -3855,6 +3839,12 @@ export interface RecipeSteps {
* @memberof RecipeSteps
*/
numrecipe?: string;
/**
*
* @type {boolean}
* @memberof RecipeSteps
*/
show_ingredients_table?: boolean;
}
/**
*
@ -4580,7 +4570,7 @@ export interface Step {
* @type {boolean}
* @memberof Step
*/
show_ingredeints_table?: boolean;
show_ingredients_table?: boolean;
}
/**
*
@ -4851,6 +4841,12 @@ export interface Unit {
* @memberof Unit
*/
description?: string | null;
/**
*
* @type {string}
* @memberof Unit
*/
base_unit?: string | null;
/**
*
* @type {string}
@ -4943,6 +4939,12 @@ export interface UnitConversionBaseUnit {
* @memberof UnitConversionBaseUnit
*/
description?: string | null;
/**
*
* @type {string}
* @memberof UnitConversionBaseUnit
*/
base_unit?: string | null;
/**
*
* @type {string}

View File

@ -4,7 +4,7 @@
* Django Recipes
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -4,7 +4,7 @@
* Django Recipes
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).