import { db } from "../../db/postgre.js";
import { Hashtag } from "../entities/hashtag.js";
export const HashtagRepository = db.getRepository(Hashtag).extend({
    async pack (src) {
        return {
            tag: src.name,
            mentionedUsersCount: src.mentionedUsersCount,
            mentionedLocalUsersCount: src.mentionedLocalUsersCount,
            mentionedRemoteUsersCount: src.mentionedRemoteUsersCount,
            attachedUsersCount: src.attachedUsersCount,
            attachedLocalUsersCount: src.attachedLocalUsersCount,
            attachedRemoteUsersCount: src.attachedRemoteUsersCount
        };
    },
    packMany (hashtags) {
        return Promise.all(hashtags.map((x)=>this.pack(x)));
    }
});
