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.employmentType.name,
        plugins: [{ name: 'history' }, { name: 'lock' }, { name: 'compare' }],
        title: RootConfig.entities.employmentType.title,
        icon: RootConfig.entities.employmentType.icon,
        formats: {
            individual: RootConfig.entities.employmentType.title,
            plural: RootConfig.entities.employmentType.titlePlural,
            searchResult: { title: '{{ title }}', description: RootConfig.module.title },
        },
        relatedEntities: [],
        groups: [
            {
                id: 'basic-info',
                title: '@human-capital-management:employment-types.entities.employment-type.groups.basic-info',
            },
        ],
        properties: [
            {
                name: 'id',
                title: 'ID',
                groupId: 'basic-info',
                schema: {
                    dataType: 'uuid',
                    visible: false,
                    nullable: false,
                    readonly: true,
                    unique: { enabled: true },
                },
            },
            {
                name: 'title',
                title: '@human-capital-management:employment-types.entities.employment-type.fields.title',
                groupId: 'basic-info',
                schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
                options: {
                    sort: { enabled: true },
                    filter: { advance: { enabled: true }, inline: { enabled: true } },
                },
                validations: [{ rule: 'required' }],
            },
            {
                name: 'description',
                title: '@human-capital-management:employment-types.entities.employment-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', 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-employment-type.entity-fZrfUpr6.mjs.map
