[feature] Implement /api/v1/reports endpoints on client API (#1330)

* start adding report client api

* route + test reports get

* start report create endpoint

* you can create reports now babyy

* stub account report processor

* add single reportGet endpoint

* fix test

* add more filtering params to /api/v1/reports GET

* update swagger

* use marshalIndent in tests

* add + test missing Link info
This commit is contained in:
tobi 2023-01-23 13:14:21 +01:00 committed by GitHub
commit e9747247d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 2184 additions and 20 deletions

View file

@ -60,6 +60,22 @@ func (suite *ReportTestSuite) TestGetReportByURI() {
suite.NotEmpty(report.URI)
}
func (suite *ReportTestSuite) TestGetAllReports() {
reports, err := suite.db.GetReports(context.Background(), nil, "", "", "", "", "", 0)
suite.NoError(err)
suite.NotEmpty(reports)
}
func (suite *ReportTestSuite) TestGetAllReportsByAccountID() {
accountID := suite.testAccounts["local_account_2"].ID
reports, err := suite.db.GetReports(context.Background(), nil, accountID, "", "", "", "", 0)
suite.NoError(err)
suite.NotEmpty(reports)
for _, r := range reports {
suite.Equal(accountID, r.AccountID)
}
}
func (suite *ReportTestSuite) TestPutReport() {
ctx := context.Background()