mirror of
https://github.com/frappe/books.git
synced 2024-11-10 15:50:56 +00:00
0efd2b4c33
- switch to doc and json schemas instead
20 lines
574 B
TypeScript
20 lines
574 B
TypeScript
import { DocValue } from 'frappe/core/types';
|
|
import Doc from 'frappe/model/doc';
|
|
import { ValidationMap } from 'frappe/model/types';
|
|
import { ValidationError } from 'frappe/utils/errors';
|
|
import { t } from 'frappe/utils/translation';
|
|
|
|
export default class SystemSettings extends Doc {
|
|
validations: ValidationMap = {
|
|
async displayPrecision(value: DocValue) {
|
|
if ((value as number) >= 0 && (value as number) <= 9) {
|
|
return;
|
|
}
|
|
|
|
throw new ValidationError(
|
|
t`Display Precision should have a value between 0 and 9.`
|
|
);
|
|
},
|
|
};
|
|
}
|