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

edition = "2023";

package optimization_guide.proto;

import "components/optimization_guide/proto/features/common_quality_data.proto";

option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.components.optimization_guide.features.proto";

option java_outer_classname = "WalletablePassExtractionProto";

// DO NOT EDIT THIS FILE DIRECTLY!
//
// This file is generated in g3 and then synced to Chrome. Instead, please refer to
// http://go/chrome-mqls-onboarding (Google-internal link), and then changes will
// be synced with Chrome automatically.

message WalletablePassExtractionLoggingData {
  WalletablePassExtractionRequest request = 1 [features = { field_presence: EXPLICIT }];

  WalletablePassExtractionResponse response = 2 [features = { field_presence: EXPLICIT }];
}

message WalletablePassExtractionRequest {
  // The context of the page that the pass is on.
  PageContext page_context = 1 [features = { field_presence: EXPLICIT }];

  // The category of the pass to be extracted.
  PassCategory pass_category = 2 [features = { field_presence: EXPLICIT }];
}

message WalletablePassExtractionResponse {
  repeated WalletablePass walletable_pass = 1;
}

message WalletablePass {
  // The oneof matches the PassCategory.
  oneof pass {
    LoyaltyCard loyalty_card = 1;

    EventPass event_pass = 2;

    TransitTicket transit_ticket = 3;
  }
}

message LoyaltyCard {
  // The loyalty plan name (e.g. Walgreen Rewards).
  string plan_name = 1 [features = { field_presence: EXPLICIT }];

  // The name of the issuer (e.g. Walgreens).
  string issuer_name = 2 [features = { field_presence: EXPLICIT }];

  // The member ID of the loyalty program.
  string member_id = 3 [features = { field_presence: EXPLICIT }];
}

message EventPass {
  // The name of the event, such as "LA Dodgers at SF Giants".
  string event_name = 1 [features = { field_presence: EXPLICIT }];

  // The start date of the event, such as "2020-01-01".
  string event_start_date = 2 [features = { field_presence: EXPLICIT }];

  // The time when the event starts. If the event spans multiple
  // days, it should be the start time on the first day.
  string event_start_time = 3 [features = { field_presence: EXPLICIT }];

  // The time when the event ends. If the event spans multiple
  // days, it should be the end time on the last day.
  string event_end_time = 4 [features = { field_presence: EXPLICIT }];

  //  A label (such as "Seat") and value for the seat number (such as
  // "1", "2", "3", or any other seat identifier).
  string seat = 5 [features = { field_presence: EXPLICIT }];

  // A label (such as "Row") and value for the row of the seat (such
  // as "1", E", "BB", or "A5").
  string row = 6 [features = { field_presence: EXPLICIT }];

  // A label (such as "Section" or "Theater") and value for the
  // section of the seat (such as "121").
  string section = 7 [features = { field_presence: EXPLICIT }];

  //  A label (such as "Gate" or "Door") and a value for the gate the
  // ticket holder should enter to get to their seat, such as "A" or "West".
  string gate = 8 [features = { field_presence: EXPLICIT }];

  // The name of the venue, such as "AT&T Park".
  string venue = 9 [features = { field_presence: EXPLICIT }];

  // The address of the event.
  string address = 10 [features = { field_presence: EXPLICIT }];

  // The name of the event pass owner.
  string owner_name = 11 [features = { field_presence: EXPLICIT }];

  // The issuer name of the event, such as "ticketmaster".
  string issuer_name = 12 [features = { field_presence: EXPLICIT }];
}

message TransitTicket {
  // The name of the issuer of the transit pass. The issuer is the name of the
  // card issuer like "Clipper", whereas the agency is the name of the transit
  // agency like "Caltrain".
  string issuer_name = 1 [features = { field_presence: EXPLICIT }];

  // The card number of the transit pass.
  string card_number = 2 [features = { field_presence: EXPLICIT }];

  // Expiration date of the transit pass.
  string date_of_expiry = 3 [features = { field_presence: EXPLICIT }];

  // The card verification code of the transit pass.
  string card_verification_code = 4 [features = { field_presence: EXPLICIT }];

  // The name of the transit pass holder.
  string owner_name = 5 [features = { field_presence: EXPLICIT }];

  // The name of the transit agency.
  string agency_name = 6 [features = { field_presence: EXPLICIT }];

  // Train or bus number of the ticket
  string vehicle_number = 7 [features = { field_presence: EXPLICIT }];

  // The seat number of the ticket.
  string seat_number = 8 [features = { field_presence: EXPLICIT }];

  // The carriage number of the ticket.
  string carriage_number = 9 [features = { field_presence: EXPLICIT }];

  // Platform of the ticket.
  string platform = 10 [features = { field_presence: EXPLICIT }];

  // The type of the ticket (e.g. "One-Way", "Round-Trip", "Monthly Pass")
  string ticket_type = 11 [features = { field_presence: EXPLICIT }];

  // How long the ticket is valid for (e.g. 1 hour, 24 hours, 1 week, etc.)
  string validity_period = 12 [features = { field_presence: EXPLICIT }];

  // The origin station or city of the ticket.
  string origin = 13 [features = { field_presence: EXPLICIT }];

  // The destination station or city of the ticket.
  string destination = 14 [features = { field_presence: EXPLICIT }];

  // The time of travel for the ticket.
  string time_of_travel = 15 [features = { field_presence: EXPLICIT }];

  // The date of travel for the ticket.
  string date_of_travel = 16 [features = { field_presence: EXPLICIT }];
}

enum PassCategory {
  PASS_CATEGORY_UNSPECIFIED = 0;

  PASS_CATEGORY_LOYALTY_CARD = 1;

  PASS_CATEGORY_EVENT_PASS = 2;

  PASS_CATEGORY_TRANSIT_TICKET = 3;
}
