syntax = "proto3";

package com.wixpress.appservice.api.upstream.com.wix.ecom.recommendations.spi;

import "google/protobuf/wrappers.proto";
import "wix/api/annotations.proto";
import "wix/api/validations.proto";
import "wix/spi/definitions.proto";

message RecommendationsProviderConfig {
    option (.wix.api.decomposite_of) = "com.wix.ecom.recommendations.spi.RecommendationsProviderConfig";
    // URI where the application implementing the SPI is deployed.
    string deployment_uri = 1 [(.wix.spi.base_uri) = true];

    // App IDs of catalogs for which recommended items can be found.
    repeated string catalog_app_ids = 2 [(.wix.api.minSize) = 1, (.wix.api.maxSize) = 100, (.wix.api.minLength) = 1, (.wix.api.maxLength) = 36];

    reserved 3;
    // The algorithms that this application can use to calculate item recommendations.
    repeated AlgorithmConfig supported_algorithms = 4 [(.wix.api.minSize) = 1, (.wix.api.maxSize) = 100];
}

message AlgorithmConfig {
    option (.wix.api.decomposite_of) = "com.wix.ecom.recommendations.spi.AlgorithmConfig";
    reserved 1;
    // Algorithm name. This value is not translatable.
    string name = 2 [(.wix.api.minLength) = 1, (.wix.api.maxLength) = 50];
    // Algorithm description. This describes how the algorithm works and if it has any limitations regarding site content, number of items in the catalog, site traffic, and so on. This value is not translatable. 
    string description = 3 [(.wix.api.minLength) = 1, (.wix.api.maxLength) = 500];
    // A supplemental `description`. It can be used to help break up and organize information. You can, for example, display this information as a tooltip or as an additional section that is collapsed by default.
    google.protobuf.StringValue additional_info = 4 [(.wix.api.minLength) = 1, (.wix.api.maxLength) = 300];
    // Algorithms may have the following types:
    // * `RELATED_ITEMS` - This type of algorithm provides recommendations based on 1 or more other provided items. For example, when an item is added to a cart, the algorithm can suggest other items frequently bought together with that item.
    // * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.
    AlgorithmType algorithm_type = 5;
    // Algorithm ID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project.
    //flynt-disable field-type-breaking-change
    string algorithm_id = 6 [(.wix.api.format) = GUID];
}

enum AlgorithmType {
    UNSPECIFIED = 0;
    RELATED_ITEMS = 1;
    GLOBAL = 2;
}