Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit branch to master / AndrewKrisnaFerdinanto #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions Contracts/RequestModels/Cart/CartDataListRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Contracts.ResponseModels.Cart;
using MediatR;


namespace Contracts.RequestModels.Cart
{
public class CartDataListRequest : IRequest<CartDataListResponse>
{

}

}
17 changes: 17 additions & 0 deletions Contracts/RequestModels/Cart/CreateCartRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Contracts.ResponseModels.Cart;
using MediatR;

namespace Contracts.RequestModels.Cart
{
//Cart = cart id, customer id, product id, quantity

//get -> customerName, productName, price, quantity, subtotal.

//edit -> hanya boleh mengubah quantity, kalo quantity 0 = hapus dari cart
public class CreateCartRequest : IRequest<CreateCartResponse>
{
public int Quantity { get; set; }
public Guid ProductID { get; set; }
public Guid CustomerID { get; set; }
}
}
19 changes: 19 additions & 0 deletions Contracts/RequestModels/Cart/DeleteCartRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Contracts.ResponseModels.Cart;
using MediatR;


namespace Contracts.RequestModels.Cart
{
public class DeleteCartRequest : DeleteCartModel, IRequest<DeleteCartResponse>
{
public Guid CartID { get; set; }

}

public class DeleteCartModel
{
public int Quantity { get; set; }
public Guid CustomerID { get; set; }
public Guid ProductID { get; set; }
}
}
15 changes: 15 additions & 0 deletions Contracts/RequestModels/Cart/DetailCartRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Contracts.ResponseModels.Cart;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.RequestModels.Cart
{
public class DetailCartRequest : IRequest<DetailCartResponse>
{
public Guid CartID { get; set; }
}
}
29 changes: 29 additions & 0 deletions Contracts/RequestModels/Cart/UpdateCartDataRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Contracts.ResponseModels.Cart;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.RequestModels.Cart
{
//get -> customerName, productName, price, quantity, subtotal.
public class UpdateCartDataRequest : UpdateCartDataModel, IRequest<UpdateCartDataResponse>
{
public Guid CartID { get; set; }
//public Guid CustomerID { get; set; }
//public Guid ProductID { get; set; }
}

public class UpdateCartDataModel
{
//public string CustomerName { get; set; } = string.Empty;
//public string ProductName { get ; set; } = string.Empty;
//public decimal Price { get; set; }
public int Quantity { get; set; }
//public Guid CustomerID { get; set; }
//public Guid ProductID { get; set; }
//public decimal SubTotal { get; set; }
}
}
12 changes: 12 additions & 0 deletions Contracts/RequestModels/Customer/CreateCustomerDetailRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

using Contracts.ResponseModels.Customer;
using MediatR;


namespace Contracts.RequestModels.Customer
{
public class CreateCustomerDetailRequest : IRequest<CreateCustomerDetailResponse>
{
public Guid CustomerID { get; set; }
}
}
11 changes: 9 additions & 2 deletions Contracts/RequestModels/Customer/CustomerDataListRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@

namespace Contracts.RequestModels.Customer
{
public class CustomerDataListRequest : IRequest<CustomerDataListResponse>
public class CustomerDataListRequest : CustomerDataModel, IRequest<CustomerDataListResponse>
{
}
public Guid? CustomerID { get; set; }
}

public class CustomerDataModel
{
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}
16 changes: 16 additions & 0 deletions Contracts/RequestModels/Customer/DeleteCustomerDataRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Contracts.ResponseModels.Customer;
using MediatR;


