package com.nokia.tsl_data.service;

import org.springframework.stereotype.Service;

import com.nokia.tsl_data.push_message.service.PushMessageService;

@Service
public class MessageService {

    private final PushMessageService pushMessageService;
    private final String accessToken = "b2f1424d6119affaacab614b184f043fcd2c73db2651bb86eff29992d66820bf";
    private final String prefix = "CUC:";

    public MessageService(PushMessageService pushMessageService) {
        this.pushMessageService = pushMessageService;
    }


    public void error(String errorMessage) {
        pushMessageService.sendMarkdownMessage(
                accessToken,
                prefix,
                String.format("<font color=#FF0000>%s</font>", errorMessage),
                "ERROR"
        );
    }

    public void info(String infoMessage) {
        pushMessageService.sendTextMessage(accessToken, prefix, infoMessage);
    }
}
