api/merchandise/model.proto (82 lines of code) (raw):
/* Copyright 2022 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.retail.merchandise.pb;
/*
* Go Lang Options
*/
option go_package = "github.com/GoogleCloudPlatform/retail-data-model/merchandise/pb";
/*
* Java Options
*/
option java_package = "com.google.retail.merchandise.pb";
option java_multiple_files = true;
import "api/common/model.proto";
import "api/merchandise/category.proto";
import "api/enterprise/model.proto";
import "api/enums/locale.proto";
import "api/bq_table.proto";
// import "api/bq_field.proto";
message Supplier {
google.retail.common.pb.VersionID id = 1;
string general_ledger_code = 2;
}
message ProductHeaderAttributeValue {
string category_template_attribute_rule_id = 1 [json_name = 'category_template_attribute_rule_id'];
oneof value {
double number_value = 2 [json_name = 'number_value'];
string string_value = 3 [json_name = 'string_value'];
}
}
message ProductHeader {
google.retail.enums.locale.Locale locale = 1 [json_name = 'locale'];
string brand = 2 [json_name = 'brand'];
string name = 3 [json_name = 'name'];
string short_description = 4 [json_name = 'short_description'];
string long_description = 5 [json_name = 'long_description'];
repeated string search_terms = 6 [json_name = 'search_terms'];
repeated ProductHeaderAttributeValue attribute_values = 8 [json_name = 'attribute_values'];
repeated google.retail.common.pb.Image images = 7 [json_name = 'images'];
}
message Product {
option (gen_bq_schema.bigquery_opts).table_name = "tbl_product";
google.retail.common.pb.VersionID id = 1 [json_name = "id"];
// A set of business keys used for identifying the product,
// SKU, UPC, GL Code, Lot #, etc.
repeated google.retail.common.pb.BusinessKey business_keys = 2 [json_name = "business_keys"];
string product_template_id = 11 [json_name = 'product_template_id'];
repeated ProductHeader headers = 3 [json_name = "headers"];
// The base price represents the price the product should not be sold below,
// if this occurs, this would be recorded as net loss.
google.retail.common.pb.Currency base_price = 5 [json_name = "base_price"];
// The tax code used to evaluate taxes on the product
google.retail.enterprise.pb.TaxCode tax_code = 6 [json_name = "tax_code"];
// The internal classification of a product.
repeated google.retail.merchandise.pb.Category categories = 7 [json_name = "categories"];
// A numeric double rating
double rating = 8;
// A set of measurements for a product, length, height, width, weight, etc.
repeated google.retail.common.pb.NamedMeasure measurements = 9 [json_name = "measurements"];
// Variants - are override value for the base product. For example, the primary
// color may be black, and it could have two color variants, where the red costs
// more than the white.
repeated google.retail.common.pb.VersionID variations = 10 [json_name = "variations"];
// Acceptable items to substitute with
repeated google.retail.common.pb.VersionID substitutions = 20 [json_name = "substitutions"];
// A set of affective suppliers. Changes to suppliers MUST create new versions
repeated google.retail.common.pb.VersionID related_products = 30 [json_name = "related_products"];
// of products.
repeated Supplier suppliers = 50 [json_name = 'suppliers'];
}