import {
  BaseService
} from "./chunk-W72PRNJY.js";

// runtime/base-classes/metadata-entity-service.ts
var MetadataEntityService = class extends BaseService {
  /**
   * Find metadata records by entity ID and entity type (EAV polymorphic lookup).
   */
  findByEntityIdAndType(entityId, entityType) {
    return this.repository.findByEntityIdAndType(entityId, entityType);
  }
  /**
   * List all metadata records for an entity.
   */
  listByEntity(entityId) {
    return this.repository.listByEntityId(entityId);
  }
  /**
   * List metadata history for an entity, ordered by validFrom desc.
   */
  listHistory(entityId) {
    return this.repository.listHistoryByEntityId(entityId);
  }
  /**
   * Bulk upsert metadata values.
   */
  upsertValues(inputs, conflictTarget, tx) {
    return this.repository.upsertMany(inputs, tx, { conflictTarget });
  }
};

export {
  MetadataEntityService
};
//# sourceMappingURL=chunk-RFH7N6EP.js.map