-
Notifications
You must be signed in to change notification settings - Fork 2
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
81e0df7
commit d304a27
Showing
26 changed files
with
438 additions
and
104 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,9 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsString, IsNotEmpty, IsNumber } from 'class-validator'; | ||
|
||
export class AddUserDto { | ||
@ApiProperty() | ||
@IsNumber() | ||
@IsNotEmpty() | ||
userId; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { | ||
CreateDateColumn, | ||
Entity, | ||
PrimaryGeneratedColumn, | ||
DeleteDateColumn, | ||
Column, | ||
ManyToOne, | ||
Index, | ||
} from 'typeorm'; | ||
import { EntityHelper } from '../../utils/entity-helper'; | ||
import { User } from '..'; | ||
import { Meeting } from './meeting.entity'; | ||
import { MemberRole, MemberStatus } from '../enums/member'; | ||
|
||
@Entity({ name: 'members' }) | ||
export class Member extends EntityHelper { | ||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@ManyToOne(() => User, (user) => user.participant, { | ||
eager: true, | ||
cascade: true, | ||
}) | ||
@Index() | ||
user: User; | ||
|
||
@ManyToOne(() => Meeting, (meeting) => meeting.members) | ||
meeting: Meeting; | ||
|
||
@Column({ | ||
type: 'enum', | ||
enum: MemberRole, | ||
default: MemberRole.Attendee, | ||
}) | ||
role: MemberRole; | ||
|
||
@Column({ | ||
type: 'enum', | ||
enum: MemberStatus, | ||
default: MemberStatus.Inviting, | ||
}) | ||
status: MemberStatus; | ||
|
||
@CreateDateColumn() | ||
createdAt: Date; | ||
|
||
@DeleteDateColumn() | ||
deletedAt: Date; | ||
} |
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,51 @@ | ||
import { | ||
Column, | ||
CreateDateColumn, | ||
DeleteDateColumn, | ||
Entity, | ||
ManyToOne, | ||
PrimaryGeneratedColumn, | ||
UpdateDateColumn, | ||
} from 'typeorm'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { EntityHelper } from '../../utils/entity-helper'; | ||
import { Meeting } from './meeting.entity'; | ||
import { Status } from '../enums'; | ||
import { MessageType } from '../enums/message'; | ||
|
||
@Entity({ name: 'messages' }) | ||
export class Message extends EntityHelper { | ||
@PrimaryGeneratedColumn() | ||
@ApiProperty({ example: 1 }) | ||
id: number; | ||
|
||
@ApiProperty({ example: 'Hi there!' }) | ||
@Column({ type: String }) | ||
data: string; | ||
|
||
@ManyToOne(() => Meeting, (meeting) => meeting.participants) | ||
meeting: Meeting; | ||
|
||
@Column({ | ||
type: 'enum', | ||
enum: MessageType, | ||
default: MessageType.Default, | ||
}) | ||
type: MessageType; | ||
|
||
@Column({ | ||
type: 'enum', | ||
enum: Status, | ||
default: Status.Active, | ||
}) | ||
status: Status; | ||
|
||
@CreateDateColumn() | ||
createdAt: Date; | ||
|
||
@UpdateDateColumn() | ||
updatedAt: Date; | ||
|
||
@DeleteDateColumn() | ||
deletedAt: Date; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './participant-role'; | ||
export * from './status'; |
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,9 @@ | ||
export enum MemberRole { | ||
Host = 0, | ||
Attendee = 1, | ||
} | ||
|
||
export enum MemberStatus { | ||
Inviting = 0, | ||
Joined = 1, | ||
} |
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 @@ | ||
export enum MessageType { | ||
Default, | ||
System, | ||
} |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { ChatsController } from './chats.controller'; | ||
|
||
describe('ChatsController', () => { | ||
let controller: ChatsController; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
controllers: [ChatsController], | ||
}).compile(); | ||
|
||
controller = module.get<ChatsController>(ChatsController); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(controller).toBeDefined(); | ||
}); | ||
}); |
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,16 @@ | ||
import { Controller, UseGuards } from '@nestjs/common'; | ||
import { AuthGuard } from '@nestjs/passport'; | ||
import { ApiBearerAuth } from '@nestjs/swagger'; | ||
import { ChatsUseCases } from './chats.usecase'; | ||
|
||
@ApiBearerAuth() | ||
@UseGuards(AuthGuard('jwt')) | ||
@Controller({ | ||
path: 'chats', | ||
version: '1', | ||
}) | ||
export class ChatsController { | ||
constructor( | ||
private chatsUseCases: ChatsUseCases, // private meetingFactoryService: MeetingFactoryService, | ||
) {} | ||
} |
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,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { ChatsController } from './chats.controller'; | ||
import { ChatsService } from './chats.service'; | ||
|
||
@Module({ | ||
controllers: [ChatsController], | ||
providers: [ChatsService] | ||
}) | ||
export class ChatsModule {} |
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,18 @@ | ||
import { Test, TestingModule } from '@nestjs/testing'; | ||
import { ChatsService } from './chats.service'; | ||
|
||
describe('ChatsService', () => { | ||
let service: ChatsService; | ||
|
||
beforeEach(async () => { | ||
const module: TestingModule = await Test.createTestingModule({ | ||
providers: [ChatsService], | ||
}).compile(); | ||
|
||
service = module.get<ChatsService>(ChatsService); | ||
}); | ||
|
||
it('should be defined', () => { | ||
expect(service).toBeDefined(); | ||
}); | ||
}); |
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 { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class ChatsService {} |
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,7 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { ChatsService } from './chats.service'; | ||
|
||
@Injectable() | ||
export class ChatsUseCases { | ||
constructor(private chatServices: ChatsService) {} | ||
} |
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
Oops, something went wrong.