Skip to content

Commit

Permalink
Merge pull request #1653 from ministryofjustice/MLPAB-2422-removed-at…
Browse files Browse the repository at this point in the history
…torneys

MLPAB-2422 Use correct fields to assign lpa-store attorneys
  • Loading branch information
hawx authored Dec 2, 2024
2 parents 2e6dc4d + d5d0425 commit 04eee0e
Show file tree
Hide file tree
Showing 76 changed files with 2,113 additions and 718 deletions.
5 changes: 3 additions & 2 deletions cmd/event-received/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/ministryofjustice/opg-modernising-lpa/internal/app"
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext"
"github.com/ministryofjustice/opg-modernising-lpa/internal/certificateprovider"
"github.com/ministryofjustice/opg-modernising-lpa/internal/donor/donordata"
"github.com/ministryofjustice/opg-modernising-lpa/internal/event"
"github.com/ministryofjustice/opg-modernising-lpa/internal/lambda"
Expand Down Expand Up @@ -40,7 +41,7 @@ type SecretsClient interface {
}

type ShareCodeSender interface {
SendCertificateProviderInvite(context.Context, appcontext.Data, sharecode.CertificateProviderInvite) error
SendCertificateProviderInvite(context.Context, appcontext.Data, sharecode.CertificateProviderInvite, notify.ToEmail) error
SendCertificateProviderPrompt(context.Context, appcontext.Data, *donordata.Provided) error
SendAttorneys(context.Context, appcontext.Data, *lpadata.Lpa) error
}
Expand Down Expand Up @@ -166,7 +167,7 @@ func (f *Factory) ShareCodeSender(ctx context.Context) (ShareCodeSender, error)
return nil, err
}

f.shareCodeSender = sharecode.NewSender(sharecode.NewStore(f.dynamoClient), notifyClient, f.appPublicURL, random.String, event.NewClient(f.cfg, f.eventBusName))
f.shareCodeSender = sharecode.NewSender(sharecode.NewStore(f.dynamoClient), notifyClient, f.appPublicURL, random.String, event.NewClient(f.cfg, f.eventBusName), certificateprovider.NewStore(f.dynamoClient))
}

return f.shareCodeSender, nil
Expand Down
29 changes: 19 additions & 10 deletions cmd/event-received/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
dynamodbtypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/ministryofjustice/opg-modernising-lpa/internal/appcontext"
"github.com/ministryofjustice/opg-modernising-lpa/internal/document"
Expand Down Expand Up @@ -77,18 +78,26 @@ type uidEvent struct {
}

type dynamodbClient interface {
AnyByPK(ctx context.Context, pk dynamo.PK, v interface{}) error
AllByLpaUIDAndPartialSK(ctx context.Context, uid string, partialSK dynamo.SK, v interface{}) error
Create(ctx context.Context, v interface{}) error
CreateOnly(ctx context.Context, v interface{}) error
DeleteOne(ctx context.Context, pk dynamo.PK, sk dynamo.SK) error
AllByKeys(ctx context.Context, keys []dynamo.Keys) ([]map[string]dynamodbtypes.AttributeValue, error)
AllByLpaUIDAndPartialSK(ctx context.Context, uid string, partialSK dynamo.SK, v any) error
AllByPartialSK(ctx context.Context, pk dynamo.PK, partialSK dynamo.SK, v any) error
AllBySK(ctx context.Context, sk dynamo.SK, v any) error
AllKeysByPK(ctx context.Context, pk dynamo.PK) ([]dynamo.Keys, error)
AnyByPK(ctx context.Context, pk dynamo.PK, v any) error
BatchPut(ctx context.Context, items []any) error
Create(ctx context.Context, v any) error
CreateOnly(ctx context.Context, v any) error
DeleteKeys(ctx context.Context, keys []dynamo.Keys) error
DeleteOne(ctx context.Context, pk dynamo.PK, sk dynamo.SK) error
LatestForActor(ctx context.Context, sk dynamo.SK, v any) error
Move(ctx context.Context, oldKeys dynamo.Keys, value any) error
One(ctx context.Context, pk dynamo.PK, sk dynamo.SK, v interface{}) error
OneByUID(ctx context.Context, uid string, v interface{}) error
OneByPK(ctx context.Context, pk dynamo.PK, v interface{}) error
OneBySK(ctx context.Context, sk dynamo.SK, v interface{}) error
Put(ctx context.Context, v interface{}) error
One(ctx context.Context, pk dynamo.PK, sk dynamo.SK, v any) error
OneByPK(ctx context.Context, pk dynamo.PK, v any) error
OneByPartialSK(ctx context.Context, pk dynamo.PK, partialSK dynamo.SK, v any) error
OneBySK(ctx context.Context, sk dynamo.SK, v any) error
OneByUID(ctx context.Context, uid string, v any) error
Put(ctx context.Context, v any) error
Update(ctx context.Context, pk dynamo.PK, sk dynamo.SK, values map[string]dynamodbtypes.AttributeValue, expression string) error
WriteTransaction(ctx context.Context, transaction *dynamo.Transaction) error
}

Expand Down
23 changes: 13 additions & 10 deletions cmd/event-received/mock_ShareCodeSender_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 04eee0e

Please sign in to comment.