import { firestore } from 'firebase' ; import { IModel , Model } from './model.model' ; /**
 * Token interface
 */ export interface IToken extends IModel { uid : string ; name : string ; createdOn ? : firestore . Timestamp ; updatedOn ? : firestore . Timestamp ; } /**
 * Token model
 */ export class TokenModel extends Model < IToken > implements IToken { uid : string ; name : string ; createdOn : firestore . Timestamp ; updatedOn : firestore . Timestamp ; param token constructor ( token ? ) { super ( ) ; this . uid = token ? token . uid : undefined ; this . name = token ? token . name : undefined ; this . createdOn = token ? token . createdOn : undefined ; this . updatedOn = token ? token . updatedOn : undefined ; } param requiredOnly public toData ( requiredOnly ? ) { const data = { uid : this . uid , name : this . name , } ; if ( ! requiredOnly ) { data . createdOn = this . createdOn ; data . updatedOn = this . updatedOn ; } return data ; } }