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

Tient compte de startsAllDay / endsAllDay dans les éléments de paie #448

Merged
merged 1 commit into from
Oct 30, 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,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 -%}
Loading