0
I have an entity called Requests that satisfies the following business:
- A request is made by an Employee(Entity), then it is changed by another Employee and then confirmed by a third Employee.
In a request I am sending a Client(Entity) from one Bed(Entity) to another Bed(Entity). Below is the current mapping:
using System; using SG.ProjetoTCC.Domain.Entities.Local; namespace SG.ProjetoTCC.Domain.Entities { public class Solicitacao { public Solicitacao() { SolicitacaoId = Guid.NewGuid(); } public Guid SolicitacaoId { get; set; } public DateTime DataSolicitacao { get; set; } public Guid FuncionarioSolicitanteId { get; set; } public virtual Funcionario FuncionarioSolicitante { get; set; } public TipoSolicitacao TipoSolicitacao { get; set; } public Guid ClienteId { get; set; } public virtual Cliente Cliente { get; set; } public Guid LeitoLocalId { get; set; } public virtual Leito LeitoLocal { get; set; } public Guid LeitoDestinoId { get; set; } public virtual Leito LeitoDestino { get; set; } public DateTime DataReserva { get; set; } public Guid FuncionarioReservaId { get; set; } public virtual Funcionario FuncionarioReserva { get; set; } public DateTime DataConclusao { get; set; } public Guid FuncionarioConclusaoId { get; set; } public virtual Funcionario FuncionarioConclusao { get; set; } public DateTime Tempo { get; set; } } }
A Solicitation does not have many (Ienumerable) Employees, it has 3 employees, which are: Functionary (who requested a bed), Functionary(who reserved the bed) and Functionconclusion(who placed the client in the destination Bed), and also 2 Beds; Lectern, and Leitodestino.
- Is my design correct? I should use a Collection(Bed) and a Collection(Employee)?
I’m sorry if you got too confused, but I think you can understand the way I explained it.
Thank you,
Hugs.
Yes, I have 3 Fks. I didn’t understand your modeling Requestrequester, Requestreservation and Requestconclusionconclusion. Because in A Request I have 3 fields of the Employee type.
– Samuel Gomes
I’ve added some additional information, maybe it’ll help you understand better.
– Tobias Mesquita
These properties
SolicitacoesSolicitante
, etc... belong to the entityFuncionario
and not theSolicitante
– Tobias Mesquita
Now I understand your reasoning. You are distinguishing Employee from: Requester = That Employee who Only Requests, Booking = That Who Only Reserves and Completion = That Who Completed the Request. However 1 Employee will make a request in the system, then another employee, or the same, will make the reservation of the bed, when the reserved bed is occupied, another employee or the same will make the Completion of the request. That is, in 1 request I will have to inform 3 employees. If that was your reasoning forgive me for not understanding.
– Samuel Gomes
At no time is there this limitation, I will rewrite the response to try to be clearer.
– Tobias Mesquita