Working on Voice stuff
This commit is contained in:
34
src/utilties/storage/entities/DBCall.ts
Normal file
34
src/utilties/storage/entities/DBCall.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { DBChannel } from "./DBChannel";
|
||||
import { DBCallTranscriptions } from "./DBCallTranscriptions";
|
||||
import { DBCallUsers } from "./DBCallUsers";
|
||||
|
||||
@Entity()
|
||||
export class DBCall {
|
||||
@PrimaryGeneratedColumn()
|
||||
call_id: number
|
||||
|
||||
@ManyToOne(() => DBChannel, (channel: DBChannel) => channel.calls)
|
||||
channel: DBChannel
|
||||
|
||||
@Column({type: "datetime"})
|
||||
call_start_time: Date
|
||||
|
||||
@Column({type: "datetime", nullable: true, default: null})
|
||||
call_end_time: Date | null
|
||||
|
||||
@Column({default: false})
|
||||
call_consolidated: boolean
|
||||
|
||||
@Column({default: false})
|
||||
call_transcribed: boolean
|
||||
|
||||
@Column({default: false})
|
||||
call_data_cleaned_up: boolean
|
||||
|
||||
@OneToMany(() => DBCallTranscriptions, (transcription: DBCallTranscriptions) => transcription.call, {nullable: true})
|
||||
transcriptions: DBCallTranscriptions[] | null
|
||||
|
||||
@OneToMany(() => DBCallUsers, (callUser: DBCallUsers) => callUser.call, {nullable: true})
|
||||
participants: DBCallUsers | null
|
||||
}
|
||||
21
src/utilties/storage/entities/DBCallTranscriptions.ts
Normal file
21
src/utilties/storage/entities/DBCallTranscriptions.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { DBCall } from "./DBCall";
|
||||
import { DBUser } from "./DBUser";
|
||||
|
||||
@Entity()
|
||||
export class DBCallTranscriptions {
|
||||
@PrimaryGeneratedColumn()
|
||||
transcription_id: number
|
||||
|
||||
@ManyToOne(() => DBCall, (call: DBCall) => call.transcriptions)
|
||||
call: DBCall
|
||||
|
||||
@ManyToOne(() => DBUser, (user: DBUser) => user.transcriptions)
|
||||
user: DBUser
|
||||
|
||||
@Column({type: "datetime"})
|
||||
speaking_start_time: Date
|
||||
|
||||
@Column()
|
||||
text: string
|
||||
}
|
||||
21
src/utilties/storage/entities/DBCallUsers.ts
Normal file
21
src/utilties/storage/entities/DBCallUsers.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { DBCall } from "./DBCall";
|
||||
import { DBUser } from "./DBUser";
|
||||
|
||||
@Entity()
|
||||
export class DBCallUsers {
|
||||
@PrimaryGeneratedColumn()
|
||||
call_users_id: number
|
||||
|
||||
@ManyToOne(() => DBCall, (call: DBCall) => call.participants)
|
||||
call: DBCall
|
||||
|
||||
@ManyToOne(() => DBUser, (user: DBUser) => user.call_history)
|
||||
user: DBUser
|
||||
|
||||
@Column({type: "datetime"})
|
||||
call_join_time: Date
|
||||
|
||||
@Column({type: "datetime", nullable: true, default: null})
|
||||
call_leave_time: Date | null
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Column, Entity, ManyToOne, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { DBServer } from "./DBServer";
|
||||
import { DBMessage } from "./DBMessage";
|
||||
import { DBCall } from "./DBCall";
|
||||
|
||||
@Entity()
|
||||
export class DBChannel {
|
||||
@@ -23,5 +24,8 @@ export class DBChannel {
|
||||
is_voice: boolean
|
||||
|
||||
@OneToMany(() => DBMessage, (message: DBMessage) => message.channel)
|
||||
messages: DBMessage[]
|
||||
messages: DBMessage[] | null
|
||||
|
||||
@OneToMany(() => DBCall, (call: DBCall) => call.channel)
|
||||
calls: DBCall[] | null
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Column, Entity, OneToMany, PrimaryColumn } from "typeorm";
|
||||
import { DBMessage } from "./DBMessage";
|
||||
import { DBCallTranscriptions } from "./DBCallTranscriptions";
|
||||
import { DBCallUsers } from "./DBCallUsers";
|
||||
|
||||
@Entity()
|
||||
export class DBUser {
|
||||
@@ -14,4 +16,10 @@ export class DBUser {
|
||||
|
||||
@OneToMany(() => DBMessage, (message: DBMessage) => message.user)
|
||||
messages: DBMessage[]
|
||||
|
||||
@OneToMany(() => DBCallTranscriptions, (transcription: DBCallTranscriptions) => transcription.user, {nullable: true})
|
||||
transcriptions: DBCallTranscriptions[] | null
|
||||
|
||||
@OneToMany(() => DBCallUsers, (call_user: DBCallUsers) => call_user.user)
|
||||
call_history: DBCallUsers[] | null
|
||||
}
|
||||
Reference in New Issue
Block a user