field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

TeraGeneratedCalendarCards.swift (1314B)


      1 import TeraKitBindings
      2 
      3 extension FfiTodayCardRecord {
      4   func appValue() throws -> TeraTodayCard {
      5     guard schemaVersion == 2, (cardType == .event) == (calendarTiming != nil) else {
      6       throw TeraCalendarTiming.unsupported
      7     }
      8     return try TeraTodayCard(
      9       id: cardId,
     10       type: cardType.appValue,
     11       sourceEventID: sourceEventId,
     12       sourceAddress: sourceAddress,
     13       authorPublicKey: authorPublicKey,
     14       contractID: contractId,
     15       title: title,
     16       content: content,
     17       authoredAtUnixSeconds: authoredAtUnixS,
     18       effectiveAtUnixSeconds: effectiveAtUnixS,
     19       calendarTiming: calendarTiming?.appValue(),
     20       location: location,
     21       priceAmount: priceAmount,
     22       priceCurrency: priceCurrency,
     23       priceUnit: priceUnit,
     24       quantity: quantity,
     25       foodSummary: foodSummary,
     26       foodPublishedAtUnixSeconds: foodPublishedAtUnixS,
     27       foodStatus: foodStatus,
     28       contextRank: contextRank,
     29       inclusionReason: inclusionReason,
     30       media: media.map(\.appValue),
     31       lifecycle: lifecycle.appValue,
     32       rankDigest: rankDigest,
     33       authorProfile: authorProfile?.appValue,
     34       thread: thread.map(\.appValue),
     35       localSourceDraftID: localSourceDraftId,
     36       localOperationID: localOperationId,
     37       localOperationState: localOperationState
     38     )
     39   }
     40 }