update name to insights explorer

This commit is contained in:
MaysWind
2026-01-03 16:40:53 +08:00
parent 8be5e8aa1d
commit cc0996e0d2
37 changed files with 1714 additions and 1714 deletions
+21 -21
View File
@@ -593,7 +593,7 @@ export enum DateRangeScene {
Normal = 0,
TrendAnalysis = 1,
AssetTrends = 2,
InsightsExplore = 3
InsightsExplorer = 3
}
export class DateRange implements TypeAndName {
@@ -601,38 +601,38 @@ export class DateRange implements TypeAndName {
private static readonly allInstancesByType: Record<number, DateRange> = {};
// All date range
public static readonly All = new DateRange(0, 'All', false, false, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly All = new DateRange(0, 'All', false, false, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
// Date ranges for normal scene only
public static readonly Today = new DateRange(1, 'Today', false, false, DateRangeScene.Normal, DateRangeScene.InsightsExplore);
public static readonly Yesterday = new DateRange(2, 'Yesterday', false, false, DateRangeScene.Normal, DateRangeScene.InsightsExplore);
public static readonly LastSevenDays = new DateRange(3, 'Recent 7 days', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly LastThirtyDays = new DateRange(4, 'Recent 30 days', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly ThisWeek = new DateRange(5, 'This week', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly LastWeek = new DateRange(6, 'Last week', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly ThisMonth = new DateRange(7, 'This month', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly LastMonth = new DateRange(8, 'Last month', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly Today = new DateRange(1, 'Today', false, false, DateRangeScene.Normal, DateRangeScene.InsightsExplorer);
public static readonly Yesterday = new DateRange(2, 'Yesterday', false, false, DateRangeScene.Normal, DateRangeScene.InsightsExplorer);
public static readonly LastSevenDays = new DateRange(3, 'Recent 7 days', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly LastThirtyDays = new DateRange(4, 'Recent 30 days', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly ThisWeek = new DateRange(5, 'This week', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly LastWeek = new DateRange(6, 'Last week', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly ThisMonth = new DateRange(7, 'This month', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly LastMonth = new DateRange(8, 'Last month', false, false, DateRangeScene.Normal, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
// Date ranges for normal and trend analysis scene
public static readonly ThisYear = new DateRange(9, 'This year', false, false, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly LastYear = new DateRange(10, 'Last year', false, false, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly ThisFiscalYear = new DateRange(11, 'This fiscal year', false, true, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly LastFiscalYear = new DateRange(12, 'Last fiscal year', false, true, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly ThisYear = new DateRange(9, 'This year', false, false, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly LastYear = new DateRange(10, 'Last year', false, false, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly ThisFiscalYear = new DateRange(11, 'This fiscal year', false, true, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly LastFiscalYear = new DateRange(12, 'Last fiscal year', false, true, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
// Billing cycle date ranges for normal scene only
public static readonly CurrentBillingCycle = new DateRange(51, 'Current Billing Cycle', true, true, DateRangeScene.Normal);
public static readonly PreviousBillingCycle = new DateRange(52, 'Previous Billing Cycle', true, true, DateRangeScene.Normal);
// Date ranges for trend analysis scene only
public static readonly RecentTwelveMonths = new DateRange(101, 'Recent 12 months', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly RecentTwentyFourMonths = new DateRange(102, 'Recent 24 months', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly RecentThirtySixMonths = new DateRange(103, 'Recent 36 months', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly RecentTwoYears = new DateRange(104, 'Recent 2 years', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly RecentThreeYears = new DateRange(105, 'Recent 3 years', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly RecentFiveYears = new DateRange(106, 'Recent 5 years', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly RecentTwelveMonths = new DateRange(101, 'Recent 12 months', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly RecentTwentyFourMonths = new DateRange(102, 'Recent 24 months', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly RecentThirtySixMonths = new DateRange(103, 'Recent 36 months', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly RecentTwoYears = new DateRange(104, 'Recent 2 years', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly RecentThreeYears = new DateRange(105, 'Recent 3 years', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public static readonly RecentFiveYears = new DateRange(106, 'Recent 5 years', false, false, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
// Custom date range
public static readonly Custom = new DateRange(255, 'Custom Date', false, true, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplore);
public static readonly Custom = new DateRange(255, 'Custom Date', false, true, DateRangeScene.Normal, DateRangeScene.TrendAnalysis, DateRangeScene.AssetTrends, DateRangeScene.InsightsExplorer);
public readonly type: number;
public readonly name: string;
-291
View File
@@ -1,291 +0,0 @@
import { type NameValue } from '@/core/base.ts';
import { DateRange } from '@/core/datetime.ts';
export enum TransactionExploreConditionRelation {
First = 'first',
And = 'and',
Or = 'or'
}
export const TransactionExploreConditionRelationPriority: Record<TransactionExploreConditionRelation, number> = {
[TransactionExploreConditionRelation.First]: 0,
[TransactionExploreConditionRelation.Or]: 1,
[TransactionExploreConditionRelation.And]: 2
};
export enum TransactionExploreConditionFieldType {
TransactionType = 'transactionType',
TransactionCategory = 'transactionCategory',
SourceAccount = 'sourceAccount',
DestinationAccount = 'destinationAccount',
SourceAmount = 'sourceAmount',
DestinationAmount = 'destinationAmount',
TransactionTag = 'transactionTag',
Description = 'description'
}
export class TransactionExploreConditionField implements NameValue {
private static readonly allInstances: TransactionExploreConditionField[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExploreConditionField> = {};
public static readonly TransactionType = new TransactionExploreConditionField('Transaction Type', TransactionExploreConditionFieldType.TransactionType);
public static readonly TransactionCategory = new TransactionExploreConditionField('Category', TransactionExploreConditionFieldType.TransactionCategory);
public static readonly SourceAccount = new TransactionExploreConditionField('Source Account', TransactionExploreConditionFieldType.SourceAccount);
public static readonly DestinationAccount = new TransactionExploreConditionField('Destination Account', TransactionExploreConditionFieldType.DestinationAccount);
public static readonly SourceAmount = new TransactionExploreConditionField('Amount', TransactionExploreConditionFieldType.SourceAmount);
public static readonly DestinationAmount = new TransactionExploreConditionField('Transfer In Amount', TransactionExploreConditionFieldType.DestinationAmount);
public static readonly TransactionTag = new TransactionExploreConditionField('Tags', TransactionExploreConditionFieldType.TransactionTag);
public static readonly Description = new TransactionExploreConditionField('Description', TransactionExploreConditionFieldType.Description);
public readonly name: string;
public readonly value: TransactionExploreConditionFieldType;
private constructor(name: string, value: TransactionExploreConditionFieldType) {
this.name = name;
this.value = value;
TransactionExploreConditionField.allInstances.push(this);
TransactionExploreConditionField.allInstancesByValue[value] = this;
}
public static values(): TransactionExploreConditionField[] {
return TransactionExploreConditionField.allInstances;
}
public static valueOf(value: string): TransactionExploreConditionField | undefined {
return TransactionExploreConditionField.allInstancesByValue[value];
}
}
export enum TransactionExploreConditionOperatorType {
In = 'in',
GreaterThan = 'greaterThan',
LessThan = 'lessThan',
Equals = 'equals',
NotEquals = 'notEquals',
Between = 'between',
NotBetween = 'notBetween',
HasAny = 'hasAny',
HasAll = 'hasAll',
NotHasAny = 'notHasAny',
NotHasAll = 'notHasAll',
IsEmpty = 'isEmpty',
IsNotEmpty = 'isNotEmpty',
Contains = 'contains',
NotContains = 'notContains',
StartsWith = 'startsWith',
NotStartsWith = 'notStartsWith',
EndsWith = 'endsWith',
NotEndsWith = 'notEndsWith'
}
export class TransactionExploreConditionOperator implements NameValue {
private static readonly allInstances: TransactionExploreConditionOperator[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExploreConditionOperator> = {};
public static readonly In = new TransactionExploreConditionOperator('In', TransactionExploreConditionOperatorType.In);
public static readonly GreaterThan = new TransactionExploreConditionOperator('Greater than', TransactionExploreConditionOperatorType.GreaterThan);
public static readonly LessThan = new TransactionExploreConditionOperator('Less than', TransactionExploreConditionOperatorType.LessThan);
public static readonly Equals = new TransactionExploreConditionOperator('Equal to', TransactionExploreConditionOperatorType.Equals);
public static readonly NotEquals = new TransactionExploreConditionOperator('Not equal to', TransactionExploreConditionOperatorType.NotEquals);
public static readonly Between = new TransactionExploreConditionOperator('Between', TransactionExploreConditionOperatorType.Between);
public static readonly NotBetween = new TransactionExploreConditionOperator('Not between', TransactionExploreConditionOperatorType.NotBetween);
public static readonly HasAny = new TransactionExploreConditionOperator('Has any', TransactionExploreConditionOperatorType.HasAny);
public static readonly HasAll = new TransactionExploreConditionOperator('Has all', TransactionExploreConditionOperatorType.HasAll);
public static readonly NotHasAny = new TransactionExploreConditionOperator('Not has any', TransactionExploreConditionOperatorType.NotHasAny);
public static readonly NotHasAll = new TransactionExploreConditionOperator('Not has all', TransactionExploreConditionOperatorType.NotHasAll);
public static readonly IsEmpty = new TransactionExploreConditionOperator('Is empty', TransactionExploreConditionOperatorType.IsEmpty);
public static readonly IsNotEmpty = new TransactionExploreConditionOperator('Is not empty', TransactionExploreConditionOperatorType.IsNotEmpty);
public static readonly Contains = new TransactionExploreConditionOperator('Contains', TransactionExploreConditionOperatorType.Contains);
public static readonly NotContains = new TransactionExploreConditionOperator('Not contains', TransactionExploreConditionOperatorType.NotContains);
public static readonly StartsWith = new TransactionExploreConditionOperator('Starts with', TransactionExploreConditionOperatorType.StartsWith);
public static readonly NotStartsWith = new TransactionExploreConditionOperator('Not starts with', TransactionExploreConditionOperatorType.NotStartsWith);
public static readonly EndsWith = new TransactionExploreConditionOperator('Ends with', TransactionExploreConditionOperatorType.EndsWith);
public static readonly NotEndsWith = new TransactionExploreConditionOperator('Not ends with', TransactionExploreConditionOperatorType.NotEndsWith);
public readonly name: string;
public readonly value: TransactionExploreConditionOperatorType;
private constructor(name: string, value: TransactionExploreConditionOperatorType) {
this.name = name;
this.value = value;
TransactionExploreConditionOperator.allInstances.push(this);
TransactionExploreConditionOperator.allInstancesByValue[value] = this;
}
public static values(): TransactionExploreConditionOperator[] {
return TransactionExploreConditionOperator.allInstances;
}
public static valueOf(value: string): TransactionExploreConditionOperator | undefined {
return TransactionExploreConditionOperator.allInstancesByValue[value];
}
}
export enum TransactionExploreChartTypeValue {
Pie = 'pie',
ColumnStacked = 'columnStacked',
Column100PercentStacked = 'column100%Stacked',
ColumnGrouped = 'columnGrouped',
LineGrouped = 'lineGrouped',
AreaStacked = 'areaStacked',
Area100PercentStacked = 'area100%Stacked',
BubbleGrouped = 'bubbleGrouped',
Radar = 'radar'
}
export class TransactionExploreChartType implements NameValue {
private static readonly allInstances: TransactionExploreChartType[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExploreChartType> = {};
public static readonly Pie = new TransactionExploreChartType('Pie Chart', TransactionExploreChartTypeValue.Pie, false);
public static readonly Radar = new TransactionExploreChartType('Radar Chart', TransactionExploreChartTypeValue.Radar, false);
public static readonly Default = TransactionExploreChartType.Pie;
public readonly name: string;
public readonly value: TransactionExploreChartTypeValue;
public readonly seriesDimensionRequired: boolean;
private constructor(name: string, value: TransactionExploreChartTypeValue, seriesDimensionRequired: boolean) {
this.name = name;
this.value = value;
this.seriesDimensionRequired = seriesDimensionRequired;
TransactionExploreChartType.allInstances.push(this);
TransactionExploreChartType.allInstancesByValue[value] = this;
}
public static values(): TransactionExploreChartType[] {
return TransactionExploreChartType.allInstances;
}
public static valueOf(value: string): TransactionExploreChartType | undefined {
return TransactionExploreChartType.allInstancesByValue[value];
}
}
export enum TransactionExploreDataDimensionType {
None = 'none',
Query = 'query',
DateTime = 'dateTime',
DateTimeByYearMonthDay = 'dateTimeByYearMonthDay',
DateTimeByYearMonth = 'dateTimeByYearMonth',
DateTimeByYearQuarter = 'dateTimeByYearQuarter',
DateTimeByYear = 'dateTimeByYear',
DateTimeByFiscalYear = 'dateTimeByFiscalYear',
DateTimeByDayOfWeek = 'dateTimeByDayOfWeek',
DateTimeByDayOfMonth = 'dateTimeByDayOfMonth',
DateTimeByMonthOfYear = 'dateTimeByMonthOfYear',
DateTimeByQuarterOfYear = 'dateTimeByQuarterOfYear',
TransactionType = 'transactionType',
SourceAccount = 'sourceAccount',
SourceAccountCategory = 'sourceAccountCategory',
SourceAccountCurrency = 'sourceAccountCurrency',
DestinationAccount = 'destinationAccount',
DestinationAccountCategory = 'destinationAccountCategory',
DestinationAccountCurrency = 'destinationAccountCurrency',
SourceAmount = 'sourceAmount',
DestinationAmount = 'destinationAmount',
PrimaryCategory = 'primaryCategory',
SecondaryCategory = 'secondaryCategory'
}
export class TransactionExploreDataDimension implements NameValue {
private static readonly allInstances: TransactionExploreDataDimension[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExploreDataDimension> = {};
public static readonly None = new TransactionExploreDataDimension('None', TransactionExploreDataDimensionType.None);
public static readonly Query = new TransactionExploreDataDimension('Query', TransactionExploreDataDimensionType.Query);
public static readonly DateTime = new TransactionExploreDataDimension('Transaction Time', TransactionExploreDataDimensionType.DateTime);
public static readonly DateTimeByYearMonthDay = new TransactionExploreDataDimension('Transaction Date', TransactionExploreDataDimensionType.DateTimeByYearMonthDay);
public static readonly DateTimeByYearMonth = new TransactionExploreDataDimension('Transaction Year-Month', TransactionExploreDataDimensionType.DateTimeByYearMonth);
public static readonly DateTimeByYearQuarter = new TransactionExploreDataDimension('Transaction Year-Quarter', TransactionExploreDataDimensionType.DateTimeByYearQuarter);
public static readonly DateTimeByYear = new TransactionExploreDataDimension('Transaction Year', TransactionExploreDataDimensionType.DateTimeByYear);
public static readonly DateTimeByFiscalYear = new TransactionExploreDataDimension('Transaction Fiscal Year', TransactionExploreDataDimensionType.DateTimeByFiscalYear);
public static readonly DateTimeByDayOfWeek = new TransactionExploreDataDimension('Transaction Day of Week', TransactionExploreDataDimensionType.DateTimeByDayOfWeek);
public static readonly DateTimeByDayOfMonth = new TransactionExploreDataDimension('Transaction Day of Month', TransactionExploreDataDimensionType.DateTimeByDayOfMonth);
public static readonly DateTimeByMonthOfYear = new TransactionExploreDataDimension('Transaction Month of Year', TransactionExploreDataDimensionType.DateTimeByMonthOfYear);
public static readonly DateTimeByQuarterOfYear = new TransactionExploreDataDimension('Transaction Quarter of Year', TransactionExploreDataDimensionType.DateTimeByQuarterOfYear);
public static readonly TransactionType = new TransactionExploreDataDimension('Transaction Type', TransactionExploreDataDimensionType.TransactionType);
public static readonly SourceAccount = new TransactionExploreDataDimension('Source Account', TransactionExploreDataDimensionType.SourceAccount);
public static readonly SourceAccountCategory = new TransactionExploreDataDimension('Source Account Category', TransactionExploreDataDimensionType.SourceAccountCategory);
public static readonly SourceAccountCurrency = new TransactionExploreDataDimension('Source Account Currency', TransactionExploreDataDimensionType.SourceAccountCurrency);
public static readonly DestinationAccount = new TransactionExploreDataDimension('Destination Account', TransactionExploreDataDimensionType.DestinationAccount);
public static readonly DestinationAccountCategory = new TransactionExploreDataDimension('Destination Account Category', TransactionExploreDataDimensionType.DestinationAccountCategory);
public static readonly DestinationAccountCurrency = new TransactionExploreDataDimension('Destination Account Currency', TransactionExploreDataDimensionType.DestinationAccountCurrency);
public static readonly PrimaryCategory = new TransactionExploreDataDimension('Primary Category', TransactionExploreDataDimensionType.PrimaryCategory);
public static readonly SecondaryCategory = new TransactionExploreDataDimension('Secondary Category', TransactionExploreDataDimensionType.SecondaryCategory);
public static readonly SourceAmount = new TransactionExploreDataDimension('Amount', TransactionExploreDataDimensionType.SourceAmount);
public static readonly DestinationAmount = new TransactionExploreDataDimension('Transfer In Amount', TransactionExploreDataDimensionType.DestinationAmount);
public static readonly CategoryDimensionDefault = TransactionExploreDataDimension.Query;
public static readonly SeriesDimensionDefault = TransactionExploreDataDimension.None;
public readonly name: string;
public readonly value: TransactionExploreDataDimensionType;
private constructor(name: string, value: TransactionExploreDataDimensionType) {
this.name = name;
this.value = value;
TransactionExploreDataDimension.allInstances.push(this);
TransactionExploreDataDimension.allInstancesByValue[value] = this;
}
public static values(): TransactionExploreDataDimension[] {
return TransactionExploreDataDimension.allInstances;
}
public static valueOf(value: string): TransactionExploreDataDimension | undefined {
return TransactionExploreDataDimension.allInstancesByValue[value];
}
}
export enum TransactionExploreValueMetricType {
TransactionCount = 'transactionCount',
SourceAmountSum = 'sourceAmountSum',
SourceAmountAverage = 'sourceAmountAverage',
SourceAmountMedian = 'sourceAmountMedian',
SourceAmountMinimum = 'sourceAmountMinimum',
SourceAmountMaximum = 'sourceAmountMaximum'
}
export class TransactionExploreValueMetric implements NameValue {
private static readonly allInstances: TransactionExploreValueMetric[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExploreValueMetric> = {};
public static readonly TransactionCount = new TransactionExploreValueMetric('Transaction Count', TransactionExploreValueMetricType.TransactionCount, false);
public static readonly SourceAmountSum = new TransactionExploreValueMetric('Total Amount', TransactionExploreValueMetricType.SourceAmountSum, true);
public static readonly SourceAmountAverage = new TransactionExploreValueMetric('Average Amount', TransactionExploreValueMetricType.SourceAmountAverage, true);
public static readonly SourceAmountMedian = new TransactionExploreValueMetric('Median Amount', TransactionExploreValueMetricType.SourceAmountMedian, true);
public static readonly SourceAmountMinimum = new TransactionExploreValueMetric('Minimum Amount', TransactionExploreValueMetricType.SourceAmountMinimum, true);
public static readonly SourceAmountMaximum = new TransactionExploreValueMetric('Maximum Amount', TransactionExploreValueMetricType.SourceAmountMaximum, true);
public static readonly Default = TransactionExploreValueMetric.SourceAmountSum;
public readonly name: string;
public readonly value: TransactionExploreValueMetricType;
public readonly isAmount: boolean;
private constructor(name: string, value: TransactionExploreValueMetricType, isAmount: boolean) {
this.name = name;
this.value = value;
this.isAmount = isAmount;
TransactionExploreValueMetric.allInstances.push(this);
TransactionExploreValueMetric.allInstancesByValue[value] = this;
}
public static values(): TransactionExploreValueMetric[] {
return TransactionExploreValueMetric.allInstances;
}
public static valueOf(value: string): TransactionExploreValueMetric | undefined {
return TransactionExploreValueMetric.allInstancesByValue[value];
}
}
export const DEFAULT_TRANSACTION_EXPLORE_DATE_RANGE: DateRange = DateRange.ThisMonth;
+291
View File
@@ -0,0 +1,291 @@
import { type NameValue } from '@/core/base.ts';
import { DateRange } from '@/core/datetime.ts';
export enum TransactionExplorerConditionRelation {
First = 'first',
And = 'and',
Or = 'or'
}
export const TransactionExplorerConditionRelationPriority: Record<TransactionExplorerConditionRelation, number> = {
[TransactionExplorerConditionRelation.First]: 0,
[TransactionExplorerConditionRelation.Or]: 1,
[TransactionExplorerConditionRelation.And]: 2
};
export enum TransactionExplorerConditionFieldType {
TransactionType = 'transactionType',
TransactionCategory = 'transactionCategory',
SourceAccount = 'sourceAccount',
DestinationAccount = 'destinationAccount',
SourceAmount = 'sourceAmount',
DestinationAmount = 'destinationAmount',
TransactionTag = 'transactionTag',
Description = 'description'
}
export class TransactionExplorerConditionField implements NameValue {
private static readonly allInstances: TransactionExplorerConditionField[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExplorerConditionField> = {};
public static readonly TransactionType = new TransactionExplorerConditionField('Transaction Type', TransactionExplorerConditionFieldType.TransactionType);
public static readonly TransactionCategory = new TransactionExplorerConditionField('Category', TransactionExplorerConditionFieldType.TransactionCategory);
public static readonly SourceAccount = new TransactionExplorerConditionField('Source Account', TransactionExplorerConditionFieldType.SourceAccount);
public static readonly DestinationAccount = new TransactionExplorerConditionField('Destination Account', TransactionExplorerConditionFieldType.DestinationAccount);
public static readonly SourceAmount = new TransactionExplorerConditionField('Amount', TransactionExplorerConditionFieldType.SourceAmount);
public static readonly DestinationAmount = new TransactionExplorerConditionField('Transfer In Amount', TransactionExplorerConditionFieldType.DestinationAmount);
public static readonly TransactionTag = new TransactionExplorerConditionField('Tags', TransactionExplorerConditionFieldType.TransactionTag);
public static readonly Description = new TransactionExplorerConditionField('Description', TransactionExplorerConditionFieldType.Description);
public readonly name: string;
public readonly value: TransactionExplorerConditionFieldType;
private constructor(name: string, value: TransactionExplorerConditionFieldType) {
this.name = name;
this.value = value;
TransactionExplorerConditionField.allInstances.push(this);
TransactionExplorerConditionField.allInstancesByValue[value] = this;
}
public static values(): TransactionExplorerConditionField[] {
return TransactionExplorerConditionField.allInstances;
}
public static valueOf(value: string): TransactionExplorerConditionField | undefined {
return TransactionExplorerConditionField.allInstancesByValue[value];
}
}
export enum TransactionExplorerConditionOperatorType {
In = 'in',
GreaterThan = 'greaterThan',
LessThan = 'lessThan',
Equals = 'equals',
NotEquals = 'notEquals',
Between = 'between',
NotBetween = 'notBetween',
HasAny = 'hasAny',
HasAll = 'hasAll',
NotHasAny = 'notHasAny',
NotHasAll = 'notHasAll',
IsEmpty = 'isEmpty',
IsNotEmpty = 'isNotEmpty',
Contains = 'contains',
NotContains = 'notContains',
StartsWith = 'startsWith',
NotStartsWith = 'notStartsWith',
EndsWith = 'endsWith',
NotEndsWith = 'notEndsWith'
}
export class TransactionExplorerConditionOperator implements NameValue {
private static readonly allInstances: TransactionExplorerConditionOperator[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExplorerConditionOperator> = {};
public static readonly In = new TransactionExplorerConditionOperator('In', TransactionExplorerConditionOperatorType.In);
public static readonly GreaterThan = new TransactionExplorerConditionOperator('Greater than', TransactionExplorerConditionOperatorType.GreaterThan);
public static readonly LessThan = new TransactionExplorerConditionOperator('Less than', TransactionExplorerConditionOperatorType.LessThan);
public static readonly Equals = new TransactionExplorerConditionOperator('Equal to', TransactionExplorerConditionOperatorType.Equals);
public static readonly NotEquals = new TransactionExplorerConditionOperator('Not equal to', TransactionExplorerConditionOperatorType.NotEquals);
public static readonly Between = new TransactionExplorerConditionOperator('Between', TransactionExplorerConditionOperatorType.Between);
public static readonly NotBetween = new TransactionExplorerConditionOperator('Not between', TransactionExplorerConditionOperatorType.NotBetween);
public static readonly HasAny = new TransactionExplorerConditionOperator('Has any', TransactionExplorerConditionOperatorType.HasAny);
public static readonly HasAll = new TransactionExplorerConditionOperator('Has all', TransactionExplorerConditionOperatorType.HasAll);
public static readonly NotHasAny = new TransactionExplorerConditionOperator('Not has any', TransactionExplorerConditionOperatorType.NotHasAny);
public static readonly NotHasAll = new TransactionExplorerConditionOperator('Not has all', TransactionExplorerConditionOperatorType.NotHasAll);
public static readonly IsEmpty = new TransactionExplorerConditionOperator('Is empty', TransactionExplorerConditionOperatorType.IsEmpty);
public static readonly IsNotEmpty = new TransactionExplorerConditionOperator('Is not empty', TransactionExplorerConditionOperatorType.IsNotEmpty);
public static readonly Contains = new TransactionExplorerConditionOperator('Contains', TransactionExplorerConditionOperatorType.Contains);
public static readonly NotContains = new TransactionExplorerConditionOperator('Not contains', TransactionExplorerConditionOperatorType.NotContains);
public static readonly StartsWith = new TransactionExplorerConditionOperator('Starts with', TransactionExplorerConditionOperatorType.StartsWith);
public static readonly NotStartsWith = new TransactionExplorerConditionOperator('Not starts with', TransactionExplorerConditionOperatorType.NotStartsWith);
public static readonly EndsWith = new TransactionExplorerConditionOperator('Ends with', TransactionExplorerConditionOperatorType.EndsWith);
public static readonly NotEndsWith = new TransactionExplorerConditionOperator('Not ends with', TransactionExplorerConditionOperatorType.NotEndsWith);
public readonly name: string;
public readonly value: TransactionExplorerConditionOperatorType;
private constructor(name: string, value: TransactionExplorerConditionOperatorType) {
this.name = name;
this.value = value;
TransactionExplorerConditionOperator.allInstances.push(this);
TransactionExplorerConditionOperator.allInstancesByValue[value] = this;
}
public static values(): TransactionExplorerConditionOperator[] {
return TransactionExplorerConditionOperator.allInstances;
}
public static valueOf(value: string): TransactionExplorerConditionOperator | undefined {
return TransactionExplorerConditionOperator.allInstancesByValue[value];
}
}
export enum TransactionExplorerChartTypeValue {
Pie = 'pie',
ColumnStacked = 'columnStacked',
Column100PercentStacked = 'column100%Stacked',
ColumnGrouped = 'columnGrouped',
LineGrouped = 'lineGrouped',
AreaStacked = 'areaStacked',
Area100PercentStacked = 'area100%Stacked',
BubbleGrouped = 'bubbleGrouped',
Radar = 'radar'
}
export class TransactionExplorerChartType implements NameValue {
private static readonly allInstances: TransactionExplorerChartType[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExplorerChartType> = {};
public static readonly Pie = new TransactionExplorerChartType('Pie Chart', TransactionExplorerChartTypeValue.Pie, false);
public static readonly Radar = new TransactionExplorerChartType('Radar Chart', TransactionExplorerChartTypeValue.Radar, false);
public static readonly Default = TransactionExplorerChartType.Pie;
public readonly name: string;
public readonly value: TransactionExplorerChartTypeValue;
public readonly seriesDimensionRequired: boolean;
private constructor(name: string, value: TransactionExplorerChartTypeValue, seriesDimensionRequired: boolean) {
this.name = name;
this.value = value;
this.seriesDimensionRequired = seriesDimensionRequired;
TransactionExplorerChartType.allInstances.push(this);
TransactionExplorerChartType.allInstancesByValue[value] = this;
}
public static values(): TransactionExplorerChartType[] {
return TransactionExplorerChartType.allInstances;
}
public static valueOf(value: string): TransactionExplorerChartType | undefined {
return TransactionExplorerChartType.allInstancesByValue[value];
}
}
export enum TransactionExplorerDataDimensionType {
None = 'none',
Query = 'query',
DateTime = 'dateTime',
DateTimeByYearMonthDay = 'dateTimeByYearMonthDay',
DateTimeByYearMonth = 'dateTimeByYearMonth',
DateTimeByYearQuarter = 'dateTimeByYearQuarter',
DateTimeByYear = 'dateTimeByYear',
DateTimeByFiscalYear = 'dateTimeByFiscalYear',
DateTimeByDayOfWeek = 'dateTimeByDayOfWeek',
DateTimeByDayOfMonth = 'dateTimeByDayOfMonth',
DateTimeByMonthOfYear = 'dateTimeByMonthOfYear',
DateTimeByQuarterOfYear = 'dateTimeByQuarterOfYear',
TransactionType = 'transactionType',
SourceAccount = 'sourceAccount',
SourceAccountCategory = 'sourceAccountCategory',
SourceAccountCurrency = 'sourceAccountCurrency',
DestinationAccount = 'destinationAccount',
DestinationAccountCategory = 'destinationAccountCategory',
DestinationAccountCurrency = 'destinationAccountCurrency',
SourceAmount = 'sourceAmount',
DestinationAmount = 'destinationAmount',
PrimaryCategory = 'primaryCategory',
SecondaryCategory = 'secondaryCategory'
}
export class TransactionExplorerDataDimension implements NameValue {
private static readonly allInstances: TransactionExplorerDataDimension[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExplorerDataDimension> = {};
public static readonly None = new TransactionExplorerDataDimension('None', TransactionExplorerDataDimensionType.None);
public static readonly Query = new TransactionExplorerDataDimension('Query', TransactionExplorerDataDimensionType.Query);
public static readonly DateTime = new TransactionExplorerDataDimension('Transaction Time', TransactionExplorerDataDimensionType.DateTime);
public static readonly DateTimeByYearMonthDay = new TransactionExplorerDataDimension('Transaction Date', TransactionExplorerDataDimensionType.DateTimeByYearMonthDay);
public static readonly DateTimeByYearMonth = new TransactionExplorerDataDimension('Transaction Year-Month', TransactionExplorerDataDimensionType.DateTimeByYearMonth);
public static readonly DateTimeByYearQuarter = new TransactionExplorerDataDimension('Transaction Year-Quarter', TransactionExplorerDataDimensionType.DateTimeByYearQuarter);
public static readonly DateTimeByYear = new TransactionExplorerDataDimension('Transaction Year', TransactionExplorerDataDimensionType.DateTimeByYear);
public static readonly DateTimeByFiscalYear = new TransactionExplorerDataDimension('Transaction Fiscal Year', TransactionExplorerDataDimensionType.DateTimeByFiscalYear);
public static readonly DateTimeByDayOfWeek = new TransactionExplorerDataDimension('Transaction Day of Week', TransactionExplorerDataDimensionType.DateTimeByDayOfWeek);
public static readonly DateTimeByDayOfMonth = new TransactionExplorerDataDimension('Transaction Day of Month', TransactionExplorerDataDimensionType.DateTimeByDayOfMonth);
public static readonly DateTimeByMonthOfYear = new TransactionExplorerDataDimension('Transaction Month of Year', TransactionExplorerDataDimensionType.DateTimeByMonthOfYear);
public static readonly DateTimeByQuarterOfYear = new TransactionExplorerDataDimension('Transaction Quarter of Year', TransactionExplorerDataDimensionType.DateTimeByQuarterOfYear);
public static readonly TransactionType = new TransactionExplorerDataDimension('Transaction Type', TransactionExplorerDataDimensionType.TransactionType);
public static readonly SourceAccount = new TransactionExplorerDataDimension('Source Account', TransactionExplorerDataDimensionType.SourceAccount);
public static readonly SourceAccountCategory = new TransactionExplorerDataDimension('Source Account Category', TransactionExplorerDataDimensionType.SourceAccountCategory);
public static readonly SourceAccountCurrency = new TransactionExplorerDataDimension('Source Account Currency', TransactionExplorerDataDimensionType.SourceAccountCurrency);
public static readonly DestinationAccount = new TransactionExplorerDataDimension('Destination Account', TransactionExplorerDataDimensionType.DestinationAccount);
public static readonly DestinationAccountCategory = new TransactionExplorerDataDimension('Destination Account Category', TransactionExplorerDataDimensionType.DestinationAccountCategory);
public static readonly DestinationAccountCurrency = new TransactionExplorerDataDimension('Destination Account Currency', TransactionExplorerDataDimensionType.DestinationAccountCurrency);
public static readonly PrimaryCategory = new TransactionExplorerDataDimension('Primary Category', TransactionExplorerDataDimensionType.PrimaryCategory);
public static readonly SecondaryCategory = new TransactionExplorerDataDimension('Secondary Category', TransactionExplorerDataDimensionType.SecondaryCategory);
public static readonly SourceAmount = new TransactionExplorerDataDimension('Amount', TransactionExplorerDataDimensionType.SourceAmount);
public static readonly DestinationAmount = new TransactionExplorerDataDimension('Transfer In Amount', TransactionExplorerDataDimensionType.DestinationAmount);
public static readonly CategoryDimensionDefault = TransactionExplorerDataDimension.Query;
public static readonly SeriesDimensionDefault = TransactionExplorerDataDimension.None;
public readonly name: string;
public readonly value: TransactionExplorerDataDimensionType;
private constructor(name: string, value: TransactionExplorerDataDimensionType) {
this.name = name;
this.value = value;
TransactionExplorerDataDimension.allInstances.push(this);
TransactionExplorerDataDimension.allInstancesByValue[value] = this;
}
public static values(): TransactionExplorerDataDimension[] {
return TransactionExplorerDataDimension.allInstances;
}
public static valueOf(value: string): TransactionExplorerDataDimension | undefined {
return TransactionExplorerDataDimension.allInstancesByValue[value];
}
}
export enum TransactionExplorerValueMetricType {
TransactionCount = 'transactionCount',
SourceAmountSum = 'sourceAmountSum',
SourceAmountAverage = 'sourceAmountAverage',
SourceAmountMedian = 'sourceAmountMedian',
SourceAmountMinimum = 'sourceAmountMinimum',
SourceAmountMaximum = 'sourceAmountMaximum'
}
export class TransactionExplorerValueMetric implements NameValue {
private static readonly allInstances: TransactionExplorerValueMetric[] = [];
private static readonly allInstancesByValue: Record<string, TransactionExplorerValueMetric> = {};
public static readonly TransactionCount = new TransactionExplorerValueMetric('Transaction Count', TransactionExplorerValueMetricType.TransactionCount, false);
public static readonly SourceAmountSum = new TransactionExplorerValueMetric('Total Amount', TransactionExplorerValueMetricType.SourceAmountSum, true);
public static readonly SourceAmountAverage = new TransactionExplorerValueMetric('Average Amount', TransactionExplorerValueMetricType.SourceAmountAverage, true);
public static readonly SourceAmountMedian = new TransactionExplorerValueMetric('Median Amount', TransactionExplorerValueMetricType.SourceAmountMedian, true);
public static readonly SourceAmountMinimum = new TransactionExplorerValueMetric('Minimum Amount', TransactionExplorerValueMetricType.SourceAmountMinimum, true);
public static readonly SourceAmountMaximum = new TransactionExplorerValueMetric('Maximum Amount', TransactionExplorerValueMetricType.SourceAmountMaximum, true);
public static readonly Default = TransactionExplorerValueMetric.SourceAmountSum;
public readonly name: string;
public readonly value: TransactionExplorerValueMetricType;
public readonly isAmount: boolean;
private constructor(name: string, value: TransactionExplorerValueMetricType, isAmount: boolean) {
this.name = name;
this.value = value;
this.isAmount = isAmount;
TransactionExplorerValueMetric.allInstances.push(this);
TransactionExplorerValueMetric.allInstancesByValue[value] = this;
}
public static values(): TransactionExplorerValueMetric[] {
return TransactionExplorerValueMetric.allInstances;
}
public static valueOf(value: string): TransactionExplorerValueMetric | undefined {
return TransactionExplorerValueMetric.allInstancesByValue[value];
}
}
export const DEFAULT_TRANSACTION_EXPLORER_DATE_RANGE: DateRange = DateRange.ThisMonth;
+10 -10
View File
@@ -10,7 +10,7 @@ import {
DEFAULT_TREND_CHART_DATA_RANGE,
DEFAULT_ASSET_TRENDS_CHART_DATA_RANGE
} from './statistics.ts';
import { DEFAULT_TRANSACTION_EXPLORE_DATE_RANGE } from './explore.ts';
import { DEFAULT_TRANSACTION_EXPLORER_DATE_RANGE } from './explorer.ts';
import { DEFAULT_CURRENCY_CODE } from '@/consts/currency.ts';
export type ApplicationSettingKey = string;
@@ -50,9 +50,9 @@ export interface ApplicationSettings extends BaseApplicationSetting {
autoSaveTransactionDraft: string;
autoGetCurrentGeoLocation: boolean;
alwaysShowTransactionPicturesInMobileTransactionEditPage: boolean;
// Insights & Explore Page
insightsExploreDefaultDateRangeType: number;
timezoneUsedForInsightsExplorePage: number;
// Insights Explorer Page
insightsExplorerDefaultDateRangeType: number;
timezoneUsedForInsightsExplorerPage: number;
// Account List Page
totalAmountExcludeAccountIds: Record<string, boolean>;
// Exchange Rates Data Page
@@ -115,9 +115,9 @@ export const ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES: Record<string, UserAp
'autoSaveTransactionDraft': UserApplicationCloudSettingType.String,
'autoGetCurrentGeoLocation': UserApplicationCloudSettingType.Boolean,
'alwaysShowTransactionPicturesInMobileTransactionEditPage': UserApplicationCloudSettingType.Boolean,
// Insights & Explore Page
'insightsExploreDefaultDateRangeType': UserApplicationCloudSettingType.Number,
'timezoneUsedForInsightsExplorePage': UserApplicationCloudSettingType.Number,
// Insights Explorer Page
'insightsExplorerDefaultDateRangeType': UserApplicationCloudSettingType.Number,
'timezoneUsedForInsightsExplorerPage': UserApplicationCloudSettingType.Number,
// Account List Page
'totalAmountExcludeAccountIds': UserApplicationCloudSettingType.StringBooleanMap,
// Exchange Rates Data Page
@@ -165,9 +165,9 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = {
autoSaveTransactionDraft: 'disabled',
autoGetCurrentGeoLocation: false,
alwaysShowTransactionPicturesInMobileTransactionEditPage: false,
// Insights & Explore Page
insightsExploreDefaultDateRangeType: DEFAULT_TRANSACTION_EXPLORE_DATE_RANGE.type,
timezoneUsedForInsightsExplorePage: TimezoneTypeForStatistics.Default.type,
// Insights Explorer Page
insightsExplorerDefaultDateRangeType: DEFAULT_TRANSACTION_EXPLORER_DATE_RANGE.type,
timezoneUsedForInsightsExplorerPage: TimezoneTypeForStatistics.Default.type,
// Account List Page
totalAmountExcludeAccountIds: {},
// Exchange Rates Data Page