Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Backend Logic for Reporting Period Certification and Transition #410

Closed
Tracked by #77
Vikariusu opened this issue Sep 4, 2024 · 0 comments · Fixed by #421
Closed
Tracked by #77

Implement Backend Logic for Reporting Period Certification and Transition #410

Vikariusu opened this issue Sep 4, 2024 · 0 comments · Fixed by #421

Comments

@Vikariusu
Copy link
Contributor

Dependencies

Blocked by: #408

Description

Implement the backend logic for certifying (closing) a current reporting period and transitioning to the next one. This includes creating a certification record, updating the organization's current reporting period, and handling edge cases.

Requirements

1. Implement certifyReportingPeriod mutation

This mutation should:
a) Create a new ReportingPeriodCertification (use createReportingPeriodCertification below)
b) Update the organization's current reporting period (use updateCurrentReportingPeriod below)

2. Update existing createReportingPeriodCertification

Ensure it creates a record with:

certifiedBy: current user's id
organizationId: current user's organization id
reportingPeriodId: id of the reporting period being certified

3. Implement updateCurrentReportingPeriod function

This should:
a) Remove the certified period from preferences.current_period_id
b) Set preferences.current_period_id to the result of calling nextReportingPeriod (to implement)

4. Implement nextReportingPeriod query

Find the reporting period with the closest future start date

Business Rules

  • Only one reporting period can be open (accepting uploads) at a time
  • Users cannot re-certify reporting periods
  • Maintain the unique constraint on ReportingPeriodCertification (organizationId + reportingPeriodId)

Edge Cases

Handle scenario when no subsequent reporting period exists. On the frontend, we'll display the last closed period but disable file uploads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant