-- SPDX-FileCopyrightText: 2023 Steffen Jost <s.jost@fraport.de>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later

{-# LANGUAGE ExistentialQuantification #-}

module Utils.Print.SomeLetter where 

import Utils.Print.Letters

data SomeLetter = forall l . (MDLetter l) => SomeLetter l -- a record selector would be useless here due to the escaped type variable

instance MDLetter SomeLetter where
  letterMeta        (SomeLetter l)  = letterMeta l
  getPJId           (SomeLetter l)  = getPJId l
  getLetterEnvelope (SomeLetter l)  = getLetterEnvelope l
  getLetterKind     (SomeLetter l)  = getLetterKind l
  getTemplate       (SomeLetter l)  = getTemplate l
  getMailSubject    (SomeLetter l)  = getMailSubject l
  getMailBody       (SomeLetter l)  = getMailBody l
  encryptPDFfor     (SomeLetter l)  = encryptPDFfor l