-
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.
feat: use automapper on all controllers
- Loading branch information
1 parent
ff75f57
commit dba04a8
Showing
10 changed files
with
107 additions
and
19 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
src/Armory.Api/Controllers/People/Requests/UpdatePersonRequest.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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Armory.Api.Controllers.People.Requests | ||
{ | ||
public class UpdatePersonRequest | ||
{ | ||
[Required(ErrorMessage = "La identificación de la persona es requerida.")] | ||
[MaxLength(10, ErrorMessage = "La identificación de la persona no debe tener más de 10 caracteres.")] | ||
public string Id { get; set; } | ||
|
||
[Required(ErrorMessage = "El primer nombre de la persona es requerido.")] | ||
[MaxLength(50, ErrorMessage = "El primer nombre de la persona no debe tener más de 50 caracteres.")] | ||
public string FirstName { get; set; } | ||
|
||
[MaxLength(50, ErrorMessage = "El segundo nombre de la persona no debe tener más de 50 caracteres.")] | ||
public string SecondName { get; set; } | ||
|
||
[Required(ErrorMessage = "El primer apellido de la persona es requerido.")] | ||
[MaxLength(50, ErrorMessage = "El primer aoellido de la persona no debe tener más de 50 caracteres.")] | ||
public string LastName { get; set; } | ||
|
||
[MaxLength(50, ErrorMessage = "El segundo apellido de la persona no debe tener más de 50 caracteres.")] | ||
public string SecondLastName { get; set; } | ||
} | ||
} |
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
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 Armory.Api.Controllers.ArmoryUsers.Requests; | ||
using Armory.Users.Application.ChangePassword; | ||
using Armory.Users.Application.ResetPassword; | ||
using AutoMapper; | ||
|
||
namespace Armory.Api.Profiles | ||
{ | ||
public class ArmoryUsersProfile : Profile | ||
{ | ||
public ArmoryUsersProfile() | ||
{ | ||
CreateMap<ResetPasswordRequest, ResetPasswordCommand>(); | ||
CreateMap<ChangePasswordRequest, ChangePasswordCommand>(); | ||
} | ||
} | ||
} |
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 Armory.Api.Controllers.People.Requests; | ||
using Armory.People.Application.Create; | ||
using Armory.People.Application.Update; | ||
using AutoMapper; | ||
|
||
namespace Armory.Api.Profiles | ||
{ | ||
public class PeopleProfile : Profile | ||
{ | ||
public PeopleProfile() | ||
{ | ||
CreateMap<CreatePersonRequest, CreatePersonCommand>(); | ||
CreateMap<UpdatePersonRequest, UpdatePersonCommand>(); | ||
} | ||
} | ||
} |
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,14 @@ | ||
using Armory.Api.Controllers.Squadron.Requests; | ||
using Armory.Squadrons.Application.Create; | ||
using AutoMapper; | ||
|
||
namespace Armory.Api.Profiles | ||
{ | ||
public class SquadronsProfile : Profile | ||
{ | ||
public SquadronsProfile() | ||
{ | ||
CreateMap<CreateSquadronRequest, CreateSquadronCommand>(); | ||
} | ||
} | ||
} |
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,14 @@ | ||
using Armory.Api.Controllers.Squads.Requests; | ||
using Armory.Squads.Application.Create; | ||
using AutoMapper; | ||
|
||
namespace Armory.Api.Profiles | ||
{ | ||
public class SquadsProfile : Profile | ||
{ | ||
public SquadsProfile() | ||
{ | ||
CreateMap<CreateSquadRequest, CreateSquadCommand>(); | ||
} | ||
} | ||
} |
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