2019-08-15 11:53:26 +02:00
|
|
|
import { VideoChangeOwnershipModel } from '@server/models/video/video-change-ownership'
|
2020-06-23 14:10:17 +02:00
|
|
|
import { PickWith } from '@shared/core-utils'
|
2019-11-15 15:06:03 +01:00
|
|
|
import { MAccountDefault, MAccountFormattable } from '../account/account'
|
2020-06-28 22:45:25 +02:00
|
|
|
import { MVideoWithAllFiles, MVideoFormattable } from './video'
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
type Use<K extends keyof VideoChangeOwnershipModel, M> = PickWith<VideoChangeOwnershipModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MVideoChangeOwnership = Omit<VideoChangeOwnershipModel, 'Initiator' | 'NextOwner' | 'Video'>
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MVideoChangeOwnershipFull =
|
|
|
|
MVideoChangeOwnership &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'Initiator', MAccountDefault> &
|
|
|
|
Use<'NextOwner', MAccountDefault> &
|
2019-11-15 15:06:03 +01:00
|
|
|
Use<'Video', MVideoWithAllFiles>
|
2019-08-20 19:05:31 +02:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MVideoChangeOwnershipFormattable =
|
|
|
|
Pick<MVideoChangeOwnership, 'id' | 'status' | 'createdAt'> &
|
2019-08-20 19:05:31 +02:00
|
|
|
Use<'Initiator', MAccountFormattable> &
|
|
|
|
Use<'NextOwner', MAccountFormattable> &
|
2020-06-28 22:45:25 +02:00
|
|
|
Use<'Video', MVideoFormattable>
|