autofill_offer_specifics.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. // If you change or add any fields in this file, update proto_visitors.h and
  5. // potentially proto_enum_conversions.{h, cc}.
  6. syntax = "proto2";
  7. option java_multiple_files = true;
  8. option java_package = "org.chromium.components.sync.protocol";
  9. option optimize_for = LITE_RUNTIME;
  10. package sync_pb;
  11. // Properties of Autofill wallet offer related objects.
  12. // Next tag: 11
  13. message AutofillOfferSpecifics {
  14. // The id for this offer data. Will be used as the client tag.
  15. optional int64 id = 1;
  16. // The link leading to the offer details page on Gpay app. Will be populated
  17. // on Android only.
  18. optional string offer_details_url = 2;
  19. // Merchant domain and merchant app package name refers to the merchant this
  20. // offer is applied to.
  21. repeated string merchant_domain = 3;
  22. repeated string merchant_app_package = 4;
  23. // The expiry of this offer. Will be represented in the form of unix epoch
  24. // time in seconds. Once the offer is expired it will not be shown in the
  25. // client.
  26. optional int64 offer_expiry_date = 5;
  27. // Proto containing data specific to a card-linked offer.
  28. message CardLinkedOfferData {
  29. reserved 1, 2;
  30. // The server id of the card to which the offer is linked.
  31. repeated int64 instrument_id = 3;
  32. }
  33. // Proto containing data specific to a promo code offer.
  34. message PromoCodeOfferData {
  35. // The actual promo code which can be applied at checkout.
  36. optional string promo_code = 1;
  37. }
  38. // The unique offer data for different offer types.
  39. oneof type_specific_offer_data {
  40. CardLinkedOfferData card_linked_offer_data = 6;
  41. PromoCodeOfferData promo_code_offer_data = 9;
  42. }
  43. // Strings to be shown in client UI, based on the offer type and details.
  44. message DisplayStrings {
  45. // A message translated in the user's GPay app locale, explaining the value
  46. // of the offer. For example, a promo code offer might display
  47. // "$5 off on shoes, up to $50."
  48. optional string value_prop_text = 1;
  49. // A message translated in the user's GPay app locale and shown on mobile as
  50. // a link, prompting the user to click it to learn more about the offer.
  51. // Generally, "See details".
  52. optional string see_details_text_mobile = 2;
  53. // A message translated in the user's GPay app locale and shown on desktop
  54. // (not as a link), informing the user that exclusions and restrictions may
  55. // apply to the value prop text. Generally, "Terms apply."
  56. optional string see_details_text_desktop = 3;
  57. // A message translated in the user's GPay app locale and shown on mobile,
  58. // instructing them on how to redeem the offer. For example, a promo code
  59. // offer might display "Tap the promo code field at checkout to autofill
  60. // it."
  61. optional string usage_instructions_text_mobile = 4;
  62. // A message translated in the user's GPay app locale and shown on desktop,
  63. // instructing them on how to redeem the offer. For example, a promo code
  64. // offer might display "Click the promo code field at checkout to autofill
  65. // it."
  66. optional string usage_instructions_text_desktop = 5;
  67. }
  68. optional DisplayStrings display_strings = 10;
  69. // This value will be shown in the offer text template as "XXX% cashback".
  70. // Percentage has a range of (0, 100].
  71. message PercentageReward {
  72. // The string contains a number and a percent sign.
  73. optional string percentage = 1;
  74. }
  75. // This value will be shown in the offer text template as "XXX$ off".
  76. message FixedAmountReward {
  77. // The string contains a number and a currency sign.
  78. optional string amount = 1;
  79. }
  80. // The reward type of the offer. Will be used to generate the display text in
  81. // the UI. Each type has its own client side text template.
  82. oneof reward_type {
  83. PercentageReward percentage_reward = 7;
  84. FixedAmountReward fixed_amount_reward = 8;
  85. }
  86. }