import { init as settingInit } from './models/Setting.js';
import { init as userInit } from './models/User.js';
import Logs from './libs/logs.js';

(() => {
  settingInit({
    innerDefaultAmount: 10000,
    // minProfitAmount: 0,
    minShowAmount: 0,
    innerRebateRatio: 0,
    innerOuMinValue: 0,
    obRebateRatio: 0,
    obRebateType: 0,
    obMaxDiff: 0,
    imRebateRatio: 0,
    imRebateType: 0,
    imMaxDiff: 0,
    hgRebateRatio: 0,
    hgRebateType: 0,
    hgRebateLower: 0,
    hgMaxDiff: 0,
    pcRebateRatio: 0,
    pcRebateType: 0,
    innerRouSubsidyValue: 0,
    innerRouMaxAdjust: 100,
    innerWmSubsidyRatio: 0,
    innerOtSubsidyRatio: 0,
    halfTimeActiveTime: 0,
    expireTimeEvents: 45000,
    expireTimeSpecial: 60000,
    syncSettingEnabled: false,
    runWorkerEnabled: false,
  })
  .then(() => {
    Logs.out('初始化设置完成');
  })
  .catch(err => {
    Logs.errDev('初始化设置失败:', err);
  });

  userInit({
    username: 'admin',
    password: '123456'
  })
  .then(() => {
    Logs.out('初始化用户完成');
  })
  .catch(err => {
    Logs.errDev('初始化用户失败:', err);
  });
})();
