Last active
February 4, 2022 21:40
-
-
Save joshuawright11/57c4ff03db0bd4ab4fcd20bb752faf5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct UploadAnalyticsJob: Job { | |
func run() async throws { | |
var allEvents: [AnalyticsEvent] = [] | |
allEvents.append(contentsOf: try await CardEvent.all().map(\.event)) | |
} | |
} | |
extension CardEvent { | |
fileprivate var event: AnalyticsEvent { | |
.cardEvent( | |
amount: card.amount, | |
network: card.network, | |
merchantAddressCity: card.merchantAddressCity, | |
merchantName: card.merchantName) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment