import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
import { UserGroupMember } from './user_group_member.entity';

@Entity({ name: 'user_group' })
export class UserGroup {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  account_id: number;

  @Column()
  name: string;

  @Column({ nullable: true })
  deleted_at?: Date;

  @Column()
  created_by: string;

  @Column({ nullable: true })
  created_at?: Date;

  @Column()
  updated_by: string;

  @Column({ nullable: true })
  updated_at?: Date;

  @OneToMany(
    () => UserGroupMember,
    (userGroupMember) => userGroupMember.userGroup,
  )
  userGroupMembers?: UserGroupMember[];
}
