-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from IliyanIlievPH/65
Implement voucher presents
- Loading branch information
Showing
18 changed files
with
280 additions
and
6 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
client/MAVN.Service.SmartVouchers.Client/Models/Requests/PresentVouchersRequest.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,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace MAVN.Service.SmartVouchers.Client.Models.Requests | ||
{ | ||
/// <summary> | ||
/// Request model to present vouchers | ||
/// </summary> | ||
public class PresentVouchersRequest | ||
{ | ||
/// <summary> | ||
/// Id of the campaign | ||
/// </summary> | ||
[Required] | ||
public Guid CampaignId { get; set; } | ||
|
||
/// <summary> | ||
/// Id of the admin | ||
/// </summary> | ||
[Required] | ||
public Guid AdminId { get; set; } | ||
|
||
/// <summary> | ||
/// Emails of customer receivers | ||
/// </summary> | ||
[Required] | ||
public List<string> CustomerEmails { get; set; } | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
client/MAVN.Service.SmartVouchers.Client/Models/Responses/Enums/PresentVouchersErrorCodes.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,29 @@ | ||
namespace MAVN.Service.SmartVouchers.Client.Models.Responses.Enums | ||
{ | ||
/// <summary> | ||
/// Error codes | ||
/// </summary> | ||
public enum PresentVouchersErrorCodes | ||
{ | ||
/// <summary> | ||
/// no error | ||
/// </summary> | ||
None, | ||
/// <summary> | ||
/// Voucher campaign is missing | ||
/// </summary> | ||
VoucherCampaignNotFound, | ||
/// <summary> | ||
/// Voucher campaign is not active | ||
/// </summary> | ||
VoucherCampaignNotActive, | ||
/// <summary> | ||
/// Not enough vouchers in stock | ||
/// </summary> | ||
NotEnoughVouchersInStock, | ||
/// <summary> | ||
/// Admin user is not the creator of the campaign | ||
/// </summary> | ||
IncorrectAdminUser, | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
client/MAVN.Service.SmartVouchers.Client/Models/Responses/PresentVouchersResponse.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,20 @@ | ||
using System.Collections.Generic; | ||
using MAVN.Service.SmartVouchers.Client.Models.Responses.Enums; | ||
|
||
namespace MAVN.Service.SmartVouchers.Client.Models.Responses | ||
{ | ||
/// <summary> | ||
/// response model | ||
/// </summary> | ||
public class PresentVouchersResponse | ||
{ | ||
/// <summary> | ||
/// error | ||
/// </summary> | ||
public PresentVouchersErrorCodes Error { get; set; } | ||
/// <summary> | ||
/// Not registered emails | ||
/// </summary> | ||
public List<string> NotRegisteredEmails { get; set; } | ||
} | ||
} |
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
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
11 changes: 11 additions & 0 deletions
11
src/MAVN.Service.SmartVouchers.Domain/Enums/PresentVouchersErrorCodes.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,11 @@ | ||
namespace MAVN.Service.SmartVouchers.Domain.Enums | ||
{ | ||
public enum PresentVouchersErrorCodes | ||
{ | ||
None, | ||
VoucherCampaignNotFound, | ||
VoucherCampaignNotActive, | ||
NotEnoughVouchersInStock, | ||
IncorrectAdminUser, | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/MAVN.Service.SmartVouchers.Domain/Models/PresentVouchersResult.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,11 @@ | ||
using System.Collections.Generic; | ||
using MAVN.Service.SmartVouchers.Domain.Enums; | ||
|
||
namespace MAVN.Service.SmartVouchers.Domain.Models | ||
{ | ||
public class PresentVouchersResult | ||
{ | ||
public PresentVouchersErrorCodes Error { get; set; } | ||
public List<string> NotRegisteredEmails { get; set; } | ||
} | ||
} |
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
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
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.