import { GroupStatus, GroupType } from '@/constants/group';
import { IPaginationRequest, IPaginationResponse } from '@/types/common';

export interface GroupInfo {
  // 播络群 id
  blGroupId: string;
  // 群标题
  imGroupNick: string;
  // 通告数量
  allJobs: number;
  // 今日通告数量
  todayUpdates: number;
  // 群头像
  groupAvatar: string;
  groupType: GroupType;
  // 人数
  groupMemberCount?: number;
}

export interface GroupDetail extends GroupInfo {
  // 机器人 id
  robotId: string;
}

export interface BatchPublishGroup {
  cityCode: string;
  count: number;
}

export interface SimpleGroupInfo extends Pick<GroupInfo, 'blGroupId' | 'imGroupNick'> {
  groupId: string;
}

// 后台接口还没做分页，这里前端先提前做好
export interface GetGroupsRequest extends IPaginationRequest {
  type: GroupType;
  imGroupNick?: string;
  //  0：allGroups 返回所有的，1：allGroups 返回已经申请的
  status?: GroupStatus;
}

export interface GetGroupsResponse extends IPaginationResponse {
  myCreatedGroups: GroupInfo[];
  myJoinedGroups: GroupInfo[];
  allGroups: GroupInfo[];
  myFollowedGroups: GroupInfo[];
}

export interface GetGroupDetailsRequest {
  blGroupId: string;
}
