syntax = "proto3";
package code.justin.tv.revenue.ripley;
option go_package = "riptwirp";
import "google/protobuf/timestamp.proto";

// Ripley server return user's payout type
service Ripley {
    // Get a payout type for user
    rpc GetPayoutType (GetPayoutTypeRequest) returns (GetPayoutTypeResponse);
    // Get a payout type for users
    rpc BatchGetPayoutType (BatchGetPayoutTypeRequest) returns (BatchGetPayoutTypeResponse);
    // Check if user is ValidatedNonPartner
    rpc GetValidatedNonPartnerStatus (ValidatedNonPartnerRequest) returns (GetValidatedNonPartnerResponse);
    // Delete user from ValidatedNonPartner table
    rpc DeleteValidatedNonPartnerStatus (ValidatedNonPartnerRequest) returns (EditValidatedNonPartnerResponse);
    // Add user to ValidatedNonPartner table
    rpc AddValidatedNonPartnerStatus (ValidatedNonPartnerRequest) returns (EditValidatedNonPartnerResponse);
}

//Get payout type request
message GetPayoutTypeRequest {
    //channel_id
    string channel_id = 1;
}

//Batch get payout type request
message BatchGetPayoutTypeRequest {
    //a list of channel_id to look up
    repeated string channel_ids = 1;
}

// Validated Non Partner request
message ValidatedNonPartnerRequest {
    //channel_id
    string channel_id = 1;
}

// Payout Type
message PayoutType {
    //channel_id
    string channel_id = 1;
    //whether user is affiliate or not
    bool is_affiliate = 2;
    //whether user is partner or not
    bool is_partner = 3;
    //whether user is developer or not
    bool is_developer = 4;
    //category of this user which can be affiliate or partner
    string category = 5;
    //developer category of this user which can be developer
    string developer_category = 6;
    //additional information regarding the user payout type, return only when users owned channel or calling batch get
    repeated string tags = 7;
}

//Get payout type response
message GetPayoutTypeResponse {
    PayoutType payout_type = 1;
}

//Batch get payout type response
message BatchGetPayoutTypeResponse {
    //user payout types keyed by channel_id
    map<string, PayoutType> payout_types = 1;
}

message GetValidatedNonPartnerResponse {
    // The channel ID
    string channel_id = 1;
    // The date that user was marked as ValidatedNonPartner
    google.protobuf.Timestamp timestamp = 2;
    // Whether the user is a ValidatedNonPartner
    bool is_validated_non_partner = 3;
}

message EditValidatedNonPartnerResponse {
}
