Skip to content

Commit

Permalink
Support email for test notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
markm77 committed Jan 10, 2023
1 parent 838af5b commit b6f3e76
Show file tree
Hide file tree
Showing 16 changed files with 279 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace FinnovationLabs.OpenBanking.Library.Connector.Fluent.AccountAndTransaction
{
public interface IAccountAccessConsentsContext :
IConsentContext<AccountAccessConsentRequest, AccountAccessConsentCreateResponse, AccountAccessConsentReadResponse>,
IConsentContext<AccountAccessConsentRequest, AccountAccessConsentCreateResponse, AccountAccessConsentCreateResponse>,
IDeleteConsentContext
{
/// <summary>
Expand All @@ -41,7 +41,7 @@ public interface IAccountAccessConsentsContext :

internal interface IAccountAccessConsentsContextInternal :
IAccountAccessConsentsContext,
IConsentContextInternal<AccountAccessConsentRequest, AccountAccessConsentCreateResponse, AccountAccessConsentReadResponse>,
IConsentContextInternal<AccountAccessConsentRequest, AccountAccessConsentCreateResponse, AccountAccessConsentCreateResponse>,
IDeleteConsentContextInternal { }

internal class AccountAccessConsentsConsentContext :
Expand Down Expand Up @@ -93,7 +93,7 @@ public AccountAccessConsentsConsentContext(ISharedContext sharedContext)
_sharedContext.SoftwareStatementProfileCachedRepo,
_sharedContext.Instrumentation));

public IObjectRead<AccountAccessConsentReadResponse, ConsentReadParams> ReadObject { get; }
public IObjectRead<AccountAccessConsentCreateResponse, ConsentReadParams> ReadObject { get; }

