-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58e6775
commit b2542ab
Showing
14 changed files
with
65 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...s/contracts/src/lib/notification.model.ts → ...tracts/src/lib/user-notification.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { IBasePerEntityType, IBasePerTenantAndOrganizationEntityModel, ID } from './base-entity.model'; | ||
import { IUser } from './user.model'; | ||
|
||
export interface INotification extends IBasePerTenantAndOrganizationEntityModel, IBasePerEntityType { | ||
export interface IUserNotification extends IBasePerTenantAndOrganizationEntityModel, IBasePerEntityType { | ||
title?: string; | ||
message?: string; | ||
type?: NotificationTypeEnum; | ||
type?: UserNotificationTypeEnum; | ||
sentById?: ID; | ||
sentBy?: IUser; | ||
isRead?: boolean; | ||
readedAt?: Date; | ||
readAt?: Date; | ||
receiverId?: ID; | ||
receiver?: IUser; | ||
} | ||
|
||
export enum NotificationTypeEnum { | ||
export enum UserNotificationTypeEnum { | ||
PAYMENT = 'Payment', // Will be stored as 0 in DB | ||
ASSIGNEMENT = 'Assignement', // Will be stored as 1 in DB | ||
ASSIGNMENT = 'Assignment', // Will be stored as 1 in DB | ||
INVITATION = 'Invitation', // Will be stored as 2 in DB | ||
MENTION = 'Mention', // Will be stored as 3 in DB | ||
COMMENT = 'Comment', // Will be stored as 4 in DB | ||
MESSAGE = 'Message' // Will be stored as 5 in DB | ||
} | ||
|
||
export interface INotificationCreateInput extends Omit<INotification, 'isRead' | 'readedAt'> {} | ||
export interface IUserNotificationCreateInput extends Omit<IUserNotification, 'isRead' | 'readedAt'> {} | ||
|
||
export interface INotificationUpdateInput | ||
extends Omit<INotification, 'receiverId' | 'receiver' | 'sentById' | 'sentBy'> {} | ||
extends Omit<IUserNotification, 'receiverId' | 'receiver' | 'sentById' | 'sentBy'> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/core/src/lib/notification/repository/mikro-orm-notification.repository.ts
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
packages/core/src/lib/notification/repository/type-orm.notification.repository.ts
This file was deleted.
Oops, something went wrong.
40 changes: 20 additions & 20 deletions
40
packages/core/src/lib/shared/pipes/notification-type-transform.pipe.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/core/src/lib/user-notification/repository/mikro-orm-user-notification.repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { MikroOrmBaseEntityRepository } from '../../core/repository/mikro-orm-base-entity.repository'; | ||
import { UserNotification } from '../user-notification.entity'; | ||
|
||
export class MikroOrmUserNotificationRepository extends MikroOrmBaseEntityRepository<UserNotification> {} |
11 changes: 11 additions & 0 deletions
11
packages/core/src/lib/user-notification/repository/type-orm-user-notification.repository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
import { Repository } from 'typeorm'; | ||
import { UserNotification } from '../user-notification.entity'; | ||
|
||
@Injectable() | ||
export class TypeOrmUserNotificationRepository extends Repository<UserNotification> { | ||
constructor(@InjectRepository(UserNotification) readonly repository: Repository<UserNotification>) { | ||
super(repository.target, repository.manager, repository.queryRunner); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/core/src/lib/user-notification/user-notification.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
@Module({}) | ||
export class UserNotificationModule {} |