// Package notifyall provides functionality for sending messages to multiple chat platforms
package notifyall

import (
	"sync"

	google "quantex.com/qfixdpl/src/client/notify/google"
	"quantex.com/qfixdpl/src/client/notify/slack"
	"quantex.com/qfixdpl/src/domain"
)

type AllNotify struct {
	google *google.Notify
	slack  *slack.Notify
}

type Config struct {
	Slack  domain.Channels
	Google domain.Channels
}

func New(cfg Config) *AllNotify {
	return &AllNotify{
		google: google.New(cfg.Google),
		slack:  slack.New(cfg.Slack),
	}
}

func (an AllNotify) SendMsg(chat domain.MessageChannel, text string, status domain.MessageStatus, wg *sync.WaitGroup) {
	an.google.SendMsg(chat, text, status, wg)
	an.slack.SendMsg(chat, text, status, wg)
}
