Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,51 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
FieldMetadata,
|
||||
IsSystem,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'activityTargets',
|
||||
labelSingular: 'Activity Target',
|
||||
labelPlural: 'Activity Targets',
|
||||
description: 'An activity target',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ActivityTargetObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Activity',
|
||||
description: 'ActivityTarget activity',
|
||||
icon: 'IconNotes',
|
||||
joinColumn: 'activityId',
|
||||
})
|
||||
@IsNullable()
|
||||
activity: ActivityObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Person',
|
||||
description: 'ActivityTarget person',
|
||||
icon: 'IconUser',
|
||||
joinColumn: 'personId',
|
||||
})
|
||||
@IsNullable()
|
||||
person: PersonObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Company',
|
||||
description: 'ActivityTarget company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
joinColumn: 'companyId',
|
||||
})
|
||||
@IsNullable()
|
||||
company: CompanyObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
IsNullable,
|
||||
FieldMetadata,
|
||||
RelationMetadata,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
|
||||
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CommentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/comment.object-metadata';
|
||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'activities',
|
||||
labelSingular: 'Activity',
|
||||
labelPlural: 'Activities',
|
||||
description: 'An activity',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ActivityObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Title',
|
||||
description: 'Activity title',
|
||||
icon: 'IconNotes',
|
||||
})
|
||||
@IsNullable()
|
||||
title: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Body',
|
||||
description: 'Activity body',
|
||||
icon: 'IconList',
|
||||
})
|
||||
@IsNullable()
|
||||
body: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Type',
|
||||
description: 'Activity type',
|
||||
icon: 'IconCheckbox',
|
||||
defaultValue: { value: 'Note' },
|
||||
})
|
||||
type: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Reminder Date',
|
||||
description: 'Activity reminder date',
|
||||
icon: 'IconCalendarEvent',
|
||||
})
|
||||
@IsNullable()
|
||||
reminderAt: Date;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Due Date',
|
||||
description: 'Activity due date',
|
||||
icon: 'IconCalendarEvent',
|
||||
})
|
||||
@IsNullable()
|
||||
dueAt: Date;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Completion Date',
|
||||
description: 'Activity completion date',
|
||||
icon: 'IconCheck',
|
||||
})
|
||||
@IsNullable()
|
||||
completedAt: Date;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Targets',
|
||||
description: 'Activity targets',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'activityTarget',
|
||||
})
|
||||
@IsNullable()
|
||||
activityTargets: ActivityTargetObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Attachments',
|
||||
description: 'Activity attachments',
|
||||
icon: 'IconFileImport',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'attachment',
|
||||
})
|
||||
@IsNullable()
|
||||
attachments: AttachmentObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Comments',
|
||||
description: 'Activity comments',
|
||||
icon: 'IconComment',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'comment',
|
||||
})
|
||||
@IsNullable()
|
||||
comments: CommentObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Author',
|
||||
description: 'Activity author',
|
||||
icon: 'IconUserCircle',
|
||||
joinColumn: 'authorId',
|
||||
})
|
||||
author: WorkspaceMemberObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Assignee',
|
||||
description: 'Acitivity assignee',
|
||||
icon: 'IconUserCircle',
|
||||
joinColumn: 'assigneeId',
|
||||
})
|
||||
@IsNullable()
|
||||
assignee: WorkspaceMemberObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
IsSystem,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'apiKeys',
|
||||
labelSingular: 'Api Key',
|
||||
labelPlural: 'Api Keys',
|
||||
description: 'An api key',
|
||||
icon: 'IconRobot',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ApiKeyObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Name',
|
||||
description: 'ApiKey name',
|
||||
icon: 'IconLink',
|
||||
defaultValue: { value: '' },
|
||||
})
|
||||
name: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Expiration date',
|
||||
description: 'ApiKey expiration date',
|
||||
icon: 'IconCalendar',
|
||||
})
|
||||
expiresAt: Date;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Revocation date',
|
||||
description: 'ApiKey revocation date',
|
||||
icon: 'IconCalendar',
|
||||
})
|
||||
@IsNullable()
|
||||
revokedAt?: Date;
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'attachments',
|
||||
labelSingular: 'Attachment',
|
||||
labelPlural: 'Attachments',
|
||||
description: 'An attachment',
|
||||
icon: 'IconFileImport',
|
||||
})
|
||||
@IsSystem()
|
||||
export class AttachmentObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Name',
|
||||
description: 'Attachment name',
|
||||
icon: 'IconFileUpload',
|
||||
})
|
||||
name: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Full path',
|
||||
description: 'Attachment full path',
|
||||
icon: 'IconLink',
|
||||
})
|
||||
fullPath: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Type',
|
||||
description: 'Attachment type',
|
||||
icon: 'IconList',
|
||||
})
|
||||
type: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Author',
|
||||
description: 'Attachment author',
|
||||
icon: 'IconCircleUser',
|
||||
joinColumn: 'authorId',
|
||||
})
|
||||
author: WorkspaceMemberObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Activity',
|
||||
description: 'Attachment activity',
|
||||
icon: 'IconNotes',
|
||||
joinColumn: 'activityId',
|
||||
})
|
||||
@IsNullable()
|
||||
activity: ActivityObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Person',
|
||||
description: 'Attachment person',
|
||||
icon: 'IconUser',
|
||||
joinColumn: 'personId',
|
||||
})
|
||||
@IsNullable()
|
||||
person: PersonObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Company',
|
||||
description: 'Attachment company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
joinColumn: 'companyId',
|
||||
})
|
||||
@IsNullable()
|
||||
company: CompanyObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
FieldMetadata,
|
||||
IsSystem,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
|
||||
export abstract class BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.UUID,
|
||||
label: 'Id',
|
||||
icon: null,
|
||||
description: null,
|
||||
defaultValue: { type: 'uuid' },
|
||||
})
|
||||
@IsSystem()
|
||||
id: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Creation date',
|
||||
description: null,
|
||||
icon: 'IconCalendar',
|
||||
defaultValue: { type: 'now' },
|
||||
})
|
||||
createdAt: Date;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Update date',
|
||||
description: null,
|
||||
icon: 'IconCalendar',
|
||||
defaultValue: { type: 'now' },
|
||||
})
|
||||
@IsSystem()
|
||||
updatedAt: Date;
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'comments',
|
||||
labelSingular: 'Comment',
|
||||
labelPlural: 'Comments',
|
||||
description: 'A comment',
|
||||
icon: 'IconMessageCircle',
|
||||
})
|
||||
@IsSystem()
|
||||
export class CommentObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Body',
|
||||
description: 'Comment body',
|
||||
icon: 'IconLink',
|
||||
defaultValue: { value: '' },
|
||||
})
|
||||
body: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Author',
|
||||
description: 'Comment author',
|
||||
icon: 'IconCircleUser',
|
||||
joinColumn: 'authorId',
|
||||
})
|
||||
author: WorkspaceMemberObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Activity',
|
||||
description: 'Comment activity',
|
||||
icon: 'IconNotes',
|
||||
joinColumn: 'activityId',
|
||||
})
|
||||
activity: ActivityObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,177 @@
|
||||
import { CurrencyMetadata } from 'src/metadata/field-metadata/composite-types/currency.composite-type';
|
||||
import { LinkMetadata } from 'src/metadata/field-metadata/composite-types/link.composite-type';
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
RelationMetadata,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
|
||||
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
||||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'companies',
|
||||
labelSingular: 'Company',
|
||||
labelPlural: 'Companies',
|
||||
description: 'A company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
})
|
||||
export class CompanyObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Name',
|
||||
description: 'The company name',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
})
|
||||
name: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Domain Name',
|
||||
description:
|
||||
'The company website URL. We use this url to fetch the company icon',
|
||||
icon: 'IconLink',
|
||||
})
|
||||
@IsNullable()
|
||||
domainName?: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Address',
|
||||
description: 'The company address',
|
||||
icon: 'IconMap',
|
||||
})
|
||||
@IsNullable()
|
||||
address: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'Employees',
|
||||
description: 'Number of employees in the company',
|
||||
icon: 'IconUsers',
|
||||
})
|
||||
@IsNullable()
|
||||
employees: number;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.LINK,
|
||||
label: 'Linkedin',
|
||||
description: 'The company Linkedin account',
|
||||
icon: 'IconBrandLinkedin',
|
||||
})
|
||||
@IsNullable()
|
||||
linkedinLink: LinkMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.LINK,
|
||||
label: 'X',
|
||||
description: 'The company Twitter/X account',
|
||||
icon: 'IconBrandX',
|
||||
})
|
||||
@IsNullable()
|
||||
xLink: LinkMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.CURRENCY,
|
||||
label: 'ARR',
|
||||
description:
|
||||
'Annual Recurring Revenue: The actual or estimated annual revenue of the company',
|
||||
icon: 'IconMoneybag',
|
||||
})
|
||||
@IsNullable()
|
||||
annualRecurringRevenue: CurrencyMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.BOOLEAN,
|
||||
label: 'ICP',
|
||||
description:
|
||||
'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you',
|
||||
icon: 'IconTarget',
|
||||
})
|
||||
@IsNullable()
|
||||
idealCustomerProfile: boolean;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'People',
|
||||
description: 'People linked to the company.',
|
||||
icon: 'IconUsers',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'person',
|
||||
})
|
||||
@IsNullable()
|
||||
people: PersonObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Account Owner',
|
||||
description:
|
||||
'Your team member responsible for managing the company account',
|
||||
icon: 'IconUserCircle',
|
||||
joinColumn: 'accountOwnerId',
|
||||
})
|
||||
@IsNullable()
|
||||
accountOwner: WorkspaceMemberObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Activities',
|
||||
description: 'Activities tied to the company',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'activityTarget',
|
||||
})
|
||||
@IsNullable()
|
||||
activityTargets: ActivityTargetObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Opportunities',
|
||||
description: 'Opportunities linked to the company.',
|
||||
icon: 'IconTargetArrow',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'opportunity',
|
||||
})
|
||||
@IsNullable()
|
||||
opportunities: OpportunityObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the company',
|
||||
icon: 'IconHeart',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'favorite',
|
||||
})
|
||||
@IsNullable()
|
||||
favorites: FavoriteObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the company.',
|
||||
icon: 'IconFileImport',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'attachment',
|
||||
})
|
||||
@IsNullable()
|
||||
attachments: AttachmentObjectMetadata[];
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'favorites',
|
||||
labelSingular: 'Favorite',
|
||||
labelPlural: 'Favorites',
|
||||
description: 'A favorite',
|
||||
icon: 'IconHeart',
|
||||
})
|
||||
@IsSystem()
|
||||
export class FavoriteObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'Position',
|
||||
description: 'Favorite position',
|
||||
icon: 'IconList',
|
||||
defaultValue: { value: 0 },
|
||||
})
|
||||
position: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Workspace Member',
|
||||
description: 'Favorite workspace member',
|
||||
icon: 'IconCircleUser',
|
||||
joinColumn: 'workspaceMemberId',
|
||||
})
|
||||
workspaceMember: WorkspaceMemberObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Person',
|
||||
description: 'Favorite person',
|
||||
icon: 'IconUser',
|
||||
joinColumn: 'personId',
|
||||
})
|
||||
@IsNullable()
|
||||
person: PersonObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Company',
|
||||
description: 'Favorite company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
joinColumn: 'companyId',
|
||||
})
|
||||
@IsNullable()
|
||||
company: CompanyObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
|
||||
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
|
||||
import { ApiKeyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/api-key.object-metadata';
|
||||
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
|
||||
import { CommentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/comment.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
||||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
||||
import { PipelineStepObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/pipeline-step.object-metadata';
|
||||
import { ViewFieldObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view-field.object-metadata';
|
||||
import { ViewFilterObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view-filter.object-metadata';
|
||||
import { ViewSortObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view-sort.object-metadata';
|
||||
import { ViewObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view.object-metadata';
|
||||
import { WebhookObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/webook.object-metadata';
|
||||
import { WorkspaceMemberObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/workspace-member.object-metadata';
|
||||
|
||||
export const standardObjectMetadata = [
|
||||
ActivityTargetObjectMetadata,
|
||||
ActivityObjectMetadata,
|
||||
ApiKeyObjectMetadata,
|
||||
AttachmentObjectMetadata,
|
||||
CommentObjectMetadata,
|
||||
CompanyObjectMetadata,
|
||||
FavoriteObjectMetadata,
|
||||
OpportunityObjectMetadata,
|
||||
PersonObjectMetadata,
|
||||
PipelineStepObjectMetadata,
|
||||
ViewFieldObjectMetadata,
|
||||
ViewFilterObjectMetadata,
|
||||
ViewSortObjectMetadata,
|
||||
ViewObjectMetadata,
|
||||
WebhookObjectMetadata,
|
||||
WorkspaceMemberObjectMetadata,
|
||||
];
|
||||
@ -0,0 +1,90 @@
|
||||
import { CurrencyMetadata } from 'src/metadata/field-metadata/composite-types/currency.composite-type';
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { PersonObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/person.object-metadata';
|
||||
import { PipelineStepObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/pipeline-step.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'opportunities',
|
||||
labelSingular: 'Opportunity',
|
||||
labelPlural: 'Opportunities',
|
||||
description: 'An opportunity',
|
||||
icon: 'IconTargetArrow',
|
||||
})
|
||||
export class OpportunityObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.CURRENCY,
|
||||
label: 'Amount',
|
||||
description: 'Opportunity amount',
|
||||
icon: 'IconCurrencyDollar',
|
||||
})
|
||||
@IsNullable()
|
||||
amount: CurrencyMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Close date',
|
||||
description: 'Opportunity close date',
|
||||
icon: 'IconCalendarEvent',
|
||||
})
|
||||
@IsNullable()
|
||||
closeDate: Date;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Probability',
|
||||
description: 'Opportunity probability',
|
||||
icon: 'IconProgressCheck',
|
||||
defaultValue: { value: '0' },
|
||||
})
|
||||
@IsNullable()
|
||||
probability: string;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Pipeline Step',
|
||||
description: 'Opportunity pipeline step',
|
||||
icon: 'IconKanban',
|
||||
joinColumn: 'pipelineStepId',
|
||||
})
|
||||
@IsNullable()
|
||||
pipelineStep: PipelineStepObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Point of Contact',
|
||||
description: 'Opportunity point of contact',
|
||||
icon: 'IconUser',
|
||||
joinColumn: 'pointOfContactId',
|
||||
})
|
||||
@IsNullable()
|
||||
pointOfContact: PersonObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Person',
|
||||
description: 'Opportunity person',
|
||||
icon: 'IconUser',
|
||||
joinColumn: 'personId',
|
||||
})
|
||||
@IsNullable()
|
||||
person: PersonObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Company',
|
||||
description: 'Opportunity company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
joinColumn: 'companyId',
|
||||
})
|
||||
@IsNullable()
|
||||
company: CompanyObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
import { FullNameMetadata } from 'src/metadata/field-metadata/composite-types/full-name.composite-type';
|
||||
import { LinkMetadata } from 'src/metadata/field-metadata/composite-types/link.composite-type';
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
RelationMetadata,
|
||||
IsSystem,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityTargetObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity-target.object-metadata';
|
||||
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'people',
|
||||
labelSingular: 'Person',
|
||||
labelPlural: 'People',
|
||||
description: 'A person',
|
||||
icon: 'IconUser',
|
||||
})
|
||||
export class PersonObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.FULL_NAME,
|
||||
label: 'Name',
|
||||
description: 'Contact’s name',
|
||||
icon: 'IconUser',
|
||||
})
|
||||
@IsNullable()
|
||||
name: FullNameMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.EMAIL,
|
||||
label: 'Email',
|
||||
description: 'Contact’s Email',
|
||||
icon: 'IconMail',
|
||||
})
|
||||
@IsNullable()
|
||||
email: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.LINK,
|
||||
label: 'Linkedin',
|
||||
description: 'Contact’s Linkedin account',
|
||||
icon: 'IconBrandLinkedin',
|
||||
})
|
||||
@IsNullable()
|
||||
linkedinLink: LinkMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.LINK,
|
||||
label: 'X',
|
||||
description: 'Contact’s X/Twitter account',
|
||||
icon: 'IconBrandX',
|
||||
})
|
||||
@IsNullable()
|
||||
xLink: LinkMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Job Title',
|
||||
description: 'Contact’s job title',
|
||||
icon: 'IconBriefcase',
|
||||
})
|
||||
@IsNullable()
|
||||
jobTitle: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Phone',
|
||||
description: 'Contact’s phone number',
|
||||
icon: 'IconPhone',
|
||||
})
|
||||
@IsNullable()
|
||||
phone: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'City',
|
||||
description: 'Contact’s city',
|
||||
icon: 'IconMap',
|
||||
})
|
||||
@IsNullable()
|
||||
city: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Avatar',
|
||||
description: 'Contact’s avatar',
|
||||
icon: 'IconFileUpload',
|
||||
})
|
||||
@IsSystem()
|
||||
@IsNullable()
|
||||
avatarUrl: string;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Company',
|
||||
description: 'Contact’s company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
joinColumn: 'companyId',
|
||||
})
|
||||
@IsNullable()
|
||||
company: CompanyObjectMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'POC for Opportunities',
|
||||
description: 'Point of Contact for Opportunities',
|
||||
icon: 'IconTargetArrow',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'opportunity',
|
||||
inverseSideFieldName: 'pointOfContact',
|
||||
})
|
||||
@IsNullable()
|
||||
pointOfContactForOpportunities: OpportunityObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Activities',
|
||||
description: 'Activities tied to the contact',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'activityTarget',
|
||||
})
|
||||
@IsNullable()
|
||||
activityTargets: ActivityTargetObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Opportunities',
|
||||
description: 'Opportunities linked to the contact.',
|
||||
icon: 'IconTargetArrow',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'opportunity',
|
||||
})
|
||||
@IsNullable()
|
||||
opportunities: OpportunityObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the contact',
|
||||
icon: 'IconHeart',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'favorite',
|
||||
})
|
||||
@IsNullable()
|
||||
favorites: FavoriteObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the contact.',
|
||||
icon: 'IconFileImport',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'attachment',
|
||||
})
|
||||
@IsNullable()
|
||||
attachments: AttachmentObjectMetadata[];
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
IsSystem,
|
||||
RelationMetadata,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { OpportunityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/opportunity.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'pipelineSteps',
|
||||
labelSingular: 'Pipeline Step',
|
||||
labelPlural: 'Pipeline Steps',
|
||||
description: 'A pipeline step',
|
||||
icon: 'IconLayoutKanban',
|
||||
})
|
||||
@IsSystem()
|
||||
export class PipelineStepObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Name',
|
||||
description: 'Pipeline Step name',
|
||||
icon: 'IconCurrencyDollar',
|
||||
})
|
||||
@IsNullable()
|
||||
name: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Color',
|
||||
description: 'Pipeline Step color',
|
||||
icon: 'IconColorSwatch',
|
||||
})
|
||||
@IsNullable()
|
||||
color: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'Position',
|
||||
description: 'Pipeline Step position',
|
||||
icon: 'IconHierarchy2',
|
||||
defaultValue: { value: 0 },
|
||||
})
|
||||
@IsNullable()
|
||||
position: number;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Opportunities',
|
||||
description: 'Opportunities linked to the step.',
|
||||
icon: 'IconTargetArrow',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'opportunity',
|
||||
})
|
||||
@IsNullable()
|
||||
opportunities: OpportunityObjectMetadata[];
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { ViewObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'viewFields',
|
||||
labelSingular: 'View Field',
|
||||
labelPlural: 'View Fields',
|
||||
description: '(System) View Fields',
|
||||
icon: 'IconTag',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ViewFieldObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.UUID,
|
||||
label: 'Field Metadata Id',
|
||||
description: 'View Field target field',
|
||||
icon: 'IconTag',
|
||||
})
|
||||
fieldMetadataId: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.BOOLEAN,
|
||||
label: 'Visible',
|
||||
description: 'View Field visibility',
|
||||
icon: 'IconEye',
|
||||
defaultValue: { value: true },
|
||||
})
|
||||
isVisible: boolean;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'Size',
|
||||
description: 'View Field size',
|
||||
icon: 'IconEye',
|
||||
defaultValue: { value: 0 },
|
||||
})
|
||||
size: number;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
label: 'Position',
|
||||
description: 'View Field position',
|
||||
icon: 'IconList',
|
||||
defaultValue: { value: 0 },
|
||||
})
|
||||
position: number;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'View',
|
||||
description: 'View Field related view',
|
||||
icon: 'IconLayoutCollage',
|
||||
joinColumn: 'viewId',
|
||||
})
|
||||
@IsNullable()
|
||||
view?: ViewObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { ViewObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'viewFilters',
|
||||
labelSingular: 'View Filter',
|
||||
labelPlural: 'View Filters',
|
||||
description: '(System) View Filters',
|
||||
icon: 'IconFilterBolt',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ViewFilterObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.UUID,
|
||||
label: 'Field Metadata Id',
|
||||
description: 'View Filter target field',
|
||||
icon: null,
|
||||
})
|
||||
fieldMetadataId: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Operand',
|
||||
description: 'View Filter operand',
|
||||
icon: null,
|
||||
defaultValue: { value: 'Contains' },
|
||||
})
|
||||
operand: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Value',
|
||||
description: 'View Filter value',
|
||||
icon: null,
|
||||
defaultValue: { value: '' },
|
||||
})
|
||||
value: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Display Value',
|
||||
description: 'View Filter Display Value',
|
||||
icon: null,
|
||||
defaultValue: { value: '' },
|
||||
})
|
||||
displayValue: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'View',
|
||||
description: 'View Filter related view',
|
||||
icon: 'IconLayoutCollage',
|
||||
joinColumn: 'viewId',
|
||||
})
|
||||
@IsNullable()
|
||||
view: ViewObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
IsSystem,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { ViewObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'viewSorts',
|
||||
labelSingular: 'View Sort',
|
||||
labelPlural: 'View Sorts',
|
||||
description: '(System) View Sorts',
|
||||
icon: 'IconArrowsSort',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ViewSortObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.UUID,
|
||||
label: 'Field Metadata Id',
|
||||
description: 'View Sort target field',
|
||||
icon: 'IconTag',
|
||||
})
|
||||
fieldMetadataId: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Direction',
|
||||
description: 'View Sort direction',
|
||||
icon: null,
|
||||
defaultValue: { value: 'asc' },
|
||||
})
|
||||
direction: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'View',
|
||||
description: 'View Sort related view',
|
||||
icon: 'IconLayoutCollage',
|
||||
joinColumn: 'viewId',
|
||||
})
|
||||
@IsNullable()
|
||||
view: ViewObjectMetadata;
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
RelationMetadata,
|
||||
IsNullable,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { ViewFieldObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view-field.object-metadata';
|
||||
import { ViewFilterObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view-filter.object-metadata';
|
||||
import { ViewSortObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/view-sort.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'views',
|
||||
labelSingular: 'View',
|
||||
labelPlural: 'Views',
|
||||
description: '(System) Views',
|
||||
icon: 'IconLayoutCollage',
|
||||
})
|
||||
@IsSystem()
|
||||
export class ViewObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Name',
|
||||
description: 'View name',
|
||||
icon: null,
|
||||
defaultValue: { value: '' },
|
||||
})
|
||||
name: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.UUID,
|
||||
label: 'Object Metadata Id',
|
||||
description: 'View target object',
|
||||
icon: null,
|
||||
})
|
||||
objectMetadataId: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Type',
|
||||
description: 'View type',
|
||||
icon: null,
|
||||
defaultValue: { value: 'table' },
|
||||
})
|
||||
type: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'View Fields',
|
||||
description: 'View Fields',
|
||||
icon: 'IconTag',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'viewField',
|
||||
})
|
||||
@IsNullable()
|
||||
viewFields: ViewFieldObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'View Filters',
|
||||
description: 'View Filters',
|
||||
icon: 'IconFilterBolt',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'viewFilter',
|
||||
})
|
||||
@IsNullable()
|
||||
viewFilters: ViewFilterObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'View Sorts',
|
||||
description: 'View Sorts',
|
||||
icon: 'IconArrowsSort',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'viewSort',
|
||||
})
|
||||
@IsNullable()
|
||||
viewSorts: ViewSortObjectMetadata[];
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'webhooks',
|
||||
labelSingular: 'Webhook',
|
||||
labelPlural: 'Webhooks',
|
||||
description: 'A webhook',
|
||||
icon: 'IconRobot',
|
||||
})
|
||||
@IsSystem()
|
||||
export class WebhookObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Target Url',
|
||||
description: 'Webhook target url',
|
||||
icon: 'IconLink',
|
||||
})
|
||||
targetUrl: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Operation',
|
||||
description: 'Webhook operation',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
operation: string;
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
import { FullNameMetadata } from 'src/metadata/field-metadata/composite-types/full-name.composite-type';
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { RelationMetadataType } from 'src/metadata/relation-metadata/relation-metadata.entity';
|
||||
import {
|
||||
ObjectMetadata,
|
||||
IsSystem,
|
||||
FieldMetadata,
|
||||
IsNullable,
|
||||
RelationMetadata,
|
||||
} from 'src/workspace/workspace-sync-metadata/decorators/metadata.decorator';
|
||||
import { ActivityObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/activity.object-metadata';
|
||||
import { AttachmentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/attachment.object-metadata';
|
||||
import { BaseObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/base.object-metadata';
|
||||
import { CommentObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/comment.object-metadata';
|
||||
import { CompanyObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/company.object-metadata';
|
||||
import { FavoriteObjectMetadata } from 'src/workspace/workspace-sync-metadata/standard-objects/favorite.object-metadata';
|
||||
|
||||
@ObjectMetadata({
|
||||
namePlural: 'workspaceMembers',
|
||||
labelSingular: 'Workspace Member',
|
||||
labelPlural: 'Workspace Members',
|
||||
description: 'A workspace member',
|
||||
icon: 'IconUserCircle',
|
||||
})
|
||||
@IsSystem()
|
||||
export class WorkspaceMemberObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.FULL_NAME,
|
||||
label: 'Name',
|
||||
description: 'Workspace member name',
|
||||
icon: 'IconCircleUser',
|
||||
})
|
||||
name: FullNameMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Color Scheme',
|
||||
description: 'Preferred color scheme',
|
||||
icon: 'IconColorSwatch',
|
||||
defaultValue: { value: 'Light' },
|
||||
})
|
||||
colorScheme: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Language',
|
||||
description: 'Preferred language',
|
||||
icon: 'IconLanguage',
|
||||
defaultValue: { value: 'en' },
|
||||
})
|
||||
locale: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Avatar Url',
|
||||
description: 'Workspace member avatar',
|
||||
icon: 'IconFileUpload',
|
||||
})
|
||||
avatarUrl: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.UUID,
|
||||
label: 'User Id',
|
||||
description: 'Associated User Id',
|
||||
icon: 'IconCircleUsers',
|
||||
})
|
||||
userId: string;
|
||||
|
||||
// Relations
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Authored activities',
|
||||
description: 'Activities created by the workspace member',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'activity',
|
||||
inverseSideFieldName: 'author',
|
||||
})
|
||||
@IsNullable()
|
||||
authoredActivities: ActivityObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Assigned activities',
|
||||
description: 'Activities assigned to the workspace member',
|
||||
icon: 'IconCheckbox',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'activity',
|
||||
inverseSideFieldName: 'assignee',
|
||||
})
|
||||
@IsNullable()
|
||||
assignedActivities: ActivityObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the workspace member',
|
||||
icon: 'IconHeart',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'favorite',
|
||||
})
|
||||
@IsNullable()
|
||||
favorites: FavoriteObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Account Owner For Companies',
|
||||
description: 'Account owner for companies',
|
||||
icon: 'IconBriefcase',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'company',
|
||||
inverseSideFieldName: 'accountOwner',
|
||||
})
|
||||
@IsNullable()
|
||||
accountOwnerForCompanies: CompanyObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Authored attachments',
|
||||
description: 'Attachments created by the workspace member',
|
||||
icon: 'IconFileImport',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'attachment',
|
||||
inverseSideFieldName: 'author',
|
||||
})
|
||||
@IsNullable()
|
||||
authoredAttachments: AttachmentObjectMetadata[];
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.RELATION,
|
||||
label: 'Authored comments',
|
||||
description: 'Authored comments',
|
||||
icon: 'IconComment',
|
||||
})
|
||||
@RelationMetadata({
|
||||
type: RelationMetadataType.ONE_TO_MANY,
|
||||
objectName: 'comment',
|
||||
inverseSideFieldName: 'author',
|
||||
})
|
||||
@IsNullable()
|
||||
authoredComments: CommentObjectMetadata[];
|
||||
}
|
||||
Reference in New Issue
Block a user