func (r *GormTrackerRepository) Create(ctx context.Context, url string, typeID string) (*app.Tracker, error) {
	//URL Validation
	isValid := govalidator.IsURL(url)
	if isValid != true {
		return nil, BadParameterError{parameter: "url", value: url}
	}

	_, present := RemoteWorkItemImplRegistry[typeID]
	// Ensure we support this remote tracker.
	if present != true {
		return nil, BadParameterError{parameter: "type", value: typeID}
	}
	t := Tracker{
		URL:  url,
		Type: typeID}
	tx := r.db
	if err := tx.Create(&t).Error; err != nil {
		return nil, InternalError{simpleError{err.Error()}}
	}
	log.Info(ctx, map[string]interface{}{
		"tracker": t,
	}, "Tracker reposity created")

	t2 := app.Tracker{
		ID:   strconv.FormatUint(t.ID, 10),
		URL:  url,
		Type: typeID}

	return &t2, nil
}
// Create creates a new tracker configuration in the repository
// returns BadParameterError, ConversionError or InternalError
Create creates a new tracker configuration in the repository
returns BadParameterError, ConversionError or InternalError
// Create creates a new tracker configuration in the repository // returns BadParameterError ConversionError or InternalError
func (r *GormTrackerRepository) Create(ctx context.Context, url string, typeID string) (*app.Tracker, error) {
	isValid := govalidator.IsURL(url)
	if isValid != true {
		return nil, BadParameterError{parameter: "url", value: url}
	}
	_, present := RemoteWorkItemImplRegistry[typeID]
	if present != true {
		return nil, BadParameterError{parameter: "type", value: typeID}
	}
	t := Tracker{
		URL:  url,
		Type: typeID}
	tx := r.db
	if err := tx.Create(&t).Error; err != nil {
		return nil, InternalError{simpleError{err.Error()}}
	}
	log.Info(ctx, map[string]interface{}{
		"tracker": t,
	}, "Tracker reposity created")
	t2 := app.Tracker{
		ID:   strconv.FormatUint(t.ID, 10),
		URL:  url,
		Type: typeID}
	return &t2, nil
}
func ( r * GormTrackerRepository ) Create ( ctx context . Context , url string , typeID string ) ( * app . Tracker , error ) { isValid := govalidator . IsURL ( url ) if isValid != true { return nil , BadParameterError { parameter : " " , value : url } } _ , present := RemoteWorkItemImplRegistry [ typeID ] if present != true { return nil , BadParameterError { parameter : " " , value : typeID } } t := Tracker { URL : url , Type : typeID } tx := r . db if err := tx . Create ( & t ) . Error ; err != nil { return nil , InternalError { simpleError { err . Error ( ) } } } log . Info ( ctx , map [ string ] interface { } { " " : t , } , " " ) t2 := app . Tracker { ID : strconv . FormatUint ( t . ID , 10 ) , URL : url , Type : typeID } return & t2 , nil }
Create creates a new tracker configuration in the repository
returns BadParameterError, ConversionError or InternalError
Create creates a new tracker configuration in the repository returns BadParameterError ConversionError or InternalError
//URL Validation // Ensure we support this remote tracker.