package job

import (
	missionentity "haixun-backend/internal/model/copy_mission/domain/entity"
	missiondomain "haixun-backend/internal/model/copy_mission/domain/usecase"
)

func audienceSamplesFromSummary(in []missiondomain.AudienceSampleSummary) []missionentity.AudienceSample {
	if len(in) == 0 {
		return nil
	}
	out := make([]missionentity.AudienceSample, 0, len(in))
	for _, item := range in {
		out = append(out, missionentity.AudienceSample{
			Username:       item.Username,
			SamplePostID:   item.SamplePostID,
			SampleText:     item.SampleText,
			ReplyLikeCount: item.ReplyLikeCount,
			Appearances:    item.Appearances,
			FirstSeenAt:    item.FirstSeenAt,
			LastSeenAt:     item.LastSeenAt,
			Status:         item.Status,
		})
	}
	return out
}
