Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/nightlybuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
run: dotnet test "TransactionProcessor.IntegrationTests\TransactionProcessor.IntegrationTests.csproj"

- uses: actions/[email protected]
if: always()
with:
name: tracelogs
path: /home/runner/trace/
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
dotnet test "TransactionProcessor.IntegrationTests/TransactionProcessor.IntegrationTests.csproj" --filter Category=PRTest --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"

- uses: actions/[email protected]
if: always()
with:
name: tracelogs
path: /home/runner/trace/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public async Task<Result<TransactionValidationResult>> ValidateReconciliationTra

// Validate Merchant
Result<TransactionValidationResult<MerchantAggregate>> merchantValidationResult = await ValidateMerchant(estate.EstateName, merchantId, cancellationToken);
if (merchantValidationResult.IsFailed) return CreateFailedResult(merchantValidationResult.Data.validationResult); ;
if (merchantValidationResult.IsFailed) return CreateFailedResult(merchantValidationResult.Data.validationResult);

var merchant = merchantValidationResult.Data.additionalData.GetMerchant();

Expand Down Expand Up @@ -137,7 +137,7 @@ public async Task<Result<TransactionValidationResult>> ValidateSaleTransaction(G

// Validate Merchant
Result<TransactionValidationResult<MerchantAggregate>> merchantValidationResult = await ValidateMerchant(estate.EstateName, merchantId, cancellationToken);
if (merchantValidationResult.IsFailed) return CreateFailedResult(merchantValidationResult.Data.validationResult); ;
if (merchantValidationResult.IsFailed) return CreateFailedResult(merchantValidationResult.Data.validationResult);

Models.Merchant.Merchant merchant = merchantValidationResult.Data.additionalData.GetMerchant();

Expand Down
47 changes: 2 additions & 45 deletions TransactionProcessor.Client/TransactionProcessorClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,49 +63,7 @@ public async Task<Result<EstateResponse>> GetEstate(String accessToken,
throw exception;
}
}
//private async Task<Result<String>> SendPostRequest(String uri, String accessToken, String content, CancellationToken cancellationToken)
//{

// HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Post, uri);
// requestMessage.Headers.Authorization = new AuthenticationHeaderValue(AuthenticationSchemes.Bearer, accessToken);
// requestMessage.Content = new StringContent(content, Encoding.UTF8, "application/json");

// // Make the Http Call here
// HttpResponseMessage httpResponse = await this.HttpClient.SendAsync(requestMessage, cancellationToken);

// // Process the response
// Result<String> result = await this.HandleResponseX(httpResponse, cancellationToken);

// if (result.IsFailed)
// return ResultHelpers.CreateFailure(result);

// return Result.Success<String>(result.Data);
//}

//public static class AuthenticationSchemes
//{
// public static readonly String Bearer = "Bearer";
//}


//private async Task<Result<String>> SendDeleteRequest(String uri, String accessToken, CancellationToken cancellationToken)
//{

// HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Delete, uri);
// requestMessage.Headers.Authorization = new AuthenticationHeaderValue(AuthenticationSchemes.Bearer, accessToken);

// // Make the Http Call here
// HttpResponseMessage httpResponse = await this.HttpClient.SendAsync(requestMessage, cancellationToken);

// // Process the response
// Result<String> result = await this.HandleResponseX(httpResponse, cancellationToken);

// if (result.IsFailed)
// return ResultHelpers.CreateFailure(result);

// return Result.Success<String>(result.Data);
//}


public async Task<Result> CreateEstate(String accessToken,
CreateEstateRequest createEstateRequest,
CancellationToken cancellationToken) {
Expand Down Expand Up @@ -305,8 +263,7 @@ public async Task<Result<GetVoucherResponse>> GetVoucherByTransactionId(String a
catch (Exception ex) {
// An exception has occurred, add some additional information to the message
Exception exception = new("Error getting voucher by transaction Id.", ex);
;


throw exception;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,32 +691,7 @@ public async Task<Result> UpdateMerchantAddress(MerchantPostalCodeUpdatedEvent d

return await context.SaveChangesAsync(cancellationToken);
}

//public async Task<Result> AddGeneratedVoucher(VoucherDomainEvents.VoucherGeneratedEvent domainEvent,
// CancellationToken cancellationToken)
//{
// EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken);

// Voucher voucher = new Voucher
// {
// ExpiryDateTime = domainEvent.ExpiryDateTime,
// ExpiryDate = domainEvent.ExpiryDateTime.Date,
// IsGenerated = true,
// IsIssued = false,
// OperatorIdentifier = domainEvent.OperatorId.ToString(),
// Value = domainEvent.Value,
// VoucherCode = domainEvent.VoucherCode,
// VoucherId = domainEvent.VoucherId,
// TransactionId = domainEvent.TransactionId,
// GenerateDateTime = domainEvent.GeneratedDateTime,
// GenerateDate = domainEvent.GeneratedDateTime.Date
// };

// await context.Vouchers.AddAsync(voucher, cancellationToken);

// return await context.SaveChangesAsync(cancellationToken);
//}


public async Task<Result> UpdateMerchantContact(MerchantContactNameUpdatedEvent domainEvent, CancellationToken cancellationToken)
{
EstateManagementContext context = await this.GetContext(domainEvent.EstateId);
Expand Down Expand Up @@ -1687,42 +1662,9 @@ public async Task<Result> UpdateTransactionAuthorisation(TransactionDomainEvents
transaction.ResponseCode = domainEvent.ResponseCode;
transaction.ResponseMessage = domainEvent.ResponseMessage;

return await context.SaveChangesAsync(cancellationToken); ;
return await context.SaveChangesAsync(cancellationToken);
}

//public async Task<Result> UpdateVoucherIssueDetails(VoucherDomainEvents.VoucherIssuedEvent domainEvent,
// CancellationToken cancellationToken) {
// EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken);

// var getVoucherResult = await context.LoadVoucher(domainEvent, cancellationToken);
// if (getVoucherResult.IsFailed)
// return ResultHelpers.CreateFailure(getVoucherResult);
// var voucher = getVoucherResult.Data;
// voucher.IsIssued = true;
// voucher.RecipientEmail = domainEvent.RecipientEmail;
// voucher.RecipientMobile = domainEvent.RecipientMobile;
// voucher.IssuedDateTime = domainEvent.IssuedDateTime;
// voucher.IssuedDate = domainEvent.IssuedDateTime.Date;

// return await context.SaveChangesAsync(cancellationToken);
//}

//public async Task<Result> UpdateVoucherRedemptionDetails(VoucherDomainEvents.VoucherFullyRedeemedEvent domainEvent,
// CancellationToken cancellationToken) {
// EstateManagementGenericContext context = await this.GetContextFromDomainEvent(domainEvent, cancellationToken);

// var getVoucherResult = await context.LoadVoucher(domainEvent, cancellationToken);
// if (getVoucherResult.IsFailed)
// return ResultHelpers.CreateFailure(getVoucherResult);
// var voucher = getVoucherResult.Data;

// voucher.IsRedeemed = true;
// voucher.RedeemedDateTime = domainEvent.RedeemedDateTime;
// voucher.RedeemedDate = domainEvent.RedeemedDateTime.Date;

// return await context.SaveChangesAsync(cancellationToken);
//}


public async Task<Result<List<Models.Operator.Operator>>> GetOperators(Guid estateId, CancellationToken cancellationToken)
{
EstateManagementContext context = await this.GetContext(estateId);
Expand Down
Loading