syntax = "proto3";
package EntityFrameworkDAOServices;

// --- MENSAJES MODERNOS (Con todas las columnas) ---

message ServiceInfoEF {
	int32 servicesid = 1; 
	string name = 2;
    int32 product_type_id = 3;
    string events_ids = 4;
    string description = 5;
    string form_tmplt = 6;
    bool active = 7;
    string last_update = 8; 
    int32 base_price = 9;
    string service_logo_url = 10;
    bool visible = 11;
}

message ProductTypeInfoEF {
	int32 id = 1; 
	string product_name = 2;
    string product_dsc = 3;
    bool is_available = 4;
    string steps = 5;
    string identification_key = 6;
}

// --- Request/Response para métodos Backend ---
message GetServicesByProductTypeRequest {
    int32 product_type_id = 1;
}
message GetServicesByProductTypeResponse {
    repeated ServiceInfoEF services = 1;
}

// --- Request/Response para métodos Frontend (Perfil) ---
message GetAllowedProductTypesRequest {
  int32 user_id = 1;
}
message GetAllowedProductTypesResponse {
  repeated ProductTypeInfoEF product_type = 1; 
}

message GetAllowedServicesRequest {
  int32 user_id = 1;
  int32 product_type_id = 2;
}
message GetAllowedServicesResponse {
  repeated ServiceInfoEF services = 1; 
}


// ==========================================
// SERVICIO DE CATÁLOGOS (Modernizado)
// ==========================================
service CatalogService {
    
    // Método Backend (Renombrado para evitar conflicto con legacy)
    rpc GetServicesCatalogEF (GetServicesByProductTypeRequest) returns (GetServicesByProductTypeResponse);

    // Métodos Frontend (Lógica de Perfiles)
    rpc GetAllowedProductTypes (GetAllowedProductTypesRequest) returns (GetAllowedProductTypesResponse);
    rpc GetAllowedServices (GetAllowedServicesRequest) returns (GetAllowedServicesResponse);
}
