async markWishAsDelivered(id) {
    let chatDoc = await this.getChat(id);
    if (!chatDoc.exists) {
      throw new ChatError('invalid-chat', `chat of ${id} does not exist`);
    }
    let data = {
      status: DELIVERED,
    };
    chatsCollection.doc(id).update(data);
    return await this.getChat(id);
  }
/**
   * Mark a chat with status as delivered
   * @param {string} id The id of the chat that tbe message belongs to
   * @throws {ChatError}
   * @throws {FirebaseError}
   * @return {object} A firebase document of the updated chat
   */
Mark a chat with status as delivered
@param {string} id The id of the chat that tbe message belongs to
@throws {ChatError}
@throws {FirebaseError}
@return {object} A firebase document of the updated chat
Mark a chat with status as delivered @param { string } id The id of the chat that tbe message belongs to @throws { ChatError } @throws { FirebaseError } @return { object } A firebase document of the updated chat
async markWishAsDelivered(id) {
    let chatDoc = await this.getChat(id);
    if (!chatDoc.exists) {
      throw new ChatError('invalid-chat', `chat of ${id} does not exist`);
    }
    let data = {
      status: DELIVERED,
    };
    chatsCollection.doc(id).update(data);
    return await this.getChat(id);
  }
async markWishAsDelivered ( id ) { let chatDoc = await this . getChat ( id ) ; if ( ! chatDoc . exists ) { throw new ChatError ( 'invalid-chat' , ` ${ id } ` ) ; } let data = { status : DELIVERED , } ; chatsCollection . doc ( id ) . update ( data ) ; return await this . getChat ( id ) ; }
Mark a chat with status as delivered
 @param {string} id The id of the chat that tbe message belongs to
 @throws {ChatError}
 @throws {FirebaseError}
 @return {object} A firebase document of the updated chat
Mark a chat with status as delivered @param { string } id The id of the chat that tbe message belongs to @throws { ChatError } @throws { FirebaseError } @return { object } A firebase document of the updated chat