Skip to content

feat: expense dialog result#428

Open
algirdasc wants to merge 5 commits intomainfrom
feature/EXP-13-expense-dialog-result
Open

feat: expense dialog result#428
algirdasc wants to merge 5 commits intomainfrom
feature/EXP-13-expense-dialog-result

Conversation

@algirdasc
Copy link
Copy Markdown
Owner

No description provided.

Frontend Developer and others added 5 commits March 22, 2026 22:12
Move calendar state management (route data init, query param sync,
rangeChange handling) into a dedicated CalendarStateComponent, leaving
MainComponent as a thin layout shell (sidebar, mobile detection, swipe).

- New CalendarStateComponent owns visibleDate, calendarDateFrom/To,
  calendar selection, and calls mainService.refreshCalendar() on change
- MainComponent retains: isMobile detection, swipe, sidebar toggle,
  busy-state subscriptions, and statement import trigger
- Sidebar calendarChange now calls mainService.refreshCalendar() directly

Co-Authored-By: Paperclip <noreply@paperclip.ing>
… actions

EXP-10: Separates four mixed concerns into focused components.

- CalendarListDisplayComponent: pure display, renders calendar list with
  per-item radio, name, balance, and icon; emits events for calendarSelect,
  makeDefault, editCalendar, deleteCalendar — no API calls
- CalendarListActionsComponent: owns CRUD dialog lifecycle (create, edit,
  delete) and the \"Add a calendar\" button; emits calendarsChange after
  mutations
- CalendarSidebarListComponent: thin container; handles makeDefault via
  UserApiService, wires display events to actions component
- Removes StatementImportService from this component hierarchy entirely

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…report

EXP-11: Removes the shared abstract base class and gives each report
component its own typed fetch method, eliminating any-typed callbacks
and unsafe string-keyed API dispatch.

- DailyExpensesComponent: fetches via reportsApiService.dailyExpenses(),
  typed to ExpenseReportResponse
- MonthlyExpensesComponent: fetches via reportsApiService.monthlyExpenses(),
  typed to ExpenseReportResponse
- CategoryExpensesComponent: fetches via reportsApiService.categoryExpenses(),
  typed to CategoryExpenseReportResponse
- Each component owns isBusy, dateRange, fetchSubscription, and
  preparedToFetch() locally
- AbstractReportComponent deleted

Co-Authored-By: Paperclip <noreply@paperclip.ing>
EXP-12: Replaces direct MainService reads with @input() props so the
component can be reused and tested in isolation.

- Add @input() calendar and @input() visibleDate to ExpenseReportComponent
- Remove MainService injection; fetch logic moves to private fetchReport()
- Add ngOnChanges to re-fetch when calendar or visibleDate inputs change
- HeaderCalendarInfoComponent: switch from component-class popover to
  template-ref popover, passing calendar and visibleDate as inputs; add
  @input() visibleDate
- header.component.html: pass [visibleDate] to app-header-calendar-info

Co-Authored-By: Paperclip <noreply@paperclip.ing>
EXP-13: Replaces 4 callback @input() props with a single typed
ExpenseDialogResult close value so callers use one .onClose.subscribe().

- Add ExpenseDialogResult interface: { expense?: Expense; deleted?: boolean }
- ExpenseComponent, BalanceComponent: remove @input() onSubmit/onDelete;
  close dialog with { expense } on save, { deleted: true } on delete
- TransferComponent: close with {} (saved, no specific expense returned)
- Remove onExpenseSubmit/onExpenseDelete/onBalanceSubmit/onBalanceDelete
  from ExpenseDialogComponent and its template
- CalendarService: subscribe as ExpenseDialogResult; truthiness check unchanged
- StatementReviewDialogComponent: remove onExpenseDelete context callback;
  handle delete vs save branches via result.deleted / result.expense

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant