mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19:01 +00:00
19 lines
490 B
TypeScript
19 lines
490 B
TypeScript
import { DocValue } from 'fyo/core/types';
|
|
import { ValidationMap } from 'fyo/model/types';
|
|
import { InvoiceItem } from '../InvoiceItem/InvoiceItem';
|
|
import { validateCouponCode } from 'models/helpers';
|
|
|
|
export class AppliedCouponCodes extends InvoiceItem {
|
|
coupons?: string;
|
|
|
|
validations: ValidationMap = {
|
|
coupons: async (value: DocValue) => {
|
|
if (!value) {
|
|
return;
|
|
}
|
|
|
|
await validateCouponCode(this as AppliedCouponCodes, value as string);
|
|
},
|
|
};
|
|
}
|