You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I have a CAP project that uses the NodeJS/ExpressJS backend.
In my project I have entities which are provided with a validity period by adding validFrom and validTo.
In order to display only the (currently) active price elements in the application, I have annotated the fields that define the validity period of an element with the respective annotation @cds.valid.from/to.
Here are the entities I need for this
aspectpriceElement:cuid, managed {
@title:'{i18n>PriceConditionType}'toCondition:Association to one PriceCondition;
@title:'{i18n>PriceElementValue}'value:Double;
@title:'{i18n>PriceElementFormat}'format:String default'%';
@title:'{i18n>GeneralValidFrom}'validFrom:Date @cds.valid.from;
@title:'{i18n>GeneralValidTo}'validTo:Date @cds.valid.to;
}
@plural:'HeaderPriceElements'@assert.unique: {contract_condition: [
toContract,
toCondition,
validFrom
]}
entityHeaderPriceElement:priceElement {
@title:'{i18n>ContractName}'toContract:Association to one Contract;
}
@plural:'ItemPriceElements'entityItemPriceElement:priceElement {
@title:'{i18n>ContractItemName}'toContractItem:Association to one ContractItem;
}
This raises two questions/problems for me
Is it somehow possible for me to set a filter in the application to view all price elements over the entire time period?
I know that I can send a Time-Period Query directly to the remaining endpoint to retrieve all price elements from a certain date. Can I also set such a filter in the frontend?
Validation of the validity periods
In order to be able to validate that the validity periods of a condition for an entity do not overlap, I would like to validate the periods so that I can assure that only one condition value is active at a time.
I am currently writing something for this in the backend. However, to ensure a seamless transition between the price elements, I need to be able to select them and check the time periods.
However, the @cds.valid.from/to annotation also restricts the direct selection to the table by the annotation to only active elements. How can I then validate that the time periods do not overlap and have seamless transitions?
Hi everyone, I have a CAP project that uses the NodeJS/ExpressJS backend.
In my project I have entities which are provided with a validity period by adding
validFrom
andvalidTo
.In order to display only the (currently) active price elements in the application, I have annotated the fields that define the validity period of an element with the respective annotation
@cds.valid.from/to
.Here are the entities I need for this
This raises two questions/problems for me
I know that I can send a
Time-Period Query
directly to the remaining endpoint to retrieve all price elements from a certain date.Can I also set such a filter in the frontend?
In order to be able to validate that the validity periods of a condition for an entity do not overlap, I would like to validate the periods so that I can assure that only one condition value is active at a time.
I am currently writing something for this in the backend. However, to ensure a seamless transition between the price elements, I need to be able to select them and check the time periods.
However, the
@cds.valid.from/to
annotation also restricts the direct selection to the table by the annotation to only active elements.How can I then validate that the time periods do not overlap and have seamless transitions?
Local data
Code for selection
Selection result
Important
In total, both arrays should provide 2 entries each, as the CSV file already contains a condition that is no longer valid
The text was updated successfully, but these errors were encountered: