1 import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
2 import { PickWith } from '@server/typings/utils'
3 import { MAccountDefault, MAccountFormattable } from '../account/account'
4 import { MVideo, MVideoWithAllFiles } from './video'
6 type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
8 // ############################################################################
10 export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
12 export type MVideoChangeOwnershipFull = MVideoChangeOwnership &
13 Use<'Initiator', MAccountDefault> &
14 Use<'NextOwner', MAccountDefault> &
15 Use<'Video', MVideoWithAllFiles>
17 // ############################################################################
19 // Format for API or AP object
21 export type MVideoChangeOwnershipFormattable = Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
22 Use<'Initiator', MAccountFormattable> &
23 Use<'NextOwner', MAccountFormattable> &
24 Use<'Video', Pick<MVideo, 'id' | 'uuid' | 'url' | 'name'>>