import type { JSONSupport, JSONSupportMixinProperties } from "../../../../core/JSONSupport.js";

export interface ReconcileParametersProperties extends JSONSupportMixinProperties, Partial<Pick<ReconcileParameters, "abortIfConflicts" | "conflictDetection" | "withPost">> {}

export type DetectionType = "by-object" | "by-attribute";

export default abstract class ReconcileParameters extends JSONSupport {
  /**
   * Specifies whether the reconcile should be aborted if conflicts are found. The default is false
   *
   * @default false
   */
  accessor abortIfConflicts: boolean;
  /** Specifies the conditions required for conflicts to occur are defined by object (row) or attribute (column). */
  accessor conflictDetection: DetectionType | null;
  /**
   * Specifies if post will occur after calling reconcile. Causes post to occur immediately after reconcile, false by default.
   *
   * @default false
   */
  accessor withPost: boolean;
}