template-for-typescript-projects
    Preparing search index...

    Function toPersistence

    • Converts a domain Alert into a persistence document.

      Parameters

      • entity: Alert

        The domain alert to convert.

      Returns {
          _id: string;
          createdAt: NativeDate;
          details?:
              | {
                  detectedValue: number;
                  limitValue: number;
                  periodType?: string
                  | null;
                  thresholdId: string;
                  thresholdName: string;
                  thresholdType: string;
                  utilityType: string;
              }
              | null;
          failReason?: string
          | null;
          readAt?: NativeDate | null;
          sentAt?: NativeDate | null;
          status: AlertStatus;
      }

      The AlertDocument ready for persistence.