import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';

const activityMetadata = {
  nameSingular: 'activityV2',
  namePlural: 'activitiesV2',
  labelSingular: 'Activity',
  labelPlural: 'Activities',
  targetTableName: 'activity',
  description: 'An activity',
  icon: 'IconCheckbox',
  isActive: true,
  isSystem: true,
  fields: [
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.TEXT,
      name: 'title',
      label: 'Title',
      targetColumnMap: {
        value: 'title',
      },
      description: 'Activity title',
      icon: 'IconNotes',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.TEXT,
      name: 'body',
      label: 'Body',
      targetColumnMap: {
        value: 'body',
      },
      description: 'Activity body',
      icon: 'IconList',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.TEXT,
      name: 'type',
      label: 'Type',
      targetColumnMap: {
        value: 'type',
      },
      description: 'Activity type',
      icon: 'IconCheckbox',
      isNullable: false,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.DATE,
      name: 'reminderAt',
      label: 'Reminder Date',
      targetColumnMap: {
        value: 'reminderAt',
      },
      description: 'Activity reminder date',
      icon: 'IconCalendarEvent',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.DATE,
      name: 'dueAt',
      label: 'Due Date',
      targetColumnMap: {
        value: 'dueAt',
      },
      description: 'Activity due date',
      icon: 'IconCalendarEvent',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.DATE,
      name: 'completedAt',
      label: 'Completion Date',
      targetColumnMap: {
        value: 'completedAt',
      },
      description: 'Activity completion date',
      icon: 'IconCheck',
      isNullable: true,
    },
    // Relations
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.RELATION,
      name: 'activityTargets',
      label: 'Targets',
      targetColumnMap: {},
      description: 'Activity targets',
      icon: 'IconCheckbox',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.RELATION,
      name: 'attachments',
      label: 'Attachments',
      targetColumnMap: {},
      description: 'Activity attachments',
      icon: 'IconFileImport',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.RELATION,
      name: 'comments',
      label: 'Comments',
      targetColumnMap: {},
      description: 'Activity comments',
      icon: 'IconComment',
      isNullable: true,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.RELATION,
      name: 'author',
      label: 'Author',
      targetColumnMap: {
        value: 'authorId',
      },
      description:
        'Activity author. This is the person who created the activity',
      icon: 'IconUserCircle',
      isNullable: false,
    },
    {
      isCustom: false,
      isActive: true,
      type: FieldMetadataType.RELATION,
      name: 'assignee',
      label: 'Assignee',
      targetColumnMap: {
        value: 'assigneeId',
      },
      description:
        'Acitivity assignee. This is the workspace member assigned to the activity ',
      icon: 'IconUserCircle',
      isNullable: true,
    },
  ],
};

export default activityMetadata;
