forked from Ivasoft/mattermost-mobile
* MM_30476 : Added all isolated tables from the server schema * MM_30476 : Updated 'test' script in package.json * MM_30476 : ADDED team section of the server schema * MM_30476 : Apply suggestions from code review Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com> * MM_30476 : Apply suggestions from code review Co-authored-by: Elias Nahum <nahumhbl@gmail.com> * MM_30476 : Updates to field name and description Co-authored-by: Elias Nahum <nahumhbl@gmail.com> Co-authored-by: Hossein <hahmadia@users.noreply.github.com> * MM_30476 : Updated my_team and team_search_history description * MM_30476 : Prefixing boolean fields with 'is' * MM_30476 : Updated channel.d.ts Co-authored-by: Hossein <hahmadia@users.noreply.github.com> Co-authored-by: Elias Nahum <nahumhbl@gmail.com> * MM_30476 : ADDED lazy queries to TeamMembership Two methods that will retrieve all users in a team and all the teams that a user is part of * MM_30476 : Updated descriptions for the associations * MM_30476 : Updated tests as server schema was updated * MM_30476 : Updated Team to have a 1:1 relationship with TeamChannelHistory * MM_30476 : Updated team_membership and user Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com> Co-authored-by: Elias Nahum <nahumhbl@gmail.com> Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
70 lines
2.5 KiB
TypeScript
70 lines
2.5 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Query} from '@nozbe/watermelondb';
|
|
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
|
|
|
import Channel from '@typings/database/channel';
|
|
import GroupsInTeam from '@typings/database/groups_in_team';
|
|
import MyTeam from '@typings/database/my_team';
|
|
import SlashCommand from '@typings/database/slash_command';
|
|
import TeamChannelHistory from '@typings/database/team_channel_history';
|
|
import TeamMembership from '@typings/database/team_membership';
|
|
import TeamSearchHistory from '@typings/database/team_search_history';
|
|
|
|
/**
|
|
* A Team houses and enables communication to happen across channels and users.
|
|
*/
|
|
export default class Team extends Model {
|
|
/** table (entity name) : Team */
|
|
static table: string;
|
|
|
|
/** associations : Describes every relationship to this entity. */
|
|
static associations: Associations;
|
|
|
|
/** is_allow_open_invite : Boolean flag indicating if this team is open to the public */
|
|
isAllowOpenInvite: boolean;
|
|
|
|
/** description : The description for the team */
|
|
description: string;
|
|
|
|
/** display_name : The display name for the team */
|
|
displayName: string;
|
|
|
|
/** is_group_constrained : Boolean flag indicating if members are managed groups */
|
|
isGroupConstrained: boolean;
|
|
|
|
/** last_team_icon_updated_at : Timestamp for when this team's icon has been updated last */
|
|
lastTeamIconUpdatedAt: number;
|
|
|
|
/** name : The name for the team */
|
|
name: string;
|
|
|
|
/** type : The type of team ( e.g. open/private ) */
|
|
type: string;
|
|
|
|
/** allowed_domains : List of domains that can join this team */
|
|
allowedDomains: string;
|
|
|
|
/** channels : All the channels associated with this team */
|
|
channels: Channel[];
|
|
|
|
/** groupsInTeam : All the groups associated with this team */
|
|
groupsInTeam: GroupsInTeam[];
|
|
|
|
/** myTeam : Lazy query property returning only the team member that this user is part of */
|
|
myTeam: Query<MyTeam>;
|
|
|
|
/** slashCommands : All the slash commands associated with this team */
|
|
slashCommands: SlashCommand[];
|
|
|
|
/** teamChannelHistory : A history of the channels in this team that has been visited, ordered by the most recent and capped to the last 5 */
|
|
teamChannelHistory: Query<TeamChannelHistory>;
|
|
|
|
/** members : All the users associated with this team */
|
|
members: TeamMembership[];
|
|
|
|
/** teamSearchHistories : All the searches performed on this team */
|
|
teamSearchHistories: TeamSearchHistory[];
|
|
}
|