2
0
mirror of https://github.com/frappe/books.git synced 2024-11-15 09:54:04 +00:00
books/models/baseModels/AppliedCouponCodes/AppliedCouponCodes.ts
2024-10-18 10:54:18 +05:30

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);
},
};
}