Files
workavia-drive/tdrive/backend/node/src/services/channels/entities/channel-counters.ts
T
Montassar Ghanmy e0615fa867 📁 Changed TDrive root folder (#16)
📁 Changed TDrive root folder
2023-04-11 10:04:29 +01:00

36 lines
783 B
TypeScript

import { Column, Entity } from "../../../core/platform/services/database/services/orm/decorators";
export const TYPE = "channel_counters";
@Entity(TYPE, {
primaryKey: [["id"], "counter_type", "company_id", "workspace_id"],
type: TYPE,
})
export class ChannelCounterEntity {
@Column("id", "uuid")
id: string;
@Column("counter_type", "string")
counter_type: string;
@Column("company_id", "uuid")
company_id: string;
@Column("workspace_id", "string")
workspace_id: string;
@Column("value", "counter")
value: number;
}
export type ChannelCounterPrimaryKey = Pick<
ChannelCounterEntity,
"id" | "counter_type" | "company_id" | "workspace_id"
>;
export enum ChannelUserCounterType {
MEMBERS = "members",
MESSAGES = "messages",
GUESTS = "guests",
}