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

@@ -13,7 +13,7 @@ export const ERRORS = {
};
export const DEFAULT_VIEW_COLUMNS = [];
export const DEFAULT_VIEWS = [
export const CreditNoteDefaultViews = [
{
name: 'credit_note.view.draft',
slug: 'draft',
@@ -71,7 +71,7 @@ export const defaultCreditNoteBrandingAttributes = {
// # Colors
primaryColor: '',
secondaryColor: '',
// # Company logo
showCompanyLogo: true,
companyLogoKey: '',

View File

@@ -10,10 +10,13 @@ import { ItemEntry } from '@/modules/TransactionItemEntry/models/ItemEntry';
import { Warehouse } from '@/modules/Warehouses/models/Warehouse.model';
import { mixin, Model, raw } from 'objection';
import { CreditNoteMeta } from './CreditNote.meta';
import { InjectModelDefaultViews } from '@/modules/Views/decorators/InjectModelDefaultViews.decorator';
import { CreditNoteDefaultViews } from '../constants';
@ExportableModel()
@ImportableModel()
@InjectModelMeta(CreditNoteMeta)
@InjectModelDefaultViews(CreditNoteDefaultViews)
export class CreditNote extends TenantBaseModel {
public amount: number;
public exchangeRate: number;
@@ -402,20 +405,6 @@ export class CreditNote extends TenantBaseModel {
};
}
// /**
// * Sale invoice meta.
// */
// static get meta() {
// return CreditNoteMeta;
// }
// /**
// * Retrieve the default custom views, roles and columns.
// */
// static get defaultViews() {
// return DEFAULT_VIEWS;
// }
/**
* Model searchable.
*/