#include <string>
#include "components/commerce/core/subscriptions/commerce_subscription.h"
namespace {
const char kSubscriptionTypePriceTrack[] = …;
const char kSubscriptionTypeUnspecified[] = …;
const char kSubscriptionIdTypeOfferId[] = …;
const char kSubscriptionIdTypeProductClusterId[] = …;
const char kSubscriptionIdTypeUnspecified[] = …;
const char kSubscriptionManagementTypeChrome[] = …;
const char kSubscriptionManagementTypeUser[] = …;
const char kSubscriptionManagementTypeUnspecified[] = …;
}
namespace commerce {
UserSeenOffer::UserSeenOffer(std::string offer_id,
long user_seen_price,
std::string country_code,
std::string locale)
: … { … }
UserSeenOffer::UserSeenOffer(const UserSeenOffer&) = default;
UserSeenOffer& UserSeenOffer::operator=(const UserSeenOffer&) = default;
UserSeenOffer::~UserSeenOffer() = default;
const int64_t kUnknownSubscriptionTimestamp = …;
const uint64_t kInvalidSubscriptionId = …;
CommerceSubscription::CommerceSubscription(
SubscriptionType type,
IdentifierType id_type,
std::string id,
ManagementType management_type,
int64_t timestamp,
std::optional<UserSeenOffer> user_seen_offer)
: … { … }
CommerceSubscription::CommerceSubscription(const CommerceSubscription&) =
default;
CommerceSubscription& CommerceSubscription::operator=(
const CommerceSubscription&) = default;
CommerceSubscription::~CommerceSubscription() = default;
std::string SubscriptionTypeToString(SubscriptionType type) { … }
SubscriptionType StringToSubscriptionType(const std::string& s) { … }
std::string SubscriptionIdTypeToString(IdentifierType type) { … }
IdentifierType StringToSubscriptionIdType(const std::string& s) { … }
std::string SubscriptionManagementTypeToString(ManagementType type) { … }
ManagementType StringToSubscriptionManagementType(const std::string& s) { … }
std::string GetStorageKeyForSubscription(
const CommerceSubscription& subscription) { … }
}