"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NoticeService = void 0;
const common_1 = require("@nestjs/common");
const permission_resolver_helpers_1 = require("../../common/access-control/permission-resolver.helpers");
const permission_resolver_service_1 = require("../../common/access-control/permission-resolver.service");
const config_1 = require("../../config");
const entities_1 = require("../../config/database/entities");
const utils_1 = require("../../utils");
const notifications_service_1 = require("../notifications/notifications.service");
const notice_dto_1 = require("./notice.dto");
let NoticeService = class NoticeService {
    constructor(db, uploadService, notificationService, permissionResolver) {
        this.db = db;
        this.uploadService = uploadService;
        this.notificationService = notificationService;
        this.permissionResolver = permissionResolver;
    }
    async getPermissions(ctx) {
        return this.permissionResolver.resolveForUser(ctx);
    }
    buildPaginationDetails(page, limit, total) {
        const totalPages = Math.ceil(total / limit);
        return {
            pagination: {
                total_items: total,
                total_pages: totalPages,
                current_page: page,
                items_per_page: limit,
                has_next_page: page < totalPages,
                has_previous_page: page > 1,
                next_page: page < totalPages ? page + 1 : null,
                previous_page: page > 1 ? page - 1 : null,
            },
        };
    }
    async getNoticeSummary(owner_id, audience, adminDepartmentId) {
        const where = {
            owner_id,
        };
        if (audience?.memberId || audience?.memberDepartmentId) {
            const orConditions = [];
            if (audience.memberId) {
                orConditions.push({
                    recipients: {
                        some: {
                            id: audience.memberId,
                        },
                    },
                });
            }
            if (audience.memberDepartmentId) {
                orConditions.push({
                    departments: {
                        some: {
                            id: audience.memberDepartmentId,
                        },
                    },
                });
            }
            if (orConditions.length > 0) {
                where.OR = orConditions;
            }
        }
        else if (adminDepartmentId) {
            where.departments = {
                some: {
                    id: adminDepartmentId,
                },
            };
        }
        const [total_notice, total_published, total_high_priority, total_acknowledge,] = await Promise.all([
            this.db.notices.count({ where }),
            this.db.notices.count({
                where: {
                    ...where,
                    status: 'published',
                },
            }),
            this.db.notices.count({
                where: {
                    ...where,
                    priority: 'high',
                },
            }),
            this.db.notices.count({
                where: {
                    ...where,
                    required_acknowledgment: true,
                },
            }),
        ]);
        return {
            total_notice,
            total_published,
            total_high_priority,
            total_acknowledge,
        };
    }
    includeRelations() {
        return {
            departments: true,
            recipients: true,
            up_acknowledgment: true,
            down_acknowledgment: true,
        };
    }
    async ensureMemberIdsExist(memberIds, owner_id) {
        if (memberIds.length === 0) {
            return;
        }
        const count = await this.db.members.count({
            where: {
                owner_id,
                id: {
                    in: memberIds,
                },
            },
        });
        if (count !== memberIds.length) {
            throw (0, utils_1.createGeneralError)('One or more members are invalid', 'member_ids', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    resolveTargetType(data) {
        if (data.target_type) {
            return data.target_type;
        }
        if ((data.member_ids ?? []).length > 0) {
            return 'individual';
        }
        return 'department';
    }
    buildAudienceFilter(audience) {
        if (!audience?.memberId && !audience?.memberDepartmentId) {
            return {};
        }
        const orConditions = [];
        if (audience.memberId) {
            orConditions.push({
                recipients: {
                    some: {
                        id: audience.memberId,
                    },
                },
            });
        }
        if (audience.memberDepartmentId) {
            orConditions.push({
                departments: {
                    some: {
                        id: audience.memberDepartmentId,
                    },
                },
            });
        }
        return orConditions.length > 0 ? { OR: orConditions } : {};
    }
    hasAudienceFilter(where) {
        if (where?.departments?.some?.id) {
            return true;
        }
        return (Array.isArray(where?.OR) &&
            where.OR.some((clause) => clause?.recipients?.some?.id || clause?.departments?.some?.id));
    }
    async ensureDepartmentIdsExist(departmentIds, owner_id) {
        if (departmentIds.length === 0) {
            return;
        }
        const count = await this.db.departments.count({
            where: {
                owner_id,
                id: {
                    in: departmentIds,
                },
            },
        });
        if (count !== departmentIds.length) {
            throw (0, utils_1.createGeneralError)('One or more departments are invalid', 'department_ids', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    async moveNoticeDocument(document) {
        if (!document ||
            typeof document !== 'object' ||
            typeof document.file_name !== 'string' ||
            document.file_name.trim() === '') {
            return undefined;
        }
        const allowedMimeTypes = [
            'application/pdf',
            'application/msword',
            'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'application/vnd.ms-excel',
            'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        ];
        const mimeType = String(document.mime_type ?? '').toLowerCase();
        const isImage = mimeType.startsWith('image/');
        const isAllowedDoc = allowedMimeTypes.includes(mimeType);
        if (!isImage && !isAllowedDoc) {
            throw (0, utils_1.createGeneralError)('Document must be pdf, doc, excel or image', 'document', common_1.HttpStatus.BAD_REQUEST);
        }
        const moved = await this.uploadService.moveImage(document, 'notices');
        return {
            file_name: moved.file_name,
            original_name: moved.original_name,
            file_size: moved.file_size,
            mime_type: moved.mime_type,
        };
    }
    buildWhereFilter(query, audience) {
        const where = {};
        if (query.status) {
            where.status = query.status;
        }
        if (query.priority) {
            where.priority = query.priority;
        }
        if (typeof query.required_acknowledgment === 'boolean') {
            where.required_acknowledgment = query.required_acknowledgment;
        }
        if (query.search) {
            where.OR = [
                {
                    title: {
                        contains: query.search,
                    },
                },
                {
                    content: {
                        contains: query.search,
                    },
                },
            ];
        }
        if (query.from || query.to) {
            const fromDate = query.from ? new Date(query.from) : undefined;
            const toDate = query.to ? new Date(query.to) : undefined;
            const dateFilter = {};
            if (fromDate && toDate) {
                dateFilter.published_at = {
                    gte: fromDate,
                    lte: toDate,
                };
            }
            else if (fromDate) {
                dateFilter.published_at = {
                    gte: fromDate,
                };
            }
            else if (toDate) {
                dateFilter.published_at = {
                    lte: toDate,
                };
            }
            where.AND = [...(where.AND || []), dateFilter];
        }
        const audienceFilter = this.buildAudienceFilter(audience);
        if (Object.keys(audienceFilter).length > 0) {
            where.AND = [...(where.AND || []), audienceFilter];
        }
        else if (query.department_id) {
            where.departments = {
                some: {
                    id: query.department_id,
                },
            };
        }
        return where;
    }
    async getNoticesWithFullRelations(where, skip, take) {
        const hasAudienceFilterApplied = this.hasAudienceFilter(where);
        if (!hasAudienceFilterApplied) {
            return this.db.notices.findMany({
                where,
                include: this.includeRelations(),
                orderBy: {
                    published_at: 'desc',
                },
                skip,
                take,
            });
        }
        const pagedRows = await this.db.notices.findMany({
            where,
            orderBy: {
                published_at: 'desc',
            },
            skip,
            take,
        });
        const ids = pagedRows.map((notice) => notice.id).filter(Boolean);
        if (ids.length === 0) {
            return [];
        }
        const rowsWithRelations = await this.db.notices.findMany({
            where: {
                id: {
                    in: ids,
                },
            },
            include: this.includeRelations(),
        });
        const rowMap = new Map(rowsWithRelations.map((notice) => [notice.id, notice]));
        return ids
            .map((id) => rowMap.get(id))
            .filter((notice) => Boolean(notice));
    }
    async createNotice(data, owner_id, ctx) {
        try {
            const permissions = await this.getPermissions(ctx);
            (0, permission_resolver_helpers_1.assertToggle)(permissions, 'notice.access');
            (0, permission_resolver_helpers_1.assertScopedAction)(permissions, 'notice.create', ctx.sub, ctx.sub);
            const targetType = this.resolveTargetType(data);
            const departmentIds = data.department_ids ?? [];
            const memberIds = data.member_ids ?? [];
            if (targetType === 'department') {
                await this.ensureDepartmentIdsExist(departmentIds, owner_id);
            }
            else {
                await this.ensureMemberIdsExist(memberIds, owner_id);
            }
            const document = await this.moveNoticeDocument(data.document);
            const notice = await this.db.notices.create({
                data: {
                    title: data.title,
                    ...(data.content ? { content: data.content } : {}),
                    document: document ?? {},
                    ...(data.status ? { status: data.status } : {}),
                    ...(data.priority ? { priority: data.priority } : {}),
                    ...(data.created_by ? { created_by: data.created_by } : {}),
                    ...(data.published_at ? { published_at: data.published_at } : {}),
                    ...(data.expire_at ? { expire_at: data.expire_at } : {}),
                    ...(typeof data.required_acknowledgment === 'boolean'
                        ? { required_acknowledgment: data.required_acknowledgment }
                        : {}),
                    ...(targetType === 'department' && departmentIds.length > 0
                        ? {
                            departments: {
                                connect: departmentIds.map((id) => ({ id })),
                            },
                        }
                        : {}),
                    ...(targetType === 'individual' && memberIds.length > 0
                        ? {
                            recipients: {
                                connect: memberIds.map((id) => ({ id })),
                            },
                        }
                        : {}),
                    owner: {
                        connect: {
                            id: owner_id,
                        },
                    },
                },
                include: this.includeRelations(),
            });
            const { data: parsedNotice } = notice_dto_1.noticeResponseSchema.safeParse({
                ...notice,
                target_type: targetType,
            });
            const message = data?.expire_at
                ? `A new notice has been published and will remain active from ${(0, utils_1.getUserTimzoneDate)(data.published_at)} to ${(0, utils_1.getUserTimzoneDate)(data.expire_at)}. Please review the notice for important updates and information.`
                : `A new notice has been published on ${(0, utils_1.getUserTimzoneDate)(data.published_at)}. Please review the notice for important updates and information.`;
            this.notificationService.sendNotification({
                owner_id,
                title: notice.title,
                start_time: data?.published_at,
                end_time: data?.expire_at,
                message: message,
                type: entities_1.NotificationTypeEnum.notice,
                reference_id: notice.id,
                include_owner: true,
                include_admins: true,
                ...(targetType === 'department'
                    ? { department_ids: departmentIds }
                    : { member_ids: memberIds }),
                meta: {
                    notice_id: notice.id,
                    priority: notice.priority,
                },
            });
            return {
                data: parsedNotice,
                message: 'Notice created successfully',
                status: common_1.HttpStatus.CREATED,
                details: null,
            };
        }
        catch (error) {
            config_1.logger.error(`Error in createNotice: ${String(error)}`);
            if (error instanceof config_1.ErrorResponse) {
                throw error;
            }
            throw (0, utils_1.createGeneralError)(String(error), 'root', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    async getNotices(query, owner_id, ctx) {
        try {
            const permissions = await this.getPermissions(ctx);
            (0, permission_resolver_helpers_1.assertToggle)(permissions, 'notice.access');
            const scopeFilter = (0, permission_resolver_helpers_1.resolveDataScope)(permissions, 'notice.view', query.data_scope, ctx);
            const page = query.page ?? 1;
            const limit = query.limit ?? 10;
            const skip = (page - 1) * limit;
            let audience;
            if (scopeFilter === 'own') {
                const member = await this.db.members.findUnique({
                    where: { id: ctx.sub, owner_id },
                    select: { department_id: true },
                });
                if (!member) {
                    throw (0, utils_1.createGeneralError)('Member not found', 'member', common_1.HttpStatus.NOT_FOUND);
                }
                audience = {
                    memberId: ctx.sub,
                    ...(member.department_id
                        ? { memberDepartmentId: member.department_id }
                        : {}),
                };
            }
            const where = {
                owner_id,
                ...this.buildWhereFilter(query, audience),
            };
            const [notices, total, summary] = await Promise.all([
                this.getNoticesWithFullRelations(where, skip, limit),
                this.db.notices.count({ where }),
                this.getNoticeSummary(owner_id, audience, query.department_id),
            ]);
            const { data: parsedNotices } = notice_dto_1.noticesResponseSchema.safeParse(notices?.map((notice) => ({
                ...notice,
                target_type: (notice.recipients?.length ?? 0) > 0 ? 'individual' : 'department',
            })));
            return {
                data: parsedNotices,
                message: 'Notices retrieved successfully',
                status: common_1.HttpStatus.OK,
                details: {
                    ...this.buildPaginationDetails(page, limit, total),
                    summary,
                },
            };
        }
        catch (error) {
            config_1.logger.error(`Error in getNotices: ${String(error)}`);
            if (error instanceof config_1.ErrorResponse) {
                throw error;
            }
            throw (0, utils_1.createGeneralError)(String(error), 'root', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    async getNoticeById(id, owner_id, ctx) {
        try {
            const permissions = await this.getPermissions(ctx);
            (0, permission_resolver_helpers_1.assertToggle)(permissions, 'notice.access');
            (0, permission_resolver_helpers_1.assertScope)(permissions, 'notice.view');
            const notice = await this.db.notices.findUnique({
                where: { id, owner_id },
                include: this.includeRelations(),
            });
            if (!notice) {
                throw (0, utils_1.createGeneralError)('Notice not found', 'notice', common_1.HttpStatus.NOT_FOUND);
            }
            const { data: parsedNotice } = notice_dto_1.noticeResponseSchema.safeParse({
                ...notice,
                target_type: (notice.recipients?.length ?? 0) > 0 ? 'individual' : 'department',
            });
            return {
                data: parsedNotice,
                message: 'Notice retrieved successfully',
                status: common_1.HttpStatus.OK,
                details: null,
            };
        }
        catch (error) {
            config_1.logger.error(`Error in getNoticeById: ${String(error)}`);
            if (error instanceof config_1.ErrorResponse) {
                throw error;
            }
            throw (0, utils_1.createGeneralError)(String(error), 'root', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    async updateNotice(id, data, owner_id, ctx) {
        try {
            const permissions = await this.getPermissions(ctx);
            (0, permission_resolver_helpers_1.assertToggle)(permissions, 'notice.access');
            (0, permission_resolver_helpers_1.assertScope)(permissions, 'notice.update');
            const existingNotice = await this.db.notices.findUnique({
                where: { id, owner_id },
                include: this.includeRelations(),
            });
            if (!existingNotice) {
                throw (0, utils_1.createGeneralError)('Notice not found', 'notice', common_1.HttpStatus.NOT_FOUND);
            }
            const isTargetingUpdate = data.target_type !== undefined ||
                data.department_ids !== undefined ||
                data.member_ids !== undefined;
            let targetType;
            if (isTargetingUpdate) {
                targetType = this.resolveTargetType({
                    target_type: data.target_type,
                    department_ids: data.department_ids ?? [],
                    member_ids: data.member_ids ?? [],
                });
                if (targetType === 'department') {
                    await this.ensureDepartmentIdsExist(data.department_ids ?? [], owner_id);
                }
                else {
                    await this.ensureMemberIdsExist(data.member_ids ?? [], owner_id);
                }
            }
            const nextDocument = data.document === null
                ? {}
                : data.document
                    ? await this.moveNoticeDocument(data.document)
                    : undefined;
            const updatedNotice = await this.db.notices.update({
                where: { id },
                data: {
                    ...(data.title ? { title: data.title } : {}),
                    ...(data.content !== undefined ? { content: data.content } : {}),
                    ...(nextDocument !== undefined ? { document: nextDocument } : {}),
                    ...(data.status ? { status: data.status } : {}),
                    ...(data.priority ? { priority: data.priority } : {}),
                    ...(data.created_by !== undefined
                        ? { created_by: data.created_by }
                        : {}),
                    ...(data.published_at !== undefined
                        ? { published_at: data.published_at }
                        : {}),
                    ...(data.expire_at !== undefined
                        ? { expire_at: data.expire_at }
                        : {}),
                    ...(typeof data.required_acknowledgment === 'boolean'
                        ? { required_acknowledgment: data.required_acknowledgment }
                        : {}),
                    ...(targetType === 'department'
                        ? {
                            departments: {
                                set: (data.department_ids ?? []).map((departmentId) => ({
                                    id: departmentId,
                                })),
                            },
                            recipients: {
                                set: [],
                            },
                        }
                        : {}),
                    ...(targetType === 'individual'
                        ? {
                            recipients: {
                                set: (data.member_ids ?? []).map((memberId) => ({
                                    id: memberId,
                                })),
                            },
                            departments: {
                                set: [],
                            },
                        }
                        : {}),
                },
                include: this.includeRelations(),
            });
            const message = data?.expire_at
                ? `The notice information has been updated and is valid from ${(0, utils_1.getUserTimzoneDate)(data.published_at ?? existingNotice.published_at)} to ${(0, utils_1.getUserTimzoneDate)(data.expire_at ?? existingNotice.expire_at)}. Please check the latest changes and updates.`
                : `The notice information has been updated on ${(0, utils_1.getUserTimzoneDate)(data.published_at ?? existingNotice.published_at)}. Please check the latest changes and updates.`;
            const resolvedTargetType = targetType ??
                ((updatedNotice.recipients?.length ?? 0) > 0
                    ? 'individual'
                    : 'department');
            const notificationDepartmentIds = resolvedTargetType === 'department'
                ? (data.department_ids ??
                    updatedNotice.departments?.map((dept) => dept.id) ??
                    [])
                : undefined;
            const notificationMemberIds = resolvedTargetType === 'individual'
                ? (data.member_ids ??
                    updatedNotice.recipients?.map((member) => member.id) ??
                    [])
                : undefined;
            this.notificationService.sendNotification({
                owner_id,
                title: updatedNotice.title,
                start_time: data?.published_at ?? existingNotice.published_at,
                end_time: data?.expire_at ?? existingNotice.expire_at,
                message: message,
                type: entities_1.NotificationTypeEnum.notice,
                reference_id: updatedNotice.id,
                include_owner: true,
                include_admins: true,
                ...(notificationDepartmentIds
                    ? { department_ids: notificationDepartmentIds }
                    : {}),
                ...(notificationMemberIds ? { member_ids: notificationMemberIds } : {}),
                meta: {
                    notice_id: updatedNotice.id,
                    priority: updatedNotice.priority,
                },
            });
            const { data: parsedNotice } = notice_dto_1.noticeResponseSchema.safeParse({
                ...updatedNotice,
                target_type: resolvedTargetType,
            });
            return {
                data: parsedNotice,
                message: 'Notice updated successfully',
                status: common_1.HttpStatus.OK,
                details: null,
            };
        }
        catch (error) {
            config_1.logger.error(`Error in updateNotice: ${String(error)}`);
            if (error instanceof config_1.ErrorResponse) {
                throw error;
            }
            throw (0, utils_1.createGeneralError)(String(error), 'root', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    async updateAcknowledgeNotice(id, data, owner_id, ctx) {
        try {
            const permissions = await this.getPermissions(ctx);
            (0, permission_resolver_helpers_1.assertToggle)(permissions, 'notice.access');
            (0, permission_resolver_helpers_1.assertScopedAction)(permissions, 'notice.view', data.member_id, ctx.sub);
            const { member_id, acknowledgment } = data;
            const notice = await this.db.notices.findUnique({
                where: { id, owner_id },
                include: {
                    up_acknowledgment: true,
                    down_acknowledgment: true,
                },
            });
            if (!notice) {
                throw (0, utils_1.createGeneralError)('Notice not found', 'notice', common_1.HttpStatus.NOT_FOUND);
            }
            const member = await this.db.members.findUnique({
                where: {
                    id: member_id,
                    owner_id,
                },
                select: {
                    id: true,
                },
            });
            if (!member) {
                throw (0, utils_1.createGeneralError)('Member not found', 'member', common_1.HttpStatus.NOT_FOUND);
            }
            const alreadyAcknowledgedUp = (notice.up_acknowledgment ?? []).some((member) => member.id === member_id);
            const alreadyAcknowledgedDown = (notice.down_acknowledgment ?? []).some((member) => member.id === member_id);
            const nextUpAcknowledgment = [...(notice.up_acknowledgment ?? [])];
            const nextDownAcknowledgment = [...(notice.down_acknowledgment ?? [])];
            const removeMember = (members) => members.filter((currentMember) => currentMember.id !== member_id);
            const addMember = (members) => {
                if (members.some((currentMember) => currentMember.id === member_id)) {
                    return members;
                }
                return [...members, member];
            };
            if (acknowledgment === 'up') {
                if (alreadyAcknowledgedUp) {
                    const updatedNotice = await this.db.notices.update({
                        where: { id },
                        data: {
                            up_acknowledgment: removeMember(nextUpAcknowledgment),
                            down_acknowledgment: removeMember(nextDownAcknowledgment),
                        },
                    });
                    if (!updatedNotice) {
                        throw (0, utils_1.createGeneralError)('Failed to update acknowledgment', 'notice', common_1.HttpStatus.BAD_REQUEST);
                    }
                }
                else {
                    await this.db.notices.update({
                        where: { id },
                        data: {
                            up_acknowledgment: addMember(nextUpAcknowledgment),
                            down_acknowledgment: removeMember(nextDownAcknowledgment),
                        },
                    });
                }
            }
            else if (acknowledgment === 'down') {
                if (alreadyAcknowledgedDown) {
                    await this.db.notices.update({
                        where: { id },
                        data: {
                            up_acknowledgment: removeMember(nextUpAcknowledgment),
                            down_acknowledgment: removeMember(nextDownAcknowledgment),
                        },
                    });
                }
                else {
                    await this.db.notices.update({
                        where: {
                            id,
                        },
                        data: {
                            down_acknowledgment: addMember(nextDownAcknowledgment),
                            up_acknowledgment: removeMember(nextUpAcknowledgment),
                        },
                    });
                }
            }
            return {
                data: null,
                message: 'Acknowledgment updated successfully',
                status: common_1.HttpStatus.OK,
                details: null,
            };
        }
        catch (error) {
            config_1.logger.error(`Error in acknowledgeNotice: ${String(error)}`);
            if (error instanceof config_1.ErrorResponse) {
                throw error;
            }
            throw (0, utils_1.createGeneralError)(String(error), 'root', common_1.HttpStatus.BAD_REQUEST);
        }
    }
    async deleteNotice(id, owner_id, ctx) {
        try {
            const permissions = await this.getPermissions(ctx);
            (0, permission_resolver_helpers_1.assertToggle)(permissions, 'notice.access');
            (0, permission_resolver_helpers_1.assertScope)(permissions, 'notice.delete');
            const existingNotice = await this.db.notices.findUnique({
                where: { id, owner_id },
            });
            if (!existingNotice) {
                throw (0, utils_1.createGeneralError)('Notice not found', 'notice', common_1.HttpStatus.NOT_FOUND);
            }
            await this.db.notices.delete({
                where: { id },
            });
            return {
                data: null,
                message: 'Notice deleted successfully',
                status: common_1.HttpStatus.OK,
                details: null,
            };
        }
        catch (error) {
            config_1.logger.error(`Error in deleteNotice: ${String(error)}`);
            if (error instanceof config_1.ErrorResponse) {
                throw error;
            }
            throw (0, utils_1.createGeneralError)(String(error), 'root', common_1.HttpStatus.BAD_REQUEST);
        }
    }
};
exports.NoticeService = NoticeService;
exports.NoticeService = NoticeService = __decorate([
    (0, common_1.Injectable)(),
    __metadata("design:paramtypes", [config_1.DatabaseService,
        config_1.UploadService,
        notifications_service_1.NotificationsService,
        permission_resolver_service_1.PermissionResolverService])
], NoticeService);
//# sourceMappingURL=notice.service.js.map