-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
3,512 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
Nezam.Modular.ESS.Identity.Application/Employers/Dtos/EmployerDto.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,21 @@ | ||
using Bonyan.Layer.Application.Dto; | ||
using FastEndpoints; | ||
using Nezam.Modular.ESS.Identity.Domain.Employer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Employers.Dtos; | ||
|
||
public class EmployerDto : EntityDto<EmployerId> | ||
{ | ||
public string FirstName { get; set; } | ||
public string LastName { get; set; } | ||
} | ||
|
||
public class EmployerFilterDto | ||
{ | ||
|
||
[QueryParam] | ||
public int Take { get; set; } | ||
[QueryParam] | ||
public int Skip { get; set; } | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
Nezam.Modular.ESS.Identity.Application/Employers/EmployerProfile.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,15 @@ | ||
using AutoMapper; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Employers.Dtos; | ||
using Nezam.Modular.ESS.Identity.Domain.Employer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Employers; | ||
|
||
public class EmployerProfile : Profile | ||
{ | ||
public EmployerProfile() | ||
{ | ||
CreateMap<EmployerEntity,EmployerDto>(); | ||
CreateMap<PaginatedResult<EmployerEntity>,PaginatedResult<EmployerDto>>(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Nezam.Modular.ESS.Identity.Application/Employers/EngineerService.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 Bonyan.Layer.Application.Services; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Employers.Dtos; | ||
using Nezam.Modular.ESS.Identity.Application.Employers.Specs; | ||
using Nezam.Modular.ESS.Identity.Domain.Employer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Employers; | ||
|
||
public class EmployerService : ApplicationService, IEmployerService | ||
{ | ||
public IEmployerRepository EmployerRepository => LazyServiceProvider.LazyGetRequiredService<IEmployerRepository>(); | ||
|
||
public async Task<PaginatedResult<EmployerDto>> GetPaginatedResult(EmployerFilterDto filterDto) | ||
{ | ||
var res = await EmployerRepository.PaginatedAsync(new EmployerFilterSpec(filterDto)); | ||
return Mapper.Map<PaginatedResult<EmployerEntity>,PaginatedResult<EmployerDto>>(res); | ||
} | ||
|
||
|
||
} |
10 changes: 10 additions & 0 deletions
10
Nezam.Modular.ESS.Identity.Application/Employers/IEngineerService.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,10 @@ | ||
using Bonyan.Layer.Application.Services; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Employers.Dtos; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Employers; | ||
|
||
public interface IEmployerService : IApplicationService | ||
{ | ||
Task<PaginatedResult<EmployerDto>> GetPaginatedResult(EmployerFilterDto filterDto); | ||
} |
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
20 changes: 20 additions & 0 deletions
20
Nezam.Modular.ESS.Identity.Application/Employers/Specs/EmployerFilterSpec.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 Bonyan.Layer.Domain.Specifications; | ||
using Nezam.Modular.ESS.Identity.Application.Employers.Dtos; | ||
using Nezam.Modular.ESS.Identity.Application.Users.Dto; | ||
using Nezam.Modular.ESS.Identity.Domain.Employer; | ||
using Nezam.Modular.ESS.Identity.Domain.Engineer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Employers.Specs; | ||
|
||
public class EmployerFilterSpec : PaginatedSpecification<EmployerEntity> | ||
{ | ||
public EmployerFilterSpec(EmployerFilterDto dto) : base(dto.Skip,dto.Take) | ||
{ | ||
} | ||
|
||
public override void Handle(ISpecificationContext<EmployerEntity> context) | ||
{ | ||
context | ||
.AddInclude(x => x.User); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Nezam.Modular.ESS.Identity.Application/Engineers/Dtos/EngineerDto.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,28 @@ | ||
using Bonyan.Layer.Application.Dto; | ||
using FastEndpoints; | ||
using Nezam.Modular.ESS.Identity.Application.Users.Dto; | ||
using Nezam.Modular.ESS.Identity.Domain.Engineer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Engineers.Dtos; | ||
|
||
public class EngineerDto : EntityDto<EngineerId> | ||
{ | ||
public string FirstName { get; set; } | ||
public string LastName { get; set; } | ||
public string RegistrationNumber { get; set; } | ||
} | ||
|
||
public class EngineerDtoWithDetails : EngineerDto | ||
{ | ||
public UserDto User { get; set; } | ||
} | ||
|
||
public class EngineerFilterDto | ||
{ | ||
|
||
[QueryParam] | ||
public int Take { get; set; } | ||
[QueryParam] | ||
public int Skip { get; set; } | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
Nezam.Modular.ESS.Identity.Application/Engineers/EngineerProfile.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,17 @@ | ||
using AutoMapper; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Engineers.Dtos; | ||
using Nezam.Modular.ESS.Identity.Domain.Engineer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Engineers; | ||
|
||
public class EngineerProfile : Profile | ||
{ | ||
public EngineerProfile() | ||
{ | ||
CreateMap<EngineerEntity,EngineerDto>(); | ||
CreateMap<EngineerEntity,EngineerDtoWithDetails>(); | ||
CreateMap<PaginatedResult<EngineerEntity>,PaginatedResult<EngineerDto>>(); | ||
CreateMap<PaginatedResult<EngineerEntity>,PaginatedResult<EngineerDtoWithDetails>>(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Nezam.Modular.ESS.Identity.Application/Engineers/EngineerService.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 Bonyan.Layer.Application.Services; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Engineers.Dtos; | ||
using Nezam.Modular.ESS.Identity.Application.Engineers.Specs; | ||
using Nezam.Modular.ESS.Identity.Domain.Engineer; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Engineers; | ||
|
||
public class EngineerService : ApplicationService, IEngineerService | ||
{ | ||
public IEngineerRepository EngineerRepository => LazyServiceProvider.LazyGetRequiredService<IEngineerRepository>(); | ||
|
||
public async Task<PaginatedResult<EngineerDtoWithDetails>> GetPaginatedResult(EngineerFilterDto filterDto) | ||
{ | ||
var res = await EngineerRepository.PaginatedAsync(new EngineerFilterSpec(filterDto)); | ||
return Mapper.Map<PaginatedResult<EngineerEntity>,PaginatedResult<EngineerDtoWithDetails>>(res); | ||
} | ||
|
||
|
||
} |
10 changes: 10 additions & 0 deletions
10
Nezam.Modular.ESS.Identity.Application/Engineers/IEngineerService.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,10 @@ | ||
using Bonyan.Layer.Application.Services; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Engineers.Dtos; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Engineers; | ||
|
||
public interface IEngineerService : IApplicationService | ||
{ | ||
Task<PaginatedResult<EngineerDtoWithDetails>> GetPaginatedResult(EngineerFilterDto filterDto); | ||
} |
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
20 changes: 20 additions & 0 deletions
20
Nezam.Modular.ESS.Identity.Application/Engineers/Specs/EngineerFilterSpec.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 Bonyan.Layer.Domain.Specifications; | ||
using Nezam.Modular.ESS.Identity.Application.Engineers.Dtos; | ||
using Nezam.Modular.ESS.Identity.Application.Users.Dto; | ||
using Nezam.Modular.ESS.Identity.Domain.Engineer; | ||
using Nezam.Modular.ESS.Identity.Domain.User; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Engineers.Specs; | ||
|
||
public class EngineerFilterSpec : PaginatedSpecification<EngineerEntity> | ||
{ | ||
public EngineerFilterSpec(EngineerFilterDto dto) : base(dto.Skip,dto.Take) | ||
{ | ||
} | ||
|
||
public override void Handle(ISpecificationContext<EngineerEntity> context) | ||
{ | ||
context | ||
.AddInclude(x => x.User); | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
Nezam.Modular.ESS.Identity.Application/Roles/Dto/RoleDto.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; | ||
using Bonyan.Layer.Application.Dto; | ||
using FastEndpoints; | ||
using Nezam.Modular.ESS.Identity.Domain.Roles; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Roles.Dto; | ||
|
||
public class RoleDto : EntityDto<RoleId> | ||
{ | ||
public string Name { get; set; } | ||
public string Title { get; set; } | ||
} | ||
public class RoleFilterDto | ||
{ | ||
|
||
[QueryParam] | ||
public int Take { get; set; } | ||
[QueryParam] | ||
public int Skip { get; set; } | ||
} |
11 changes: 11 additions & 0 deletions
11
Nezam.Modular.ESS.Identity.Application/Roles/IRoleService.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; | ||
using Bonyan.Layer.Application.Services; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Roles.Dto; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Roles; | ||
|
||
public interface IRoleService : IApplicationService | ||
{ | ||
Task<PaginatedResult<RoleDto>> GetPaginatedResult(RoleFilterDto filterDto); | ||
} |
16 changes: 16 additions & 0 deletions
16
Nezam.Modular.ESS.Identity.Application/Roles/RoleProfile.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,16 @@ | ||
using System; | ||
using AutoMapper; | ||
using Bonyan.Layer.Domain.Model; | ||
using Nezam.Modular.ESS.Identity.Application.Roles.Dto; | ||
using Nezam.Modular.ESS.Identity.Domain.Roles; | ||
|
||
namespace Nezam.Modular.ESS.Identity.Application.Roles; | ||
|
||
public class RoleProfile : Profile | ||
{ | ||
public RoleProfile() | ||
{ | ||
CreateMap<RoleEntity,RoleDto>(); | ||
CreateMap<PaginatedResult<RoleEntity>,PaginatedResult<RoleDto>>(); | ||
} | ||
} |
Oops, something went wrong.