<script setup>
import { useRoute } from 'vue-router';

import VnNotes from 'src/components/ui/VnNotes.vue';

const route = useRoute();

const userFilter = {
    order: 'created DESC',

    include: {
        relation: 'worker',
        scope: {
            fields: ['id', 'firstName', 'lastName'],
            include: {
                relation: 'user',
                scope: {
                    fields: ['id', 'nickname', 'name'],
                },
            },
        },
    },
};

const body = { workerFk: route.params.id };
</script>

<template>
    <VnNotes
        :add-note="true"
        url="WorkerObservations"
        :user-filter="userFilter"
        :filter="{ where: { workerFk: $route.params.id } }"
        :body="body"
    />
</template>
