import { ApiProperty } from '@nestjs/swagger'; import { Column, Model, Table, DataType } from 'sequelize-typescript'; import { MediaType } from '../enum'; @Table({ tableName: 'common_Media', createdAt: false, updatedAt: false }) export class MediasModel extends Model { @Column({ primaryKey: true, allowNull: false, }) @ApiProperty({ type: String, description: 'MediaID' }) MediaId: string; @Column({ allowNull: false, }) @ApiProperty({ type: String, description: 'ObjectID' }) ObjectId: string; @Column({ allowNull: false, }) @ApiProperty({ type: String, description: 'ObjectType' }) ObjectType: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'title of the media' }) Title: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'Description of the media' }) Description: string; @Column({ allowNull: false, }) @ApiProperty({ type: String, description: 'Enum either Photo, Video, Document', }) Type: MediaType; @Column({ allowNull: false, }) @ApiProperty({ type: String, description: 'isExternal either Y, N' }) IsExternalYN: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'External surce for the file' }) ExternalSource: string; @Column({ allowNull: false, }) @ApiProperty({ type: String, description: 'isExternal either Y, N' }) IsEncryptedYN: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'file name without extension' }) FileName: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'extention of file in jpg etc' }) FileExtension: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'location on the media in term of path', }) FilePath: string; @Column({ allowNull: true, }) @ApiProperty({ type: String, description: 'URl of the media' }) URL: string; @ApiProperty({ example: new Date(), description: 'Timestamp for data creation.', }) @Column({ type: DataType.DATE, allowNull: false }) CreatedAt: Date; @ApiProperty({ example: '138140891dd211b288d34bc7b4312a49', description: 'The CreatedById for Media.', }) @Column({ allowNull: false }) CreatedById: string; @ApiProperty({ example: new Date(), description: 'Timestamp for latest data modification', }) @Column({ type: DataType.DATE, allowNull: true }) UpdatedAt: Date; @ApiProperty({ example: '138140891dd211b288d34bc7b4312a49', description: 'The UpdatedById for Media.', }) @Column({ allowNull: false }) UpdatedById: string; @Column({ allowNull: true }) HiddenYN: string; @Column({ allowNull: true }) DefaultYN: string; }