Files
mattermost-mobile/app/database/models/server/my_team.ts
Avinash Lingaloo 29628a585f Gekidou - Fix to make all models implement their respective interface (#6099)
* make all models implement their respective interface

* make all models implement their respective interface
2022-03-29 17:41:46 -03:00

32 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, {Associations} from '@nozbe/watermelondb/Model';
import {MM_TABLES} from '@constants/database';
import type MyTeamModelInterface from '@typings/database/models/servers/my_team';
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 implements MyTeamModelInterface {
/** table (name) : MyTeam */
static table = MY_TEAM;
static associations: Associations = {
[TEAM]: {type: 'belongs_to', key: 'id'},
};
/** 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>;
}