package emit

import (
	"jirasop/model"
	"strconv"
)

func Emit(ar *model.AnalyzeResult, summary string) (string, error) {
	resStr := `The Analysis according to SOP for Alert ` + summary + ` is:

`
	for k, v := range ar.Reasons {
		str := `Optional Reason ` + strconv.Itoa(k) + ` is: *` + v.Name + `*
`
		str += `The Judgement is: *` + strconv.FormatBool(v.Is) + `*
`
		str += `The description is: 
` + v.Description + `
		
`
		resStr += str
	}
	return resStr, nil
}
