remove unused code

This commit is contained in:
MaysWind
2025-02-06 20:44:18 +08:00
parent bd96b2398a
commit 68cb5bc523
3 changed files with 35 additions and 59 deletions
+13 -21
View File
@@ -1,20 +1,16 @@
import type { TypeAndName, TypeAndDisplayName } from './base.ts';
type AccountTypeName = 'SingleAccount' | 'MultiSubAccounts';
export class AccountType implements TypeAndName {
private static readonly allInstances: AccountType[] = [];
public static readonly SingleAccount = new AccountType(1, 'SingleAccount', 'Single Account');
public static readonly MultiSubAccounts = new AccountType(2, 'MultiSubAccounts', 'Multiple Sub-accounts');
public static readonly SingleAccount = new AccountType(1, 'Single Account');
public static readonly MultiSubAccounts = new AccountType(2, 'Multiple Sub-accounts');
public readonly type: number;
public readonly typeName: AccountTypeName;
public readonly name: string;
private constructor(type: number, typeName: AccountTypeName, name: string) {
private constructor(type: number, name: string) {
this.type = type;
this.typeName = typeName;
this.name = name;
AccountType.allInstances.push(this);
@@ -25,32 +21,28 @@ export class AccountType implements TypeAndName {
}
}
type AccountCategoryTypeName = 'Cash' | 'CheckingAccount' | 'SavingsAccount' | 'CreditCard' | 'VirtualAccount' | 'DebtAccount' | 'Receivables' | 'CertificateOfDeposit' | 'InvestmentAccount';
export class AccountCategory implements TypeAndName {
private static readonly allInstances: AccountCategory[] = [];
private static readonly allInstancesByType: Record<number, AccountCategory> = {};
public static readonly Cash = new AccountCategory(1, 'Cash', 'Cash', '1');
public static readonly CheckingAccount = new AccountCategory(2, 'CheckingAccount', 'Checking Account', '100');
public static readonly SavingsAccount = new AccountCategory(8, 'SavingsAccount', 'Savings Account', '100');
public static readonly CreditCard = new AccountCategory(3, 'CreditCard', 'Credit Card', '100');
public static readonly VirtualAccount = new AccountCategory(4, 'VirtualAccount', 'Virtual Account', '500');
public static readonly DebtAccount = new AccountCategory(5, 'DebtAccount', 'Debt Account', '600');
public static readonly Receivables = new AccountCategory(6, 'Receivables', 'Receivables', '700');
public static readonly CertificateOfDeposit = new AccountCategory(9, 'CertificateOfDeposit', 'Certificate of Deposit', '110');
public static readonly InvestmentAccount = new AccountCategory(7, 'InvestmentAccount', 'Investment Account', '800');
public static readonly Cash = new AccountCategory(1, 'Cash', '1');
public static readonly CheckingAccount = new AccountCategory(2, 'Checking Account', '100');
public static readonly SavingsAccount = new AccountCategory(8, 'Savings Account', '100');
public static readonly CreditCard = new AccountCategory(3, 'Credit Card', '100');
public static readonly VirtualAccount = new AccountCategory(4, 'Virtual Account', '500');
public static readonly DebtAccount = new AccountCategory(5, 'Debt Account', '600');
public static readonly Receivables = new AccountCategory(6, 'Receivables', '700');
public static readonly CertificateOfDeposit = new AccountCategory(9, 'Certificate of Deposit', '110');
public static readonly InvestmentAccount = new AccountCategory(7, 'Investment Account', '800');
public static readonly Default = AccountCategory.Cash;
public readonly type: number;
public readonly typeName: AccountCategoryTypeName;
public readonly name: string;
public readonly defaultAccountIconId: string;
private constructor(type: number, typeName: AccountCategoryTypeName, name: string, defaultAccountIconId: string) {
private constructor(type: number, name: string, defaultAccountIconId: string) {
this.type = type;
this.typeName = typeName;
this.name = name;
this.defaultAccountIconId = defaultAccountIconId;