Files
purchases-ios/Sources/Logging/Strings/TransactionMetadataStrings.swift
T
Antonio Pallares 0c3467ae78 Improve accuracy of transactions origin Part 1: refactor to allow caching transaction metadata (#5940)
* Small cleanup

* add `LocalTransactionDetailsStorage`

* Add models for local transaction metadata caching. Reset PurchasesOrchestrator

* Complete `Codable`, lossless implementation of `LocalTransactionMetadata`

* Rename `LocalTransactionMetadataCache` to `LocalTransactionMetadataStore`

* Comment

* lint

* Remove unnecessary import

* Remove unused method

* Replace `Storefront` with `storeCountry` in both `ProductRequestData` and `PurchasedTransactionData`

This removes the need of a `StorefrontEncodedWrapper` object

* Disambiguate `asDictionary()` method

Now that `SubscriberAttribute` is `Codable`, `Encodable`'s `asDictionary()` and `SubscriberAttribute`'s `asDictionary()` were clashing

* Undo `Codable` conformance of `PresentedOfferingContext` and `TargetingContext`

* lint

* `LocalTransactionMetadata` now refers to a single transaction. `LocalTransactionMetadataStore` now stores one file per transaction and does not use an in-memory cache

* Temporarily remove `LocalTransactionMetadata` and `LocalTransactionMetadataStore` for easier PR review

* Undo `Codable` conformance of `EncodedAppleReceipt`

Not needed for now
2026-01-23 08:29:08 +01:00

38 lines
1.1 KiB
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// TransactionMetadataStrings.swift
//
// Created by Antonio Pallares on 8/1/26.
import Foundation
// swiftlint:disable identifier_name
enum TransactionMetadataStrings {
case metadata_already_exists_for_transaction(transactionId: String)
case metadata_not_found_to_clear_for_transaction(transactionId: String)
}
extension TransactionMetadataStrings: LogMessage {
var description: String {
switch self {
case let .metadata_already_exists_for_transaction(transactionId):
return "Purchase data already cached for transaction identifier: \(transactionId). Skipping cache."
case let .metadata_not_found_to_clear_for_transaction(transactionId):
return "Purchase data not found in cache for transaction identifier \(transactionId) when trying to clear"
}
}
var category: String { return "transactionMetadata" }
}