public IObjectCreate<AccountAccessConsentRequest, AccountAccessConsentCreateResponse, ConsentCreateParams>
CreateObject { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ internal AccountAccessConsentBaseResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid accountAndTransactionApiId) : base(
id,
created,
Expand All @@ -35,7 +37,9 @@ internal AccountAccessConsentBaseResponse(
warnings,
bankRegistrationId,
externalApiId,
externalApiUserId)
externalApiUserId,
authContextModified,
authContextModifiedBy)
{
AccountAndTransactionApiId = accountAndTransactionApiId;
}
Expand All @@ -60,6 +64,8 @@ internal AccountAccessConsentCreateResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid accountAndTransactionApiId,
OBReadConsentResponse1? externalApiResponse) : base(
id,
Expand All @@ -70,6 +76,8 @@ internal AccountAccessConsentCreateResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
accountAndTransactionApiId)
{
ExternalApiResponse = externalApiResponse;
Expand All @@ -84,43 +92,4 @@ internal AccountAccessConsentCreateResponse(
/// </summary>
public OBReadConsentResponse1? ExternalApiResponse { get; }
}

/// <summary>
/// Response to AccountAccessConsent Read requests.
/// </summary>
public class AccountAccessConsentReadResponse : AccountAccessConsentBaseResponse
{
internal AccountAccessConsentReadResponse(
Guid id,
DateTimeOffset created,
string? createdBy,
string? reference,
IList<string>? warnings,
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
Guid accountAndTransactionApiId,
OBReadConsentResponse1 externalApiResponse) : base(
id,
created,
createdBy,
reference,
warnings,
bankRegistrationId,
externalApiId,
externalApiUserId,
accountAndTransactionApiId)
{
ExternalApiResponse = externalApiResponse;
}

/// <summary>
/// Response object OBReadConsentResponse1 from UK Open Banking Read-Write Account and Transaction API spec
/// <a
/// href="https://github.com/OpenBankingUK/read-write-api-specs/blob/v3.1.8r5/dist/openapi/account-info-openapi.yaml" />
/// v3.1.9r5 <a />. Open Banking Connector will automatically
/// translate <i>to</i> this from an older format for banks supporting an earlier spec version.
/// </summary>
public OBReadConsentResponse1 ExternalApiResponse { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ internal DomesticPaymentConsentBaseResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid paymentInitiationApiId) : base(
id,
created,
Expand All @@ -48,7 +50,9 @@ internal DomesticPaymentConsentBaseResponse(
warnings,
bankRegistrationId,
externalApiId,
externalApiUserId)
externalApiUserId,
authContextModified,
authContextModifiedBy)
{
PaymentInitiationApiId = paymentInitiationApiId;
}
Expand All @@ -73,6 +77,8 @@ internal DomesticPaymentConsentCreateResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid paymentInitiationApiId,
PaymentInitiationModelsPublic.OBWriteDomesticConsentResponse5? externalApiResponse) : base(
id,
Expand All @@ -83,6 +89,8 @@ internal DomesticPaymentConsentCreateResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
paymentInitiationApiId)
{
ExternalApiResponse = externalApiResponse;
Expand All @@ -106,6 +114,8 @@ internal DomesticPaymentConsentReadResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid paymentInitiationApiId,
PaymentInitiationModelsPublic.OBWriteDomesticConsentResponse5 externalApiResponse) : base(
id,
Expand All @@ -116,6 +126,8 @@ internal DomesticPaymentConsentReadResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
paymentInitiationApiId)
{
ExternalApiResponse = externalApiResponse;
Expand All @@ -139,6 +151,8 @@ internal DomesticPaymentConsentReadFundsConfirmationResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid paymentInitiationApiId,
PaymentInitiationModelsPublic.OBWriteFundsConfirmationResponse1 externalApiResponse) : base(
id,
Expand All @@ -149,6 +163,8 @@ internal DomesticPaymentConsentReadFundsConfirmationResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
paymentInitiationApiId)
{
ExternalApiResponse = externalApiResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ internal ConsentResponseBase(
IList<string>? warnings,
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId) : base(id, created, createdBy, reference)
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy) : base(id, created, createdBy, reference)
{
Warnings = warnings;
BankRegistrationId = bankRegistrationId;
ExternalApiId = externalApiId;
ExternalApiUserId = externalApiUserId;
AuthContextModified = authContextModified;
AuthContextModifiedBy = authContextModifiedBy;
}

/// <summary>
Expand All @@ -37,10 +41,14 @@ internal ConsentResponseBase(
/// same bank but we do not assume global uniqueness between objects created at multiple banks.
/// </summary>
public string ExternalApiId { get; }

/// <summary>
/// User ID at external API (bank) which may or may not be available via ID token "sub" claim. If retrieved from ID
/// token or supplied on object creation, it will be stored here.
/// </summary>
public string? ExternalApiUserId { get; }

public DateTimeOffset AuthContextModified { get; }

public string? AuthContextModifiedBy { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ internal DomesticVrpConsentBaseResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid variableRecurringPaymentsApiId) : base(
id,
created,
Expand All @@ -46,7 +48,9 @@ internal DomesticVrpConsentBaseResponse(
warnings,
bankRegistrationId,
externalApiId,
externalApiUserId)
externalApiUserId,
authContextModified,
authContextModifiedBy)
{
VariableRecurringPaymentsApiId = variableRecurringPaymentsApiId;
}
Expand All @@ -72,6 +76,8 @@ internal DomesticVrpConsentCreateResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid variableRecurringPaymentsApiId,
VariableRecurringPaymentsModelsPublic.OBDomesticVRPConsentResponse? externalApiResponse) : base(
id,
Expand All @@ -82,6 +88,8 @@ internal DomesticVrpConsentCreateResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
variableRecurringPaymentsApiId)
{
ExternalApiResponse = externalApiResponse;
Expand All @@ -104,6 +112,8 @@ internal DomesticVrpConsentReadResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid variableRecurringPaymentsApiId,
VariableRecurringPaymentsModelsPublic.OBDomesticVRPConsentResponse externalApiResponse) : base(
id,
Expand All @@ -114,6 +124,8 @@ internal DomesticVrpConsentReadResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
variableRecurringPaymentsApiId)
{
ExternalApiResponse = externalApiResponse;
Expand All @@ -137,6 +149,8 @@ internal DomesticVrpConsentReadFundsConfirmationResponse(
Guid bankRegistrationId,
string externalApiId,
string? externalApiUserId,
DateTimeOffset authContextModified,
string? authContextModifiedBy,
Guid variableRecurringPaymentsApiId,
VariableRecurringPaymentsModelsPublic.OBVRPFundsConfirmationResponse externalApiResponse) : base(
id,
Expand All @@ -147,6 +161,8 @@ internal DomesticVrpConsentReadFundsConfirmationResponse(
bankRegistrationId,
externalApiId,
externalApiUserId,
authContextModified,
authContextModifiedBy,
variableRecurringPaymentsApiId)
{
ExternalApiResponse = externalApiResponse;
Expand Down
Loading

0 comments on commit b6f3e76

Please sign in to comment.