import { Controller, Get, Post, Body, Patch, Param, Delete, Query, UseGuards } from '@nestjs/common';
import { SendNotificationService } from './send-notification.service';
import { ThrottlerGuard, SkipThrottle } from '@nestjs/throttler';
 
@Controller('send-notification')
export class SendNotificationController {
  constructor(private readonly sendNotificationService: SendNotificationService) {}
   @UseGuards( ThrottlerGuard)
   @SkipThrottle()
  @Post('to-abha-address')
async  findAll(@Body('abhaAddress')abhaAddress:string,@Body('title')title:string,@Body(`body`)body:string,@Body('module')module:any) {
    return this.sendNotificationService.findAll(abhaAddress,title,body,module);
  }
     @UseGuards( ThrottlerGuard)
   @SkipThrottle()
  @Post('to-profile')
async sendNotificationToProfile(@Body('patient_id')patient_id:string,@Body('title')title:string,@Body(`body`)body:string,@Body('module')module:any) {
    return this.sendNotificationService.SendNotificationForPatientProfile(patient_id,title,body,module);
  }
     @UseGuards( ThrottlerGuard)
   @SkipThrottle()
  @Post('count-for-profile')
async getcountForProfile(@Query('patient_id')patient_id:any,@Query('user_id')user_id:any){
  return this.sendNotificationService.getAllNotificationCountForProfile(user_id,patient_id)
}
   @UseGuards( ThrottlerGuard)
   @SkipThrottle()
@Post('get-all-notification-for-profile')
async getnotificationForProfile(@Query('patient_id')patient_id:any,@Query('user_id')user_id:any){
  return this.sendNotificationService.getAllNotificationForProfile(user_id,patient_id)
}
   @UseGuards( ThrottlerGuard)
   @SkipThrottle()
@Post('count-for-abha-address')
async getcountForAbhaAddress(@Query('abhaAddress')abhaAddress:any,@Query('user_id')user_id:any){
  return this.sendNotificationService.getAllNotificationCountForAbhaAddress(user_id,abhaAddress)
}
   @UseGuards( ThrottlerGuard)
   @SkipThrottle()
@Post('get-all-notification-for-abha-address')
async getnotificationForAbhaAddress(@Query('abhaAddress')abhaAddress:any,@Query('user_id')user_id:any){
  return this.sendNotificationService.getAllNotificationForAbhaAddress(user_id,abhaAddress)
}
   @UseGuards( ThrottlerGuard)
   @SkipThrottle()
@Post('mark-as-read-notification-for-abha-address')
async markReaNnotificationForAbhaAddress(@Query('abhaAddress')abhaAddress:any,@Query('user_id')user_id:any,@Query('id')id:any){
  return this.sendNotificationService.markAsReadForAbhaAddress(user_id,abhaAddress,id)
}
   @UseGuards( ThrottlerGuard)
   @SkipThrottle()
@Post('mark-as-read-notification-for-profile')
async markReaNnotificationForProfile(@Query('patient_id')patient_id:any,@Query('user_id')user_id:any,@Query('id')id:any){
  return this.sendNotificationService.markAsReadForProfile(user_id,patient_id,id)
}
}