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

pfs-116 FE only for downloading a report #3

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

Nicholassully
Copy link
Contributor

No description provided.

@Nicholassully Nicholassully requested review from a team as code owners August 8, 2024 12:25
Copy link
Contributor

@denialanderror denialanderror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This form is meant to select a report type with parameters, which will then generate the report and return it as a file (presuming CSV), but this doesn't appear to do that. We don't have the API for that yet, but that should be what the mock does, so when we do have a solution, we can just plug it in.

adrs/0002-new-finance-back-end.md Outdated Show resolved Hide resolved
internal/api/submit_download.go Outdated Show resolved Hide resolved
internal/server/server.go Outdated Show resolved Hide resolved
internal/server/submit_download.go Outdated Show resolved Hide resolved
"net/http"
)

func (c *ApiClient) Download(ctx Context, reportType string, reportJournalType string, reportScheduleType string, reportAccountType string, reportDebtType string, dateField string, dateFromField string, dateToField string, emailField string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field is redundant naming here. Also, dateField needs to be more descriptive to distinguish it from the other date fields.

internal/api/api_client_test.go Outdated Show resolved Hide resolved
internal/api/download.go Outdated Show resolved Hide resolved
internal/api/download.go Outdated Show resolved Hide resolved
internal/api/download.go Outdated Show resolved Hide resolved
internal/api/api_client.go Outdated Show resolved Hide resolved
internal/server/download.go Outdated Show resolved Hide resolved
internal/server/download_test.go Show resolved Hide resolved
internal/server/get_downloads.go Outdated Show resolved Hide resolved
internal/util/util/translate.go Outdated Show resolved Hide resolved
internal/util/util/translate.go Outdated Show resolved Hide resolved
import (
"bytes"
"encoding/json"
"github.com/opg-sirius-finance-admin/internal/model"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you look into this?

Comment on lines 52 to 54
innerMap := make(map[string]string)
innerMap[reason] = reason
validationErrors[reason] = innerMap
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
innerMap := make(map[string]string)
innerMap[reason] = reason
validationErrors[reason] = innerMap
validationErrors[reason] = map[string]string{reason: reason}

)

type MockClient struct {
DoFunc func(req *http.Request) (*http.Response, error)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove this field since you aren't using it

)

type Date struct {
Time time.Time
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use model.NewDate in tests instead

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Contributor

@denialanderror denialanderror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enums will need json un/marshalling functions, otherwise they will be sent across the wire as integers

internal/model/date_test.go Outdated Show resolved Hide resolved
internal/server/server.go Outdated Show resolved Hide resolved
@Nicholassully Nicholassully merged commit c9c119b into main Sep 10, 2024
6 checks passed
@Nicholassully Nicholassully deleted the pfs-116-fe-report-form branch September 10, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants