fix(exports): stabilize published types and compatibility with updated dependencies

This commit is contained in:
2026-04-16 19:41:55 +00:00
parent cb6b3db15a
commit 40ffc2b355
25 changed files with 4539 additions and 5354 deletions
+39 -21
View File
@@ -2,68 +2,86 @@ import * as plugins from './plugins.js';
import { getDb, getDbSync } from './skr.database.js';
import type { TAccountType, TSKRType, IAccountData } from './skr.types.js';
const { SmartDataDbDoc, svDb, unI, index, searchable } = plugins.smartdata;
declare abstract class SmartDataDbDocBase {
public save(): Promise<void>;
public delete(): Promise<void>;
public static getInstance<T>(
this: new (...args: any[]) => T,
query: Record<string, any>,
): Promise<T | null>;
public static getInstances<T>(
this: new (...args: any[]) => T,
query: Record<string, any>,
): Promise<T[]>;
}
@plugins.smartdata.Collection(() => getDbSync())
export class Account extends SmartDataDbDoc<Account, Account> {
const SmartDataDbDoc = plugins.smartdata.SmartDataDbDoc as unknown as typeof SmartDataDbDocBase;
const Collection = plugins.smartdata.Collection as any;
const svDb = plugins.smartdata.svDb as any;
const unI = plugins.smartdata.unI as any;
const index = plugins.smartdata.index as any;
const searchable = plugins.smartdata.searchable as any;
@Collection(() => getDbSync())
export class Account extends SmartDataDbDoc {
@unI()
public id: string;
public id!: string;
@svDb()
@index()
public accountNumber: string;
public accountNumber!: string;
@svDb()
@searchable()
public accountName: string;
public accountName!: string;
@svDb()
@index()
public accountClass: number;
public accountClass!: number;
@svDb()
public accountGroup: number;
public accountGroup!: number;
@svDb()
public accountSubgroup: number;
public accountSubgroup!: number;
@svDb()
public accountType: TAccountType;
public accountType!: TAccountType;
@svDb()
@index()
public skrType: TSKRType;
public skrType!: TSKRType;
@svDb()
@searchable()
public description: string;
public description!: string;
@svDb()
public vatRate: number;
public vatRate!: number;
@svDb()
public balance: number;
public balance!: number;
@svDb()
public debitTotal: number;
public debitTotal!: number;
@svDb()
public creditTotal: number;
public creditTotal!: number;
@svDb()
public isActive: boolean;
public isActive!: boolean;
@svDb()
public isSystemAccount: boolean;
public isSystemAccount!: boolean;
@svDb()
public isAutomaticAccount: boolean;
public isAutomaticAccount!: boolean;
@svDb()
public createdAt: Date;
public createdAt!: Date;
@svDb()
public updatedAt: Date;
public updatedAt!: Date;
constructor(data?: Partial<IAccountData>) {
super();