SeedCompany / cord-api-v3

Bible translation project management API
MIT License
18 stars 4 forks source link

Fix current report picking final prematurely #3200

Closed CarsonF closed 5 months ago

CarsonF commented 5 months ago

Sort periodic reports by start date instead of end date.

This fixes incorrectly matching the current report to the final one. Given reports: Last regular: 1/1/2024 - 3/31/2024 Final: 3/31/2024 - 3/31/2024

So if using the end date, one of those two is arbitrarily picked, and has so far just been a coincidence to have been picked correctly.

https://seed-company-squad.monday.com/boards/5989610236/pulses/6618205719

github-actions[bot] commented 5 months ago

🗞 GraphQL Summary

View schema changes ```diff @@ -2174,9 +2174,9 @@ estimatedSubmission: SecuredDateNullable! fieldRegion: SecuredFieldRegion! financialReportPeriod: SecuredReportPeriod! financialReportReceivedAt: SecuredDateTimeNullable! - financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! id: ID! initialMouEnd: SecuredDateNullable! """ @@ -2190,9 +2190,9 @@ mouEnd: SecuredDateNullable! mouRange: SecuredDateRange! mouStart: SecuredDateNullable! name: SecuredString! - narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """ The financial report due next. This is the period currently in progress. """ @@ -2410,9 +2410,9 @@ partnershipsProducingMediums: SecuredPartnershipsProducingMediums! pnp: SecuredFile! products(input: ProductListInput = {count: 25, filter: {}, order: ASC, page: 1, sort: "createdAt"}): SecuredProductList! progressReport(date: Date!): SecuredProgressReport! - progressReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): ProgressReportList! + progressReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): ProgressReportList! project: Project! """Based on the project's sensitivity""" sensitivity: Sensitivity! @@ -2669,9 +2669,9 @@ estimatedSubmission: SecuredDateNullable! fieldRegion: SecuredFieldRegion! financialReportPeriod: SecuredReportPeriod! financialReportReceivedAt: SecuredDateTimeNullable! - financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! id: ID! initialMouEnd: SecuredDateNullable! """ @@ -2685,9 +2685,9 @@ mouEnd: SecuredDateNullable! mouRange: SecuredDateRange! mouStart: SecuredDateNullable! name: SecuredString! - narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """ The financial report due next. This is the period currently in progress. """ @@ -2785,9 +2785,9 @@ estimatedSubmission: SecuredDateNullable! fieldRegion: SecuredFieldRegion! financialReportPeriod: SecuredReportPeriod! financialReportReceivedAt: SecuredDateTimeNullable! - financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! id: ID! initialMouEnd: SecuredDateNullable! """ @@ -2801,9 +2801,9 @@ mouEnd: SecuredDateNullable! mouRange: SecuredDateRange! mouStart: SecuredDateNullable! name: SecuredString! - narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """ The financial report due next. This is the period currently in progress. """ @@ -3615,9 +3615,9 @@ """1-indexed page number for offset pagination.""" page: Int = 1 """The field in which to sort on""" - sort: String = "end" + sort: String = "start" """Filter reports on the start date""" start: DateFilter @@ -4359,9 +4359,9 @@ estimatedSubmission: SecuredDateNullable! fieldRegion: SecuredFieldRegion! financialReportPeriod: SecuredReportPeriod! financialReportReceivedAt: SecuredDateTimeNullable! - financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """The object's ID""" id: ID! initialMouEnd: SecuredDateNullable! @@ -4371,9 +4371,9 @@ mouEnd: SecuredDateNullable! mouRange: SecuredDateRange! mouStart: SecuredDateNullable! name: SecuredString! - narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """ The financial report due next. This is the period currently in progress. """ @@ -4840,9 +4840,9 @@ """Read a periodic report by id.""" periodicReport(changeset: ID, id: ID!): PeriodicReport! """List of periodic reports""" - periodicReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): PeriodicReportListOutput! + periodicReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): PeriodicReportListOutput! """Look up a post by ID""" post(id: ID!): Post! powers: [Power!]! @@ -6571,9 +6571,9 @@ estimatedSubmission: SecuredDateNullable! fieldRegion: SecuredFieldRegion! financialReportPeriod: SecuredReportPeriod! financialReportReceivedAt: SecuredDateTimeNullable! - financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + financialReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """The object's ID""" id: ID! initialMouEnd: SecuredDateNullable! @@ -6589,9 +6589,9 @@ mouEnd: SecuredDateNullable! mouRange: SecuredDateRange! mouStart: SecuredDateNullable! name: SecuredString! - narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "end"}): SecuredPeriodicReportList! + narrativeReports(input: PeriodicReportListInput = {count: 25, order: ASC, page: 1, sort: "start"}): SecuredPeriodicReportList! """ The financial report due next. This is the period currently in progress. """ ```

⚠️ Dangerous Changes