chromium/components/sync/protocol/autofill_offer_specifics.proto

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// If you change or add any fields in this file, update proto_visitors.h and
// potentially proto_enum_conversions.{h, cc}.

syntax = "proto2";

option java_multiple_files = true;
option java_package = "org.chromium.components.sync.protocol";

option optimize_for = LITE_RUNTIME;

package sync_pb;

// Properties of Autofill wallet offer related objects.

// Next tag: 11
message AutofillOfferSpecifics {
  // The id for this offer data. Will be used as the client tag.
  optional int64 id = 1;

  // The link leading to the offer details page on Gpay app. Will be populated
  // on Android only.
  optional string offer_details_url = 2;

  // Merchant domain and merchant app package name refers to the merchant this
  // offer is applied to.
  repeated string merchant_domain = 3;
  repeated string merchant_app_package = 4;

  // The expiry of this offer. Will be represented in the form of unix epoch
  // time in seconds. Once the offer is expired it will not be shown in the
  // client.
  optional int64 offer_expiry_date = 5;

  // Proto containing data specific to a card-linked offer.
  message CardLinkedOfferData {
    reserved 1, 2;

    // The server id of the card to which the offer is linked.
    repeated int64 instrument_id = 3;
  }

  // Proto containing data specific to a promo code offer.
  message PromoCodeOfferData {
    // The actual promo code which can be applied at checkout.
    optional string promo_code = 1;
  }

  // The unique offer data for different offer types.
  oneof type_specific_offer_data {
    CardLinkedOfferData card_linked_offer_data = 6;
    PromoCodeOfferData promo_code_offer_data = 9;
  }

  // Strings to be shown in client UI, based on the offer type and details.
  message DisplayStrings {
    // A message translated in the user's GPay app locale, explaining the value
    // of the offer. For example, a promo code offer might display
    // "$5 off on shoes, up to $50."
    optional string value_prop_text = 1;

    // A message translated in the user's GPay app locale and shown on mobile as
    // a link, prompting the user to click it to learn more about the offer.
    // Generally, "See details".
    optional string see_details_text_mobile = 2;

    // A message translated in the user's GPay app locale and shown on desktop
    // (not as a link), informing the user that exclusions and restrictions may
    // apply to the value prop text. Generally, "Terms apply."
    optional string see_details_text_desktop = 3;

    // A message translated in the user's GPay app locale and shown on mobile,
    // instructing them on how to redeem the offer. For example, a promo code
    // offer might display "Tap the promo code field at checkout to autofill
    // it."
    optional string usage_instructions_text_mobile = 4;

    // A message translated in the user's GPay app locale and shown on desktop,
    // instructing them on how to redeem the offer. For example, a promo code
    // offer might display "Click the promo code field at checkout to autofill
    // it."
    optional string usage_instructions_text_desktop = 5;
  }
  optional DisplayStrings display_strings = 10;

  // This value will be shown in the offer text template as "XXX% cashback".
  // Percentage has a range of (0, 100].
  message PercentageReward {
    // The string contains a number and a percent sign.
    optional string percentage = 1;
  }

  // This value will be shown in the offer text template as "XXX$ off".
  message FixedAmountReward {
    // The string contains a number and a currency sign.
    optional string amount = 1;
  }

  // The reward type of the offer. Will be used to generate the display text in
  // the UI. Each type has its own client side text template.
  oneof reward_type {
    PercentageReward percentage_reward = 7;
    FixedAmountReward fixed_amount_reward = 8;
  }
}