syntax = "proto3";

package com.wixpress.appservice.api.upstream.wix.translation.schema.group.v1;
option java_package = "com.wixpress.appservice.api.upstream.wix.translation.schema.group.v1";

import "wix/api/validations.proto";
import "wix/api/entity.proto";
import "wix/api/annotations.proto";
import "google/api/annotations.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";

message SchemaGroup {
  // SchemaGroup ID. Field is read only.
  google.protobuf.StringValue id = 1 [(.wix.api.format) = GUID, (.wix.api.readOnly) = true];

  // Date and time the SchemaGroup was created. Field is read only.
  google.protobuf.Timestamp created_date = 2 [(.wix.api.readOnly) = true];

  // Date and time the SchemaGroup was last updated. Field is read only.
  google.protobuf.Timestamp updated_date = 3 [(.wix.api.readOnly) = true];

  // Name of the SchemaGroup. Max symbol length is 100. Field is translatable.
  google.protobuf.StringValue name = 4 [(.wix.api.maxLength) = 100, (.wix.api.translatable) = {name: "Group name", grouping: "Group name", type: SHORT_TEXT}];
  
  // List of Schemas.
  repeated SchemaGroupElement group_elements = 5 [(.wix.api.maxSize) = 50];
}

message SchemaGroupElement {
  option (.wix.api.decomposite_of) = "wix.translation.schema.group.v1.SchemaGroupElement";
  // ID of the Schema. If the schema group uses an element from another existing group, the reference id to that group has to be provided here.
  google.protobuf.StringValue id = 1 [(.wix.api.format) = GUID, (.wix.api.referenced_entity) = "wix.multilingual.translation.v1.schema"];
  
  // Position of the schema group element.
  google.protobuf.Int32Value position = 2;
}
