Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added type to curriculumvitaereferencedto #1061

Merged
merged 3 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using AutoMapper;
using Orso.Arpa.Application.General.Model;
using Orso.Arpa.Application.SelectValueApplication.Model;
using Orso.Arpa.Domain.General.Model;
using Orso.Arpa.Domain.MusicianProfileDomain.Model;

Expand All @@ -13,6 +14,7 @@ public class CurriculumVitaeReferenceDto : BaseEntityDto
public Guid? TypeId { get; set; }
public string Description { get; set; }
public byte? SortOrder { get; set; }
public SelectValueDto Type { get; set; }
}

public class CurriculumVitaeReferenceDtoMappingProfile : Profile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,17 @@
Institution = command.Institution;
TypeId = command.TypeId;
Description = command.Description;
Description = command.Description;
SortOrder = command.SortOrder;
}

public string TimeSpan { get; private set; }
public string Institution { get; private set; }
public Guid? TypeId { get; private set; }
public virtual SelectValueMapping Type { get; private set; }

Check warning on line 42 in Orso.Arpa.Domain/MusicianProfileDomain/Model/CurriculumVitaeReference.cs

View workflow job for this annotation

GitHub Actions / Build and run sonar analysis

Remove the unused private setter 'set_Type'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
public string Description { get; private set; }

public byte? SortOrder { get; private set; }
public Guid MusicianProfileId { get; private set; }
public virtual MusicianProfile MusicianProfile { get; private set; }

Check warning on line 47 in Orso.Arpa.Domain/MusicianProfileDomain/Model/CurriculumVitaeReference.cs

View workflow job for this annotation

GitHub Actions / Build and run sonar analysis

Remove the unused private setter 'set_MusicianProfile'. (https://rules.sonarsource.com/csharp/RSPEC-1144)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ public async Task Should_Add_CurriculumVitaeReference()
Description = createDto.Description,
SortOrder = createDto.SortOrder,
CreatedBy = _staff.DisplayName,
CreatedAt = FakeDateTime.UtcNow
CreatedAt = FakeDateTime.UtcNow,
Type = SelectValueDtoData.SoloPerformance
};

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public static CurriculumVitaeReferenceDto Mozarteum
SortOrder = 1,
Id = Guid.Parse("ea0ad4a1-9351-457f-ab82-24e593e062a1"),
CreatedAt = FakeDateTime.UtcNow,
CreatedBy = "anonymous"
CreatedBy = "anonymous",
Type = SelectValueDtoData.EnsemblePosition
};
}
}
Expand Down
12 changes: 12 additions & 0 deletions Tests/Orso.Arpa.Tests.Shared/DtoTestData/SelectValueDtoData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,17 @@ public static IList<SelectValueDto> ProjectGenres
Name = "University",
Description = ""
};

public static SelectValueDto SoloPerformance => new() {
Id = Guid.Parse("3245182e-7985-4c07-828e-d69287ff2a2d"),
Name = "Solo performance",
Description = ""
};

public static SelectValueDto EnsemblePosition => new() {
Id = Guid.Parse("dead0ae2-bb2b-4584-992e-dddeb7f23d53"),
Name = "Ensemble position",
Description = ""
};
}
}
5 changes: 3 additions & 2 deletions Tests/Orso.Arpa.Tests.Shared/FakeData/FakeMusicianProfiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public static MusicianProfile PerformerHornMusicianProfile
universityEducation.SetProperty(nameof(Education.Type), FakeSelectValueMappings.PrivateLesson);
profile.Educations.Add(universityEducation);
CurriculumVitaeReference mozarteum = CurriculumVitaeReferenceSeedData.Mozarteum;
mozarteum.SetProperty(nameof(MusicianProfile.CreatedBy), "anonymous");
mozarteum.SetProperty(nameof(MusicianProfile.CreatedAt), FakeDateTime.UtcNow);
mozarteum.SetProperty(nameof(CurriculumVitaeReference.CreatedBy), "anonymous");
mozarteum.SetProperty(nameof(CurriculumVitaeReference.CreatedAt), FakeDateTime.UtcNow);
mozarteum.SetProperty(nameof(CurriculumVitaeReference.Type), FakeSelectValueMappings.EnsemblePosition);
profile.CurriculumVitaeReferences.Add(mozarteum);
return profile;
}
Expand Down
12 changes: 11 additions & 1 deletion Tests/Orso.Arpa.Tests.Shared/FakeData/FakeSelectValueMappings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static SelectValueMapping PrivateOwnership
}
}

public static SelectValueMapping PrivateLesson
public static SelectValueMapping PrivateLesson
{
get
{
Expand All @@ -115,5 +115,15 @@ public static SelectValueMapping PrivateLesson
return selectValueMapping;
}
}

public static SelectValueMapping EnsemblePosition
{
get
{
SelectValueMapping selectValueMapping = SelectValueMappingSeedData.CurriculumVitaeReferenceTypeMappings[0];
selectValueMapping.SetProperty(nameof(SelectValueMapping.SelectValue), SelectValueSeedData.EnsemblePosition);
return selectValueMapping;
}
}
}
}
Loading