api/enterprise/model.proto (115 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.enterprise.pb;
// Go Lang Options
option go_package = "github.com/GoogleCloudPlatform/retail-data-model/enterprise/pb";
// Java Options
option java_package = "com.google.retail.enterprise.pb";
option java_multiple_files = true;
import "google/protobuf/timestamp.proto";
import "api/common/model.proto";
import "api/enums/lang.proto";
import "api/enums/currency.proto";
import "api/enums/country.proto";
import "api/party/model.proto";
import "api/bq_table.proto";
// import "api/bq_field.proto";
message BusinessUnitGroup {
google.retail.common.pb.VersionID id = 1 [json_name = 'id'];
google.retail.enums.lang.Language primary_language = 2 [json_name = 'primary_language'];
repeated google.retail.enums.lang.Language supported_languages = 3 [json_name = 'languages'];
repeated string business_unit_ids = 4 [json_name = 'business_unit_ids'];
}
message BusinessUnit {
option (gen_bq_schema.bigquery_opts).table_name = "tbl_business_unit";
/*
* A retail outlet that sells merchandise and services through either a
* physical location, catalog, web page or other channel. It may or may not be
* identical to a Site. It may be co-located at the same Site as a
* DistributionCenter, InventoryLocation or AdministrativeCenter.
*
* TODO - Add departments and hours
*/
message RetailStore {
google.protobuf.Timestamp open_date = 1 [json_name = 'open_date'];
google.protobuf.Timestamp close_date = 2 [json_name = 'close_date'];
google.protobuf.Timestamp last_remodeled_date = 3 [json_name = 'last_remodeled_date'];
repeated google.retail.common.pb.NamedMeasure named_measures = 4 [json_name = 'named_measures'];
}
/*
* A warehouse or other storage facility that receives merchandise in bulk
* from Suppliers and supplies merchandise to RetailStores. It may be
* co-located at the same Site as a RetailStore or AdministrativeCenter.
*/
message DistributionCenter {
google.protobuf.Timestamp open_date = 1 [json_name = 'open_date'];
google.protobuf.Timestamp close_date = 2 [json_name = 'close_date'];
google.protobuf.Timestamp last_remodeled_date = 3 [json_name = 'last_remodeled_date'];
repeated google.retail.common.pb.NamedMeasure named_measures = 4 [json_name = 'named_measures'];
}
/*
* A group of offices at which the retail enterprise conducts administrative
* (non-selling) operations. May be co-located at a Site with RetailStore,
* DistributionCenter, or InventoryLocation.
*/
message AdministrationCenter {
google.protobuf.Timestamp open_date = 1 [json_name = 'open_date'];
google.protobuf.Timestamp close_date = 2 [json_name = 'close_date'];
google.protobuf.Timestamp last_remodeled_date = 3 [json_name = 'last_remodeled_date'];
repeated google.retail.common.pb.NamedMeasure named_measures = 4 [json_name = 'named_measures'];
}
google.retail.common.pb.VersionID id = 1 [json_name = 'id'];
string status = 2 [json_name = 'status'];
google.retail.enums.currency.Currency primary_currency = 3 [json_name = 'primary_currency'];
repeated google.retail.enums.currency.Currency supported_currencies = 4 [json_name = 'supported_currencies'];
google.retail.party.pb.OperationalParty operational_party = 5 [json_name = 'operational_party'];
int32 operational_capacity = 6 [json_name = 'operational_capacity'];
oneof detail {
RetailStore store = 7 [json_name = 'store'];
DistributionCenter distribution_center = 8 [json_name = 'distribution_center'];
AdministrationCenter administration_center = 9 [json_name = 'administration_center'];
}
}
/*
* A tax code is a fundamental structure for defining tax for various
* segments of the tax hierarchy. Example
* USA - Colorado
* - SALES_TAX, 0.07 [ ALL ]
* USA - Colorado - Parker
* - FOOD_TAX, 0.005, [ FOOD, BEVERAGE ]
* - CLEAN_AIR_ACT, 0.001 [ TOBACCO ]
* In this case, if a customer buys a beverage in Parker COLORADO, they will
* pay an additional 0.071 % tax on their purchase.
* If a category lowers a base tax rate, then it MUST override it.
*/
message TaxCode {
option (gen_bq_schema.bigquery_opts).table_name = "tbl_tax_code";
message Rate {
google.retail.common.pb.VersionID id = 1 [json_name = 'id'];
google.protobuf.Timestamp deleted = 2 [json_name = 'deleted'];
string name = 3 [json_name = 'name'];
string description = 4 [json_name = 'description'];
string municipality = 5 [json_name = 'municipality'];
double rate = 6 [json_name = 'rate'];
repeated string category_ids= 7 [json_name = 'category_ids'];
}
google.retail.common.pb.VersionID id = 1 [json_name = 'id'];
google.protobuf.Timestamp deleted = 2 [json_name = 'deleted'];
string name = 3 [json_name = 'name'];
string description = 4 [json_name = 'description'];
google.retail.enums.countries.Country country = 5 [json_name = 'country'];
repeated Rate rates = 6 [json_name = 'rates'];
}