mirror of
https://github.com/frappe/books.git
synced 2024-12-22 10:58:59 +00:00
feat: loyalty program models
This commit is contained in:
parent
a6688fb682
commit
9bfcbbfc5e
@ -0,0 +1,8 @@
|
||||
import { Doc } from 'fyo/model/doc';
|
||||
import { Money } from 'pesa';
|
||||
|
||||
export class CollectionRulesItems extends Doc {
|
||||
tierName?: string;
|
||||
collectionFactor?: number;
|
||||
minimumTotalSpent?: Money;
|
||||
}
|
21
models/baseModels/LoyaltyPointEntry/LoyaltyPointEntry.ts
Normal file
21
models/baseModels/LoyaltyPointEntry/LoyaltyPointEntry.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { Doc } from 'fyo/model/doc';
|
||||
import { ListViewSettings } from 'fyo/model/types';
|
||||
|
||||
export class LoyaltyPointEntry extends Doc {
|
||||
loyaltyProgram?: string;
|
||||
customer?: string;
|
||||
invoice?: string;
|
||||
purchaseAmount?: number;
|
||||
expiryDate?: Date;
|
||||
|
||||
static override getListViewSettings(): ListViewSettings {
|
||||
return {
|
||||
columns: [
|
||||
'loyaltyProgram',
|
||||
'customer',
|
||||
'purchaseAmount',
|
||||
'loyaltyPoints',
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
22
models/baseModels/LoyaltyProgram/LoyaltyProgram.ts
Normal file
22
models/baseModels/LoyaltyProgram/LoyaltyProgram.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Doc } from 'fyo/model/doc';
|
||||
import { FiltersMap, ListViewSettings } from 'fyo/model/types';
|
||||
import { CollectionRulesItems } from '../CollectionRulesItems/CollectionRulesItems';
|
||||
import { AccountRootTypeEnum } from '../Account/types';
|
||||
|
||||
export class LoyaltyProgram extends Doc {
|
||||
collectionRules?: CollectionRulesItems[];
|
||||
expiryDuration?: number;
|
||||
|
||||
static filters: FiltersMap = {
|
||||
expenseAccount: () => ({
|
||||
rootType: AccountRootTypeEnum.Liability,
|
||||
isGroup: false,
|
||||
}),
|
||||
};
|
||||
|
||||
static getListViewSettings(): ListViewSettings {
|
||||
return {
|
||||
columns: ['name', 'fromDate', 'toDate', 'expiryDuration'],
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user