// AssignNotifierToJob assigns a notifier to job
AssignNotifierToJob assigns a notifier to job
// AssignNotifierToJob assigns a notifier to job
func AssignNotifierToJob(request AssignNotifierToJobRequest) (AssignNotifierToJobResponse, error) {
	response := AssignNotifierToJobResponse{}
	job, errJob := reader.FindOneJob(request.JobName)
	notifier, errNotifier := reader.FindOneNotifier(request.NotifierName)
	if errJob != nil || errNotifier != nil {
		return response, errors.New("error finding job/notifier")
	}
	assignment := entities.Assign(&job, &notifier, request.OnErrorOnly)
	err := writer.CreateAssignment(&assignment)
	if err != nil {
		return response, err
	}
	response.Msg = notifier.Name + " assigned to " + job.Name
	return response, nil
}
func AssignNotifierToJob ( request AssignNotifierToJobRequest ) ( AssignNotifierToJobResponse , error ) { response := AssignNotifierToJobResponse { } job , errJob := reader . FindOneJob ( request . JobName ) notifier , errNotifier := reader . FindOneNotifier ( request . NotifierName ) if errJob != nil || errNotifier != nil { return response , errors . New ( " " ) } assignment := entities . Assign ( & job , & notifier , request . OnErrorOnly ) err := writer . CreateAssignment ( & assignment ) if err != nil { return response , err } response . Msg = notifier . Name + " " + job . Name return response , nil }
AssignNotifierToJob assigns a notifier to job
AssignNotifierToJob assigns a notifier to job