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-organization-management.mjs';

async function factory(injector) {
    const entityDef = {
        module: RootConfig.module.name,
        name: RootConfig.entities.teamMemberRole.name,
        title: '@organization-management:team-member-roles.entities.team-member-role.title',
        icon: 'fa-light fa-user-tag',
        formats: {
            individual: '@organization-management:team-member-roles.entities.team-member-role.title',
            plural: '@organization-management:team-member-roles.entities.team-member-role.plural',
            searchResult: { title: '{{ title }}', description: RootConfig.module.title },
        },
        groups: [{ id: 'basic-info', title: '@general:terms.interface.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: '@general:terms.common.title',
                groupId: 'basic-info',
                schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
                validations: [{ rule: 'required' }],
                options: {
                    sort: { enabled: true },
                    filter: { advance: { enabled: true }, inline: { enabled: true } },
                },
            },
            {
                name: 'name',
                title: '@general:terms.common.name',
                groupId: 'basic-info',
                schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
                validations: [{ rule: 'required' }],
                options: {
                    sort: { enabled: true },
                    filter: { advance: { enabled: true }, inline: { enabled: true } },
                },
            },
        ],
        columns: [{ name: 'title' }, { name: 'name' }],
        interfaces: {
            master: {
                create: {
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
                    ],
                },
                update: {
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
                    ],
                },
                single: {
                    title: '{{title}}',
                    sections: [{ id: 'basic-info' }],
                    properties: [
                        { name: 'title', layout: { positions: { lg: { colSpan: 6 } } } },
                        { name: 'name', layout: { positions: { lg: { colSpan: 6 } } } },
                    ],
                    actions: [...entityMasterRecordActions()],
                },
                list: {
                    actions: [...entityMasterCrudActions()],
                    views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],
                },
            },
        },
    };
    return entityDef;
}

export { factory };
//# sourceMappingURL=acorex-modules-organization-management-team-member-role.entity-BpiViu0T.mjs.map
