fix(webapp): add validation to aging summary customize form

This commit is contained in:
Ahmed Bouhuolia
2023-08-27 00:44:37 +02:00
parent 321de4d327
commit b9be83dc2b
3 changed files with 16 additions and 58 deletions

View File

@@ -36,19 +36,23 @@ export const getAPAgingSummaryQuerySchema = () => {
.required()
.integer()
.positive()
.label('agingBeforeDays'),
.label('Aging days before')
.min(1)
.max(500),
agingPeriods: Yup.number()
.required()
.integer()
.positive()
.label('agingPeriods'),
.max(12)
.min(1)
.label('Aging periods'),
});
};
/**
* Parses the AP aging summary query state.
* @param locationQuery
* @returns
* @param locationQuery
* @returns
*/
const parseAPAgingSummaryQuery = (locationQuery) => {
const defaultQuery = getDefaultAPAgingSummaryQuery();