namespace Contracts.RequestModels.Customer
{
public class DeleteCustomerDataRequest : DeleteCustomerModel, IRequest<DeleteCustomerDataResponse>
{
public Guid CustomerID { get; set; }
}
public class DeleteCustomerModel
{
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}
21 changes: 21 additions & 0 deletions Contracts/RequestModels/Customer/UpdateCustomerDataRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Contracts.ResponseModels.Customer;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.RequestModels.Customer
{
public class UpdateCustomerDataRequest : UpdateCustomerDataModel, IRequest<UpdateCustomerDataResponse>
{
public Guid? CustomerID { get; set; }
}

public class UpdateCustomerDataModel
{
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}
12 changes: 12 additions & 0 deletions Contracts/RequestModels/Product/CreateProductRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Contracts.ResponseModels.Product;
using MediatR;

namespace Contracts.RequestModels.Product
{
public class CreateProductRequest : IRequest<CreateProductResponse>
{
public string Name { get; set; } = string.Empty;

public decimal Price { get; set; }
}
}
17 changes: 17 additions & 0 deletions Contracts/RequestModels/Product/DeleteProductDataRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

using Contracts.ResponseModels.Product;
using MediatR;


namespace Contracts.RequestModels.Product
{
public class DeleteProductDataRequest : DeleteProductModel, IRequest<DeleteProductDataResponse>
{
public Guid ProductID { get; set; }
}
public class DeleteProductModel
{
public string Name { get; set; } = string.Empty;
public decimal Price { get; set; }
}
}
15 changes: 15 additions & 0 deletions Contracts/RequestModels/Product/DetailProductRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Contracts.ResponseModels.Product;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.RequestModels.Product
{
public class DetailProductRequest : IRequest<DetailProductResponse>
{
public Guid ProductID { get; set; }
}
}
9 changes: 9 additions & 0 deletions Contracts/RequestModels/Product/ProductDataListRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Contracts.ResponseModels.Product;
using MediatR;

namespace Contracts.RequestModels.Product
{
public class ProductDataListRequest : IRequest<ProductDataListResponse>
{
}
}
22 changes: 22 additions & 0 deletions Contracts/RequestModels/Product/UpdateProductDataRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Contracts.ResponseModels.Customer;
using Contracts.ResponseModels.Product;
using MediatR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.RequestModels.Product
{
public class UpdateProductDataRequest : UpdateProductDataModel, IRequest<UpdateProductDataResponse>
{
public Guid? ProductID { get; set; }
}

public class UpdateProductDataModel
{
public string Name { get; set; } = string.Empty;
public decimal Price { get; set; }
}
}
19 changes: 19 additions & 0 deletions Contracts/ResponseModels/Cart/CartDataListResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

//get -> customerName, productName, price, quantity, subtotal.
namespace Contracts.ResponseModels.Cart
{
public class CartDataListResponse
{
public List<CartData> CartDatas { get; set; } = new List<CartData>();
}

public class CartData
{
public Guid CartID { get; set; }
public string CustomerName { get; set; } = string.Empty;
public string ProductName { get; set; } = string.Empty;
public int Quantity { get; set; }
public decimal Price { get; set; }
public decimal SubTotal { get; set; }
}
}
18 changes: 18 additions & 0 deletions Contracts/ResponseModels/Cart/CreateCartResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


namespace Contracts.ResponseModels.Cart
{
public class CreateCartResponse
{
public Guid CartID { get; set; }

public string CustomerName { get; set; } = string.Empty;

public string ProductName { get; set; } = string.Empty;

public decimal Price { get; set; }
public int Quantity { get; set; }
public decimal SubTotal { get; set; }

}
}
10 changes: 10 additions & 0 deletions Contracts/ResponseModels/Cart/DeleteCartResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


namespace Contracts.ResponseModels.Cart
{
public class DeleteCartResponse
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
}
}
20 changes: 20 additions & 0 deletions Contracts/ResponseModels/Cart/DetailCartResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.ResponseModels.Cart
{
public class DetailCartResponse
{
public Guid CartID { get; set; }
public int Quantity { get; set; }
public Guid ProductID { get; set; }
public Guid CustomerID { get; set; }
public string CustomerName { get; set; } = string.Empty;
public string ProductName { get; set; } = string.Empty;
public decimal Price { get; set; }
public decimal SubTotal { get; set; }
}
}
14 changes: 14 additions & 0 deletions Contracts/ResponseModels/Cart/UpdateCartDataResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.ResponseModels.Cart
{
public class UpdateCartDataResponse
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
}
}
15 changes: 15 additions & 0 deletions Contracts/ResponseModels/Customer/CreateCustomerDetailResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.ResponseModels.Customer
{
public class CreateCustomerDetailResponse
{
public Guid CustomerID { get; set; }
public string Name { get; set; } = string.Empty;
public string Email { get; set; } = string.Empty;
}
}
5 changes: 3 additions & 2 deletions Contracts/ResponseModels/Customer/CustomerDataListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class CustomerDataListResponse
{
public List<CustomerData> CustomerDatas { get; set;} = new List<CustomerData>();
}
}

public class CustomerData
{
Expand All @@ -12,5 +12,6 @@ public class CustomerData
public string Name { get; set; } = string.Empty;

public string Email { get; set; } = string.Empty;
}

}
}
14 changes: 14 additions & 0 deletions Contracts/ResponseModels/Customer/DeleteCustomerDataResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Contracts.ResponseModels.Customer
{
public class DeleteCustomerDataResponse
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
}
}
10 changes: 10 additions & 0 deletions Contracts/ResponseModels/Customer/UpdateCustomerDataResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

namespace Contracts.ResponseModels.Customer
{
public class UpdateCustomerDataResponse
{
public bool Success { get; set; }
public string Message { get; set; } = string.Empty;
}

}
7 changes: 7 additions & 0 deletions Contracts/ResponseModels/Product/CreateProductResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Contracts.ResponseModels.Product
{
public class CreateProductResponse
{
public Guid ProductID { get; set; }
}
}
Loading