概要

新しいセット追加時に同種目の過去最大値と比較し、PR(Personal Record)かどうか判定。 PR達成時は祝賀演出 + POST-PR Paywall(v1.0.5)で課金転換を狙う。

関連画面

PRDetector API

struct PRDetector {
    func detectPR(newSet: WorkoutSet, history: [WorkoutSet]) -> PRType?
    func detectPRs(sessions: [WorkoutSession]) -> [PR]
}

enum PRType {
    case maxWeight       // 重量更新
    case maxVolume       // ボリューム更新
    case maxReps(Double) // 同重量でレップ更新
}

1RM 推定(Epley公式)

struct OneRepMaxCalculator {
    static func calculate(weight: Double, reps: Int) -> Double {
        return weight * (1 + Double(reps) / 30)
    }
}

処理フロー

  1. WorkoutSet 保存後
  2. 同種目の過去 WorkoutSet を取得
  3. PRDetector.detectPR() で比較
  4. PR なら祝賀演出(アニメーション + ハプティクス)
  5. 条件下で Paywall 表示(無料 + 初回PR 等)

ビジネスルール

変更履歴

バージョン日付変更内容
1.02026-05-09初版作成