chromium/components/commerce/core/proto/discounts_db_content.proto

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

syntax = "proto2";

package discounts_db;

option optimize_for = LITE_RUNTIME;

// Used for storing discounts.
message DiscountsContentProto {
  // Original key for data, i.e. the url.
  optional string key = 1;
  repeated DiscountContent discounts = 2;
}

message DiscountContent {
  enum ClusterType {
    CLUSTER_TYPE_UNSPECIFIED = 0;
    OFFER_LEVEL = 1;
  }
  optional ClusterType cluster_type = 1;

  // The unique ID that identifies the discount.
  optional uint64 id = 2;

  enum Type {
    TYPE_UNSPECIFIED = 0;
    FREE_LISTING_WITH_CODE = 1;
  }
  // Type of the discount.
  optional Type type = 3;

  // Format: "en-US", "en-GB", "es", "es-419", "fr", "pt-BR", etc.
  optional string language_code = 4;

  // The discount text details.
  optional string description_detail = 5;

  // The text of any terms and conditions that apply to the discount. The
  // maximum length is 500 characters.
  optional string terms_and_conditions = 6;

  // Value of the discount in text, e.g. 10% off, $10 off, Free shipping, etc.
  optional string value_in_text = 7;

  // The expiry timestamp in second.
  optional double expiry_time_sec = 8;

  // Whether this is a merchant wide discount.
  optional bool is_merchant_wide = 9;

  // The discount code that is used to redeem the discount.
  optional string discount_code = 10;

  // The discount associated offer id.
  optional uint64 offer_id = 11;
}