// AddActivity adds the given activity to the activity store.
AddActivity adds the given activity to the activity store.
// AddActivity adds the given activity to the activity store .
func (s *Provider) AddActivity(activity *vocab.ActivityType) error {
	logger.Debugf("[%s] Storing activity - Type: %s, ID: %s",
		s.serviceName, activity.Type(), activity.ID())
	activityBytes, err := json.Marshal(activity)
	if err != nil {
		return fmt.Errorf("failed to marshal activity: %w", err)
	}
	err = s.activityStore.Put(activity.ID().String(), activityBytes,
		ariesstorage.Tag{
			Name: activityTag,
		}, ariesstorage.Tag{
			Name:  timeAddedTagName,
			Value: strconv.FormatInt(time.Now().UnixNano(), 10),
		})
	if err != nil {
		return orberrors.NewTransient(fmt.Errorf("failed to store activity: %w", err))
	}
	return nil
}
func ( s * Provider ) AddActivity ( activity * vocab . ActivityType ) error { logger . Debugf ( " " , s . serviceName , activity . Type ( ) , activity . ID ( ) ) activityBytes , err := json . Marshal ( activity ) if err != nil { return fmt . Errorf ( " " , err ) } err = s . activityStore . Put ( activity . ID ( ) . String ( ) , activityBytes , ariesstorage . Tag { Name : activityTag , } , ariesstorage . Tag { Name : timeAddedTagName , Value : strconv . FormatInt ( time . Now ( ) . UnixNano ( ) , 10 ) , } ) if err != nil { return orberrors . NewTransient ( fmt . Errorf ( " " , err ) ) } return nil }
AddActivity adds the given activity to the activity store.
AddActivity adds the given activity to the activity store .