Skip to content

Commit 9df129d

Browse files
author
Eren Mülkoğlu
committed
store app
0 parents commit 9df129d

File tree

357 files changed

+131113
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+131113
-0
lines changed

.gitignore

Lines changed: 477 additions & 0 deletions
Large diffs are not rendered by default.

Entities/ClassDiagram1.cd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ClassDiagram />

Entities/Dtos/ProductDto.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace Entities.Dtos
4+
{
5+
public record ProductDto
6+
{
7+
public int ProductId { get; init; }
8+
9+
[Required(ErrorMessage = "ProductName is required.")]
10+
public String? ProductName { get; init; } = String.Empty;
11+
12+
[Required(ErrorMessage = "Price is required.")]
13+
public decimal Price { get; init; }
14+
public String? Summary { get; init; } = String.Empty;
15+
public String? ImageUrl { get; set; }
16+
public int? CategoryId { get; init; }
17+
18+
}
19+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Entities.Dtos
2+
{
3+
public record ProductDtoForInsertion : ProductDto
4+
{
5+
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Entities.Dtos
2+
{
3+
public record ProductDtoForUpdate : ProductDto
4+
{
5+
public bool Showcase { get; set; }
6+
}
7+
}

Entities/Dtos/RegisterDto.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace Entities.Dtos
4+
{
5+
public record RegisterDto
6+
{
7+
[Required(ErrorMessage = "Username is required")]
8+
public String? UserName { get; init; }
9+
10+
[Required(ErrorMessage = "Email is required")]
11+
public String? Email { get; init; }
12+
13+
[Required(ErrorMessage = "Password is required")]
14+
public String? Password { get; init; }
15+
}
16+
}

Entities/Dtos/ResetPasswordDto.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace Entities.Dtos
4+
{
5+
public record ResetPasswordDto
6+
{
7+
public String? UserName { get; init; }
8+
9+
[DataType(DataType.Password)]
10+
[Required(ErrorMessage ="Password is required.")]
11+
public String? Password { get; init; }
12+
13+
[DataType(DataType.Password)]
14+
[Required(ErrorMessage ="ConfirmPassword is required.")]
15+
[Compare("Password",ErrorMessage ="Password and ConfirmPassword must be match.")]
16+
public String? ConfirmPassword { get; init; }
17+
}
18+
}

Entities/Dtos/UserDto.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace Entities.Dtos
4+
{
5+
public record UserDto
6+
{
7+
[DataType(DataType.Text)]
8+
[Required(ErrorMessage ="UserName is required.")]
9+
public String? UserName { get; init; }
10+
11+
[DataType(DataType.EmailAddress)]
12+
[Required(ErrorMessage ="Email is required.")]
13+
public String? Email { get; init; }
14+
15+
[DataType(DataType.PhoneNumber)]
16+
public String? PhoneNumber { get; init; }
17+
18+
public HashSet<String> Roles { get; set; } = new HashSet<string>();
19+
}
20+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace Entities.Dtos
4+
{
5+
public record UserDtoForCreation : UserDto
6+
{
7+
[DataType(DataType.Password)]
8+
[Required(ErrorMessage = "Password is required.")]
9+
public String? Password { get; init; }
10+
}
11+
}

Entities/Dtos/UserDtoForUpdate.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Entities.Dtos
2+
{
3+
public record UserDtoForUpdate : UserDto
4+
{
5+
public HashSet<string> UserRoles { get; set; } = new HashSet<string>();
6+
}
7+
}

0 commit comments

Comments
 (0)