package com.example.weighttracker;

import android.content.Context;

// I split goal checking out of WeightLogActivity so the screen code stays cleaner.
public class GoalHelper {

    // Compares the saved goal against the current entry.
    // Less than or equal counts because reaching or passing the goal should trigger the alert.
    public static void checkGoal(Context context, DatabaseHelper db, double currentWeight) {
        Double goal = db.getGoalWeight();

        if (goal == null) {
            return;
        }

        if (currentWeight <= goal) {
            SmsHelper.sendGoalText(context);
        }
    }
}