import { Dictionary, DictionaryEntry } from "@open-mercato/core/modules/dictionaries/data/entities";
import { normalizeDictionaryValue } from "@open-mercato/core/modules/dictionaries/lib/utils";
async function resolveStatusEntryIdByValue(em, params) {
  const normalizedValue = normalizeDictionaryValue(params.value);
  const dictionary = await em.findOne(Dictionary, {
    tenantId: params.tenantId,
    organizationId: params.organizationId,
    key: "sales.order_status",
    deletedAt: null
  });
  if (!dictionary) return null;
  const entry = await em.findOne(DictionaryEntry, {
    dictionary,
    tenantId: params.tenantId,
    organizationId: params.organizationId,
    normalizedValue
  });
  return entry?.id ?? null;
}
export {
  resolveStatusEntryIdByValue
};
//# sourceMappingURL=statusHelpers.js.map
