feat(ReadObject): created to handle objects.

- Add ObjectDto and mapping profile
This commit is contained in:
tekh 2025-07-29 22:19:48 +02:00
parent 27e4b4b2ef
commit 8ceaa9cb21
3 changed files with 29 additions and 0 deletions

View File

@ -5,6 +5,7 @@ using WorkFlow.Application.DTO.Profile;
using WorkFlow.Application.DTO.ProfileControlsTF;
using WorkFlow.Application.DTO.ProfileObjState;
using WorkFlow.Application.DTO.State;
using WorkFlow.Application.Objects;
using WorkFlow.Application.Profiles;
using WorkFlow.Domain.Entities;
@ -21,6 +22,12 @@ namespace WorkFlow.Application
CreateMap<ProfileObjState, ProfileObjStateDto>();
CreateMap<State, StateDto>();
CreateMap<Button, ButtonDto>();
CreateMap<ProfileObject, ObjectDto>()
.ForMember(dest => dest.Headlines, opt => opt.MapFrom(src =>
new[] { src.Headline1, src.Headline2 }))
.ForMember(dest => dest.Sublines, opt => opt.MapFrom(src =>
new[] { src.Subline1, src.Subline2 }));
// Mapping create-DTO to entity
CreateMap<ConfigCreateDto, Config>();

View File

@ -0,0 +1,19 @@
using MediatR;
namespace WorkFlow.Application.Objects;
public class ObjectDto
{
public long? ObjStateId { get; set; }
public long? Id { get; set; }
public IEnumerable<string> Headlines { get; set; } = Array.Empty<string>();
public IEnumerable<string> Sublines { get; set; } = Array.Empty<string>();
public string? CmdCheckIn { get; set; }
}
public record ReadObjectRequest : IRequest
{
}

View File

@ -2,6 +2,7 @@
using MediatR;
using WorkFlow.Application.Buttons;
using WorkFlow.Application.Contracts.Repositories;
using WorkFlow.Application.Objects;
namespace WorkFlow.Application.Profiles;
@ -21,6 +22,8 @@ public class ProfileDto
public string? BackColor { get; init; }
public IEnumerable<ObjectDto> Objects { get; init; } = Array.Empty<ObjectDto>();
public IEnumerable<ButtonDto>? Buttons { get; set; } = Array.Empty<ButtonDto>();
}