diff --git a/go.sum b/go.sum index 6475eb12f7..2c1e791e63 100644 --- a/go.sum +++ b/go.sum @@ -4,94 +4,52 @@ github.com/MicahParks/keyfunc/v3 v3.3.3 h1:c6j9oSu1YUo0k//KwF1miIQlEMtqNlj7XBFLB github.com/MicahParks/keyfunc/v3 v3.3.3/go.mod h1:f/UMyXdKfkZzmBeBFUeYk+zu066J1Fcl48f7Wnl5Z48= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= github.com/aws/aws-lambda-go v1.47.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= -github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8= -github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 h1:70PVAiL15/aBMh5LThwgXdSQorVr91L127ttckI9QQU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4/go.mod h1:/MQxMqci8tlqDH+pjmoLu1i0tbWCUP1hhyMRuFxpQCw= -github.com/aws/aws-sdk-go-v2/config v1.27.31 h1:kxBoRsjhT3pq0cKthgj6RU6bXTm/2SgdoUMyrVw0rAI= -github.com/aws/aws-sdk-go-v2/config v1.27.31/go.mod h1:z04nZdSWFPaDwK3DdJOG2r+scLQzMYuJeW0CujEm9FM= github.com/aws/aws-sdk-go-v2/config v1.27.33 h1:Nof9o/MsmH4oa0s2q9a0k7tMz5x/Yj5k06lDODWz3BU= github.com/aws/aws-sdk-go-v2/config v1.27.33/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks= -github.com/aws/aws-sdk-go-v2/credentials v1.17.30 h1:aau/oYFtibVovr2rDt8FHlU17BTicFEMAi29V1U+L5Q= -github.com/aws/aws-sdk-go-v2/credentials v1.17.30/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g= github.com/aws/aws-sdk-go-v2/credentials v1.17.32 h1:7Cxhp/BnT2RcGy4VisJ9miUPecY+lyE9I8JvcZofn9I= github.com/aws/aws-sdk-go-v2/credentials v1.17.32/go.mod h1:P5/QMF3/DCHbXGEGkdbilXHsyTBX5D3HSwcrSc9p20I= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.0 h1:zExbglw6JfQeXPLHmWg6vxOXdkvuZkEKRVo69scPd4M= -github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.0/go.mod h1:bswOrGH35stnF9k41t5gKQ8b+j6B4SLe6cF3xHuJG6E= github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.2 h1:ss2pLhKcLRqzzWR08Z3arJN1R/9gcjDbzlYHyYNZ/F0= github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.15.2/go.mod h1:luXuuIR1T/EQo8PO3rkxKajO0hMRa7NYUhComrBpgW0= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16/go.mod h1:2DwJF39FlNAUiX5pAc0UNeiz16lK2t7IaFcm0LFHEgc= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17/go.mod h1:Dh5zzJYMtxfIjYW+/evjQ8uj2OyR/ve2KROHGHlSFqE= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 h1:jYfy8UPmd+6kJW5YhY0L1/KftReOGxI/4NtVSTh9O/I= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16/go.mod h1:7ZfEPZxkW42Afq4uQB8H2E2e6ebh6mXTueEpYzjCzcs= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 h1:Mqr/V5gvrhA2gvgnF42Zh5iMiQNcOYthFYwCyrnuWlc= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17/go.mod h1:aLJpZlCmjE+V+KtN1q1uyZkfnUWpQGpbsn89XPKyzfU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.16 h1:mimdLQkIX1zr8GIPY1ZtALdBQGxcASiBd2MOp8m/dMc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.16/go.mod h1:YHk6owoSwrIsok+cAH9PENCOGoH5PU2EllX4vLtSrsY= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.17 h1:Roo69qTpfu8OlJ2Tb7pAYVuF0CpuUMB0IYWwYP/4DZM= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.17/go.mod h1:NcWPxQzGM1USQggaTVwz6VpqMZPX1CvDJLDh6jnOCa4= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.6 h1:LKZuRTlh8RszjuWcUwEDvCGwjx5olHPp6ZOepyZV5p8= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.6/go.mod h1:s2fYaueBuCnwv1XQn6T8TfShxJWusv5tWPMcL+GY6+g= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.8 h1:XTz8pSCsPiM9FpT+gTPIL6ryiu/T4Z3dpR/FBtPaBXA= github.com/aws/aws-sdk-go-v2/service/dynamodb v1.34.8/go.mod h1:N3YdUYxyxhiuAelUgCpSVBuBI1klobJxZrDtL+olu10= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.5 h1:sM/SaWUKPtsCcXE0bHZPUG4jjCbFbxakyptXQbYLrdU= -github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.5/go.mod h1:3YxVsEoCNYOLIbdA+cCXSp1fom9hrhyB1DsCiYryCaQ= github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7 h1:VTBHXWkSeFgT3sfYB4U92qMgzHl0nz9H1tYNHHutLg0= github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.22.7/go.mod h1:F/ybU7YfgFcktSp+biKgiHjyscGhlZxOz4QFFQqHXGw= -github.com/aws/aws-sdk-go-v2/service/eventbridge v1.33.5 h1:wL8V4pdudr0mHbZ/tj9YacfRak5klKz9omV0uXBt5Sk= -github.com/aws/aws-sdk-go-v2/service/eventbridge v1.33.5/go.mod h1:AudiowtxywCESLsT3fvGcAEEcN4l7nusiW2nZMaCo+g= github.com/aws/aws-sdk-go-v2/service/eventbridge v1.33.7 h1:q+xiPu+Dk5MFC20ZjdGGhbihD39Xsih98epvVjnOjyE= github.com/aws/aws-sdk-go-v2/service/eventbridge v1.33.7/go.mod h1:iQCsmx9LyBMyMEkLCBVqnIAz+rfo6/ss3oLcYn26+no= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.18 h1:GckUnpm4EJOAio1c8o25a+b3lVfwVzC9gnSBqiiNmZM= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.18/go.mod h1:Br6+bxfG33Dk3ynmkhsW2Z/t9D4+lRqdLDNCKi85w0U= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.19 h1:FLMkfEiRjhgeDTCjjLoc3URo/TBkgeQbocA78lfkzSI= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.19/go.mod h1:Vx+GucNSsdhaxs3aZIKfSUjKVGsxN25nX2SRcdhuw08= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.17 h1:HDJGz1jlV7RokVgTPfx1UHBHANC0N5Uk++xgyYgz5E0= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.17/go.mod h1:5szDu6TWdRDytfDxUQVv2OYfpTQMKApVFyqpm+TcA98= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18 h1:GACdEPdpBE59I7pbfvu0/Mw1wzstlP3QtPHklUxybFE= github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.18/go.mod h1:K+xV06+Wni4TSaOOJ1Y35e5tYOCUBYbebLKmJQQa8yY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 h1:tJ5RnkHCiSH0jyd6gROjlJtNwov0eGYNz8s8nFcR0jQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18/go.mod h1:++NHzT+nAF7ZPrHPsA+ENvsXkOO8wEu+C6RXltAG4/c= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.16 h1:jg16PhLPUiHIj8zYIW6bqzeQSuHVEiWnGA0Brz5Xv2I= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.16/go.mod h1:Uyk1zE1VVdsHSU7096h/rwnXDzOzYQVl+FNPhPw7ShY= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.17 h1:u+EfGmksnJc/x5tq3A+OD7LrMbSSR/5TrKLvkdy/fhY= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.17/go.mod h1:VaMx6302JHax2vHJWgRo+5n9zvbacs3bLU/23DNQrTY= -github.com/aws/aws-sdk-go-v2/service/s3 v1.61.0 h1:Wb544Wh+xfSXqJ/j3R4aX9wrKUoZsJNmilBYZb3mKQ4= -github.com/aws/aws-sdk-go-v2/service/s3 v1.61.0/go.mod h1:BSPI0EfnYUuNHPS0uqIo5VrRwzie+Fp+YhQOUs16sKI= github.com/aws/aws-sdk-go-v2/service/s3 v1.61.2 h1:Kp6PWAlXwP1UvIflkIP6MFZYBNDCa4mFCGtxrpICVOg= github.com/aws/aws-sdk-go-v2/service/s3 v1.61.2/go.mod h1:5FmD/Dqq57gP+XwaUnd5WFPipAuzrf0HmupX27Gvjvc= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.6 h1:3TZlWvCC813uhS1Z4fVTmBhg41OYUrgSlvXqIDDkurw= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.6/go.mod h1:5NPkI3RsTOhwz1CuG7VVSgJCm3CINKkoIaUbUZWQ67w= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.8 h1:HNXhQReFG2fbucvPRxDabbIGQf/6dieOfTnzoGPEqXI= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.32.8/go.mod h1:BYr9P/rrcLNJ8A36nT15p8tpoVDZ5lroHuMn/njecBw= -github.com/aws/aws-sdk-go-v2/service/sqs v1.34.6 h1:DbjODDHumQBdJ3T+EO7AXVoFUeUhAsJYOdjStH5Ws4A= -github.com/aws/aws-sdk-go-v2/service/sqs v1.34.6/go.mod h1:7idt3XszF6sE9WPS1GqZRiDJOxw4oPtlRBXodWnCGjU= github.com/aws/aws-sdk-go-v2/service/sqs v1.34.8 h1:t3TzmBX0lpDNtLhl7vY97VMvLtxp/KTvjjj2X3s6SUQ= github.com/aws/aws-sdk-go-v2/service/sqs v1.34.8/go.mod h1:zn0Oy7oNni7XIGoAd6bHBTVtX06OrnpvT1kww8jxyi8= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 h1:pIaGg+08llrP7Q5aiz9ICWbY8cqhTkyy+0SHvfzQpTc= github.com/aws/aws-sdk-go-v2/service/sso v1.22.7/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 h1:/Cfdu0XV3mONYKaOt1Gr0k1KvQzkzPyiKUdlWJqy+J4= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wINh+4UK+k/0Yo/q8= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 h1:NKTa1eqZYw8tiHSRGpP0VtTdub/8KNk8sDkNPFaOKDE= github.com/aws/aws-sdk-go-v2/service/sts v1.30.7/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= @@ -171,8 +129,6 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/ministryofjustice/opg-go-common v1.10.0 h1:OH5I8bdp9HKn1CSbVvO66Yi2aoLE/nv1yJlCYtEJZI4= -github.com/ministryofjustice/opg-go-common v1.10.0/go.mod h1:1r3Zdxf6ddL7LdRz+CJUvdhTcs0q3DK0Hf/GrspDSGY= github.com/ministryofjustice/opg-go-common v1.11.0 h1:g5V74jaSgh5CU3GYTgABrPfKiHsj6zT5u/KnGOj8hw8= github.com/ministryofjustice/opg-go-common v1.11.0/go.mod h1:XP3OcyjKCq/96SDIjUDFsX8ueo6PCikXjwVfxwEz7gU= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -183,8 +139,6 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/opensearch-project/opensearch-go/v4 v4.2.0 h1:uaBexfVdeSU15yOUPYF+IY059koVP0oNQPyoSde6N/A= github.com/opensearch-project/opensearch-go/v4 v4.2.0/go.mod h1:9v6a0OHRIeHwLPQlHOia18bw6R5XKECoXy93TWjX/10= -github.com/pact-foundation/pact-go/v2 v2.0.7 h1:4yELx7b54ampFcSD+qhU1wFULGxxxlXWI8dhoLr6Adk= -github.com/pact-foundation/pact-go/v2 v2.0.7/go.mod h1:2WpSPUzITjRZfLYfo1OuH3EmTltlM2DkgeA3WTDEUA8= github.com/pact-foundation/pact-go/v2 v2.0.8 h1:j9s/tk46O5hpEEbYd0/QF9kQlQt/mu3HJrVJVeix54w= github.com/pact-foundation/pact-go/v2 v2.0.8/go.mod h1:/IAP9loNwPHWdZUrECAltM8p630NETHitNarJa/DkXU= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= @@ -276,8 +230,6 @@ go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= @@ -302,8 +254,6 @@ google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1: google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= diff --git a/internal/donor/donorpage/check_your_details.go b/internal/donor/donorpage/check_your_details.go index dd4f4ec1fa..2c58bf2740 100644 --- a/internal/donor/donorpage/check_your_details.go +++ b/internal/donor/donorpage/check_your_details.go @@ -23,8 +23,7 @@ func CheckYourDetails(tmpl template.Template, shareCodeSender ShareCodeSender) H return donor.PathWeHaveReceivedVoucherDetails.Redirect(w, r, appData, provided) } - // TODO: MLPAB-1899 contact voucher - if err := shareCodeSender.SendVoucherAccessCodeToDonor(r.Context(), provided, appData); err != nil { + if err := shareCodeSender.SendVoucherAccessCode(r.Context(), provided, appData); err != nil { return err } diff --git a/internal/donor/donorpage/check_your_details_test.go b/internal/donor/donorpage/check_your_details_test.go index 12b6737602..bcdfcebc70 100644 --- a/internal/donor/donorpage/check_your_details_test.go +++ b/internal/donor/donorpage/check_your_details_test.go @@ -56,7 +56,7 @@ func TestPostCheckYourDetails(t *testing.T) { shareCodeSender := newMockShareCodeSender(t) shareCodeSender.EXPECT(). - SendVoucherAccessCodeToDonor(r.Context(), provided, testAppData). + SendVoucherAccessCode(r.Context(), provided, testAppData). Return(nil) err := CheckYourDetails(nil, shareCodeSender)(testAppData, w, r, provided) @@ -92,7 +92,7 @@ func TestPostCheckYourDetailsWhenShareCodeStoreError(t *testing.T) { shareCodeSender := newMockShareCodeSender(t) shareCodeSender.EXPECT(). - SendVoucherAccessCodeToDonor(r.Context(), provided, testAppData). + SendVoucherAccessCode(r.Context(), provided, testAppData). Return(expectedError) err := CheckYourDetails(nil, shareCodeSender)(testAppData, w, r, provided) diff --git a/internal/donor/donorpage/mock_ShareCodeSender_test.go b/internal/donor/donorpage/mock_ShareCodeSender_test.go index 9863931e2c..465386da79 100644 --- a/internal/donor/donorpage/mock_ShareCodeSender_test.go +++ b/internal/donor/donorpage/mock_ShareCodeSender_test.go @@ -123,12 +123,12 @@ func (_c *mockShareCodeSender_SendCertificateProviderPrompt_Call) RunAndReturn(r return _c } -// SendVoucherAccessCodeToDonor provides a mock function with given fields: ctx, donor, appData -func (_m *mockShareCodeSender) SendVoucherAccessCodeToDonor(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error { +// SendVoucherAccessCode provides a mock function with given fields: ctx, donor, appData +func (_m *mockShareCodeSender) SendVoucherAccessCode(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error { ret := _m.Called(ctx, donor, appData) if len(ret) == 0 { - panic("no return value specified for SendVoucherAccessCodeToDonor") + panic("no return value specified for SendVoucherAccessCode") } var r0 error @@ -141,32 +141,32 @@ func (_m *mockShareCodeSender) SendVoucherAccessCodeToDonor(ctx context.Context, return r0 } -// mockShareCodeSender_SendVoucherAccessCodeToDonor_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendVoucherAccessCodeToDonor' -type mockShareCodeSender_SendVoucherAccessCodeToDonor_Call struct { +// mockShareCodeSender_SendVoucherAccessCode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendVoucherAccessCode' +type mockShareCodeSender_SendVoucherAccessCode_Call struct { *mock.Call } -// SendVoucherAccessCodeToDonor is a helper method to define mock.On call +// SendVoucherAccessCode is a helper method to define mock.On call // - ctx context.Context // - donor *donordata.Provided // - appData appcontext.Data -func (_e *mockShareCodeSender_Expecter) SendVoucherAccessCodeToDonor(ctx interface{}, donor interface{}, appData interface{}) *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call { - return &mockShareCodeSender_SendVoucherAccessCodeToDonor_Call{Call: _e.mock.On("SendVoucherAccessCodeToDonor", ctx, donor, appData)} +func (_e *mockShareCodeSender_Expecter) SendVoucherAccessCode(ctx interface{}, donor interface{}, appData interface{}) *mockShareCodeSender_SendVoucherAccessCode_Call { + return &mockShareCodeSender_SendVoucherAccessCode_Call{Call: _e.mock.On("SendVoucherAccessCode", ctx, donor, appData)} } -func (_c *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call) Run(run func(ctx context.Context, donor *donordata.Provided, appData appcontext.Data)) *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call { +func (_c *mockShareCodeSender_SendVoucherAccessCode_Call) Run(run func(ctx context.Context, donor *donordata.Provided, appData appcontext.Data)) *mockShareCodeSender_SendVoucherAccessCode_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*donordata.Provided), args[2].(appcontext.Data)) }) return _c } -func (_c *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call) Return(_a0 error) *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call { +func (_c *mockShareCodeSender_SendVoucherAccessCode_Call) Return(_a0 error) *mockShareCodeSender_SendVoucherAccessCode_Call { _c.Call.Return(_a0) return _c } -func (_c *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call) RunAndReturn(run func(context.Context, *donordata.Provided, appcontext.Data) error) *mockShareCodeSender_SendVoucherAccessCodeToDonor_Call { +func (_c *mockShareCodeSender_SendVoucherAccessCode_Call) RunAndReturn(run func(context.Context, *donordata.Provided, appcontext.Data) error) *mockShareCodeSender_SendVoucherAccessCode_Call { _c.Call.Return(run) return _c } diff --git a/internal/donor/donorpage/payment_confirmation.go b/internal/donor/donorpage/payment_confirmation.go index e6fff977fd..09e9162614 100644 --- a/internal/donor/donorpage/payment_confirmation.go +++ b/internal/donor/donorpage/payment_confirmation.go @@ -93,10 +93,10 @@ func PaymentConfirmation(logger Logger, tmpl template.Template, payClient PayCli nextPage = donor.PathTaskList if provided.Voucher.Allowed { - if err := shareCodeSender.SendVoucherAccessCodeToDonor(r.Context(), provided, appData); err != nil { + if err := shareCodeSender.SendVoucherAccessCode(r.Context(), provided, appData); err != nil { return err } - // TODO: MLPAB-1899 contact voucher + nextPage = donor.PathWeHaveContactedVoucher } diff --git a/internal/donor/donorpage/payment_confirmation_test.go b/internal/donor/donorpage/payment_confirmation_test.go index ee00b1fc88..0ae15aa8f3 100644 --- a/internal/donor/donorpage/payment_confirmation_test.go +++ b/internal/donor/donorpage/payment_confirmation_test.go @@ -436,7 +436,7 @@ func TestGetPaymentConfirmationApprovedOrDeniedWhenVoucherAllowed(t *testing.T) shareCodeSender := newMockShareCodeSender(t) shareCodeSender.EXPECT(). - SendVoucherAccessCodeToDonor(r.Context(), provided, testAppData). + SendVoucherAccessCode(r.Context(), provided, testAppData). Return(nil) err := PaymentConfirmation(newMockLogger(t), template.Execute, payClient, donorStore, sessionStore, shareCodeSender, nil, eventClient, notifyClient)(testAppData, w, r, provided) @@ -473,7 +473,7 @@ func TestGetPaymentConfirmationWhenVoucherAllowedShareCodeError(t *testing.T) { shareCodeSender := newMockShareCodeSender(t) shareCodeSender.EXPECT(). - SendVoucherAccessCodeToDonor(mock.Anything, mock.Anything, mock.Anything). + SendVoucherAccessCode(mock.Anything, mock.Anything, mock.Anything). Return(expectedError) err := PaymentConfirmation(newMockLogger(t), nil, payClient, nil, sessionStore, shareCodeSender, nil, eventClient, notifyClient)(testAppData, w, r, &donordata.Provided{ @@ -897,13 +897,16 @@ func (m *mockPayClient) withASuccessfulPayment(amount int, ctx context.Context) func (m *mockLocalizer) withEmailLocalizations() *mockLocalizer { m.EXPECT(). Possessive("a b"). - Return("donor name possessive") + Return("donor name possessive"). + Once() m.EXPECT(). T("personal-welfare"). - Return("translated type") + Return("translated type"). + Once() m.EXPECT(). FormatDate(time.Date(2000, 1, 2, 0, 0, 0, 0, time.UTC)). - Return("formatted capture submit time") + Return("formatted capture submit time"). + Once() return m } diff --git a/internal/donor/donorpage/register.go b/internal/donor/donorpage/register.go index 0b3f56ac71..ead2cc19cd 100644 --- a/internal/donor/donorpage/register.go +++ b/internal/donor/donorpage/register.go @@ -85,7 +85,7 @@ type AddressClient interface { type ShareCodeSender interface { SendCertificateProviderInvite(context.Context, appcontext.Data, sharecode.CertificateProviderInvite) error SendCertificateProviderPrompt(context.Context, appcontext.Data, *donordata.Provided) error - SendVoucherAccessCodeToDonor(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error + SendVoucherAccessCode(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error } type OneLoginClient interface { diff --git a/internal/notify/email.go b/internal/notify/email.go index cbdc388754..926fd196ce 100644 --- a/internal/notify/email.go +++ b/internal/notify/email.go @@ -242,3 +242,19 @@ func (s VouchingShareCodeEmail) emailID(isProduction bool) string { return "881e25c4-4898-4525-bca3-722f51c5d6ee" } + +type VoucherInviteEmail struct { + VoucherFullName string + DonorFullName string + DonorFirstNamesPossessive string + DonorFirstNames string + LpaType string +} + +func (s VoucherInviteEmail) emailID(isProduction bool) string { + if isProduction { + return "36ad56ad-823b-4852-88a7-8acc4dfd1749" + } + + return "9af150b5-d9cd-4702-bf97-d3e6bfe81eec" +} diff --git a/internal/sharecode/sender.go b/internal/sharecode/sender.go index 436138ebf2..ac459aeaca 100644 --- a/internal/sharecode/sender.go +++ b/internal/sharecode/sender.go @@ -145,27 +145,39 @@ func (s *Sender) SendAttorneys(ctx context.Context, appData appcontext.Data, don return nil } -func (s *Sender) SendVoucherAccessCodeToDonor(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error { +func (s *Sender) SendVoucherAccessCode(ctx context.Context, donor *donordata.Provided, appData appcontext.Data) error { shareCode, err := s.createShareCode(ctx, donor.PK, donor.SK, donor.Voucher.UID, actor.TypeVoucher) if err != nil { return err } if donor.Donor.Mobile != "" { - return s.sendSMS(ctx, donor.Donor.Mobile, donor.LpaUID, notify.VouchingShareCodeSMS{ + if err := s.sendSMS(ctx, donor.Donor.Mobile, donor.LpaUID, notify.VouchingShareCodeSMS{ ShareCode: shareCode, DonorFullNamePossessive: appData.Localizer.Possessive(donor.Donor.FullName()), LpaType: appData.Localizer.T(donor.Type.String()), VoucherFullName: donor.Voucher.FullName(), DonorFirstNamesPossessive: appData.Localizer.Possessive(donor.Donor.FirstNames), - }) + }); err != nil { + return err + } + } else { + if err := s.sendEmail(ctx, donor.Donor.Email, donor.LpaUID, notify.VouchingShareCodeEmail{ + ShareCode: shareCode, + VoucherFullName: donor.Voucher.FullName(), + DonorFullName: donor.Donor.FullName(), + LpaType: appData.Localizer.T(donor.Type.String()), + }); err != nil { + return err + } } - return s.sendEmail(ctx, donor.Donor.Email, donor.LpaUID, notify.VouchingShareCodeEmail{ - ShareCode: shareCode, - VoucherFullName: donor.Voucher.FullName(), - DonorFullName: donor.Donor.FullName(), - LpaType: appData.Localizer.T(donor.Type.String()), + return s.sendEmail(ctx, donor.Voucher.Email, donor.LpaUID, notify.VoucherInviteEmail{ + VoucherFullName: donor.Voucher.FullName(), + DonorFullName: donor.Donor.FullName(), + DonorFirstNamesPossessive: appData.Localizer.Possessive(donor.Donor.FirstNames), + DonorFirstNames: donor.Donor.FirstNames, + LpaType: appData.Localizer.T(donor.Type.String()), }) } diff --git a/internal/sharecode/sender_test.go b/internal/sharecode/sender_test.go index ef4c47dcc6..5562adb64f 100644 --- a/internal/sharecode/sender_test.go +++ b/internal/sharecode/sender_test.go @@ -1132,7 +1132,7 @@ func TestShareCodeSenderSendAttorneysWhenEventClientErrors(t *testing.T) { } } -func TestSendVoucherAccessCodeToDonor(t *testing.T) { +func TestSendVoucherAccessCode(t *testing.T) { ctx := context.Background() uid := actoruid.New() @@ -1153,16 +1153,28 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { DonorFirstNamesPossessive: "Possessive first names", }). Return(nil) + nc.EXPECT(). + SendActorEmail(ctx, "voucher@example.com", "lpa-uid", + notify.VoucherInviteEmail{ + VoucherFullName: "c d", + DonorFullName: "a b", + DonorFirstNamesPossessive: "Possessive first names", + DonorFirstNames: "a", + LpaType: "translated type", + }). + Return(nil) return nc }, localizer: func() *mockLocalizer { l := newMockLocalizer(t) l.EXPECT(). T(lpadata.LpaTypePersonalWelfare.String()). - Return("translated type") + Return("translated type"). + Twice() l.EXPECT(). Possessive("a"). - Return("Possessive first names") + Return("Possessive first names"). + Twice() l.EXPECT(). Possessive("a b"). Return("Possessive full name") @@ -1172,14 +1184,14 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { FirstNames: "a", LastName: "b", Mobile: "123", - Email: "a@example.com", + Email: "donor@example.com", }, }, "email": { notifyClient: func() *mockNotifyClient { nc := newMockNotifyClient(t) nc.EXPECT(). - SendActorEmail(ctx, "a@example.com", "lpa-uid", + SendActorEmail(ctx, "donor@example.com", "lpa-uid", notify.VouchingShareCodeEmail{ ShareCode: testRandomString, VoucherFullName: "c d", @@ -1187,10 +1199,26 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { LpaType: "translated type", }). Return(nil) + nc.EXPECT(). + SendActorEmail(ctx, "voucher@example.com", "lpa-uid", + notify.VoucherInviteEmail{ + VoucherFullName: "c d", + DonorFullName: "a b", + DonorFirstNamesPossessive: "Possessive first names", + DonorFirstNames: "a", + LpaType: "translated type", + }). + Return(nil) return nc }, localizer: func() *mockLocalizer { l := newMockLocalizer(t) + l.EXPECT(). + T(lpadata.LpaTypePersonalWelfare.String()). + Return("translated type") + l.EXPECT(). + Possessive("a"). + Return("Possessive first names") l.EXPECT(). T(lpadata.LpaTypePersonalWelfare.String()). Return("translated type") @@ -1199,7 +1227,7 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { donor: donordata.Donor{ FirstNames: "a", LastName: "b", - Email: "a@example.com", + Email: "donor@example.com", }, }, } @@ -1219,7 +1247,7 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { TestAppData.Localizer = tc.localizer() - err := sender.SendVoucherAccessCodeToDonor(ctx, &donordata.Provided{ + err := sender.SendVoucherAccessCode(ctx, &donordata.Provided{ PK: dynamo.LpaKey("lpa"), SK: dynamo.LpaOwnerKey(dynamo.DonorKey("donor")), LpaUID: "lpa-uid", @@ -1229,6 +1257,7 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { UID: uid, FirstNames: "c", LastName: "d", + Email: "voucher@example.com", }, }, TestAppData) @@ -1237,7 +1266,7 @@ func TestSendVoucherAccessCodeToDonor(t *testing.T) { } } -func TestSendVoucherAccessCodeToDonorWhenShareCodeStoreError(t *testing.T) { +func TestSendVoucherAccessCodeWhenShareCodeStoreError(t *testing.T) { ctx := context.Background() uid := actoruid.New() @@ -1248,7 +1277,7 @@ func TestSendVoucherAccessCodeToDonorWhenShareCodeStoreError(t *testing.T) { sender := NewSender(shareCodeStore, nil, "http://app", testRandomStringFn, nil) - err := sender.SendVoucherAccessCodeToDonor(ctx, &donordata.Provided{ + err := sender.SendVoucherAccessCode(ctx, &donordata.Provided{ PK: dynamo.LpaKey("lpa"), SK: dynamo.LpaOwnerKey(dynamo.DonorKey("donor")), LpaUID: "lpa-uid", @@ -1269,51 +1298,121 @@ func TestSendVoucherAccessCodeToDonorWhenShareCodeStoreError(t *testing.T) { assert.Equal(t, fmt.Errorf("creating share failed: %w", expectedError), err) } -func TestSendVoucherAccessCodeToDonorWhenNotifyClientError(t *testing.T) { - ctx := context.Background() - uid := actoruid.New() +func TestSendVoucherAccessCodeWhenNotifyClientError(t *testing.T) { + testcases := map[string]struct { + email string + mobile string + notifyClient func() *mockNotifyClient + localizer func() *mockLocalizer + error error + }{ + "sms": { + mobile: "123", + notifyClient: func() *mockNotifyClient { + nc := newMockNotifyClient(t) + nc.EXPECT(). + SendActorSMS(mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(expectedError). + Once() + return nc + }, + localizer: func() *mockLocalizer { + l := newMockLocalizer(t) + l.EXPECT(). + T(mock.Anything). + Return("translated type") + l.EXPECT(). + Possessive(mock.Anything). + Return("Possessive first names") + l.EXPECT(). + Possessive(mock.Anything). + Return("Possessive full name") + return l + }, + error: fmt.Errorf("sms failed: %w", expectedError), + }, + "email": { + email: "a@example.com", + notifyClient: func() *mockNotifyClient { + nc := newMockNotifyClient(t) + nc.EXPECT(). + SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(expectedError). + Once() + return nc + }, + localizer: func() *mockLocalizer { + l := newMockLocalizer(t) + l.EXPECT(). + T(mock.Anything). + Return("translated type") + return l + }, + error: fmt.Errorf("email failed: %w", expectedError), + }, + "voucher email": { + mobile: "123", + notifyClient: func() *mockNotifyClient { + nc := newMockNotifyClient(t) + nc.EXPECT(). + SendActorSMS(mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(nil). + Once() + nc.EXPECT(). + SendActorEmail(mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(expectedError). + Once() + return nc + }, + localizer: func() *mockLocalizer { + l := newMockLocalizer(t) + l.EXPECT(). + T(mock.Anything). + Return("translated type"). + Times(2) + l.EXPECT(). + Possessive(mock.Anything). + Return("Possessive first names"). + Times(3) + return l + }, + error: fmt.Errorf("email failed: %w", expectedError), + }, + } - shareCodeStore := newMockShareCodeStore(t) - shareCodeStore.EXPECT(). - Put(mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(nil) + for name, tc := range testcases { + t.Run(name, func(t *testing.T) { + ctx := context.Background() + uid := actoruid.New() - notifyClient := newMockNotifyClient(t) - notifyClient.EXPECT(). - SendActorSMS(mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(expectedError) + shareCodeStore := newMockShareCodeStore(t) + shareCodeStore.EXPECT(). + Put(mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(nil) - localizer := newMockLocalizer(t) - localizer.EXPECT(). - T(lpadata.LpaTypePersonalWelfare.String()). - Return("translated type") - localizer.EXPECT(). - Possessive("a"). - Return("Possessive first names") - localizer.EXPECT(). - Possessive("a b"). - Return("Possessive full name") - TestAppData.Localizer = localizer + TestAppData.Localizer = tc.localizer() - sender := NewSender(shareCodeStore, notifyClient, "http://app", testRandomStringFn, nil) + sender := NewSender(shareCodeStore, tc.notifyClient(), "http://app", testRandomStringFn, nil) - err := sender.SendVoucherAccessCodeToDonor(ctx, &donordata.Provided{ - PK: dynamo.LpaKey("lpa"), - SK: dynamo.LpaOwnerKey(dynamo.DonorKey("donor")), - LpaUID: "lpa-uid", - Type: lpadata.LpaTypePersonalWelfare, - Donor: donordata.Donor{ - FirstNames: "a", - LastName: "b", - Mobile: "123", - Email: "a@example.com", - }, - Voucher: donordata.Voucher{ - UID: uid, - FirstNames: "c", - LastName: "d", - }, - }, TestAppData) + err := sender.SendVoucherAccessCode(ctx, &donordata.Provided{ + PK: dynamo.LpaKey("lpa"), + SK: dynamo.LpaOwnerKey(dynamo.DonorKey("donor")), + LpaUID: "lpa-uid", + Type: lpadata.LpaTypePersonalWelfare, + Donor: donordata.Donor{ + FirstNames: "a", + LastName: "b", + Mobile: tc.mobile, + Email: tc.email, + }, + Voucher: donordata.Voucher{ + UID: uid, + FirstNames: "c", + LastName: "d", + }, + }, TestAppData) - assert.Equal(t, fmt.Errorf("sms failed: %w", expectedError), err) + assert.Equal(t, tc.error, err) + }) + } }