Skip to content

Commit

Permalink
Move supporter related code to packages (#1403)
Browse files Browse the repository at this point in the history
* Move supporter pages to new package

* Move supporter related stores

* Move supporter types to data package and stores to supporter

* Remove unused mocks

* Move NoVoucherDecision to donordata
  • Loading branch information
hawx authored Aug 5, 2024
1 parent 4cda082 commit 53833f5
Show file tree
Hide file tree
Showing 87 changed files with 1,153 additions and 2,386 deletions.
4 changes: 3 additions & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ packages:
github.com/ministryofjustice/opg-modernising-lpa/internal/lpastore:
github.com/ministryofjustice/opg-modernising-lpa/internal/notify:
github.com/ministryofjustice/opg-modernising-lpa/internal/onelogin:
github.com/ministryofjustice/opg-modernising-lpa/internal/page/supporter:
github.com/ministryofjustice/opg-modernising-lpa/internal/page:
github.com/ministryofjustice/opg-modernising-lpa/internal/pay:
github.com/ministryofjustice/opg-modernising-lpa/internal/place:
Expand All @@ -30,5 +29,8 @@ packages:
github.com/ministryofjustice/opg-modernising-lpa/internal/secrets:
github.com/ministryofjustice/opg-modernising-lpa/internal/sesh:
github.com/ministryofjustice/opg-modernising-lpa/internal/sharecode:
github.com/ministryofjustice/opg-modernising-lpa/internal/supporter:
github.com/ministryofjustice/opg-modernising-lpa/internal/supporter/supporterdata:
github.com/ministryofjustice/opg-modernising-lpa/internal/supporter/supporterpage:
github.com/ministryofjustice/opg-modernising-lpa/internal/uid:
github.com/ministryofjustice/opg-modernising-lpa/internal/validation:
96 changes: 0 additions & 96 deletions cmd/event-received/mock_store_test.go

This file was deleted.

83 changes: 0 additions & 83 deletions internal/actor/organisation.go

This file was deleted.

12 changes: 5 additions & 7 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ import (
"log/slog"
"net/http"
"strings"
"time"

dynamodbtypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/google/uuid"
"github.com/ministryofjustice/opg-go-common/template"
"github.com/ministryofjustice/opg-modernising-lpa/internal/actor/actoruid"
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext"
"github.com/ministryofjustice/opg-modernising-lpa/internal/attorney/attorneydata"
"github.com/ministryofjustice/opg-modernising-lpa/internal/attorney/attorneypage"
Expand All @@ -28,13 +25,14 @@ import (
"github.com/ministryofjustice/opg-modernising-lpa/internal/onelogin"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page/fixtures"
"github.com/ministryofjustice/opg-modernising-lpa/internal/page/supporter"
"github.com/ministryofjustice/opg-modernising-lpa/internal/pay"
"github.com/ministryofjustice/opg-modernising-lpa/internal/place"
"github.com/ministryofjustice/opg-modernising-lpa/internal/random"
"github.com/ministryofjustice/opg-modernising-lpa/internal/search"
"github.com/ministryofjustice/opg-modernising-lpa/internal/sesh"
"github.com/ministryofjustice/opg-modernising-lpa/internal/sharecode"
"github.com/ministryofjustice/opg-modernising-lpa/internal/supporter"
"github.com/ministryofjustice/opg-modernising-lpa/internal/supporter/supporterpage"
)

type ErrorHandler func(http.ResponseWriter, *http.Request, error)
Expand Down Expand Up @@ -102,8 +100,8 @@ func App(
shareCodeStore := sharecode.NewStore(lpaDynamoClient)
dashboardStore := &dashboardStore{dynamoClient: lpaDynamoClient, lpaStoreResolvingService: lpastore.NewResolvingService(donorStore, lpaStoreClient)}
evidenceReceivedStore := &evidenceReceivedStore{dynamoClient: lpaDynamoClient}
organisationStore := &organisationStore{dynamoClient: lpaDynamoClient, now: time.Now, uuidString: uuid.NewString, newUID: actoruid.New}
memberStore := &memberStore{dynamoClient: lpaDynamoClient, now: time.Now, uuidString: uuid.NewString}
organisationStore := supporter.NewOrganisationStore(lpaDynamoClient)
memberStore := supporter.NewMemberStore(lpaDynamoClient)
progressTracker := page.ProgressTracker{Localizer: localizer}

shareCodeSender := page.NewShareCodeSender(shareCodeStore, notifyClient, appPublicURL, random.String, eventClient)
Expand Down Expand Up @@ -147,7 +145,7 @@ func App(
handleRoot(page.Paths.LpaWithdrawn, RequireSession,
page.Guidance(tmpls.Get("lpa_withdrawn.gohtml")))

supporter.Register(
supporterpage.Register(
rootMux,
logger,
supporterTmpls,
Expand Down
Loading

0 comments on commit 53833f5

Please sign in to comment.