グループ招待の通知とか

Resolve #5880
Resolve #5927
This commit is contained in:
syuilo
2020-02-13 02:17:54 +09:00
parent 037d4b581b
commit 2feef81516
17 changed files with 163 additions and 82 deletions

View File

@@ -3,6 +3,7 @@ import { User } from './user';
import { id } from '../id';
import { Note } from './note';
import { FollowRequest } from './follow-request';
import { UserGroupInvitation } from './user-group-invitation';
@Entity()
export class Notification {
@@ -57,12 +58,13 @@ export class Notification {
* pollVote - (自分または自分がWatchしている)投稿の投票に投票された
* receiveFollowRequest - フォローリクエストされた
* followRequestAccepted - 自分の送ったフォローリクエストが承認された
* groupInvited - グループに招待された
*/
@Column('enum', {
enum: ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted'],
enum: ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited'],
comment: 'The type of the Notification.'
})
public type: 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollVote' | 'receiveFollowRequest' | 'followRequestAccepted';
public type: 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollVote' | 'receiveFollowRequest' | 'followRequestAccepted' | 'groupInvited';
/**
* 通知が読まれたかどうか
@@ -97,6 +99,18 @@ export class Notification {
@JoinColumn()
public followRequest: FollowRequest | null;
@Column({
...id(),
nullable: true
})
public userGroupInvitationId: UserGroupInvitation['id'] | null;
@ManyToOne(type => UserGroupInvitation, {
onDelete: 'CASCADE'
})
@JoinColumn()
public userGroupInvitation: UserGroupInvitation | null;
@Column('varchar', {
length: 128, nullable: true
})