Files
mattermost-mobile/app/database/models/server/my_team.ts
Elias Nahum c452ef8038 [Gekidou] Login entry point (#5568)
* Login entry point

* feedback review

* sort imports

* Fix model relations

* Handle when no current team or current channel has been selected

* Fix MFA unit test

* update prepareCommonSystemValues arguments
2021-07-26 12:03:43 +04:00

33 lines
1.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import {field, relation} from '@nozbe/watermelondb/decorators';
import Model from '@nozbe/watermelondb/Model';
import {MM_TABLES} from '@constants/database';
import type TeamModel from '@typings/database/models/servers/team';
const {TEAM, MY_TEAM} = MM_TABLES.SERVER;
/**
* MyTeam represents only the teams that the current user belongs to
*/
export default class MyTeamModel extends Model {
/** table (name) : MyTeam */
static table = MY_TEAM;
/** is_unread : Boolean flag for unread messages on team level */
@field('is_unread') isUnread!: boolean;
/** mentions_count : Count of posts in which the user has been mentioned */
@field('mentions_count') mentionsCount!: number;
/** roles : The different permissions that this user has in the team, concatenated together with comma to form a single string. */
@field('roles') roles!: string;
/** team : The relation to the TEAM, that this user belongs to */
@relation(TEAM, 'id') team!: Relation<TeamModel>;
}