hunk.code_window:         $set: updatePayload,
         }
       );
       const template = await this.notificationTemplateRepository.findById(command.templateId, command.organizationId);
       const getSubscriberPreferenceCommand = GetSubscriberTemplatePreferenceCommand.create({
  
hunk.labels: keep keep keep add keep keep keep
hunk.after_edit:     this.analyticsService.track('Update User Preference - [Notification Center]', command.organizationId, {
         _organization: command.organizationId,
         _subscriber: command.subscriberId,
         _template: command.templateId,
         ...updatePayload,
       });
  
hunk.file_path: apps/api/src/app/widgets/usecases/update-subscriber-preference/update-subscriber-preference.usecase.ts
hunk.type: add
file: import { BaseRepository } from '../base-repository';
  import { JobEntity, JobStatusEnum } from './job.entity';
  import { Job } from './job.schema';
  import { ChannelTypeEnum, StepTypeEnum } from '@novu/shared';
  
  export class JobRepository extends BaseRepository<JobEntity> {
    constructor() {
      super(Job, JobEntity);
    }
  
    public async storeJobs(jobs: JobEntity[]): Promise<JobEntity> {
      const stored = [];
      for (let index = 0; index < jobs.length; index++) {
        if (index > 0) {
          jobs[index]._parentId = stored[index - 1]._id;
        }
  
        const created = await this.create(jobs[index]);
        stored.push(created);
      }
  
      return stored[0];
    }
  
    public async updateStatus(jobId: string, status: JobStatusEnum) {
      await this.update(
        {
          _id: jobId,
        },
        {
          $set: {
            status,
          },
        }
      );
    }
  
    public async setError(jobId: string, error: Error) {
      await this.update(
        {
          _id: jobId,
        },
        {
          $set: {
            error,
          },
        }
      );
    }
  
    public async findInAppsForDigest(transactionId: string, subscriberId: string) {
      return await this.find({
        type: ChannelTypeEnum.IN_APP,
        _subscriberId: subscriberId,
        transactionId,
      });
    }
  
    public async findJobsToDigest(from: Date, templateId: string, environmentId: string, subscriberId: string) {
      const digests = await this.find({
        updatedAt: {
          $gte: from,
        },
        _templateId: templateId,
        status: JobStatusEnum.COMPLETED,
        type: StepTypeEnum.DIGEST,
        _environmentId: environmentId,
        _subscriberId: subscriberId,
      });
      const transactionIds = digests.map((job) => job.transactionId);
  
      return await this.find({
        updatedAt: {
          $gte: from,
        },
        _templateId: templateId,
        status: JobStatusEnum.COMPLETED,
        type: StepTypeEnum.TRIGGER,
        _environmentId: environmentId,
        _subscriberId: subscriberId,
        transactionId: {
          $nin: transactionIds,
        },
      });
    }
  }
  