Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f8322f8b1e | |||
| cd474d5089 | |||
| 2feba57cb6 | |||
| f74f0e1ad3 | |||
| 6db6d13e76 | |||
| 26fae393cf |
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
parameters:
|
||||||
app.version: '0.4.7'
|
app.version: '0.4.10'
|
||||||
|
|||||||
@@ -119,11 +119,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Section : Absences -->
|
<!-- Section : Absences -->
|
||||||
<p v-if="!sidebarIsCollapsed" class="px-4 pt-5 pb-1 text-xs font-semibold uppercase tracking-wider text-neutral-400">
|
<template v-if="isAbsenceSectionVisible">
|
||||||
Absences
|
<p v-if="!sidebarIsCollapsed" class="px-4 pt-5 pb-1 text-xs font-semibold uppercase tracking-wider text-neutral-400">
|
||||||
</p>
|
Absences
|
||||||
<div v-else class="mx-2 my-3 border-t border-secondary-500" />
|
</p>
|
||||||
|
<div v-else class="mx-2 my-3 border-t border-secondary-500" />
|
||||||
|
</template>
|
||||||
<SidebarLink
|
<SidebarLink
|
||||||
|
v-if="isEmployee"
|
||||||
to="/absences"
|
to="/absences"
|
||||||
icon="mdi:umbrella-beach-outline"
|
icon="mdi:umbrella-beach-outline"
|
||||||
label="Mes absences"
|
label="Mes absences"
|
||||||
@@ -211,6 +214,8 @@ const {version} = useAppVersion()
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const isAdmin = computed(() => (auth.user?.roles ?? []).includes('ROLE_ADMIN'))
|
const isAdmin = computed(() => (auth.user?.roles ?? []).includes('ROLE_ADMIN'))
|
||||||
|
const isEmployee = computed(() => Boolean(auth.user?.isEmployee))
|
||||||
|
const isAbsenceSectionVisible = computed(() => isEmployee.value || isAdmin.value)
|
||||||
|
|
||||||
const isMailVisible = computed(() => {
|
const isMailVisible = computed(() => {
|
||||||
const roles: string[] = auth.user?.roles ?? []
|
const roles: string[] = auth.user?.roles ?? []
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export default defineNuxtRouteMiddleware(() => {
|
||||||
|
const auth = useAuthStore()
|
||||||
|
|
||||||
|
// "Mes absences" is reserved for users flagged as employees (subject to the
|
||||||
|
// absence management). Non-employees are redirected to the home page.
|
||||||
|
if (!auth.isAuthenticated || !auth.user?.isEmployee) {
|
||||||
|
return navigateTo('/')
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -75,6 +75,8 @@ import { useAbsenceHelpers } from '~/composables/useAbsenceHelpers'
|
|||||||
|
|
||||||
type Row = AbsenceRequest & { typeLabelText: string; periodText: string; daysText: string; createdAtText: string }
|
type Row = AbsenceRequest & { typeLabelText: string; periodText: string; daysText: string; createdAtText: string }
|
||||||
|
|
||||||
|
definePageMeta({ middleware: ['employee'] })
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const service = useAbsenceService()
|
const service = useAbsenceService()
|
||||||
const { statusLabel, statusVariant, statusIcon, formatRange, formatDays, formatDate } = useAbsenceHelpers()
|
const { statusLabel, statusVariant, statusIcon, formatRange, formatDays, formatDate } = useAbsenceHelpers()
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Seed the default absence policies (Syntec / IDCC 1486 legal baseline).
|
||||||
|
*
|
||||||
|
* These rows were previously created only by AppFixtures, so they existed in
|
||||||
|
* dev but never in production: the "Politiques d'absence" admin screen was
|
||||||
|
* empty in prod. This data migration seeds the same 6 policies idempotently
|
||||||
|
* (ON CONFLICT on the unique `type` index), so prod gets populated and dev,
|
||||||
|
* where fixtures already created them, is left untouched.
|
||||||
|
*
|
||||||
|
* Values mirror AppFixtures and the legal compliance design
|
||||||
|
* (docs/superpowers/specs/2026-05-22-absence-legal-compliance-fixes-design.md):
|
||||||
|
* - CP: 25 jours ouvrés/an, préavis 30 j, pas de justificatif.
|
||||||
|
* - Mariage/PACS: 4 j/événement ; Naissance: 3 j/événement.
|
||||||
|
* - Décès / Congé parental / Maladie: pas de forfait codé en dur
|
||||||
|
* (montant selon lien de parenté ou suspension), justificatif requis.
|
||||||
|
*/
|
||||||
|
final class Version20260526100000 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Seed default absence policies (Syntec IDCC 1486) idempotently for prod';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// [type, days_per_year, days_per_event, justification_required, notice_days, count_working_days_only]
|
||||||
|
$policies = [
|
||||||
|
['cp', '25', null, 'false', 30, 'true'],
|
||||||
|
['mariage_pacs', null, '4', 'true', 0, 'true'],
|
||||||
|
['naissance', null, '3', 'true', 0, 'true'],
|
||||||
|
['conge_parental', null, null, 'true', 30, 'true'],
|
||||||
|
['deces', null, null, 'true', 0, 'true'],
|
||||||
|
['maladie', null, null, 'true', 0, 'true'],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($policies as [$type, $daysPerYear, $daysPerEvent, $justif, $notice, $workingOnly]) {
|
||||||
|
$daysPerYear = null === $daysPerYear ? 'NULL' : $daysPerYear;
|
||||||
|
$daysPerEvent = null === $daysPerEvent ? 'NULL' : $daysPerEvent;
|
||||||
|
|
||||||
|
$this->addSql(<<<SQL
|
||||||
|
INSERT INTO absence_policy
|
||||||
|
(type, days_per_year, days_per_event, justification_required, notice_days, count_working_days_only, active)
|
||||||
|
VALUES
|
||||||
|
('{$type}', {$daysPerYear}, {$daysPerEvent}, {$justif}, {$notice}, {$workingOnly}, true)
|
||||||
|
ON CONFLICT (type) DO NOTHING
|
||||||
|
SQL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql("DELETE FROM absence_policy WHERE type IN ('cp', 'mariage_pacs', 'naissance', 'conge_parental', 'deces', 'maladie')");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user