Accounting periods: financial year, monthly, quarterly, annual #3

Open
opened 2026-08-07 14:22:35 +00:00 by hum3 · 0 comments
Owner

Overview

Manage accounting periods for generating reports over standard and custom date ranges.

Built-in Periods

  • Monthly: calendar months
  • Quarterly: Q1–Q4 (aligned to financial year)
  • Annual: full financial year

Configurable Financial Year

  • UK default: 6 April – 5 April (tax year)
  • Support custom start dates for other jurisdictions or corporate year-ends
  • Quarters derived from financial year start

Period Helpers

  • CurrentPeriod(periodType) — the period containing today
  • PreviousPeriod(period) — the preceding period of the same type
  • YearToDate(date) — from financial year start to the given date
  • PeriodsInRange(from, to, periodType) — generate all period boundaries within a range
  • Period{From, To time.Time} — usable directly as report date ranges

Acceptance Criteria

  • Period struct with From and To fields
  • FinancialYear config with UK default
  • Monthly, quarterly, annual period generators
  • Helper functions for current, previous, YTD
  • Tests covering UK tax year boundaries and edge cases (leap years, month ends)

Migrated from Codeberg: originally #3, opened 2026-03-25.

## Overview Manage accounting periods for generating reports over standard and custom date ranges. ## Built-in Periods - **Monthly**: calendar months - **Quarterly**: Q1–Q4 (aligned to financial year) - **Annual**: full financial year ## Configurable Financial Year - UK default: 6 April – 5 April (tax year) - Support custom start dates for other jurisdictions or corporate year-ends - Quarters derived from financial year start ## Period Helpers - `CurrentPeriod(periodType)` — the period containing today - `PreviousPeriod(period)` — the preceding period of the same type - `YearToDate(date)` — from financial year start to the given date - `PeriodsInRange(from, to, periodType)` — generate all period boundaries within a range - `Period{From, To time.Time}` — usable directly as report date ranges ## Acceptance Criteria - `Period` struct with `From` and `To` fields - `FinancialYear` config with UK default - Monthly, quarterly, annual period generators - Helper functions for current, previous, YTD - Tests covering UK tax year boundaries and edge cases (leap years, month ends) --- *Migrated from Codeberg: originally [#3](https://codeberg.org/hum3/gobank-accounts/issues/3), opened 2026-03-25.*
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hum3/gobank-accounts#3
No description provided.