File: price_tracking.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (148 lines) | stat: -rw-r--r-- 4,356 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Copyright 2021 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 commerce;

option java_package = "org.chromium.components.commerce";

option optimize_for = LITE_RUNTIME;

import "components/commerce/core/proto/product_category.proto";

// These messages are primarily used for over-the-wire communications. If this
// information needs to be stored locally, consider building a separate proto.
message PriceTrackingData {
  // metadata relating to the product
  optional BuyableProduct buyable_product = 1;

  // price update data for the product
  optional ProductPriceUpdate product_update = 2;
}

message BuyableProduct {
  enum ProductReferenceType {
    UNKNOWN = 0;
    // The product referenced in the product details page.
    MAIN_PRODUCT = 1;
  }

  // Recommendation on how to display the price range to the consumer.
  enum PriceDisplayRecommendation {
    // No recommendation.
    RECOMMENDATION_UNSPECIFIED = 0;
    // Show the price range as is.
    RECOMMENDATION_SHOW_RANGE = 1;
    // Show the lower bound of the price range.
    RECOMMENDATION_SHOW_RANGE_LOWER_BOUND = 2;
    // Show the upper bound of the price range.
    RECOMMENDATION_SHOW_RANGE_UPPER_BOUND = 3;
    // Show a '-'.
    RECOMMENDATION_SHOW_PRICE_UNDETERMINED = 4;
    // Show the single price.
    RECOMMENDATION_SHOW_SINGLE_PRICE = 5;
  }

  // One offer title of the product in the current page.
  optional string title = 1;

  // Direct link to the product image.
  optional string image_url = 2;

  // Price as shown in the page.
  optional ProductPrice current_price = 3;

  // Determines how the product is referenced in the current page.
  optional ProductReferenceType reference_type = 4;

  // Docid of the offer.
  optional fixed64 offer_id = 5;

  // Cluster id.
  optional uint64 product_cluster_id = 6;

  // Country code of the offer.
  optional string country_code = 7;

  // The title of the product cluster. This differs from above offer title in
  // that it would exclude attributes (size, color, etc.) and instead describes
  // a broader range of the same product.
  optional string gpc_title = 8;

  // Category data of this product.
  optional CategoryData category_data = 9;

  // Lowest and highest price offers.
  repeated PriceSummary price_summary = 10;

  // The price display recommendation.
  optional PriceDisplayRecommendation price_display_recommendation = 11;

  // Aggregate reviews for the product.
  optional ProductReviews product_reviews = 12;
}

message PriceSummary {
  // The condition of the offers considered in the price summary.
  enum ProductOfferCondition {
    CONDITION_UNKNOWN = 0;
    // The offers are any condition.
    CONDITION_ANY = 1;
    // The offers are all new products.
    CONDITION_NEW = 2;
  }

  // The condition of the offers in this summary.
  optional ProductOfferCondition condition = 1;

  // The lowest price offer.
  optional ProductPrice lowest_price = 2;

  // The highest price offer.
  optional ProductPrice highest_price = 3;

  // Whether this is the preferred price summary in this list.
  optional bool is_preferred = 4;
}

message ProductPriceUpdate {
  // Docid of the offer represented by this update.
  optional fixed64 offer_id = 1;

  // Old price as seen on the shopping backend.
  optional ProductPrice old_price = 2;

  // New price as seen on the shopping backend.
  optional ProductPrice new_price = 3;
}

message ProductPrice {
  // Code for the currency e.g. USD.
  optional string currency_code = 1;

  // Price in micros.
  optional int64 amount_micros = 2;
}

message ProductReviews {
  // The number of reviews for the product.
  optional int32 review_count = 1;

  // The average rating of the product.
  optional float average_rating = 2;
}

// TODO(crbug.com/40251440) Remove PriceDropNotificationPayload
// from chrome/browser/commerce/price_tracking/proto/notifications.proto
// and migrate usages of PriceDropNotificationPayload from chrome/browser
// to here in components.
message PriceDropNotificationPayload {
  optional string product_name = 1;
  optional uint64 offer_id = 2;
  optional string destination_url = 3;
  optional ProductPrice current_price = 4;
  optional ProductPrice previous_price = 5;
  optional uint64 product_cluster_id = 6;
}