-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathcollection-translation.entity.ts
34 lines (25 loc) · 1.12 KB
/
collection-translation.entity.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { LanguageCode } from '@vendure/common/lib/generated-types';
import { DeepPartial } from '@vendure/common/lib/shared-types';
import { Column, Entity, Index, ManyToOne } from 'typeorm';
import { Translation } from '../../common/types/locale-types';
import { HasCustomFields } from '../../config/custom-field/custom-field-types';
import { VendureEntity } from '../base/base.entity';
import { CustomCollectionFieldsTranslation } from '../custom-entity-fields';
import { Collection } from './collection.entity';
@Entity()
export class CollectionTranslation extends VendureEntity implements Translation<Collection>, HasCustomFields {
constructor(input?: DeepPartial<Translation<Collection>>) {
super(input);
}
@Column('varchar') languageCode: LanguageCode;
@Column() name: string;
@Index({ unique: false })
@Column()
slug: string;
@Column('text') description: string;
@Index()
@ManyToOne(type => Collection, base => base.translations, { onDelete: 'CASCADE' })
base: Collection;
@Column(type => CustomCollectionFieldsTranslation)
customFields: CustomCollectionFieldsTranslation;
}