import { createAllQueryView } from '@acorex/platform/common';
import { entityMasterCrudActions, entityMasterRecordActions } from '@acorex/platform/layout/entity';
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
import { RootConfig } from './acorex-modules-human-capital-management.mjs';

async function factory() {
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.leaveType.name,
        title: RootConfig.entities.leaveType.title,
        icon: RootConfig.entities.leaveType.icon,
        plugins: [
            { name: 'meta-data-selector', options: { display: 'popup' } },
            { name: 'color' },
            { name: 'clone' }
        ],
        formats: {
            individual: RootConfig.entities.leaveType.title,
            plural: RootConfig.entities.leaveType.titlePlural,
            searchResult: { title: '{{ title }}', description: RootConfig.module.title },
        },
        groups: [{ id: 'basic-info', title: '@general:terms.interface.basic-info' }],
        properties: [
            {
                name: 'id',
                title: 'ID',
                schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
            },
            {
                name: 'title',
                title: '@human-capital-management:leave-types.entities.leave-type.fields.title',
                groupId: 'basic-info',
                schema: {
                    dataType: 'string',
                    interface: {
                        type: AXPWidgetsCatalog.text,
                        options: {
                        //multiLanguage: true,
                        }
                    }
                },
                options: { sort: { enabled: true }, filter: { advance: { enabled: true }, inline: { enabled: true } } },
                validations: [{ rule: 'required' }],
            },
            {
                name: 'description',
                title: '@human-capital-management:leave-types.entities.leave-type.fields.description',
                groupId: 'basic-info',
                schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.largeText } },
            },
        ],
        columns: [{ name: 'title' }, { name: 'description' }],
        interfaces: {
            master: {
                create: {
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 12 } } } },
                        { name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
                    ],
                },
                update: {
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 12 } } } },
                        { name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 12 } } } },
                        { name: 'description', layout: { positions: { lg: { colSpan: 12 } } } },
                    ],
                    actions: [...entityMasterRecordActions()],
                },
                list: {
                    actions: [...entityMasterCrudActions()],
                    views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],
                },
            },
        },
    };
    return entityDef;
}

export { factory };
//# sourceMappingURL=acorex-modules-human-capital-management-leave-type.entity-YitcNesR.mjs.map
