File: cart_db_content.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 (110 lines) | stat: -rw-r--r-- 3,230 bytes parent folder | download | duplicates (8)
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
// 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 = "proto3";

option optimize_for = LITE_RUNTIME;

package cart_db;

// Represents an amount of money with its currency type.
// Next id: 4
message MoneyProto {
  // Three-letter currency code defined in ISO 4217.
  string currency_code = 1;
  // The whole units of amount.
  // e.g. for "USD", 1 unit is one US dollar.
  // This should be a int64_t, use string because base::Value does not support
  // int64_t.
  string units = 2;
  // Number of nano (10^-9) units of amount.
  // The value must be between -999,999,999 and +999,999,999 inclusive.
  // If `units` is positive, `nanos` must be positive or zero.
  // If `units` is zero, `nanos` can be positive, zero, or negative.
  // If `units` is negative, `nanos` must be negative or zero.
  // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
  int32 nanos = 3;
}

// Used storing discount for a specific rule.
// Next id: 6
message RuleDiscountInfoProto {
  // This should be a int64_t, use string because base::Value does not support
  // int64_t.
  string rule_id = 1;

  oneof discount {
    int32 percent_off = 2;
    MoneyProto amount_off = 3;
  }

  string merchant_rule_id = 4;

  string raw_merchant_offer_id = 5;
}

message CouponInfoProto {
  string promo_id = 1;
}

// Used for storing the discount information of this cart.
// Next id: 8
message ChromeCartDiscountProto {
  // String indicating the content of the discount on this cart (e.g. 15% off).
  string discount_text = 1;
  // Timestamp on the last time the discount is fetched.
  double last_fetched_timestamp = 2;

  // This should be a int64_t, use string because base::Value does not support
  // int64_t.
  string merchant_id = 3;

  reserved 4;

  repeated RuleDiscountInfoProto rule_discount_info = 5;

  bool has_coupons = 6;
  repeated CouponInfoProto coupon_info = 7;
}

// Used for storing information of products within the cart.
// Next id: 10
message ChromeCartProductProto {
  // String indicating the ID of the product. The format of IDs may vary among
  // different merchants.
  string product_id = 1;
}

// Used for storing ChromeCart Content.
message ChromeCartContentProto {
  // Original key for data.
  string key = 1;

  // Merchant name of the site that the cart belongs to.
  string merchant = 2;

  // URL that leads to the cart page.
  string merchant_cart_url = 3;

  // Timestamp that last time user interacts with this cart.
  double timestamp = 4;

  // Image URLs of products within the cart.
  repeated string product_image_urls = 5;

  // Whether the cart has been temporarily hidden. Hidden cart will be
  // re-activated when cart content changes or user visits that cart page.
  bool is_hidden = 6;

  // Whether the cart has been permanently removed. Removed cart will be deleted
  // from the database.
  bool is_removed = 7;

  // TODO(crbug.com/40181210): Rename this to cart_discount.
  // Information about current discount on the cart.
  ChromeCartDiscountProto discount_info = 8;

  // Information of products within the cart.
  repeated ChromeCartProductProto product_infos = 9;
}