generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from amosproj/edit-resource-ui
Edit resource UI
- Loading branch information
Showing
28 changed files
with
1,757 additions
and
241 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
20 changes: 12 additions & 8 deletions
20
src/deskstar-backend/Deskstar/Models/CreateResources/CreateBuildingResponseObject.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,17 +1,21 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using AutoMapper; | ||
|
||
namespace Deskstar.Models; | ||
|
||
public class CreateBuildingResponseObject | ||
{ | ||
public CreateBuildingResponseObject() { } | ||
public CreateBuildingResponseObject() { } | ||
|
||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.Building, CreateBuildingResponseObject>(); | ||
} | ||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.Building, CreateBuildingResponseObject>(); | ||
} | ||
|
||
public Guid BuildingId { get; set; } | ||
public string BuildingName { get; set; } = null!; | ||
public string Location { get; set; } = null!; | ||
[Required] | ||
public Guid BuildingId { get; set; } | ||
[Required] | ||
public string BuildingName { get; set; } = null!; | ||
[Required] | ||
public string Location { get; set; } = null!; | ||
} |
4 changes: 2 additions & 2 deletions
4
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateBuildingDto.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,6 +1,6 @@ | ||
namespace Deskstar.Models; | ||
|
||
public class UpdateBuildingDto{ | ||
public string? BuildingName; | ||
public string? Location; | ||
public string? BuildingName {get;set;} | ||
public string? Location {get;set;} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateBuildingResponseObject.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,18 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using AutoMapper; | ||
|
||
namespace Deskstar.Models; | ||
|
||
public class UpdateBuildingResponseObject | ||
{ | ||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.Building, UpdateBuildingResponseObject>(); | ||
} | ||
[Required] | ||
public Guid BuildingId { get; set; } | ||
[Required] | ||
public string BuildingName { get; set; } = null!; | ||
[Required] | ||
public string Location { get; set; } = null!; | ||
} |
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
43 changes: 43 additions & 0 deletions
43
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateDeskResponseObject.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,43 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using AutoMapper; | ||
|
||
namespace Deskstar.Models; | ||
|
||
public class UpdateDeskResponseObject | ||
{ | ||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.Desk, UpdateDeskResponseObject>() | ||
.ForMember(dest => dest.BuildingId, act => act.MapFrom(src => src.Room.Floor.Building.BuildingId)) | ||
.ForMember(dest => dest.BuildingName, act => act.MapFrom(src => src.Room.Floor.Building.BuildingName)) | ||
.ForMember(dest => dest.Location, act => act.MapFrom(src => src.Room.Floor.Building.Location)) | ||
.ForMember(dest => dest.FloorId, act => act.MapFrom(src => src.Room.Floor.FloorId)) | ||
.ForMember(dest => dest.FloorName, act => act.MapFrom(src => src.Room.Floor.FloorName)) | ||
.ForMember(dest => dest.Location, act => act.MapFrom(src => src.Room.Floor.Building.Location)) | ||
.ForMember(dest => dest.RoomId, act => act.MapFrom(src => src.Room.RoomId)) | ||
.ForMember(dest => dest.RoomName, act => act.MapFrom(src => src.Room.RoomName)) | ||
.ForMember(dest => dest.DeskTypeName, act => act.MapFrom(src => src.DeskType.DeskTypeName)); | ||
} | ||
[Required] | ||
public Guid DeskId { get; set; } | ||
[Required] | ||
public string DeskName { get; set; } = null!; | ||
[Required] | ||
public Guid DeskTypeId { get; set; } | ||
[Required] | ||
public string DeskTypeName { get; set; } = null!; | ||
[Required] | ||
public Guid RoomId { get; set; } | ||
[Required] | ||
public string RoomName { get; set; } = null!; | ||
[Required] | ||
public Guid FloorId { get; set; } | ||
[Required] | ||
public string FloorName { get; set; } = null!; | ||
[Required] | ||
public Guid BuildingId { get; set; } | ||
[Required] | ||
public string BuildingName { get; set; } = null!; | ||
[Required] | ||
public string Location { get; set; } = null!; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateDeskTypeDto.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,5 +1,5 @@ | ||
namespace Deskstar.Models; | ||
|
||
public class UpdateDeskTypeDto{ | ||
public string? DeskTypeName; | ||
public string? DeskTypeName {get;set;} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateDeskTypeResponseObject.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 System.ComponentModel.DataAnnotations; | ||
using AutoMapper; | ||
|
||
namespace Deskstar.Models; | ||
|
||
public class UpdateDeskTypeResponseObject | ||
{ | ||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.DeskType, UpdateDeskTypeResponseObject>(); | ||
} | ||
[Required] | ||
public Guid DeskTypeId { get; set; } | ||
[Required] | ||
public string DeskTypeName { get; set; } = null!; | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateFloorDto.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,6 +1,6 @@ | ||
namespace Deskstar.Models; | ||
|
||
public class UpdateFloorDto{ | ||
public string? FloorName; | ||
public string? BuildingId; | ||
public string? FloorName {get;set;} | ||
public string? BuildingId {get;set;} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateFloorResponseObject.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,25 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using AutoMapper; | ||
|
||
namespace Deskstar.Models; | ||
|
||
public class UpdateFloorResponseObject | ||
{ | ||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.Floor, UpdateFloorResponseObject>() | ||
.ForMember(dest => dest.BuildingName, act => act.MapFrom(src => src.Building.BuildingName)) | ||
.ForMember(dest => dest.Location, act => act.MapFrom(src => src.Building.Location)); | ||
} | ||
|
||
[Required] | ||
public Guid FloorId { get; set; } | ||
[Required] | ||
public string FloorName { get; set; } = null!; | ||
[Required] | ||
public Guid BuildingId { get; set; } | ||
[Required] | ||
public string BuildingName { get; set; } = null!; | ||
[Required] | ||
public string Location { get; set; } = null!; | ||
} |
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
30 changes: 30 additions & 0 deletions
30
src/deskstar-backend/Deskstar/Models/UpdateResources/UpdateRoomResponseObject.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,30 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using AutoMapper; | ||
|
||
namespace Deskstar.Models; | ||
|
||
public class UpdateRoomResponseObject | ||
{ | ||
|
||
public static void createMappings(IMapperConfigurationExpression cfg) | ||
{ | ||
cfg.CreateMap<Entities.Room, UpdateRoomResponseObject>() | ||
.ForMember(dest => dest.BuildingName, act => act.MapFrom(src => src.Floor.Building.BuildingName)) | ||
.ForMember(dest => dest.BuildingId, act => act.MapFrom(src => src.Floor.Building.BuildingId)) | ||
.ForMember(dest => dest.FloorName, act => act.MapFrom(src => src.Floor.FloorName)) | ||
.ForMember(dest => dest.Location, act => act.MapFrom(src => src.Floor.Building.Location)); | ||
} | ||
public Guid RoomId { get; set; } | ||
[Required] | ||
public string RoomName { get; set; } = null!; | ||
[Required] | ||
public Guid FloorId { get; set; } | ||
[Required] | ||
public string FloorName { get; set; } = null!; | ||
[Required] | ||
public Guid BuildingId { get; set; } | ||
[Required] | ||
public string BuildingName { get; set; } = null!; | ||
[Required] | ||
public string Location { get; set; } = null!; | ||
} |
Oops, something went wrong.