-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update workshop export #1619
Update workshop export #1619
Conversation
Quality Gate failedFailed conditions |
if (dto.ParentWorkshopId.HasValue && !await Exists((Guid)dto.ParentWorkshopId).ConfigureAwait(false)) | ||
{ | ||
var errorMessage = $"The main workshop (with id = {dto.MemberOfWorkshopId}) for the workshop being created was not found."; | ||
var errorMessage = $"The main workshop (with id = {dto.ParentWorkshopId}) for the workshop being created was not found."; | ||
throw new InvalidOperationException(errorMessage); | ||
} | ||
|
||
if (dto.MemberOfWorkshopId.HasValue && (await workshopRepository.GetById((Guid)dto.MemberOfWorkshopId).ConfigureAwait(false)).MemberOfWorkshopId.HasValue) | ||
if (dto.ParentWorkshopId.HasValue && (await workshopRepository.GetById((Guid)dto.ParentWorkshopId).ConfigureAwait(false)).ParentWorkshopId.HasValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call to Exists()
followed by GetById()
. Could there be better iplementation from performance perspective?
{ | ||
try | ||
{ | ||
logger.LogInformation("Getting all updated providers started"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogTrace/Debug maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other methods
if (providers == null) | ||
{ | ||
logger.LogError("Failed to retrieve updated providers. The provider list is null"); | ||
return new SearchResult<ProviderInfoBaseDto>(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious if it is ever a case? Do your repositories return null instead of empty list sometimes?
[JsonConverter(typeof(JsonStringEnumConverter))] | ||
public enum WorkshopType | ||
{ | ||
None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some TODO comment should be present here, otherwise this enum looks pretty simple
|
||
public uint SpecialNeedsId { get; set; } = 0; | ||
public SpecialNeedsType SpecialNeedsType { get; set; } = SpecialNeedsType.None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curios, why this and other enum property is not covered with EnumType attribute, as it was in Dto classes
query = updatedAfter == default | ||
? query.Where(workshop => !workshop.IsDeleted) | ||
: query.Where(workshop => workshop.UpdatedAt > updatedAfter || workshop.DeleteDate > updatedAfter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic doesn't correspond name. Could either be changed?
return query.Skip(from).Take(size).ToListAsync(); | ||
} | ||
|
||
public Task<int> CountWithDeleted(DateTime updatedAfter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same name vs logic issue. WithDeleted
in name but !workshop.IsDeleted
in logic
Workshop
entity to include stub of future dictionaries as enums.