const { v4: uuidv4 } = require('uuid');

class RewardReviewDecision {
  constructor({
    rewardId,
    decision,
    reviewer,
    reason,
    flags,
    previousRewardAmount,
    reviewedAt
  } = {}) {
    this.id = uuidv4();
    this.rewardId = rewardId || '';
    this.decision = decision || 'WATCH';
    this.reviewer = reviewer || 'operator';
    this.reason = reason || '';
    this.flags = Array.isArray(flags) ? flags : [];
    this.previousRewardAmount = Number(previousRewardAmount || 0);
    this.reviewedAt = reviewedAt || new Date().toISOString();
    this.createdAt = new Date().toISOString();
  }
}

module.exports = RewardReviewDecision;
