syntax = "proto3";

import "wix/api/validations.proto";
import "wix/spi/definitions.proto";
import "google/protobuf/wrappers.proto";
import "wix/api/annotations.proto";
import "components_catalog_data/forms_spi_common/com/wixpress/appservice/api/upstream/wix/forms/v4/forms_permissions.proto";

package com.wixpress.appservice.api.upstream.wix.forms.v4;

message FormSubmissionSpiConfig {
  option (.wix.api.decomposite_of) = "wix.forms.v4.FormSubmissionSpiConfig";
  // URI where the SPI Implementer is deployed
  string deployment_uri = 1 [(.wix.spi.base_uri) = true, (.wix.api.maxLength) = 500];
  // Configuration of namespaces known by implementer
  repeated FormsSubmissionsNamespaceConfig namespace_configs = 2 [(.wix.api.maxSize) = 3];
}

message FormsSubmissionsNamespaceConfig {
  option (.wix.api.decomposite_of) = "wix.forms.v4.FormsSubmissionsNamespaceConfig";
  reserved 5, 7, 8;
  // Namespace name.
  string namespace = 1 [(.wix.api.minLength) = 10, (.wix.api.maxLength) = 50];
  // Permissions associated with this namespace.
  FormsPermissions permissions = 2;
  // Mark new submission as pending by default.
  bool pending_by_default = 3;
  // Allows to disable automatic contact insert/update on contact mapping provided.
  // On manual contact mapping enabled, the implementer is responsible for mapping the submission to a contact.
  // Out of the box GDPR support is not available for unmapped submissions with contact PII fields.
  bool manual_contact_mapping = 4;
  // Delete a PENDING submission after X days.
  google.protobuf.Int32Value delete_pending_after_days = 6 [(.wix.api.min) = 1];
}
