2022-04-19 05:59:36 +00:00
|
|
|
import { DocValue } from 'fyo/core/types';
|
2022-04-24 06:48:44 +00:00
|
|
|
import { Doc } from 'fyo/model/doc';
|
2022-04-19 05:59:36 +00:00
|
|
|
import { ValidationMap } from 'fyo/model/types';
|
|
|
|
import { ValidationError } from 'fyo/utils/errors';
|
|
|
|
import { t } from 'fyo/utils/translation';
|
2022-04-07 09:27:01 +00:00
|
|
|
|
|
|
|
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.`
|
|
|
|
);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|