1044 lines
38 KiB
Go
1044 lines
38 KiB
Go
package propuesta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"regexp"
|
|
"strings"
|
|
"unicode/utf8"
|
|
)
|
|
|
|
// SystemBase es la capa 1 del prompt: 100% estable entre cotizaciones y cacheable.
|
|
// NADA dinamico puede entrar aqui — ni fechas, ni numeros de cotizacion, ni nombres
|
|
// de cliente. Un solo byte que cambie invalida el cache de las pasadas siguientes.
|
|
const SystemBase = `# QUIEN ERES
|
|
|
|
Consultor senior de digitalizacion de negocios para PyMEs mexicanas. Redactas la parte
|
|
narrativa de las propuestas de Uriel Jareth Consulting. No eres vendedor: eres
|
|
diagnosticador. Tu trabajo es explicar por que la inversion tiene sentido, nunca decidir
|
|
cuanto cuesta.
|
|
|
|
El documento que produces acompana a otro que ya existe: la cotizacion economica que el
|
|
asesor armo a mano. Ese documento manda en todo lo que sea dinero. El tuyo manda en el
|
|
porque.
|
|
|
|
# LOS PRINCIPIOS QUE NO SE NEGOCIAN
|
|
|
|
P1. NO TOCAS LOS NUMEROS. No calculas, propones ni mencionas precios, totales, IVA ni
|
|
descuentos de Uriel Jareth Consulting. Ni siquiera los ves. Para referirte a una partida usa su
|
|
refPartida (P01, P02...). El sistema inyecta los importes despues de ti.
|
|
Si escribes una cifra en pesos, solo puede ser el costo del problema DEL CLIENTE:
|
|
lo que le cuesta hoy no resolverlo. Nunca un precio nuestro.
|
|
|
|
P2. TODA AFIRMACION ES TRAZABLE. Cada cosa que digas sobre el cliente apunta a una cita
|
|
(C01...) o a un hecho (H01...). Si no tiene origen, no se escribe. No hay excepciones
|
|
y no importa lo razonable que suene.
|
|
|
|
P3. ETIQUETAS LA CERTEZA, y la diferencia importa:
|
|
- confirmado: el cliente lo dijo textualmente, o hay un dato duro.
|
|
- estimado: lo derivaste con un calculo explicito que puedes mostrar.
|
|
- por_validar: es hipotesis tuya y nadie la ha confirmado.
|
|
Presentar un estimado como confirmado es la forma mas rapida de perder una reunion:
|
|
basta que el cliente refute una cifra para que dude de todo el documento.
|
|
|
|
P4. LAS PALABRAS DEL CLIENTE SON SAGRADAS. Las citas van textuales, con sus muletillas si
|
|
hace falta. No las pulas ni les arregles la gramatica.
|
|
Bien: "se nos van los clientes porque nadie contesta el WhatsApp el fin de semana"
|
|
Mal: "oportunidades de mejora en la gestion omnicanal de la comunicacion"
|
|
|
|
P5. VENDES RESULTADO, NO HERRAMIENTA. Traduce toda capacidad tecnica a dinero, tiempo,
|
|
riesgo evitado o tranquilidad operativa.
|
|
Mal: "Configuracion de Google Ads con estructura SKAG y scripts de puja."
|
|
Bien: "Cada peso de pauta se dirige a las busquedas que si compran, en lugar de
|
|
repartirse entre terminos que solo generan clics."
|
|
|
|
P6. LO QUE NO INCLUYE VALE TANTO COMO LO QUE SI. Las exclusiones son especificas de ESTE
|
|
proyecto, sacadas de lo que se menciono en la reunion.
|
|
Mal: "No incluye servicios no mencionados."
|
|
Bien: "No incluye migrar el historico de 4 anos de pedidos que mencionaron; eso se
|
|
evalua como fase 2 cuando el sistema base este operando."
|
|
|
|
P7. LA INCERTIDUMBRE SE DECLARA, NO SE RELLENA. Si falta un dato, va a pendientes con su
|
|
etiqueta. Jamas lo inventas. Una propuesta con ocho pendientes honestos cierra mejor
|
|
que una con ocho cifras inventadas: el dia que el cliente refute un dato inventado, el
|
|
costo no lo paga el modelo, lo paga la marca.
|
|
|
|
P8. NO PROPONES SERVICIOS QUE EL ASESOR NO ELIGIO. Si detectas una necesidad que nuestro
|
|
catalogo cubre y no esta cotizada, va a notasInternas. Nunca al documento del cliente.
|
|
|
|
# EL SEMAFORO DEL DIAGNOSTICO
|
|
|
|
Cada hallazgo se clasifica por urgencia, y la clasificacion es parte del mensaje:
|
|
- rojo: problema critico. Le esta costando dinero hoy.
|
|
- ambar: area de mejora. Funciona, pero por debajo de lo que podria.
|
|
- azul: oportunidad. Algo que no esta haciendo y podria.
|
|
- verde: ventaja existente. Algo que el cliente YA hace bien.
|
|
|
|
El verde no es relleno ni cortesia: reconocer lo que el cliente hizo bien es lo que
|
|
convierte una propuesta en una conversacion entre pares en lugar de un regano. Buscalo
|
|
de verdad. Pero si no hay evidencia de alguno de los cuatro, omitelo antes que inventarlo.
|
|
|
|
# REGLAS DE CONTENIDO Y DE MARCA
|
|
|
|
1. Espanol de Mexico. Tono cercano y profesional. Tutea al cliente.
|
|
2. Prohibido el lenguaje corporativo vacio: sinergias, holistico, stakeholders,
|
|
ecosistema, disruptivo, robusto, potenciar, empoderar, solucion integral.
|
|
3. El CRM se llama Bucefalo. No menciones ningun otro CRM, por ningun motivo, aunque el
|
|
cliente haya nombrado uno en la reunion.
|
|
4. Uriel Jareth Consulting ofrece UNICAMENTE servicios digitales. Si en la reunion pidieron marketing
|
|
tradicional, impresos o diseno para imprenta, va a exclusiones aclarando que no es un
|
|
servicio de Uriel Jareth Consulting.
|
|
5. Moneda MXN, IVA 16%, facturacion CFDI. Jamas montos en dolares ni en USD.
|
|
6. No prometas resultados garantizados de mercado: ni ventas, ni posicion numero uno en
|
|
Google, ni cantidad de prospectos. Prometes entregables, procesos y metricas de
|
|
seguimiento. La palabra "garantizado" no aparece sobre resultados de mercado.
|
|
7. No prometas soporte ilimitado ni mantenimiento gratuito indefinido.
|
|
8. No incluyas nombres de empleados del cliente, sueldos, ni temas legales, laborales o de
|
|
salud. Si la reunion los toco, se omiten del documento; si el asesor debe saberlo, va a
|
|
notasInternas.
|
|
|
|
# QUE HACES CUANDO EL MATERIAL ES POBRE
|
|
|
|
Este es el caso mas importante y el que peor se suele resolver.
|
|
|
|
Si la transcripcion es corta, vaga, o no tiene una sola cifra: NO inventas para rellenar.
|
|
Produces un documento honesto — pocos hallazgos, varios marcados por_validar, montos en
|
|
null, y una lista larga y util de materiales y decisiones pendientes.
|
|
|
|
Ese documento es un exito, no un fracaso. Le dice al cliente exactamente que hace falta
|
|
para avanzar, y transfiere la responsabilidad del retraso a donde corresponde. Un hueco de
|
|
informacion declarado con claridad deja de ser un defecto y se vuelve contenido de valor.
|
|
|
|
Lo que NUNCA haces con material pobre: inventar una cifra plausible, atribuir al cliente
|
|
una frase que no dijo, o describir un dolor generico de la industria como si fuera suyo.`
|
|
|
|
// ContextoEntrada concentra la informacion humana de la cotizacion para los prompts.
|
|
type ContextoEntrada struct {
|
|
Transcripcion string
|
|
Notas string
|
|
Observaciones string
|
|
Cliente string
|
|
Empresa string
|
|
Proyecto string
|
|
}
|
|
|
|
// BloqueContexto construye la capa volatil del prompt para una cotizacion.
|
|
func BloqueContexto(e ContextoEntrada) string {
|
|
lineaCliente := "Cliente: " + e.Cliente
|
|
if strings.TrimSpace(e.Empresa) != "" {
|
|
lineaCliente += " (" + strings.TrimSpace(e.Empresa) + ")"
|
|
}
|
|
partes := []string{
|
|
lineaCliente,
|
|
"Proyecto: " + e.Proyecto,
|
|
}
|
|
if obs := strings.TrimSpace(e.Observaciones); obs != "" {
|
|
partes = append(partes, "\n## Observaciones que el asesor escribio para el cliente\n"+obs)
|
|
}
|
|
if notas := strings.TrimSpace(e.Notas); notas != "" {
|
|
partes = append(partes, "\n## Notas por partida\n"+notas)
|
|
}
|
|
if tr := strings.TrimSpace(e.Transcripcion); tr != "" {
|
|
partes = append(partes, "\n## Transcripcion de la reunion\n"+tr)
|
|
} else {
|
|
partes = append(partes, "\n## Transcripcion de la reunion\n(No se entrego transcripcion. Trabaja solo con lo de arriba, se generoso marcando por_validar, y puebla bien los pendientes.)")
|
|
}
|
|
return strings.Join(partes, "\n")
|
|
}
|
|
|
|
// MensajePaso1 arma el mensaje de usuario para la extraccion de hechos.
|
|
func MensajePaso1(e ContextoEntrada) string {
|
|
return BloqueContexto(e) + `
|
|
|
|
---
|
|
|
|
Extrae los hechos de este material y llama a registrar_hechos.
|
|
|
|
Reglas de este paso:
|
|
- Las citas van TEXTUALES. Copialas del material, no las reescribas. Si no hay nada
|
|
citable, devuelve el array vacio en vez de inventar una cita.
|
|
- Numera las citas C01, C02... y los hechos H01, H02...
|
|
- Cada hecho apunta a las citas que lo sostienen. Un hecho sin ninguna cita solo puede
|
|
ser "por_validar".
|
|
- En quienLoDijo usa el ROL ("el socio", "quien atiende el WhatsApp"), no el nombre
|
|
propio, salvo que sea el interlocutor comercial.
|
|
- Si de alguna de estas listas no hay NADA que decir, devuelvela VACIA. Un array vacio
|
|
es la respuesta correcta; no metas "N/A", "ninguno" ni un guion para rellenar.
|
|
- En redFlags anota lo que deberia preocuparle al asesor: que pidan descuento antes de
|
|
entender el alcance, que no este presente quien decide, que no haya ninguna cifra del
|
|
problema, o un "hagan todo y luego vemos".`
|
|
}
|
|
|
|
// MensajePaso2 arma el mensaje de usuario para el diagnostico.
|
|
// NUNCA incluye precios, totales ni IDs internos de base de datos (P1).
|
|
func MensajePaso2(e ContextoEntrada, hechos map[string]any, econ *EconomiaCotizacion) string {
|
|
var lineas []string
|
|
if econ != nil {
|
|
for _, p := range econ.Partidas {
|
|
lineas = append(lineas, fmt.Sprintf("- %s: %s (fase %d, pago %s)", p.Ref, p.Nombre, p.Fase, p.TipoPago))
|
|
}
|
|
}
|
|
partidas := "(ninguna)"
|
|
if len(lineas) > 0 {
|
|
partidas = strings.Join(lineas, "\n")
|
|
}
|
|
|
|
return fmt.Sprintf(`%s
|
|
|
|
## Hechos extraidos en el paso anterior
|
|
%s
|
|
|
|
## Partidas que el asesor ya eligio
|
|
%s
|
|
|
|
(Las partidas van sin precio a proposito: tu no los necesitas y no debes mencionarlos.)
|
|
|
|
---
|
|
|
|
Diagnostica y llama a registrar_diagnostico.
|
|
|
|
Reglas de este paso:
|
|
- Reformula al problema de NEGOCIO. El cliente describe sintomas ("quiero una pagina
|
|
web"); tu nombras la enfermedad ("pierden prospectos porque no tienen a donde mandarlos
|
|
desde los anuncios").
|
|
- Intenta cubrir el semaforo completo, incluido al menos un verde. Si no hay evidencia de
|
|
algun color, omitelo: es mejor un semaforo incompleto que un hallazgo inventado.
|
|
- En valorProblema, si declaras un montoAnualMXN tienes que mostrar al menos dos
|
|
factores que lo expliquen, y la aritmetica debe cuadrar: el monto es el producto o la
|
|
suma de sus factores. Cada factor lleva su propia confianza — si uno de ellos te lo
|
|
estas inventando (una tasa de conversion tipica, por ejemplo), marcalo por_validar
|
|
aunque los demas sean confirmados. Un solo factor inventado puede sostener toda la
|
|
cifra, y el asesor necesita saber cual es.
|
|
- Si NO tienes cifras para una dimension, OMITE montoAnualMXN y deja factores vacio.
|
|
No inventes factores de relleno para llenar el hueco: un array vacio dice la verdad,
|
|
"herramienta_actual=0 x canal=1" no dice nada.
|
|
- Recuerda P1: montoAnualMXN es lo que el problema le cuesta AL CLIENTE cada ano. No es
|
|
un precio de Uriel Jareth Consulting ni tiene relacion con lo que cotizamos.
|
|
- Los resultados a lograr son de negocio y medibles. "Mejorar la presencia digital" no es
|
|
un resultado; "ningun mensaje sin respuesta en mas de 24 horas" si lo es.`,
|
|
BloqueContexto(e),
|
|
marshalIndented(hechos),
|
|
partidas,
|
|
)
|
|
}
|
|
|
|
// MensajePaso3 arma el mensaje de usuario para la redaccion final.
|
|
// NUNCA incluye precios, totales ni IDs internos de base de datos (P1).
|
|
func MensajePaso3(_ ContextoEntrada, hechos map[string]any, diag map[string]any, econ *EconomiaCotizacion) string {
|
|
var lineas []string
|
|
if econ != nil {
|
|
for _, p := range econ.Partidas {
|
|
lineas = append(lineas, fmt.Sprintf("- %s: %s (fase %d, pago %s, entrega %s)", p.Ref, p.Nombre, p.Fase, p.TipoPago, p.TiempoEntrega))
|
|
}
|
|
}
|
|
partidas := "(ninguna)"
|
|
if len(lineas) > 0 {
|
|
partidas = strings.Join(lineas, "\n")
|
|
}
|
|
|
|
return fmt.Sprintf(`## Hechos
|
|
%s
|
|
|
|
## Diagnostico
|
|
%s
|
|
|
|
## Partidas a describir
|
|
%s
|
|
|
|
---
|
|
|
|
Redacta la propuesta y llama a registrar_propuesta.
|
|
|
|
Reglas de este paso:
|
|
- citaDestacadaId debe ser el ID de una cita que YA exista en los hechos de arriba. No
|
|
escribas una cita nueva ni le corrijas la gramatica: se imprime literal.
|
|
- En alcance, una entrada por cada refPartida de la lista, traducida a resultado de
|
|
negocio. No menciones importes ni plazos de pago: el sistema los inyecta.
|
|
- Cada beneficio apunta al hallazgoId que resuelve. Si un beneficio no responde a ningun
|
|
hallazgo del diagnostico, borralo: es relleno.
|
|
- Minimo una exclusion, especifica de este proyecto y sacada de lo que se menciono.
|
|
- El backlog es lo que quedo fuera y merece registrarse. Va con la etiqueta de que NO
|
|
esta comprometido en esta propuesta.
|
|
- notasInternas es lo unico que el cliente no vera. Mete ahi las red flags, lo que el
|
|
asesor deberia confirmar antes de presentar, y cualquier servicio de nuestro catalogo
|
|
que creas que aplica y no este cotizado.`,
|
|
marshalIndented(hechos),
|
|
marshalIndented(diag),
|
|
partidas,
|
|
)
|
|
}
|
|
|
|
func marshalIndented(v any) string {
|
|
b, err := json.MarshalIndent(v, "", " ")
|
|
if err != nil {
|
|
return "{}"
|
|
}
|
|
return string(b)
|
|
}
|
|
|
|
// ───────────────────── JSON Schemas de las herramientas ─────────────────────
|
|
//
|
|
// REGLA ESTRUCTURAL (P1): ningun schema declara propiedades de dinero de
|
|
// Uriel Jareth Consulting (precio, total, subtotal, iva, montoMinimo,
|
|
// tarifaHora, descuento). `montoAnualMXN` si existe y representa el costo
|
|
// anual del problema DEL CLIENTE.
|
|
|
|
// SchemaHechos devuelve el JSON Schema (sin $schema) de `registrar_hechos`.
|
|
func SchemaHechos() map[string]any {
|
|
return map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{
|
|
"citas",
|
|
"hechos",
|
|
"materialesPendientes",
|
|
"decisionesPendientes",
|
|
"mencionesFueraDeAlcance",
|
|
"redFlags",
|
|
},
|
|
"properties": map[string]any{
|
|
"citas": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 30,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"id", "textoLiteral", "quienLoDijo"},
|
|
"properties": map[string]any{
|
|
"id": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^C\d{2}$`,
|
|
"description": "El id de cita debe ser C01, C02...",
|
|
},
|
|
"textoLiteral": map[string]any{
|
|
"type": "string",
|
|
"minLength": 10,
|
|
"description": "Cita TEXTUAL del cliente, palabra por palabra. Nunca parafraseada ni corregida.",
|
|
},
|
|
"quienLoDijo": map[string]any{
|
|
"type": "string",
|
|
"description": "Rol del interlocutor comercial ('el socio', 'quien atiende el WhatsApp'). No nombres de empleados.",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"hechos": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 40,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"id", "enunciado", "confianza", "citas"},
|
|
"properties": map[string]any{
|
|
"id": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^H\d{2}$`,
|
|
"description": "El id de hecho debe ser H01, H02...",
|
|
},
|
|
"enunciado": map[string]any{
|
|
"type": "string",
|
|
"minLength": 10,
|
|
},
|
|
"confianza": map[string]any{
|
|
"type": "string",
|
|
"enum": []string{"confirmado", "estimado", "por_validar"},
|
|
},
|
|
"citas": map[string]any{
|
|
"type": "array",
|
|
"description": "IDs de las citas que sostienen este hecho.",
|
|
"items": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^C\d{2}$`,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"materialesPendientes": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 15,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"texto", "bloqueaEntrega"},
|
|
"properties": map[string]any{
|
|
"texto": map[string]any{"type": "string", "minLength": 3},
|
|
"bloqueaEntrega": map[string]any{"type": "boolean"},
|
|
},
|
|
},
|
|
},
|
|
"decisionesPendientes": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 15,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"texto", "quienDecide"},
|
|
"properties": map[string]any{
|
|
"texto": map[string]any{"type": "string", "minLength": 3},
|
|
"quienDecide": map[string]any{"type": "string"},
|
|
},
|
|
},
|
|
},
|
|
"mencionesFueraDeAlcance": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 15,
|
|
"items": map[string]any{"type": "string", "minLength": 3},
|
|
},
|
|
"redFlags": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 10,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"senal", "severidad"},
|
|
"properties": map[string]any{
|
|
"senal": map[string]any{"type": "string", "minLength": 3},
|
|
"severidad": map[string]any{"type": "string", "enum": []string{"baja", "media", "alta"}},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// SchemaDiagnostico devuelve el JSON Schema (sin $schema) de `registrar_diagnostico`.
|
|
func SchemaDiagnostico() map[string]any {
|
|
return map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"hallazgos", "valorProblema", "resultados"},
|
|
"properties": map[string]any{
|
|
"hallazgos": map[string]any{
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 12,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"id", "urgencia", "titulo", "descripcion", "confianza", "citas", "hechos"},
|
|
"properties": map[string]any{
|
|
"id": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^D\d{2}$`,
|
|
"description": "El id de hallazgo debe ser D01, D02...",
|
|
},
|
|
"urgencia": map[string]any{
|
|
"type": "string",
|
|
"enum": []string{"rojo", "ambar", "azul", "verde"},
|
|
"description": "rojo=problema critico, ambar=area de mejora, azul=oportunidad, verde=ventaja que el cliente YA tiene",
|
|
},
|
|
"titulo": map[string]any{
|
|
"type": "string",
|
|
"minLength": 3,
|
|
"maxLength": 140,
|
|
},
|
|
"descripcion": map[string]any{
|
|
"type": "string",
|
|
"minLength": 20,
|
|
},
|
|
"confianza": map[string]any{
|
|
"type": "string",
|
|
"enum": []string{"confirmado", "estimado", "por_validar"},
|
|
},
|
|
"citas": map[string]any{
|
|
"type": "array",
|
|
"items": map[string]any{"type": "string", "pattern": `^C\d{2}$`},
|
|
},
|
|
"hechos": map[string]any{
|
|
"type": "array",
|
|
"items": map[string]any{"type": "string", "pattern": `^H\d{2}$`},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"valorProblema": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"dimensiones", "notaMetodologia"},
|
|
"properties": map[string]any{
|
|
"dimensiones": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 4,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"tipo", "descripcion", "factores", "confianza", "hechos"},
|
|
"properties": map[string]any{
|
|
"tipo": map[string]any{
|
|
"type": "string",
|
|
"enum": []string{"dinero", "tiempo", "oportunidad", "error"},
|
|
},
|
|
"descripcion": map[string]any{
|
|
"type": "string",
|
|
"minLength": 10,
|
|
},
|
|
"factores": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 6,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"nombre", "valor", "confianza"},
|
|
"properties": map[string]any{
|
|
"nombre": map[string]any{"type": "string"},
|
|
"valor": map[string]any{"type": "number"},
|
|
"confianza": map[string]any{
|
|
"type": "string",
|
|
"enum": []string{"confirmado", "estimado", "por_validar"},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"montoAnualMXN": map[string]any{
|
|
"type": []string{"number", "null"},
|
|
"description": "Costo ANUAL del problema DEL CLIENTE. No es un precio de Uriel Jareth Consulting. Omitelo si no hay cifras.",
|
|
},
|
|
"confianza": map[string]any{
|
|
"type": "string",
|
|
"enum": []string{"confirmado", "estimado", "por_validar"},
|
|
},
|
|
"hechos": map[string]any{
|
|
"type": "array",
|
|
"items": map[string]any{"type": "string", "pattern": `^H\d{2}$`},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"notaMetodologia": map[string]any{
|
|
"type": "string",
|
|
"description": "Como se llego a las cifras, en una o dos frases.",
|
|
},
|
|
},
|
|
},
|
|
"resultados": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 5,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"enunciado", "metrica", "lineaBase", "periodoMedicion"},
|
|
"properties": map[string]any{
|
|
"enunciado": map[string]any{"type": "string", "minLength": 15},
|
|
"metrica": map[string]any{"type": "string"},
|
|
"lineaBase": map[string]any{"type": []string{"string", "null"}},
|
|
"periodoMedicion": map[string]any{"type": "string"},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// SchemaRedaccion devuelve el JSON Schema (sin $schema) de `registrar_propuesta`.
|
|
func SchemaRedaccion() map[string]any {
|
|
return map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{
|
|
"hero",
|
|
"citaDestacadaId",
|
|
"alcance",
|
|
"beneficios",
|
|
"exclusiones",
|
|
"backlogEvolucion",
|
|
"notasInternas",
|
|
},
|
|
"properties": map[string]any{
|
|
"hero": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"titulo", "subtitulo"},
|
|
"properties": map[string]any{
|
|
"titulo": map[string]any{"type": "string", "minLength": 5, "maxLength": 90},
|
|
"subtitulo": map[string]any{"type": "string", "minLength": 20, "maxLength": 400},
|
|
},
|
|
},
|
|
"citaDestacadaId": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^C\d{2}$`,
|
|
"description": "ID de una cita YA extraida en el paso 1. Se imprime literal; no la reescribas.",
|
|
},
|
|
"alcance": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 120,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"refPartida", "descripcionResultado"},
|
|
"properties": map[string]any{
|
|
"refPartida": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^P\d{2}$`,
|
|
"description": "Debe ser P01, P02...",
|
|
},
|
|
"descripcionResultado": map[string]any{
|
|
"type": "string",
|
|
"minLength": 20,
|
|
"description": "La partida traducida a resultado de negocio. Sin jerga tecnica y SIN mencionar importes.",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"beneficios": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 8,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"etiqueta", "texto", "hallazgoId"},
|
|
"properties": map[string]any{
|
|
"etiqueta": map[string]any{"type": "string", "minLength": 3, "maxLength": 70},
|
|
"texto": map[string]any{"type": "string", "minLength": 20},
|
|
"hallazgoId": map[string]any{
|
|
"type": "string",
|
|
"pattern": `^D\d{2}$`,
|
|
"description": "El hallazgo que este beneficio resuelve. Si no responde a ninguno, no lo incluyas.",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
"exclusiones": map[string]any{
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 10,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"texto", "razon"},
|
|
"properties": map[string]any{
|
|
"texto": map[string]any{
|
|
"type": "string",
|
|
"minLength": 15,
|
|
"description": "Especifica de ESTE proyecto, nunca generica.",
|
|
},
|
|
"razon": map[string]any{"type": "string", "minLength": 5},
|
|
},
|
|
},
|
|
},
|
|
"backlogEvolucion": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 8,
|
|
"items": map[string]any{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": []string{"problema", "momentoSugerido"},
|
|
"properties": map[string]any{
|
|
"problema": map[string]any{"type": "string", "minLength": 10},
|
|
"momentoSugerido": map[string]any{"type": "string"},
|
|
},
|
|
},
|
|
},
|
|
"notasInternas": map[string]any{
|
|
"type": "array",
|
|
"maxItems": 10,
|
|
"description": "SOLO para el asesor. Nunca se imprime en el documento del cliente.",
|
|
"items": map[string]any{"type": "string", "minLength": 5},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
// ───────────────────── Validadores de contrato por paso ─────────────────────
|
|
|
|
var (
|
|
reRefPartida = regexp.MustCompile(`^P\d{2}$`)
|
|
reIDCita = regexp.MustCompile(`^C\d{2}$`)
|
|
reIDHecho = regexp.MustCompile(`^H\d{2}$`)
|
|
reIDHallazgo = regexp.MustCompile(`^D\d{2}$`)
|
|
)
|
|
|
|
func esEnumValido(v string, permitidos ...string) bool {
|
|
for _, p := range permitidos {
|
|
if v == p {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func checkStrictKeys(m map[string]any, prefix string, allowed map[string]bool, errs *[]string) {
|
|
for k := range m {
|
|
if !allowed[k] {
|
|
*errs = append(*errs, fmt.Sprintf("%s: propiedad no declarada %q", prefix, k))
|
|
}
|
|
}
|
|
}
|
|
|
|
func reqString(m map[string]any, key, path string, minLen, maxLen int, pattern *regexp.Regexp, errs *[]string) string {
|
|
raw, ok := m[key]
|
|
if !ok || raw == nil {
|
|
*errs = append(*errs, fmt.Sprintf("%s: campo obligatorio faltante", path))
|
|
return ""
|
|
}
|
|
s, ok := raw.(string)
|
|
if !ok {
|
|
*errs = append(*errs, fmt.Sprintf("%s: debe ser texto", path))
|
|
return ""
|
|
}
|
|
n := utf8.RuneCountInString(s)
|
|
if minLen > 0 && n < minLen {
|
|
*errs = append(*errs, fmt.Sprintf("%s: longitud minima %d (tiene %d)", path, minLen, n))
|
|
}
|
|
if maxLen > 0 && n > maxLen {
|
|
*errs = append(*errs, fmt.Sprintf("%s: longitud maxima %d (tiene %d)", path, maxLen, n))
|
|
}
|
|
if pattern != nil && !pattern.MatchString(s) {
|
|
*errs = append(*errs, fmt.Sprintf("%s: formato invalido %q (esperado %s)", path, s, pattern.String()))
|
|
}
|
|
return s
|
|
}
|
|
|
|
func reqArray(m map[string]any, key, path string, minItems, maxItems int, errs *[]string) []any {
|
|
raw, ok := m[key]
|
|
if !ok || raw == nil {
|
|
*errs = append(*errs, fmt.Sprintf("%s: arreglo obligatorio faltante", path))
|
|
return nil
|
|
}
|
|
arr, ok := raw.([]any)
|
|
if !ok {
|
|
*errs = append(*errs, fmt.Sprintf("%s: debe ser un arreglo", path))
|
|
return nil
|
|
}
|
|
if minItems > 0 && len(arr) < minItems {
|
|
*errs = append(*errs, fmt.Sprintf("%s: requiere al menos %d elemento(s)", path, minItems))
|
|
}
|
|
if maxItems > 0 && len(arr) > maxItems {
|
|
*errs = append(*errs, fmt.Sprintf("%s: maximo %d elementos (tiene %d)", path, maxItems, len(arr)))
|
|
}
|
|
return arr
|
|
}
|
|
|
|
func asNumber(v any) (float64, bool) {
|
|
switch x := v.(type) {
|
|
case float64:
|
|
return x, true
|
|
case float32:
|
|
return float64(x), true
|
|
case int:
|
|
return float64(x), true
|
|
case int64:
|
|
return float64(x), true
|
|
case json.Number:
|
|
f, err := x.Float64()
|
|
return f, err == nil
|
|
default:
|
|
return 0, false
|
|
}
|
|
}
|
|
|
|
// ValidarHechos valida el resultado del paso 1 (`registrar_hechos`).
|
|
func ValidarHechos(m map[string]any) []string {
|
|
var errs []string
|
|
checkStrictKeys(m, "hechos", map[string]bool{
|
|
"citas": true, "hechos": true, "materialesPendientes": true,
|
|
"decisionesPendientes": true, "mencionesFueraDeAlcance": true, "redFlags": true,
|
|
}, &errs)
|
|
|
|
if citas := reqArray(m, "citas", "citas", 0, 30, &errs); citas != nil {
|
|
for i, item := range citas {
|
|
p := fmt.Sprintf("citas[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "id", p+".id", 1, 0, reIDCita, &errs)
|
|
reqString(obj, "textoLiteral", p+".textoLiteral", 10, 0, nil, &errs)
|
|
reqString(obj, "quienLoDijo", p+".quienLoDijo", 0, 0, nil, &errs)
|
|
}
|
|
}
|
|
|
|
if hechos := reqArray(m, "hechos", "hechos", 0, 40, &errs); hechos != nil {
|
|
for i, item := range hechos {
|
|
p := fmt.Sprintf("hechos[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "id", p+".id", 1, 0, reIDHecho, &errs)
|
|
reqString(obj, "enunciado", p+".enunciado", 10, 0, nil, &errs)
|
|
conf := reqString(obj, "confianza", p+".confianza", 1, 0, nil, &errs)
|
|
if conf != "" && !esEnumValido(conf, "confirmado", "estimado", "por_validar") {
|
|
errs = append(errs, p+".confianza: valor invalido "+conf)
|
|
}
|
|
if refs := reqArray(obj, "citas", p+".citas", 0, 0, &errs); refs != nil {
|
|
for j, r := range refs {
|
|
s, ok := r.(string)
|
|
if !ok || !reIDCita.MatchString(s) {
|
|
errs = append(errs, fmt.Sprintf("%s.citas[%d]: debe coincidir con ^C\\d{2}$", p, j))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if mats := reqArray(m, "materialesPendientes", "materialesPendientes", 0, 15, &errs); mats != nil {
|
|
for i, item := range mats {
|
|
p := fmt.Sprintf("materialesPendientes[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "texto", p+".texto", 3, 0, nil, &errs)
|
|
if _, ok := obj["bloqueaEntrega"].(bool); !ok {
|
|
errs = append(errs, p+".bloqueaEntrega: debe ser booleano")
|
|
}
|
|
}
|
|
}
|
|
|
|
if decs := reqArray(m, "decisionesPendientes", "decisionesPendientes", 0, 15, &errs); decs != nil {
|
|
for i, item := range decs {
|
|
p := fmt.Sprintf("decisionesPendientes[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "texto", p+".texto", 3, 0, nil, &errs)
|
|
reqString(obj, "quienDecide", p+".quienDecide", 0, 0, nil, &errs)
|
|
}
|
|
}
|
|
|
|
if mencs := reqArray(m, "mencionesFueraDeAlcance", "mencionesFueraDeAlcance", 0, 15, &errs); mencs != nil {
|
|
for i, item := range mencs {
|
|
s, ok := item.(string)
|
|
if !ok || utf8.RuneCountInString(s) < 3 {
|
|
errs = append(errs, fmt.Sprintf("mencionesFueraDeAlcance[%d]: debe ser texto de al menos 3 caracteres", i))
|
|
}
|
|
}
|
|
}
|
|
|
|
if flags := reqArray(m, "redFlags", "redFlags", 0, 10, &errs); flags != nil {
|
|
for i, item := range flags {
|
|
p := fmt.Sprintf("redFlags[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "senal", p+".senal", 3, 0, nil, &errs)
|
|
sev := reqString(obj, "severidad", p+".severidad", 1, 0, nil, &errs)
|
|
if sev != "" && !esEnumValido(sev, "baja", "media", "alta") {
|
|
errs = append(errs, p+".severidad: valor invalido "+sev)
|
|
}
|
|
}
|
|
}
|
|
|
|
return errs
|
|
}
|
|
|
|
// ValidarDiagnostico valida el resultado del paso 2 (`registrar_diagnostico`).
|
|
// Tolera la omision de `montoAnualMXN` (rellenando nil) igual que Zod `.default(null)`.
|
|
func ValidarDiagnostico(m map[string]any) []string {
|
|
var errs []string
|
|
checkStrictKeys(m, "diagnostico", map[string]bool{
|
|
"hallazgos": true, "valorProblema": true, "resultados": true,
|
|
}, &errs)
|
|
|
|
if hs := reqArray(m, "hallazgos", "hallazgos", 1, 12, &errs); hs != nil {
|
|
for i, item := range hs {
|
|
p := fmt.Sprintf("hallazgos[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "id", p+".id", 1, 0, reIDHallazgo, &errs)
|
|
urg := reqString(obj, "urgencia", p+".urgencia", 1, 0, nil, &errs)
|
|
if urg != "" && !esEnumValido(urg, "rojo", "ambar", "azul", "verde") {
|
|
errs = append(errs, p+".urgencia: valor invalido "+urg)
|
|
}
|
|
reqString(obj, "titulo", p+".titulo", 3, 140, nil, &errs)
|
|
reqString(obj, "descripcion", p+".descripcion", 20, 0, nil, &errs)
|
|
conf := reqString(obj, "confianza", p+".confianza", 1, 0, nil, &errs)
|
|
if conf != "" && !esEnumValido(conf, "confirmado", "estimado", "por_validar") {
|
|
errs = append(errs, p+".confianza: valor invalido "+conf)
|
|
}
|
|
if refs := reqArray(obj, "citas", p+".citas", 0, 0, &errs); refs != nil {
|
|
for j, r := range refs {
|
|
if s, ok := r.(string); !ok || !reIDCita.MatchString(s) {
|
|
errs = append(errs, fmt.Sprintf("%s.citas[%d]: debe coincidir con ^C\\d{2}$", p, j))
|
|
}
|
|
}
|
|
}
|
|
if refs := reqArray(obj, "hechos", p+".hechos", 0, 0, &errs); refs != nil {
|
|
for j, r := range refs {
|
|
if s, ok := r.(string); !ok || !reIDHecho.MatchString(s) {
|
|
errs = append(errs, fmt.Sprintf("%s.hechos[%d]: debe coincidir con ^H\\d{2}$", p, j))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
vpRaw, ok := m["valorProblema"]
|
|
if !ok || vpRaw == nil {
|
|
errs = append(errs, "valorProblema: campo obligatorio faltante")
|
|
} else if vp, ok := vpRaw.(map[string]any); !ok {
|
|
errs = append(errs, "valorProblema: debe ser un objeto")
|
|
} else {
|
|
reqString(vp, "notaMetodologia", "valorProblema.notaMetodologia", 0, 0, nil, &errs)
|
|
if dims := reqArray(vp, "dimensiones", "valorProblema.dimensiones", 0, 4, &errs); dims != nil {
|
|
for i, item := range dims {
|
|
p := fmt.Sprintf("valorProblema.dimensiones[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
tipo := reqString(obj, "tipo", p+".tipo", 1, 0, nil, &errs)
|
|
if tipo != "" && !esEnumValido(tipo, "dinero", "tiempo", "oportunidad", "error") {
|
|
errs = append(errs, p+".tipo: valor invalido "+tipo)
|
|
}
|
|
reqString(obj, "descripcion", p+".descripcion", 10, 0, nil, &errs)
|
|
conf := reqString(obj, "confianza", p+".confianza", 1, 0, nil, &errs)
|
|
if conf != "" && !esEnumValido(conf, "confirmado", "estimado", "por_validar") {
|
|
errs = append(errs, p+".confianza: valor invalido "+conf)
|
|
}
|
|
if refs := reqArray(obj, "hechos", p+".hechos", 0, 0, &errs); refs != nil {
|
|
for j, r := range refs {
|
|
if s, ok := r.(string); !ok || !reIDHecho.MatchString(s) {
|
|
errs = append(errs, fmt.Sprintf("%s.hechos[%d]: debe coincidir con ^H\\d{2}$", p, j))
|
|
}
|
|
}
|
|
}
|
|
factores := reqArray(obj, "factores", p+".factores", 0, 6, &errs)
|
|
for j, f := range factores {
|
|
fp := fmt.Sprintf("%s.factores[%d]", p, j)
|
|
fobj, ok := f.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, fp+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(fobj, "nombre", fp+".nombre", 0, 0, nil, &errs)
|
|
if _, ok := asNumber(fobj["valor"]); !ok {
|
|
errs = append(errs, fp+".valor: debe ser numerico")
|
|
}
|
|
fconf := reqString(fobj, "confianza", fp+".confianza", 1, 0, nil, &errs)
|
|
if fconf != "" && !esEnumValido(fconf, "confirmado", "estimado", "por_validar") {
|
|
errs = append(errs, fp+".confianza: valor invalido "+fconf)
|
|
}
|
|
}
|
|
|
|
rawMonto, present := obj["montoAnualMXN"]
|
|
if !present || rawMonto == nil {
|
|
obj["montoAnualMXN"] = nil
|
|
} else if _, ok := asNumber(rawMonto); !ok {
|
|
errs = append(errs, p+".montoAnualMXN: debe ser numerico o null")
|
|
} else if len(factores) < 2 {
|
|
errs = append(errs, p+".factores: Si declaras montoAnualMXN, muestra al menos 2 factores que lo expliquen.")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if res := reqArray(m, "resultados", "resultados", 0, 5, &errs); res != nil {
|
|
for i, item := range res {
|
|
p := fmt.Sprintf("resultados[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "enunciado", p+".enunciado", 15, 0, nil, &errs)
|
|
reqString(obj, "metrica", p+".metrica", 0, 0, nil, &errs)
|
|
reqString(obj, "periodoMedicion", p+".periodoMedicion", 0, 0, nil, &errs)
|
|
if rawLB, exists := obj["lineaBase"]; !exists || rawLB == nil {
|
|
obj["lineaBase"] = nil
|
|
} else if _, ok := rawLB.(string); !ok {
|
|
errs = append(errs, p+".lineaBase: debe ser texto o null")
|
|
}
|
|
}
|
|
}
|
|
|
|
return errs
|
|
}
|
|
|
|
// ValidarRedaccion valida el resultado del paso 3 (`registrar_propuesta`).
|
|
func ValidarRedaccion(m map[string]any) []string {
|
|
var errs []string
|
|
checkStrictKeys(m, "redaccion", map[string]bool{
|
|
"hero": true, "citaDestacadaId": true, "alcance": true,
|
|
"beneficios": true, "exclusiones": true, "backlogEvolucion": true, "notasInternas": true,
|
|
}, &errs)
|
|
|
|
heroRaw, ok := m["hero"]
|
|
if !ok || heroRaw == nil {
|
|
errs = append(errs, "hero: campo obligatorio faltante")
|
|
} else if hero, ok := heroRaw.(map[string]any); !ok {
|
|
errs = append(errs, "hero: debe ser un objeto")
|
|
} else {
|
|
reqString(hero, "titulo", "hero.titulo", 5, 90, nil, &errs)
|
|
reqString(hero, "subtitulo", "hero.subtitulo", 20, 400, nil, &errs)
|
|
}
|
|
|
|
reqString(m, "citaDestacadaId", "citaDestacadaId", 1, 0, reIDCita, &errs)
|
|
|
|
if alcance := reqArray(m, "alcance", "alcance", 0, 120, &errs); alcance != nil {
|
|
for i, item := range alcance {
|
|
p := fmt.Sprintf("alcance[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "refPartida", p+".refPartida", 1, 0, reRefPartida, &errs)
|
|
reqString(obj, "descripcionResultado", p+".descripcionResultado", 20, 0, nil, &errs)
|
|
}
|
|
}
|
|
|
|
if bens := reqArray(m, "beneficios", "beneficios", 0, 8, &errs); bens != nil {
|
|
for i, item := range bens {
|
|
p := fmt.Sprintf("beneficios[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "etiqueta", p+".etiqueta", 3, 70, nil, &errs)
|
|
reqString(obj, "texto", p+".texto", 20, 0, nil, &errs)
|
|
reqString(obj, "hallazgoId", p+".hallazgoId", 1, 0, reIDHallazgo, &errs)
|
|
}
|
|
}
|
|
|
|
if excls := reqArray(m, "exclusiones", "exclusiones", 1, 10, &errs); excls != nil {
|
|
for i, item := range excls {
|
|
p := fmt.Sprintf("exclusiones[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "texto", p+".texto", 15, 0, nil, &errs)
|
|
reqString(obj, "razon", p+".razon", 5, 0, nil, &errs)
|
|
}
|
|
}
|
|
|
|
if back := reqArray(m, "backlogEvolucion", "backlogEvolucion", 0, 8, &errs); back != nil {
|
|
for i, item := range back {
|
|
p := fmt.Sprintf("backlogEvolucion[%d]", i)
|
|
obj, ok := item.(map[string]any)
|
|
if !ok {
|
|
errs = append(errs, p+": debe ser un objeto")
|
|
continue
|
|
}
|
|
reqString(obj, "problema", p+".problema", 10, 0, nil, &errs)
|
|
reqString(obj, "momentoSugerido", p+".momentoSugerido", 0, 0, nil, &errs)
|
|
}
|
|
}
|
|
|
|
if notas := reqArray(m, "notasInternas", "notasInternas", 0, 10, &errs); notas != nil {
|
|
for i, item := range notas {
|
|
s, ok := item.(string)
|
|
if !ok || utf8.RuneCountInString(s) < 5 {
|
|
errs = append(errs, fmt.Sprintf("notasInternas[%d]: debe ser texto de al menos 5 caracteres", i))
|
|
}
|
|
}
|
|
}
|
|
|
|
return errs
|
|
}
|