remove compatibility code for migration

This commit is contained in:
MaysWind
2025-02-09 16:51:21 +08:00
parent f2c043a299
commit 0e4cd10376
20 changed files with 171 additions and 214 deletions
+20 -11
View File
@@ -24,15 +24,12 @@ import {
import { DEFAULT_ACCOUNT_ICON, DEFAULT_CATEGORY_ICON } from '@/consts/icon.ts';
import { DEFAULT_ACCOUNT_COLOR, DEFAULT_CATEGORY_COLOR } from '@/consts/color.ts';
import type { AccountInfoResponse } from '@/models/account.ts';
import type { TransactionCategoryInfoResponse } from '@/models/transaction_category.ts';
import type { Account } from '@/models/account.ts';
import type { TransactionCategory } from '@/models/transaction_category.ts';
import type {
TransactionStatisticResponse,
TransactionStatisticResponseItem,
TransactionStatisticResponseWithInfo,
TransactionStatisticResponseItemWithInfo,
TransactionStatisticTrendsResponseItem,
TransactionStatisticTrendsResponseItemWithInfo,
TransactionStatisticDataItemType,
TransactionStatisticDataItemBase,
TransactionCategoricalAnalysisData,
@@ -60,17 +57,29 @@ import { sortStatisticsItems } from '@/lib/statistics.ts';
import logger from '@/lib/logger.ts';
import services from '@/lib/services.ts';
interface WritableTransactionStatisticResponseItemWithInfo extends TransactionStatisticResponseItemWithInfo {
interface TransactionStatisticResponseItemWithInfo extends TransactionStatisticResponseItem {
categoryId: string;
accountId: string;
amount: number;
account?: AccountInfoResponse;
primaryAccount?: AccountInfoResponse;
category?: TransactionCategoryInfoResponse;
primaryCategory?: TransactionCategoryInfoResponse;
account?: Account;
primaryAccount?: Account;
category?: TransactionCategory;
primaryCategory?: TransactionCategory;
amountInDefaultCurrency: number | null;
}
interface TransactionStatisticResponseWithInfo {
readonly startTime: number;
readonly endTime: number;
readonly items: TransactionStatisticResponseItemWithInfo[];
}
interface TransactionStatisticTrendsResponseItemWithInfo {
readonly year: number;
readonly month: number;
readonly items: TransactionStatisticResponseItemWithInfo[];
}
interface WritableTransactionCategoricalAnalysisData {
totalAmount: number;
totalNonNegativeAmount: number;
@@ -438,7 +447,7 @@ export const useStatisticsStore = defineStore('statistics', () => {
for (let i = 0; i < items.length; i++) {
const dataItem = items[i];
const item: WritableTransactionStatisticResponseItemWithInfo = {
const item: TransactionStatisticResponseItemWithInfo = {
categoryId: dataItem.categoryId,
accountId: dataItem.accountId,
amount: dataItem.amount,