feat: models default views

This commit is contained in:
Ahmed Bouhuolia
2025-06-17 20:53:13 +02:00
parent f624cf7ae6
commit 437bcb8854
39 changed files with 286 additions and 275 deletions

View File

@@ -1,7 +1,7 @@
import { ACCOUNT_TYPE } from "@/constants/accounts";
import { ACCOUNT_TYPE } from '@/constants/accounts';
export const DEFAULT_VIEW_COLUMNS = [];
export const DEFAULT_VIEWS = [
export const ExpenseDefaultViews = [
{
name: 'Draft',
slug: 'draft',

View File

@@ -7,10 +7,13 @@ import { ExportableModel } from '@/modules/Export/decorators/ExportableModel.dec
import { ImportableModel } from '@/modules/Import/decorators/Import.decorator';
import { InjectModelMeta } from '@/modules/Tenancy/TenancyModels/decorators/InjectModelMeta.decorator';
import { ExpenseMeta } from './Expense.meta';
import { InjectModelDefaultViews } from '@/modules/Views/decorators/InjectModelDefaultViews.decorator';
import { ExpenseDefaultViews } from '../constants';
@ExportableModel()
@ImportableModel()
@InjectModelMeta(ExpenseMeta)
@InjectModelDefaultViews(ExpenseDefaultViews)
export class Expense extends TenantBaseModel {
totalAmount!: number;
currencyCode!: string;
@@ -202,7 +205,9 @@ export class Expense extends TenantBaseModel {
const { ExpenseCategory } = require('./ExpenseCategory.model');
const { Document } = require('../../ChromiumlyTenancy/models/Document');
const { Branch } = require('../../Branches/models/Branch.model');
const { MatchedBankTransaction } = require('../../BankingMatching/models/MatchedBankTransaction');
const {
MatchedBankTransaction,
} = require('../../BankingMatching/models/MatchedBankTransaction');
return {
/**
@@ -280,17 +285,6 @@ export class Expense extends TenantBaseModel {
};
}
// static get meta() {
// return ExpenseSettings;
// }
// /**
// * Retrieve the default custom views, roles and columns.
// */
// static get defaultViews() {
// return DEFAULT_VIEWS;
// }
/**
* Model search attributes.
*/