feat: services quick search.

This commit is contained in:
a.bouhuolia
2021-08-07 20:37:11 +02:00
parent fad9052da8
commit 1b90610cec
39 changed files with 380 additions and 204 deletions

View File

@@ -6,10 +6,12 @@ import BillSettings from './Bill.Settings';
import ModelSetting from './ModelSetting';
import CustomViewBaseModel from './CustomViewBaseModel';
import { DEFAULT_VIEWS } from 'services/Purchases/constants';
import ModelSearchable from './ModelSearchable';
export default class Bill extends mixin(TenantModel, [
ModelSetting,
CustomViewBaseModel,
ModelSearchable
]) {
/**
* Table name
@@ -315,4 +317,15 @@ export default class Bill extends mixin(TenantModel, [
static get defaultViews() {
return DEFAULT_VIEWS;
}
/**
* Model search attributes.
*/
static get searchRoles() {
return [
{ fieldKey: 'bill_number', comparator: 'contains' },
{ condition: 'or', fieldKey: 'reference_no', comparator: 'contains' },
{ condition: 'or', fieldKey: 'amount', comparator: 'equals' },
];
}
}