import FcmLog from '@app/core/fcm/model/FcmLog' ; import FcmLogRepository = require ( '@app/core/fcm/FcmLogRepository' ) ; export function addFcmLog ( to , author , message , cause , response ) { let fcmLog = { date : new Date ( ) , to : to , author : author , message : message , cause : cause , response : JSON . stringify ( response ) } ; return FcmLogRepository . insertFcmLog ( fcmLog ) ; } export function getRecentFcmLog ( ) { return FcmLogRepository . findRecentFcmLog ( ) ; } export function removeBeforeTimestamp ( timestamp ) { return FcmLogRepository . deleteBeforeDate ( new Date ( timestamp ) ) ; }