var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
import { OptionalProps } from "@mikro-orm/core";
import { Entity, Index, PrimaryKey, Property, Unique } from "@mikro-orm/decorators/legacy";
OptionalProps;
let CarrierShipment = class {
  constructor() {
    this.unifiedStatus = "label_created";
    this.createdAt = /* @__PURE__ */ new Date();
    this.updatedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], CarrierShipment.prototype, "id", 2);
__decorateClass([
  Property({ name: "order_id", type: "uuid" })
], CarrierShipment.prototype, "orderId", 2);
__decorateClass([
  Property({ name: "provider_key", type: "text" })
], CarrierShipment.prototype, "providerKey", 2);
__decorateClass([
  Property({ name: "carrier_shipment_id", type: "text" })
], CarrierShipment.prototype, "carrierShipmentId", 2);
__decorateClass([
  Property({ name: "tracking_number", type: "text" })
], CarrierShipment.prototype, "trackingNumber", 2);
__decorateClass([
  Property({ name: "unified_status", type: "text" })
], CarrierShipment.prototype, "unifiedStatus", 2);
__decorateClass([
  Property({ name: "carrier_status", type: "text", nullable: true })
], CarrierShipment.prototype, "carrierStatus", 2);
__decorateClass([
  Property({ name: "label_url", type: "text", nullable: true })
], CarrierShipment.prototype, "labelUrl", 2);
__decorateClass([
  Property({ name: "label_data", type: "text", nullable: true })
], CarrierShipment.prototype, "labelData", 2);
__decorateClass([
  Property({ name: "tracking_events", type: "jsonb", nullable: true })
], CarrierShipment.prototype, "trackingEvents", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], CarrierShipment.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], CarrierShipment.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "last_webhook_at", type: Date, nullable: true })
], CarrierShipment.prototype, "lastWebhookAt", 2);
__decorateClass([
  Property({ name: "last_polled_at", type: Date, nullable: true })
], CarrierShipment.prototype, "lastPolledAt", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], CarrierShipment.prototype, "createdAt", 2);
__decorateClass([
  Property({ name: "updated_at", type: Date, onUpdate: () => /* @__PURE__ */ new Date() })
], CarrierShipment.prototype, "updatedAt", 2);
__decorateClass([
  Property({ name: "deleted_at", type: Date, nullable: true })
], CarrierShipment.prototype, "deletedAt", 2);
CarrierShipment = __decorateClass([
  Entity({ tableName: "carrier_shipments" }),
  Index({ properties: ["orderId", "organizationId", "tenantId"] }),
  Index({ properties: ["providerKey", "carrierShipmentId", "organizationId"] }),
  Index({ properties: ["organizationId", "tenantId", "unifiedStatus"] })
], CarrierShipment);
OptionalProps;
let CarrierWebhookProcessedEvent = class {
  constructor() {
    this.processedAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], CarrierWebhookProcessedEvent.prototype, "id", 2);
__decorateClass([
  Property({ name: "provider_key", type: "text" })
], CarrierWebhookProcessedEvent.prototype, "providerKey", 2);
__decorateClass([
  Property({ name: "idempotency_key", type: "text" })
], CarrierWebhookProcessedEvent.prototype, "idempotencyKey", 2);
__decorateClass([
  Property({ name: "event_type", type: "text" })
], CarrierWebhookProcessedEvent.prototype, "eventType", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], CarrierWebhookProcessedEvent.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], CarrierWebhookProcessedEvent.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "processed_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], CarrierWebhookProcessedEvent.prototype, "processedAt", 2);
CarrierWebhookProcessedEvent = __decorateClass([
  Entity({ tableName: "carrier_webhook_events" }),
  Unique({
    name: "carrier_webhook_events_idempotency_unique",
    properties: ["idempotencyKey", "providerKey", "organizationId", "tenantId"]
  })
], CarrierWebhookProcessedEvent);
OptionalProps;
let CarrierShipmentIdempotencyKey = class {
  constructor() {
    this.createdAt = /* @__PURE__ */ new Date();
  }
};
__decorateClass([
  PrimaryKey({ type: "uuid", defaultRaw: "gen_random_uuid()" })
], CarrierShipmentIdempotencyKey.prototype, "id", 2);
__decorateClass([
  Property({ name: "provider_key", type: "text" })
], CarrierShipmentIdempotencyKey.prototype, "providerKey", 2);
__decorateClass([
  Property({ name: "idempotency_key", type: "text" })
], CarrierShipmentIdempotencyKey.prototype, "idempotencyKey", 2);
__decorateClass([
  Property({ name: "request_hash", type: "text" })
], CarrierShipmentIdempotencyKey.prototype, "requestHash", 2);
__decorateClass([
  Property({ name: "shipment_id", type: "uuid", nullable: true })
], CarrierShipmentIdempotencyKey.prototype, "shipmentId", 2);
__decorateClass([
  Property({ name: "organization_id", type: "uuid" })
], CarrierShipmentIdempotencyKey.prototype, "organizationId", 2);
__decorateClass([
  Property({ name: "tenant_id", type: "uuid" })
], CarrierShipmentIdempotencyKey.prototype, "tenantId", 2);
__decorateClass([
  Property({ name: "created_at", type: Date, onCreate: () => /* @__PURE__ */ new Date() })
], CarrierShipmentIdempotencyKey.prototype, "createdAt", 2);
CarrierShipmentIdempotencyKey = __decorateClass([
  Entity({ tableName: "carrier_shipment_idempotency_keys" }),
  Unique({
    name: "carrier_shipment_idempotency_keys_unique",
    properties: ["idempotencyKey", "providerKey", "organizationId", "tenantId"]
  })
], CarrierShipmentIdempotencyKey);
export {
  CarrierShipment,
  CarrierShipmentIdempotencyKey,
  CarrierWebhookProcessedEvent
};
//# sourceMappingURL=entities.js.map
