reconciliation statement page / dialog supports account balance trends chart (#184)

This commit is contained in:
MaysWind
2025-08-04 01:22:36 +08:00
parent 15d1d269ae
commit 14b4e40039
26 changed files with 917 additions and 29 deletions
+26
View File
@@ -20,6 +20,12 @@ export interface YearMonthRange {
readonly endYearMonth: Year0BasedMonth;
}
export interface YearMonthDay {
readonly year: number;
readonly month: number; // 1-based (1 = January, 12 = December)
readonly day: number;
}
export interface TimeRange {
readonly minTime: number;
readonly maxTime: number;
@@ -136,6 +142,26 @@ export class YearMonthUnixTime implements Year0BasedMonth, UnixTimeRange {
}
}
export class YearMonthDayUnixTime implements YearMonthDay, UnixTimeRange {
public readonly year: number;
public readonly month: number;
public readonly day: number;
public readonly minUnixTime: number;
public readonly maxUnixTime: number;
private constructor(year: number, month: number, day: number, minUnixTime: number, maxUnixTime: number) {
this.year = year;
this.month = month;
this.day = day
this.minUnixTime = minUnixTime;
this.maxUnixTime = maxUnixTime;
}
public static of(yearMonthDay: YearMonthDay, minUnixTime: number, maxUnixTime: number): YearMonthDayUnixTime {
return new YearMonthDayUnixTime(yearMonthDay.year, yearMonthDay.month, yearMonthDay.day, minUnixTime, maxUnixTime);
}
}
export type MonthValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
export class Month {
+10 -8
View File
@@ -151,23 +151,25 @@ export class ChartSortingType implements TypeAndName {
}
}
export class ChartDateAggregationType implements TypeAndName {
export class ChartDateAggregationType {
private static readonly allInstances: ChartDateAggregationType[] = [];
private static readonly allInstancesByType: Record<number, ChartDateAggregationType> = {};
public static readonly Month = new ChartDateAggregationType(0, 'Aggregate by Month');
public static readonly Quarter = new ChartDateAggregationType(1, 'Aggregate by Quarter');
public static readonly Year = new ChartDateAggregationType(2, 'Aggregate by Year');
public static readonly FiscalYear = new ChartDateAggregationType(3, 'Aggregate by Fiscal Year');
public static readonly Month = new ChartDateAggregationType(0, 'Monthly', 'Aggregate by Month');
public static readonly Quarter = new ChartDateAggregationType(1, 'Quarterly', 'Aggregate by Quarter');
public static readonly Year = new ChartDateAggregationType(2, 'Yearly', 'Aggregate by Year');
public static readonly FiscalYear = new ChartDateAggregationType(3, 'FiscalYearly', 'Aggregate by Fiscal Year');
public static readonly Default = ChartDateAggregationType.Month;
public readonly type: number;
public readonly name: string;
public readonly shortName: string;
public readonly fullName: string;
private constructor(type: number, name: string) {
private constructor(type: number, shortName: string, fullName: string) {
this.type = type;
this.name = name;
this.shortName = shortName;
this.fullName = fullName;
ChartDateAggregationType.allInstances.push(this);
ChartDateAggregationType.allInstancesByType[type] = this;