-
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
Draft workshop management #1602
base: develop
Are you sure you want to change the base?
Conversation
dbe21bd
to
32fae6e
Compare
086d918
to
4ecca8f
Compare
public class DateTimeRangeDraftDto | ||
{ | ||
[JsonConverter(typeof(TimespanConverter))] | ||
public TimeSpan StartTime { get; set; } |
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.
Could you check if TimeOnly is relevant type here?
(My main concern against TimeSpan is possibility t have such value as TimeSpan.FromDays(3)
i.e., that means nothing for Start/EndTime, I guess)
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.
@VadymLevkovskyi Could you please clarify your question?
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.
I'm assuming that DateTimeRangeDraftDto.StartTime
field has next range of allowed values: 00:00:00...23:59:59.999
. If my assumption is correct - then valid for TimeSpan
value (i.e. TimeSpan.FromDays(3)
) is not valid from business perspective and thus wrong type is chosen - instead of TimeSpan
there should be i.e. TimeOnly
. So I've asked @IrynaNakoneshniuk to check if mentioned type is more relevant.
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.
Btw, if my assumption is wrong and StartTime
could have not only time part but also date part, then property name should be fixed
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.
@VadymLevkovskyi Replaced TimeSpan
with TimeOnly
public TimeSpan EndTime { get; set; } | ||
|
||
[Required] | ||
public List<DaysBitMask> Workdays { get; set; } |
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.
Please ensure that DaysBitMask
is not sufficient here.
I'm in doubt of List
, b/c it makes possible to have 2 Wednesdays i.e.
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.
All duplicate Workdays will be removed during the mapping to the database entity when a workshop is created/updated.
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.
That's cool, that they are sanitized somewhere. But my main question is why we have to have to use the wrong type?
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.
Replaced List<>
with HashSet<>
… entity in parallel operations.
b790b63
to
d4d2ca6
Compare
Quality Gate failedFailed conditions |
Summary of Changes:
TrackableBaseEntity
:Introduced a reusable base model for non-business entities to track changes such as CreatedBy, ModifiedBy, CreatedAt, and
ModifiedAt.
WorkshopDraf
t andTeacherDraft
introduced models to store draft data for workshops and teachersIWorkshopDraftRepository
, added methodsUpdate
andDelete
to ensure data consistency during concurrent access.EntityDeletedConflictException
andEntityModifiedConflictException
Create
method toIWorkshopDraftService