using AMREZ.EOP.Abstractions.Applications.UseCases.MasterData.Allergen; using AMREZ.EOP.Abstractions.Infrastructures.Repositories; using AMREZ.EOP.Contracts.DTOs.MasterData.Allergen; namespace AMREZ.EOP.Application.UseCases.MasterData.Allergen; public class GetAllergenUseCase : IGetAllergenUseCase { private readonly IAllergenRepository _repo; public GetAllergenUseCase(IAllergenRepository repo) => _repo = repo; public async Task ExecuteAsync(Guid id, CancellationToken ct = default) { var e = await _repo.GetAsync(id, ct); return e is null ? null : new AllergenResponse(e.Id, e.Scope, e.Code, e.Name, e.NameI18n, e.OverridesGlobalId, e.IsActive, e.IsSystem, e.Meta); } }