This file contains hidden or 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
#!/bin/bash | |
PROTOC_REPO="google/protobuf" | |
# Credits to: lukechilds here: https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c | |
get_latest_release() { | |
URL="https://api.github.com/repos/$1/releases/latest" | |
VERSION=$(curl --silent $URL |grep '"tag_name":' |sed -E 's/.*"([^"]+)".*/\1/') | |
echo $VERSION | |
} |
This file contains hidden or 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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: cartdb-v1 | |
namespace: {{ .Release.Namespace }} | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: |
This file contains hidden or 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
FROM microsoft/dotnet:2.1.2-aspnetcore-runtime-alpine AS base | |
WORKDIR /app | |
ARG service_version | |
ENV SERVICE_VERSION ${service_version:-0.0.1} | |
ARG api_version | |
ENV API_VERSION ${api_version:-1.0} | |
ENV ASPNETCORE_URLS http://+:5003 |
This file contains hidden or 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
[ApiController] | |
[ApiVersion("1.0")] | |
[Route("api/carts")] | |
public class CartController : Controller | |
{ | |
[HttpGet] | |
[Route("{id}")] | |
[Auth(Policy = "access_cart_api")] | |
public async Task<IActionResult> Get([FromServices] IMediator eventor, Guid id, CancellationToken cancellationToken) | |
{ |
This file contains hidden or 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
public class RequestHandler : TxRequestHandlerBase<CheckoutRequest, CheckoutResponse> | |
{ | |
public RequestHandler(IUnitOfWorkAsync uow, IQueryRepositoryFactory qrf) | |
: base(uow, qrf) | |
{ | |
} | |
public override async Task<CheckoutResponse> Handle(CheckoutRequest request, CancellationToken cancellationToken) | |
{ | |
var cartCommander = UnitOfWork.Repository<Domain.Cart>(); |
This file contains hidden or 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
public class RequestHandler : TxRequestHandlerBase<DeleteItemRequest, DeleteItemResponse> | |
{ | |
private readonly ICatalogGateway _catalogGateway; | |
private readonly IShippingGateway _shippingGateway; | |
private readonly IPromoGateway _promoGateway; | |
public RequestHandler(IUnitOfWorkAsync uow, IQueryRepositoryFactory qf, | |
ICatalogGateway cgw, IShippingGateway shippingGateway, IPromoGateway promoGateway) | |
: base(uow, qf) | |
{ |
This file contains hidden or 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
public class RequestHandler : TxRequestHandlerBase<UpdateItemInCartRequest, UpdateItemInCartResponse> | |
{ | |
private readonly ICatalogGateway _catalogGateway; | |
private readonly IShippingGateway _shippingGateway; | |
private readonly IPromoGateway _promoGateway; | |
public RequestHandler(IUnitOfWorkAsync uow, IQueryRepositoryFactory qrf, | |
ICatalogGateway catalogGateway, IShippingGateway shippingGateway, | |
IPromoGateway promoGateway) : base(uow, qrf) | |
{ |
This file contains hidden or 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
public class RequestHandler : TxRequestHandlerBase<InsertItemToNewCartRequest, InsertItemToNewCartResponse> | |
{ | |
private readonly ICatalogGateway _catalogGateway; | |
private readonly IShippingGateway _shippingGateway; | |
private readonly IPromoGateway _promoGateway; | |
public RequestHandler( | |
IUnitOfWorkAsync uow, IQueryRepositoryFactory qrf, | |
ICatalogGateway catalogGateway, IShippingGateway shippingGateway, | |
IPromoGateway promoGateway) : base(uow, qrf) |
This file contains hidden or 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
public class RequestHandler : RequestHandlerBase<GetCartRequest, GetCartResponse> | |
{ | |
private readonly ICatalogGateway _catalogGateway; | |
private readonly IShippingGateway _shippingGateway; | |
private readonly IPromoGateway _promoGateway; | |
public RequestHandler(ICatalogGateway cgw, IQueryRepositoryFactory qrf, | |
IShippingGateway shippingGateway, IPromoGateway promoGateway) | |
: base(qrf) | |
{ |
This file contains hidden or 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
public sealed class Product : IdentityBase | |
{ | |
private Product() : base() | |
{ | |
} | |
private Product(Guid productId) | |
: this(productId, string.Empty, 0.0D, string.Empty) | |
{ | |
} |