accounting period

This commit is contained in:
Priec
2026-07-26 17:29:54 +02:00
parent 8146bce654
commit 5f910fb071
7 changed files with 106 additions and 6 deletions

View File

@@ -63,6 +63,22 @@ enum AccountingPeriodStatus {
ACCOUNTING_PERIOD_STATUS_APPROVED = 3;
}
// How long one accounting period lasts. MONTH and YEAR span whole months, so
// the caller states only the start and the end is derived. PARTIAL is the
// exception for periods real life cut short.
enum AccountingPeriodType {
ACCOUNTING_PERIOD_TYPE_UNSPECIFIED = 0;
// One calendar month.
ACCOUNTING_PERIOD_TYPE_MONTH = 1;
// Twelve consecutive months, aligned to the profile's fiscal year. Starting
// in January gives the calendar year; any other start month gives a business
// year (hospodársky rok).
ACCOUNTING_PERIOD_TYPE_YEAR = 2;
// Neither a whole month nor a whole year, because the entity was formed or
// terminated part-way through one. The only type carrying an explicit end.
ACCOUNTING_PERIOD_TYPE_PARTIAL = 3;
}
message PostJournalRequest {
string profile_name = 1;
@@ -244,11 +260,16 @@ message Journal {
message ConfigureAccountingPeriodRequest {
string profile_name = 1;
// Inclusive range in YYYY-MM-DD.
// First day of the period, YYYY-MM-DD. Must be the first day of a month.
string period_start = 2;
string period_end = 3;
reserved 3;
// Optional link to the preceding period in a carry chain.
optional int64 previous_period_id = 4;
// Required. Decides the length of the period.
AccountingPeriodType period_type = 5;
// Last day of the period, YYYY-MM-DD. Required for PARTIAL and rejected for
// every other type, whose end follows from the start.
string period_end = 6;
}
message CloseAccountingPeriodRequest {
@@ -286,6 +307,7 @@ message AccountingPeriod {
string closed_by_user_id = 8;
string approved_at = 9;
string approved_by_user_id = 10;
AccountingPeriodType period_type = 11;
}
message ListPeriodBalancesRequest {