Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
15 changes: 15 additions & 0 deletions traidr.Application/Dtos/AddressDtos/AddressDto.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 traidr.Application.Dtos.AddressDtos
{
public class AddressDto
{
public string Street { get; set; }
public string City { get; set; }
public string State { get; set; }
}
}
20 changes: 20 additions & 0 deletions traidr.Application/Dtos/ProductDto/ProductAndReviewDto.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;
using traidr.Domain.Models;

namespace traidr.Application.Dtos.ProductDto
{
public class ProductAndReviewDto
{
public int Id { get; set; }
public string Name { get; set; }
public int CategoryId { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public ICollection<string> Images { get; set; }
public List<Review> Reviews { get; set; }
}
}
6 changes: 4 additions & 2 deletions traidr.Application/Dtos/ProductDto/ProductCategoryDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using traidr.Domain.Models;

namespace traidr.Application.Dtos.ProductDto
{
public class ProductCategoryDto
{
//public int Id { get; set; }
public int Id { get; set; }
public string CategoryName { get; set; }

//public string SubCategoryName { get; set; }
//public List<ProductCategoryDto> SubCategories { get; set; }
}
}
24 changes: 24 additions & 0 deletions traidr.Application/Dtos/ProductDto/ProductDetailsDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using traidr.Application.Dtos.ShopDto;

namespace traidr.Application.Dtos.ProductDto
{
public class ProductDetailsDto
{
public int Id { get; set; }
public string Name { get; set; }
public int CategoryId { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public SellerDto Seller { get; set; }
public ICollection<string> Images { get; set; }
public ICollection<ReviewDto> Reviews { get; set; }
public ICollection<ProductElementDto> ProductElements { get; set; }


}
}
18 changes: 18 additions & 0 deletions traidr.Application/Dtos/ProductDto/ProductDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.ProductDto
{
public class ProductDto
{
public int Id { get; set; }
public string Name { get; set; }
public int CategoryId { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public ICollection<string> Images { get; set; }
}
}
3 changes: 2 additions & 1 deletion traidr.Application/Dtos/ProductDto/ProductElementDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace traidr.Application.Dtos.ProductDto
public class ProductElementDto
{
public int Quantity { get; set; }
public int Sku { get; set; }
public int Sku { get; set; }
public string Color { get; set; }

}
}
7 changes: 4 additions & 3 deletions traidr.Application/Dtos/ProductDto/ProductListingDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ namespace traidr.Application.Dtos.ProductDto
{
public class ProductListingDto
{
public string Title { get; set; }
public int CategoryId { get; set; }
public string ProductName { get; set; }
public string Category { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public IFormFileCollection ProductImages { get; set; }
//public ICollection<IFormFile> ProductImage { get; set; }

//public ICollection<ProductElementDto> ProductElementDto { get; set; }


}
}
17 changes: 17 additions & 0 deletions traidr.Application/Dtos/ProductDto/ReviewDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.ProductDto
{
public class ReviewDto
{
public int Rating { get; set; }
public string Comment { get; set; }

public string Reviewer { get; set; }
public DateTime CommentedAt { get; set; }
}
}
15 changes: 15 additions & 0 deletions traidr.Application/Dtos/ProductDto/SubCategoryDto.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 traidr.Application.Dtos.ProductDto
{
public class SubCategoryDto
{
public int ParentCategoryId { get; set; }
public string Name { get; set; }

}
}
15 changes: 15 additions & 0 deletions traidr.Application/Dtos/ShopDto/CreateShopDto.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 traidr.Application.Dtos.ShopDto
{
public class CreateShopDto
{
public string ShopName { get; set; }

public string Category { get; set; }
}
}
18 changes: 18 additions & 0 deletions traidr.Application/Dtos/ShopDto/GetShopDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using traidr.Domain.Models;

namespace traidr.Application.Dtos.ShopDto
{
public class GetShopDto
{

public string Id { get; set; }
public string Description { get; set; }
public string Name { get; set; }
public IEnumerable<string> Images { get; set; }
}
}
18 changes: 18 additions & 0 deletions traidr.Application/Dtos/ShopDto/SellerDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.ShopDto
{
public class SellerDto
{
public string ShopName { get; set; }
public string UserName { get; set; }

public string Email { get; set; }

}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace traidr.Application.Dtos.ProductDto
namespace traidr.Application.Dtos.ShopDto
{
public class ShopDto
{
public string ShopName { get; set; }
public string Description { get; set; }

}
}
16 changes: 16 additions & 0 deletions traidr.Application/Dtos/UserDto/CreateShopDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.UserDto
{
public class CreateShopDto
{
public string ShopName { get; set; }
public string Description { get; set; }
public string Category { get; set; }

}
}
15 changes: 15 additions & 0 deletions traidr.Application/Dtos/UserDto/ResetPasswordDto.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 traidr.Application.Dtos.UserDto
{
public class ResetPasswordDto
{
public string Email { get; set; }
public string NewPassword { get; set; }
public string Token { get; set; }
}
}
13 changes: 13 additions & 0 deletions traidr.Application/Dtos/UserDto/ResetPasswordRequestDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.UserDto
{
public class ResetPasswordRequestDto
{
public string Email { get; set; }
}
}
22 changes: 22 additions & 0 deletions traidr.Application/Dtos/UserDto/UpdatePasswordDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.UserDto
{
public class UpdatePasswordDto
{
[Required]
public string CurrentPassword { get; set; }

[Required]
public string NewPassword { get; set; }

[Required]
[Compare("NewPassword")]
public string ComfirmNewPassword { get; set; }
}
}
18 changes: 18 additions & 0 deletions traidr.Application/Dtos/UserDto/UserLoginDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Application.Dtos.UserDto
{
public class UserLoginDto
{
[Required]
public string Email { get; set; }

[Required]
public string Password { get; set; }
}
}
6 changes: 3 additions & 3 deletions traidr.Domain/Context/ApplicationDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : ba
public DbSet<Ticket> Tickets { get; set; }
public DbSet<Tracking> Trackings { get; set; }
public DbSet<Notification> Notifications { get; set; }

public DbSet<Shop> Shops { get; set; }


protected override void OnModelCreating(ModelBuilder modelBuilder)
Expand All @@ -50,10 +50,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasForeignKey(c => c.BuyerId)
.OnDelete(DeleteBehavior.SetNull);

modelBuilder.Entity<Product>()
/* modelBuilder.Entity<Product>()
.HasOne(p => p.ProductCategory)
.WithMany(c => c.Products)
.HasForeignKey(p => p.ProductCategoryId);
.HasForeignKey(p => p.ProductCategoryId);*/

base.OnModelCreating(modelBuilder);
}
Expand Down
14 changes: 14 additions & 0 deletions traidr.Domain/Helper/CategoryDto.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 traidr.Domain.Helper
{
public class CategoryDto
{
public string Name { get; set; }
public List<string> Subcategories { get; set; }
}
}
23 changes: 23 additions & 0 deletions traidr.Domain/Helper/PaginationParams.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Domain.Helper
{
public class PaginationParams
{
public int _pageSize = 10;

public const int MaxPageSize = 100;

public int PageNumber { get; set; } = 1;

public int PagesSize
{
get => _pageSize;
set => _pageSize = (value > MaxPageSize) ? MaxPageSize : value;
}
}
}
18 changes: 18 additions & 0 deletions traidr.Domain/Helper/ProductInventoryDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace traidr.Domain.Dtos.ProductDto
{
public class ProductInventoryDto
{
public int Id { get; set; }
public string Name { get; set; }
public int CategoryId { get; set; }
public string Description { get; set; }
public decimal Price { get; set; }
public ICollection<string> Images { get; set; }
}
}
Loading