// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.shopping.merchant.inventories.v1;

import "google/api/field_behavior.proto";
import "google/shopping/type/types.proto";
import "google/type/interval.proto";

option csharp_namespace = "Google.Shopping.Merchant.Inventories.V1";
option go_package = "cloud.google.com/go/shopping/merchant/inventories/apiv1/inventoriespb;inventoriespb";
option java_multiple_files = true;
option java_outer_classname = "InventoriesCommonProto";
option java_package = "com.google.shopping.merchant.inventories.v1";
option php_namespace = "Google\\Shopping\\Merchant\\Inventories\\V1";
option ruby_package = "Google::Shopping::Merchant::Inventories::V1";

// Local inventory attributes.
message LocalInventoryAttributes {
  // [Availability](https://support.google.com/merchants/answer/3061342) of the
  // product at this store.
  enum Availability {
    // Indicates that the availability is unspecified.
    LOCAL_INVENTORY_AVAILABILITY_UNSPECIFIED = 0;

    // Indicates that the product is in stock.
    IN_STOCK = 1;

    // Indicates that the product is out of stock.
    LIMITED_AVAILABILITY = 2;

    // Indicates that the product is on display to order.
    ON_DISPLAY_TO_ORDER = 3;

    // Indicates that the product is out of stock.
    OUT_OF_STOCK = 4;
  }

  // Supported [pickup
  // method](https://support.google.com/merchants/answer/3061342) for this
  // product. Unless the value is `"not supported"`, this field must be
  // submitted together with `pickupSla`.
  enum PickupMethod {
    // Indicates that the pickup method is unspecified.
    PICKUP_METHOD_UNSPECIFIED = 0;

    // Indicates that the pickup method is Buy.
    BUY = 1;

    // Indicates that the pickup method is Reserve.
    RESERVE = 2;

    // Indicates that the pickup method is Ship to store.
    SHIP_TO_STORE = 3;

    // Indicates that the pickup method is not supported.
    NOT_SUPPORTED = 4;
  }

  // Relative time period from the order date for an order for this product,
  // from this store, to be ready for pickup. Must be submitted with
  // `pickupMethod`. See more details
  // [here](https://support.google.com/merchants/answer/3061342).
  enum PickupSla {
    // Indicates that the pickup SLA is unspecified.
    PICKUP_SLA_UNSPECIFIED = 0;

    // Indicates that the pickup SLA is same day.
    SAME_DAY = 1;

    // Indicates that the pickup SLA is next day.
    NEXT_DAY = 2;

    // Indicates that the pickup SLA is two days.
    TWO_DAY = 3;

    // Indicates that the pickup SLA is three days.
    THREE_DAY = 4;

    // Indicates that the pickup SLA is four days.
    FOUR_DAY = 5;

    // Indicates that the pickup SLA is five days.
    FIVE_DAY = 6;

    // Indicates that the pickup SLA is six days.
    SIX_DAY = 7;

    // Indicates that the pickup SLA is seven days.
    SEVEN_DAY = 8;

    // Indicates that the pickup SLA is multi-week.
    MULTI_WEEK = 9;
  }

  // Optional. Price of the product at this store.
  google.shopping.type.Price price = 1 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Sale price of the product at this store. Mandatory if
  // [`salePriceEffectiveDate`][LocalInventory.sale_price_effective_date] is
  // defined.
  google.shopping.type.Price sale_price = 2
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The `TimePeriod` of the
  // sale at this store.
  google.type.Interval sale_price_effective_date = 3
      [(google.api.field_behavior) = OPTIONAL];

  // [Availability](https://support.google.com/merchants/answer/3061342) of the
  // product at this store.
  optional Availability availability = 4;

  // Optional. Quantity of the product available at this store. Must be greater
  // than or equal to zero.
  optional int64 quantity = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Supported [pickup
  // method](https://support.google.com/merchants/answer/3061342) for this
  // product. Unless the value is `"not supported"`, this field must be
  // submitted together with `pickupSla`.
  optional PickupMethod pickup_method = 6
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Relative time period from the order date for an order for this
  // product, from this store, to be ready for pickup. Must be submitted with
  // `pickupMethod`. See more details
  // [here](https://support.google.com/merchants/answer/3061342).
  optional PickupSla pickup_sla = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Location of the product inside the store. Maximum length is 20
  // bytes.
  optional string instore_product_location = 8
      [(google.api.field_behavior) = OPTIONAL];
}

// Regional inventory attributes.
message RegionalInventoryAttributes {
  // [Availability](https://support.google.com/merchants/answer/14644124) of the
  // product in this region.
  enum Availability {
    // Indicates that the availability is unspecified.
    REGIONAL_INVENTORY_AVAILABILITY_UNSPECIFIED = 0;

    // Indicates that the product is in stock.
    IN_STOCK = 1;

    // Indicates that the product is out of stock.
    OUT_OF_STOCK = 2;
  }

  // Optional. Price of the product in this region.
  google.shopping.type.Price price = 1 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Sale price of the product in this region. Mandatory if
  // [`salePriceEffectiveDate`][RegionalInventory.sale_price_effective_date] is
  // defined.
  google.shopping.type.Price sale_price = 2
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The `TimePeriod` of the
  // sale price in this region.
  google.type.Interval sale_price_effective_date = 3
      [(google.api.field_behavior) = OPTIONAL];

  // Optional.
  // [Availability](https://support.google.com/merchants/answer/14644124) of the
  // product in this region.
  optional Availability availability = 4
      [(google.api.field_behavior) = OPTIONAL];
}
