<script setup>
import VnCard from 'components/common/VnCard.vue';
import TravelDescriptor from './TravelDescriptor.vue';
import TravelFilter from '../TravelFilter.vue';

const filter = {
    fields: [
        'id',
        'ref',
        'shipped',
        'landed',
        'totalEntries',
        'warehouseInFk',
        'warehouseOutFk',
        'cargoSupplierFk',
        'agencyModeFk',
    ],
    include: [
        {
            relation: 'warehouseIn',
            scope: {
                fields: ['name'],
            },
        },
        {
            relation: 'warehouseOut',
            scope: {
                fields: ['name'],
            },
        },
    ],
};
</script>
<template>
    <VnCard
        data-key="Travel"
        base-url="Travels"
        search-data-key="TravelList"
        :filter="filter"
        :descriptor="TravelDescriptor"
        :filter-panel="TravelFilter"
        :searchbar-props="{
            url: 'Travels/filter',
            searchUrl: 'table',
            label: 'Search travel',
        }"
    />
</template>
