2019-08-15 11:53:26 +02:00
|
|
|
import { AccountBlocklistModel } from '../../../models/account/account-blocklist'
|
|
|
|
import { PickWith } from '../../utils'
|
2019-08-20 19:05:31 +02:00
|
|
|
import { MAccountDefault, MAccountFormattable } from './account'
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
type Use<K extends keyof AccountBlocklistModel, M> = PickWith<AccountBlocklistModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MAccountBlocklist = Omit<AccountBlocklistModel, 'ByAccount' | 'BlockedAccount'>
|
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
// ############################################################################
|
|
|
|
|
2019-08-15 11:53:26 +02:00
|
|
|
export type MAccountBlocklistId = Pick<AccountBlocklistModel, 'id'>
|
|
|
|
|
|
|
|
export type MAccountBlocklistAccounts = MAccountBlocklist &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'ByAccount', MAccountDefault> &
|
|
|
|
Use<'BlockedAccount', MAccountDefault>
|
2019-08-20 19:05:31 +02:00
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
|
|
|
// Format for API or AP object
|
|
|
|
|
|
|
|
export type MAccountBlocklistFormattable = Pick<MAccountBlocklist, 'createdAt'> &
|
|
|
|
Use<'ByAccount', MAccountFormattable> &
|
|
|
|
Use<'BlockedAccount', MAccountFormattable>
|