feature/nutrition #60

Merged
amit merged 2 commits from feature/nutrition into main 2026-11-04 09:12:01 +00:00
5 changed files with 4229 additions and 19 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,8 @@
{
"name": "Food Items",
"sort_order": 0,
"content_count": 441,
"content_label": "items",
"link": {
"type": "template_ref",
"label": "Food Items",
@ -14,17 +16,19 @@
"code": "food_items"
},
{
"name": "Effects",
"name": "Categories",
"sort_order": 1,
"content_count": 14,
"content_label": "categories",
"link": {
"type": "template_ref",
"label": "Effects",
"label": "Categories",
"target": {
"module_code": "m0031",
"template_code": "m0031_ct0003"
}
},
"code": "effects"
"code": "categories"
}
]
}

View File

@ -3,12 +3,12 @@
"description": "Traditional Chinese dietary therapy, food thermal energetics (cold, cool, neutral, warm, hot), and therapeutic effects.",
"short_description": "TCM dietary therapy and food thermal energetics.",
"code": "m0031",
"default_template_code": "m0031_ct0002",
"default_template_code": "m0031_ct0001",
"kind": "nutrition",
"metadata": {
"version": 1,
"status": "draft",
"entry_template_code": "m0031_ct0002"
"status": "active",
"entry_template_code": "m0031_ct0001"
},
"content_mapping": [
{
@ -26,10 +26,10 @@
"template_path": "templates/m0031_ct0002.json"
},
{
"name": "Effects List",
"name": "Categories",
"code": "m0031_ct0003",
"content_kind": "nutrition",
"data_path": "data/effects_master.json",
"data_path": "data/categories.json",
"template_path": "templates/m0031_ct0003.json"
}
]

View File

@ -36,6 +36,22 @@
"definition_kind": "scalar",
"is_multivalue": false
},
{
"name": "Content Count",
"code": "content_count",
"data_type": "number",
"default": 0,
"definition_kind": "scalar",
"is_multivalue": false
},
{
"name": "Content Label",
"code": "content_label",
"data_type": "text",
"default": "",
"definition_kind": "scalar",
"is_multivalue": false
},
{
"name": "Content Link",
"code": "link",
@ -232,6 +248,18 @@
"empty_behavior": "hide",
"visibility": "hide"
},
{
"attribute_key": "m0031_ct0001.content_count",
"empty_behavior": "hide",
"visibility": "show",
"display_order": 0
},
{
"attribute_key": "m0031_ct0001.content_label",
"empty_behavior": "hide",
"visibility": "show",
"display_order": 0
},
{
"attribute_key": "m0031_ct0001.code",
"empty_behavior": "hide",

View File

@ -1,12 +1,12 @@
{
"name": "nutrition_effect_content",
"name": "nutrition_category_content",
"code": "m0031_ct0003",
"description": "",
"description": "Nutrition categories classification",
"content_kind": "nutrition",
"is_searchable": false,
"is_filterable": false,
"is_searchable": true,
"is_filterable": true,
"attribute_prefix_code": "m0031_ct0003",
"attribute_prefix_name": "nutrition_effect",
"attribute_prefix_name": "nutrition_category",
"attribute_defs": [
{
"name": "Source ID",
@ -28,8 +28,8 @@
"is_searchable": true
},
{
"name": "Effect Name",
"code": "effect_name",
"name": "Name",
"code": "name",
"data_type": "text",
"default": "",
"definition_kind": "scalar",
@ -38,6 +38,22 @@
"is_filterable": true,
"is_searchable": true
},
{
"name": "Content Count",
"code": "content_count",
"data_type": "number",
"default": 0,
"definition_kind": "scalar",
"is_multivalue": false
},
{
"name": "Content Label",
"code": "content_label",
"data_type": "text",
"default": "items",
"definition_kind": "scalar",
"is_multivalue": false
},
{
"name": "Sort Order",
"code": "sort_order",
@ -45,6 +61,37 @@
"default": 0,
"definition_kind": "scalar",
"is_multivalue": false
},
{
"name": "Food Items",
"code": "food_items",
"data_type": "json",
"multivalue": true,
"default": [],
"definition_kind": "scalar",
"is_multivalue": true,
"metadata": {
"value_contract": {
"kind": "content_ref",
"contract_version": "1.0",
"reference_type": "content_ref",
"target_module_code": "m0031",
"target_template_code": "m0031_ct0002",
"cardinality": "many",
"authoring_identity": "source_code",
"persisted_identity": "source_key",
"runtime_identity": "content_id",
"resolution_pipeline": "source_code -> source_key -> content_id",
"rules": {
"explicit_reference_required_when_value_present": true,
"plain_text_allowed": false,
"source_code_authoring_only": true,
"source_key_persisted_only": true,
"content_id_runtime_only": true,
"do_not_infer_reference_from_label": true
}
}
}
}
],
"presentation_contracts": [
@ -54,9 +101,9 @@
"is_active": true,
"mode": "collection",
"renderers": {
"collection": "nutrition_effect_collection",
"collection_item": "nutrition_effect_card",
"detail": "nutrition_effect_detail"
"collection": "nutrition_category_collection",
"collection_item": "nutrition_category_card",
"detail": "nutrition_category_detail"
},
"link": {
"renderer": "content_link"
@ -73,7 +120,19 @@
"visibility": "hide"
},
{
"attribute_key": "m0031_ct0003.effect_name",
"attribute_key": "m0031_ct0003.name",
"empty_behavior": "hide",
"visibility": "show",
"display_order": 10
},
{
"attribute_key": "m0031_ct0003.content_count",
"empty_behavior": "hide",
"visibility": "show",
"display_order": 0
},
{
"attribute_key": "m0031_ct0003.content_label",
"empty_behavior": "hide",
"visibility": "show",
"display_order": 0
@ -82,6 +141,12 @@
"attribute_key": "m0031_ct0003.sort_order",
"empty_behavior": "hide",
"visibility": "hide"
},
{
"attribute_key": "m0031_ct0003.food_items",
"empty_behavior": "hide",
"visibility": "show",
"display_order": 20
}
],
"metadata": {