require('../config/loadEnv')();

const rewardPolicyService = require('../services/rewardPolicyService');

const result = rewardPolicyService.validateIntegrationManifestSamples();

console.log(JSON.stringify({
  ok: result.ok,
  mode: 'reward-integration-manifest-check',
  totalSamples: result.totalSamples,
  passedSamples: result.passedSamples,
  failedSamples: result.failedSamples,
  warningSamples: result.warningSamples,
  failed: result.failed,
  warnings: result.warnings,
  checkedAt: result.checkedAt
}, null, 2));

if (!result.ok) process.exitCode = 1;
