-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/OpenMAVN/MAVN.Service.Custo…
…merProfile
- Loading branch information
Showing
56 changed files
with
1,780 additions
and
96 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
client/MAVN.Service.CustomerProfile.Client/Api/IPaymentProviderDetailsApi.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net; | ||
using System.Threading.Tasks; | ||
using MAVN.Service.CustomerProfile.Client.Models.Enums; | ||
using MAVN.Service.CustomerProfile.Client.Models.Requests; | ||
using MAVN.Service.CustomerProfile.Client.Models.Responses; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Refit; | ||
|
||
namespace MAVN.Service.CustomerProfile.Client.Api | ||
{ | ||
/// <summary> | ||
/// PaymentProviderDetails API | ||
/// </summary> | ||
public interface IPaymentProviderDetailsApi | ||
{ | ||
/// <summary> | ||
/// Creates payment provider details | ||
/// </summary> | ||
/// <returns><see cref="PaymentProviderDetailsErrorCodes"/></returns> | ||
[Post("/api/paymentProviderDetails")] | ||
Task<PaymentProviderDetailsErrorCodes> CreateAsync([Body] CreatePaymentProviderDetailsRequest request); | ||
|
||
/// <summary> | ||
/// Updates payment provider details | ||
/// </summary> | ||
/// <returns><see cref="PaymentProviderDetailsErrorCodes"/></returns> | ||
[Put("/api/paymentProviderDetails")] | ||
[ProducesResponseType(typeof(PaymentProviderDetailsErrorCodes), (int) HttpStatusCode.OK)] | ||
Task<PaymentProviderDetailsErrorCodes> UpdateAsync([Body] EditPaymentProviderDetailsRequest request); | ||
|
||
/// <summary> | ||
/// Deletes payment provider details | ||
/// </summary> | ||
/// <returns><see cref="PaymentProviderDetailsErrorCodes"/></returns> | ||
[Delete("/api/paymentProviderDetails/{id}")] | ||
Task<PaymentProviderDetailsErrorCodes> DeleteAsync(Guid id); | ||
|
||
/// <summary> | ||
/// Returns all payment provider details for specific partner | ||
/// </summary> | ||
/// <returns><see cref="IReadOnlyList{T}<PaymentProviderDetails>"/></returns> | ||
[Get("/api/paymentProviderDetails/{partnerId}")] | ||
Task<IReadOnlyList<PaymentProviderDetails>> GetListByPartnerIdAsync([FromRoute] Guid partnerId); | ||
|
||
/// <summary> | ||
/// Returns all payment provider details for specific partner | ||
/// </summary> | ||
/// <returns><see cref="GetByPartnerIdAndPaymentProviderResponse"/></returns> | ||
[Get("/api/paymentProviderDetails")] | ||
Task<GetByPartnerIdAndPaymentProviderResponse> GetByPartnerIdAndPaymentProviderAsync([Query]Guid partnerId, | ||
[Query]string paymentProvider); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
client/MAVN.Service.CustomerProfile.Client/Models/Enums/PaymentProviderDetailsErrorCodes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using JetBrains.Annotations; | ||
|
||
namespace MAVN.Service.CustomerProfile.Client.Models.Enums | ||
{ | ||
/// <summary> | ||
/// Enumeration that holds error codes for payment provider details operations | ||
/// </summary> | ||
[PublicAPI] | ||
public enum PaymentProviderDetailsErrorCodes | ||
{ | ||
/// <summary> | ||
/// No errors | ||
/// </summary> | ||
None, | ||
/// <summary> | ||
/// Payment provider details does not exist | ||
/// </summary> | ||
PaymentProviderDetailsDoesNotExist, | ||
/// <summary> | ||
/// There is already existing unique pair for this partner and provider | ||
/// </summary> | ||
PaymentProviderDetailsAlreadyExists | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...AVN.Service.CustomerProfile.Client/Models/Requests/CreatePaymentProviderDetailsRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using JetBrains.Annotations; | ||
|
||
namespace MAVN.Service.CustomerProfile.Client.Models.Requests | ||
{ | ||
/// <summary> | ||
/// Request model to create payment provider details | ||
/// </summary> | ||
[PublicAPI] | ||
public class CreatePaymentProviderDetailsRequest | ||
{ | ||
/// <summary> | ||
/// The id of the partner | ||
/// </summary> | ||
[Required] | ||
public Guid PartnerId { get; set; } | ||
|
||
/// <summary> | ||
/// the payment provider used | ||
/// </summary> | ||
[Required] | ||
public string PaymentIntegrationProvider { get; set; } | ||
|
||
/// <summary> | ||
/// Configuration properties for the payment provider (json) | ||
/// </summary> | ||
[Required] | ||
public string PaymentIntegrationProperties { get; set; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
.../MAVN.Service.CustomerProfile.Client/Models/Requests/EditPaymentProviderDetailsRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using JetBrains.Annotations; | ||
|
||
namespace MAVN.Service.CustomerProfile.Client.Models.Requests | ||
{ | ||
/// <summary> | ||
/// Edit request model | ||
/// </summary> | ||
[PublicAPI] | ||
public class EditPaymentProviderDetailsRequest : CreatePaymentProviderDetailsRequest | ||
{ | ||
/// <summary> | ||
/// Id of the details model | ||
/// </summary> | ||
[Required] | ||
public Guid Id { get; set; } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...rvice.CustomerProfile.Client/Models/Responses/GetByPartnerIdAndPaymentProviderResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using JetBrains.Annotations; | ||
using MAVN.Service.CustomerProfile.Client.Models.Enums; | ||
|
||
namespace MAVN.Service.CustomerProfile.Client.Models.Responses | ||
{ | ||
/// <summary> | ||
/// Response model | ||
/// </summary> | ||
[PublicAPI] | ||
public class GetByPartnerIdAndPaymentProviderResponse | ||
{ | ||
/// <summary> | ||
/// Payment provider information | ||
/// </summary> | ||
public PaymentProviderDetails PaymentProviderDetails { get; set; } | ||
|
||
/// <summary> | ||
/// Error | ||
/// </summary> | ||
public PaymentProviderDetailsErrorCodes ErrorCode { get; set; } | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
client/MAVN.Service.CustomerProfile.Client/Models/Responses/PaymentProviderDetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using JetBrains.Annotations; | ||
|
||
namespace MAVN.Service.CustomerProfile.Client.Models.Responses | ||
{ | ||
/// <summary> | ||
/// Holds payment provider details | ||
/// </summary> | ||
[PublicAPI] | ||
public class PaymentProviderDetails | ||
{ | ||
/// <summary> | ||
/// Id of the details | ||
/// </summary> | ||
public Guid Id { get; set; } | ||
|
||
/// <summary> | ||
/// Id of the partner | ||
/// </summary> | ||
public Guid PartnerId { get; set; } | ||
|
||
/// <summary> | ||
/// Name of the payment provider | ||
/// </summary> | ||
public string PaymentIntegrationProvider { get; set; } | ||
|
||
/// <summary> | ||
/// Payment integration properties for the provider | ||
/// </summary> | ||
public string PaymentIntegrationProperties { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/MAVN.Service.CustomerProfile.Domain/Enums/PaymentProviderDetailsErrorCodes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace MAVN.Service.CustomerProfile.Domain.Enums | ||
{ | ||
public enum PaymentProviderDetailsErrorCodes | ||
{ | ||
None, | ||
PaymentProviderDetailsDoesNotExist, | ||
PaymentProviderDetailsAlreadyExists | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/MAVN.Service.CustomerProfile.Domain/Models/IPaymentProviderDetails.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace MAVN.Service.CustomerProfile.Domain.Models | ||
{ | ||
public interface IPaymentProviderDetails | ||
{ | ||
Guid Id { get; set; } | ||
|
||
Guid PartnerId { get; set; } | ||
|
||
string PaymentIntegrationProvider { get; set; } | ||
|
||
string PaymentIntegrationProperties { get; set; } | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/MAVN.Service.CustomerProfile.Domain/Repositories/ICustomerProfileRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/MAVN.Service.CustomerProfile.Domain/Repositories/IPaymentProviderDetailsRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using MAVN.Service.CustomerProfile.Domain.Models; | ||
|
||
namespace MAVN.Service.CustomerProfile.Domain.Repositories | ||
{ | ||
public interface IPaymentProviderDetailsRepository | ||
{ | ||
Task CreateAsync(IPaymentProviderDetails model); | ||
Task<bool> UpdateAsync(IPaymentProviderDetails model); | ||
Task<bool> DeleteAsync(Guid id); | ||
Task<IReadOnlyList<IPaymentProviderDetails>> GetListByPartnerIdAsync(Guid partnerId); | ||
Task<IPaymentProviderDetails> GetByPartnerIdAndProviderAsync(Guid partnerId, string paymentProvider); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/MAVN.Service.CustomerProfile.Domain/Services/IPaymentProviderDetailsService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using MAVN.Service.CustomerProfile.Domain.Enums; | ||
using MAVN.Service.CustomerProfile.Domain.Models; | ||
|
||
namespace MAVN.Service.CustomerProfile.Domain.Services | ||
{ | ||
public interface IPaymentProviderDetailsService | ||
{ | ||
Task<PaymentProviderDetailsErrorCodes> CreateAsync(IPaymentProviderDetails model); | ||
Task<PaymentProviderDetailsErrorCodes> UpdateAsync(IPaymentProviderDetails model); | ||
Task<PaymentProviderDetailsErrorCodes> DeleteAsync(Guid id); | ||
Task<IReadOnlyList<IPaymentProviderDetails>> GetListByPartnerIdAsync(Guid partnerId); | ||
Task<IPaymentProviderDetails> GetByPartnerIdAndPaymentProviderAsync(Guid partnerId, string paymentProvider); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.