Skip to content

Commit

Permalink
work on reporting columns
Browse files Browse the repository at this point in the history
  • Loading branch information
andi-huber committed Aug 6, 2024
1 parent c9cee8f commit e72bab1
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
* code
* @param meal meal happened
* when and where
* @param food name of consumed
* food
* @param foodId food identifier
* @param group food group
* @param subgroup food subgroup
* @param subSubgroup food sub-subgroup
* @param facetIds facet descriptor
* identifiers
* @param quantity quantity
* consumed [g]
* @param GCALZB Energie
Expand Down Expand Up @@ -142,14 +150,58 @@ public record ConsumptionRow(
@PropertyLayout(
fieldSetId = "details",
sequence = "9",
describedAs = "name of consumed\n"
+ "food",
hidden = Where.NOWHERE
)
String food,
@PropertyLayout(
fieldSetId = "details",
sequence = "10",
describedAs = "food identifier",
hidden = Where.NOWHERE
)
String foodId,
@PropertyLayout(
fieldSetId = "details",
sequence = "11",
describedAs = "food group",
hidden = Where.NOWHERE
)
String group,
@PropertyLayout(
fieldSetId = "details",
sequence = "12",
describedAs = "food subgroup",
hidden = Where.NOWHERE
)
String subgroup,
@PropertyLayout(
fieldSetId = "details",
sequence = "13",
describedAs = "food sub-subgroup",
hidden = Where.NOWHERE
)
String subSubgroup,
@PropertyLayout(
fieldSetId = "details",
sequence = "14",
describedAs = "facet descriptor\n"
+ "identifiers",
hidden = Where.NOWHERE
)
String facetIds,
@PropertyLayout(
fieldSetId = "details",
sequence = "15",
describedAs = "quantity\n"
+ "consumed [g]",
hidden = Where.NOWHERE
)
BigDecimal quantity,
@PropertyLayout(
fieldSetId = "details",
sequence = "10",
sequence = "16",
describedAs = "Energie\n"
+ "inkl. Ballaststoffen\n"
+ "[kcal]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ private static class RowFactory {
LocalDate consumptionDate;
String fco;
String meal;
String group = "wip";
String subgroup = "wip";
String subSubgroup = "wip";
//
ConsumptionRow row(
final Record24.Consumption cRec,
Expand All @@ -125,6 +128,12 @@ ConsumptionRow row(
consumptionDate,
fco,
meal,
foodConsumption.name(),
foodConsumption.foodId().fullFormat(":"),
group,
subgroup,
subSubgroup,
foodConsumption.facetIds().fullFormat(","),
cRec.amountConsumed(),
compositionEntry
.flatMap(e->e.lookupDatapoint(BLS302.Component.GCALZB.componentId()))
Expand Down
34 changes: 33 additions & 1 deletion recall24/reporter/src/main/resources/companion-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,39 @@ viewmodels:
required: true
description: |
meal happened
when and where
when and where
food:
type: String
required: true
description: |
name of consumed
food
foodId:
type: String
required: true
description: |
food identifier
group:
type: String
required: true
description: |
food group
subgroup:
type: String
required: true
description: |
food subgroup
subSubgroup:
type: String
required: true
description: |
food sub-subgroup
facetIds:
type: String
required: true
description: |
facet descriptor
identifiers
quantity:
type: BigDecimal
required: true
Expand Down
28 changes: 27 additions & 1 deletion recall24/reporter/src/main/resources/records/ConsumptionRow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,33 @@ viewmodel:
type: String
description: |
meal happened
when and where
when and where
food:
type: String
description: |
name of consumed
food
foodId:
type: String
description: |
food identifier
group:
type: String
description: |
food group
subgroup:
type: String
description: |
food subgroup
subSubgroup:
type: String
description: |
food sub-subgroup
facetIds:
type: String
description: |
facet descriptor
identifiers
quantity:
type: BigDecimal
description: |
Expand Down

0 comments on commit e72bab1

Please sign in to comment.