Files
mattermost-mobile/app/database/models/server/channel_info.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

41 lines
1.5 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import {field, immutableRelation} from '@nozbe/watermelondb/decorators';
import Model from '@nozbe/watermelondb/Model';
import {MM_TABLES} from '@constants/database';
import type ChannelModel from '@typings/database/models/servers/channel';
const {CHANNEL, CHANNEL_INFO} = MM_TABLES.SERVER;
/**
* ChannelInfo is an extension of the information contained in the Channel table.
* In a Separation of Concerns approach, ChannelInfo will provide additional information about a channel but on a more
* specific level.
*/
export default class ChannelInfoModel extends Model {
/** table (name) : ChannelInfo */
static table = CHANNEL_INFO;
/** guest_count : The number of guest in this channel */
@field('guest_count') guestCount!: number;
/** header : The headers at the top of each channel */
@field('header') header!: string;
/** member_count: The number of members in this channel */
@field('member_count') memberCount!: number;
/** pinned_post_count : The number of post pinned in this channel */
@field('pinned_post_count') pinnedPostCount!: number;
/** purpose: The intention behind this channel */
@field('purpose') purpose!: string;
/** channel : The lazy query property to the record from CHANNEL table */
@immutableRelation(CHANNEL, 'id') channel!: Relation<ChannelModel>;
}