Expose formula expression in api resource

This commit is contained in:
2025-04-24 13:58:02 +02:00
parent 391972c46b
commit 430926462e
2 changed files with 7 additions and 0 deletions
@@ -19,4 +19,10 @@ class FormulaApiResource
{
#[API\ApiProperty(identifier: true, writable: false)]
public string $name;
/**
* The underlying math expressed as a common-notation formula.
*/
#[API\ApiProperty(writable: false)]
public string $expression;
}
@@ -41,6 +41,7 @@ class FormulaStateProvider implements ProviderInterface
{
$resource = new FormulaApiResource();
$resource->name = $formula::getName();
$resource->expression = $formula::getAsExpression();
return $resource;
}