Skip to content

Commit

Permalink
Tient compte de startsAllDay / endsAllDay dans les éléments de paie
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca committed Oct 30, 2024
1 parent 111e829 commit 725752f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export class LeaveRequestSlotView {
constructor(
public readonly startDate: string,
public readonly endDate: string
public readonly startsAllDay: boolean,
public readonly endDate: string,
public readonly endsAllDay: boolean
) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,29 @@ describe('GetUserElementsQueryHandler', () => {
const startDate1 = '2022-05-09';
const endDate1 = '2022-05-11';
const leaveRequest1 = createLeaveRequestMock(startDate1, endDate1);
const leaveRequestSlot1 = new LeaveRequestSlotView(startDate1, endDate1);
const leaveRequestSlot1 = new LeaveRequestSlotView(
startDate1,
false,
endDate1,
false
);
const startDate2 = '2022-04-25';
const endDate2 = '2022-05-02';
const leaveRequest2 = createLeaveRequestMock(startDate2, endDate2);
const leaveRequestSlot2 = new LeaveRequestSlotView(
'2022-05-01T00:00:00.000Z',
endDate2
true,
endDate2,
false
);
const startDate3 = '2022-05-29';
const endDate3 = '2022-06-05';
const leaveRequest3 = createLeaveRequestMock(startDate3, endDate3);
const leaveRequestSlot3 = new LeaveRequestSlotView(
startDate3,
'2022-05-31T00:00:00.000Z'
false,
'2022-05-31T00:00:00.000Z',
true
);

when(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export class GetUsersElementsQueryHandler {
leavesSlotViews.push(
new LeaveRequestSlotView(
monthScopedLeave.startDate,
monthScopedLeave.endDate
monthScopedLeave.startsAllDay,
monthScopedLeave.endDate,
monthScopedLeave.endsAllDay
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/pages/payroll_elements/_leaves.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{%- if leaves.totalDays > 0 -%}
<strong>{{ leaves.totalDays }}</strong> <br>
{%- for leave in leaves.leaves -%}
{{ leave.startDate|date }} -> {{ leave.endDate|date }}
{{ leave.startDate|date }} {% if not leave.startsAllDay %}(0.5){% endif %} -> {{ leave.endDate|date }} {% if not leave.endsAllDay %}(0.5){% endif %}
{%- if not loop.last %}<br>{% endif -%}
{%- endfor -%}
{%- endif -%}

0 comments on commit 725752f

Please sign in to comment.