mirror of
https://github.com/frappe/books.git
synced 2024-11-15 01:44:04 +00:00
33 lines
696 B
TypeScript
33 lines
696 B
TypeScript
import { Fyo } from 'fyo';
|
|
import { Doc } from 'fyo/model/doc';
|
|
import {
|
|
Action,
|
|
LeadStatus,
|
|
ListViewSettings,
|
|
ValidationMap,
|
|
} from 'fyo/model/types';
|
|
import { getLeadActions, getLeadStatusColumn } from 'models/helpers';
|
|
import {
|
|
validateEmail,
|
|
validatePhoneNumber,
|
|
} from 'fyo/model/validationFunction';
|
|
|
|
export class Lead extends Doc {
|
|
status?: LeadStatus;
|
|
|
|
validations: ValidationMap = {
|
|
email: validateEmail,
|
|
mobile: validatePhoneNumber,
|
|
};
|
|
|
|
static getActions(fyo: Fyo): Action[] {
|
|
return getLeadActions(fyo);
|
|
}
|
|
|
|
static getListViewSettings(): ListViewSettings {
|
|
return {
|
|
columns: ['name', getLeadStatusColumn(), 'email', 'mobile'],
|
|
};
|
|
}
|
|
}
|