"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var appraisalServiceModule_exports = {};
__export(appraisalServiceModule_exports, {
  AppraisalService: () => AppraisalService
});
module.exports = __toCommonJS(appraisalServiceModule_exports);
var import_pui_scripting_object = require("@elliemae/pui-scripting-object");
var import_microfe_common = require("@elliemae/microfe-common");
class AppraisalService extends import_microfe_common.ScriptingObject {
  #loanId;
  #creditScore;
  Close = new import_microfe_common.Event({
    name: "Close",
    objectId: import_pui_scripting_object.ScriptingObjectNames.Module
  });
  Unloading = new import_microfe_common.Event({
    name: "Unloading",
    objectId: import_pui_scripting_object.ScriptingObjectNames.Module
  });
  onPreCommit = new import_microfe_common.Event({
    name: "onPreCommit",
    objectId: import_pui_scripting_object.ScriptingObjectNames.Module
  });
  onSaved = new import_microfe_common.Event({
    name: "onSaved",
    objectId: import_pui_scripting_object.ScriptingObjectNames.Module
  });
  constructor({
    loanId,
    creditScore
  }) {
    super(import_pui_scripting_object.ScriptingObjectNames.Module);
    this.#loanId = loanId;
    this.#creditScore = creditScore;
  }
  getCapabilities = () => Promise.resolve({
    isAdmin: true,
    los: "Encompass"
  });
  getParameters = () => Promise.resolve({
    moduleId: "appraisalService",
    loanId: this.#loanId,
    creditScore: this.#creditScore
  });
  setCreditScore = (creditScore) => {
    this.#creditScore = creditScore;
    return Promise.resolve();
  };
  saveLoan = () => Promise.resolve();
  commit = () => new Promise((resolve) => {
    setTimeout(() => {
      resolve({ loanId: this.#loanId });
    }, 1e3);
  });
  delete = () => {
    throw new Error("Not implemented");
  };
  log = async (message, level) => {
    console.log(message, level);
    return Promise.resolve();
  };
  unload = async () => {
  };
}
