Closed MarcAstr0 closed 2 months ago
/integration sha=c9dcfc3c4768ff9098f4d1d766f91e7018c85046
Changes in the Package framework-common-helpers
createInstanceWithCalculatedProperties
was added to enhance read model classes, enabling them to include calculated properties in their responses. isPromise
was introduced to verify if an object is a promise.Modifications in the Package framework-core
booster-read-models-reader.ts
file now incorporates the createInstanceWithCalculatedProperties
function. A new function createReadModelInstancesWithCalculatedProperties
was included to enhance read model instances with the calculated properties. search
function was modified for optimized performance when calculated fields dependencies exist.CalculatedField
was introduced in read-model.ts
to mark a property as a calculated field with dependencies.Updates in Test Cases
createReadModelInstancesWithCalculatedProperties
function and the CalculatedField
decorator. dependencies
property in the fields metadata.Additions in the Integration Tests
Changes in the framework-integration-tests
Project
CartMyAddress
command file was added. CalculatedField
decorator was used in cart-read-model.ts
for several methods.dependencies
property was added to the PropertyMetadata
interface to hold the dependencies of the calculated fields.:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
/integration sha=e815183
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
/integration sha=7d65cb3
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
/integration sha=008414c64635315ceda16888eaf39c0d73161b9e
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
/integration sha=ebf97f1536d507ec8127efa618913017a17875bd
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
/integration sha=3b899a6bc06d65be4f1f2bf59f3becb67abe995e
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
/integration sha=3b899a6bc06d65be4f1f2bf59f3becb67abe995e
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
/integration sha=3b899a6bc06d65be4f1f2bf59f3becb67abe995e
:hourglass: Integration tests are running...
Check their status here π
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
:x: Oh no! Integration tests have failed
/integration sha=3b899a6bc06d65be4f1f2bf59f3becb67abe995e
:hourglass: Integration tests are running...
Check their status here π
:white_check_mark: Integration tests have finished successfully!
/integration sha=85ea3c15ed9f3acf080593bec19df41e4bff93fe
:hourglass: Integration tests are running...
Check their status here π
:white_check_mark: Integration tests have finished successfully!
/integration sha=56633030c1307dc0adf1bc187387e69731cbc387
:hourglass: Integration tests are running...
Check their status here π
:white_check_mark: Integration tests have finished successfully!
/integration sha=2077b2cb598e6b6259ef8e2d1b6756e8cead1f53
:hourglass: Integration tests are running...
Check their status here π
Description
Due to the changes introduced in version 2.11.0, this PR introduces the
@CalculatedField
decorator for read model fields, which are calculated using getters using other properties of the read model. e.g.,This decorator receives a list of the read model's properties as an input parameter. The calculated field uses these properties to calculate its value. The decorator ensures that these properties are fetched from the database so that the calculated field is calculated correctly, even if the user did not explicitly request these dependencies.
Changes
CalculatedField
decorator to theframework-core
package, which stores the calculated fields and their dependencies in the read model's metadata.search
method in theBoosterReadModelsReader
class so it handles calculated fields accordingly.cli
package due to updated Node types.Checks