Class FarmerActivityService

java.lang.Object
edu.ucsb.cs156.happiercows.services.FarmerActivityService

@Service public class FarmerActivityService extends Object
Records FarmerActivity rows (play-page views, buy/sell actions) for course-linked games whose farmer's email matches a student on that course's roster. See issue #291.
  • Constructor Details

    • FarmerActivityService

      public FarmerActivityService()
  • Method Details

    • recordActivityIfStudentMatch

      public void recordActivityIfStudentMatch(User user, Game game, Farmer farmer, int activityType, int numCows)
      Records a FarmerActivity row for the given user/game/farmer/activityType, but only if the game is linked to a course and the user's email matches a student on that course's roster. Silently does nothing otherwise: tracking is opt-in-by-roster-membership, not an error condition when it doesn't apply (e.g. a standalone game with no course, or a course staff member rather than a student).