models/communities/ReactionsQuery.js

import CommunitiesIds from './CommunitiesIds.js';

export default class ReactionsQuery {
    /**
     * Creates an ReactionsQuery
     *
     * @constructor ReactionsQuery
     * @param {CommunitiesIds} ids - Entity IDs.
     */
    constructor(ids) {
        this.ids = ids;
    }

    /**
     * Get all users reacted to activity with ID.
     *
     * @memberof ReactionsQuery
     * @param {string} id- Activity ID.
     * @return {ReactionsQuery} - New query.
     */
    static forActivity(id) {
        return new ReactionsQuery(CommunitiesIds.activity(id));
    }

    /**
     * Get only users reacted with specific reaction.
     *
     * @memberof ReactionsQuery
     * @instance
     * @param {string} reaction - Reaction to filter by.
     * @return {ReactionsQuery} - Same query instance.
     */
    withReaction(reaction) {
        this.reaction = reaction;
        return this;
    }
}