member_webapp/src/packages/notification/store/detail/notification.action.ts

62 lines
1.8 KiB
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import { Action } from '@ngrx/store';
import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { Member } from '../../../member/model';
import { PageParams, Page } from 'app/commons/model';
import { Notification } from '../../model';
export enum ActionType {
MarkAsRead = '[Notification.notification] MarkAsRead',
MarkAsReadSuccess = '[Notification.notification] MarkAsReadSuccess',
MarkAsReadFailure = '[Notification.notification] MarkAsReadFailure',
// ReadUnconfirmedCount = '[Notification.notification] ReadUnconfirmedCount',
// ReadUnconfirmedCountSuccess = '[Notification.notification] ReadUnconfirmedCountSuccess',
// ReadUnconfirmedCountFailure = '[Notification.notification] ReadUnconfirmedCountFailure',
}
export class MarkAsRead implements Action {
readonly type = ActionType.MarkAsRead;
constructor(public payload: Notification ) {}
}
export class MarkAsReadSuccess implements Action {
readonly type = ActionType.MarkAsReadSuccess;
constructor(public payload: Notification) {}
}
export class MarkAsReadFailure implements Action {
readonly type = ActionType.MarkAsReadFailure;
constructor(public payload: RPCClientError) {}
}
// export class ReadUnconfirmedCount implements Action {
// readonly type = ActionType.ReadUnconfirmedCount;
// constructor(public payload: Member) {}
// }
// export class ReadUnconfirmedCountSuccess implements Action {
// readonly type = ActionType.ReadUnconfirmedCountSuccess;
// constructor(public payload: number) {}
// }
// export class ReadUnconfirmedCountFailure implements Action {
// readonly type = ActionType.ReadUnconfirmedCountFailure;
// constructor(public payload: RPCClientError) {}
// }
export type Actions =
| MarkAsRead
| MarkAsReadSuccess
| MarkAsReadFailure
// | ReadUnconfirmedCount
// | ReadUnconfirmedCountSuccess
// | ReadUnconfirmedCountFailure
;