@runnerpro/backend 1.22.7 → 1.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/types/workout/planificacionPrueba7dias/empezarCorrer/getPlanificacionPrueba7diasEmpezarCorrer.d.ts.map +1 -1
- package/lib/cjs/types/workout/planificacionPrueba7dias/index.d.ts.map +1 -1
- package/lib/cjs/workout/planificacionPrueba7dias/empezarCorrer/getPlanificacionPrueba7diasEmpezarCorrer.js +8 -0
- package/lib/cjs/workout/planificacionPrueba7dias/index.js +17 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPlanificacionPrueba7diasEmpezarCorrer.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/empezarCorrer/getPlanificacionPrueba7diasEmpezarCorrer.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;GAK7C,CAAC;AAEF,QAAA,MAAM,4CAA4C,
|
|
1
|
+
{"version":3,"file":"getPlanificacionPrueba7diasEmpezarCorrer.d.ts","sourceRoot":"","sources":["../../../../../../src/workout/planificacionPrueba7dias/empezarCorrer/getPlanificacionPrueba7diasEmpezarCorrer.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,wCAAwC;;;;;;;;;;;;;GAK7C,CAAC;AAEF,QAAA,MAAM,4CAA4C,kBA+CjD,CAAC;AAEF,OAAO,EAAE,wCAAwC,EAAE,4CAA4C,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/workout/planificacionPrueba7dias/index.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,2BAA2B,qBAAgB,GAAG,UA+EnD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/workout/planificacionPrueba7dias/index.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,2BAA2B,qBAAgB,GAAG,UA+EnD,CAAC;AA2JF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -31,6 +31,11 @@ const changeGoalDistanceByNivelActualEmpezarCorrer = (c) => {
|
|
|
31
31
|
// insultantemente fácil que tampoco convierte (caso real: ferblanco).
|
|
32
32
|
const NIVEL_POR_DIAS_CORRE = { '3-4': 2, '5+': 3 };
|
|
33
33
|
const TECHO_POR_LESION = { duele: 1, leve: 2, prudencia: 2, recuperado: 3 };
|
|
34
|
+
// Sin aguante ni frecuencia, una MARCA real corriendo (la del objetivo o la reciente F4)
|
|
35
|
+
// acredita que no es un principiante absoluto: arranca en el intermedio. El techo por
|
|
36
|
+
// lesión sigue mandando (caso real: paloma, 5K en 25' hace 1-3 meses y "recuperado",
|
|
37
|
+
// recibía bloques de 1 minuto por declarar que hoy no corre).
|
|
38
|
+
const tieneMarcaRealCliente = Number(c.vamDuration) > 0 || (Number(c.marcaRecienteDistancia) > 0 && Number(c.marcaRecienteDuracion) > 0);
|
|
34
39
|
let nivel;
|
|
35
40
|
if (NIVEL_POR_AGUANTE[c.aguanteCorriendo] !== undefined) {
|
|
36
41
|
nivel = NIVEL_POR_AGUANTE[c.aguanteCorriendo];
|
|
@@ -38,6 +43,9 @@ const changeGoalDistanceByNivelActualEmpezarCorrer = (c) => {
|
|
|
38
43
|
else if (NIVEL_POR_DIAS_CORRE[c.diasCorreActual] !== undefined) {
|
|
39
44
|
nivel = NIVEL_POR_DIAS_CORRE[c.diasCorreActual];
|
|
40
45
|
}
|
|
46
|
+
else if (tieneMarcaRealCliente) {
|
|
47
|
+
nivel = 2;
|
|
48
|
+
}
|
|
41
49
|
else if (c.objetivoPrincipal === 'Correr después de una lesión' ||
|
|
42
50
|
c.objetivoPrincipal === 'Comenzar a correr' ||
|
|
43
51
|
Number(c.goalDistance) === -2) {
|
|
@@ -118,15 +118,29 @@ exports.getPlanificacionPrueba7dias = getPlanificacionPrueba7dias;
|
|
|
118
118
|
// las semanas siguientes; solo la primera semana arranca caminando-corriendo.
|
|
119
119
|
// 20-45 y gt45 quedan fuera: quien aguanta 20+ min seguidos ya puede rodar continuo.
|
|
120
120
|
const necesitaCaminarCorrer = (c) => ['lt5', '5-20'].includes(c.aguanteCorriendo);
|
|
121
|
+
// Vuelta de lesión de quien YA está recuperado (F7) y SIGUE corriendo (F1: 3-4 o 5+ días):
|
|
122
|
+
// el caminar-correr le queda insultantemente corto (caso real: josé, 10-25 km/sem y <1 mes
|
|
123
|
+
// parado, recibía una semana CaCos de 86' con bloques de 3'). Va a la semana continua de
|
|
124
|
+
// 10k por nivel (la misma vía que 'Entrenamiento general'); los techos F5, el espaciado de
|
|
125
|
+
// lesión y el cap de calidad del cron la modulan. El aguante bajo (necesitaCaminarCorrer)
|
|
126
|
+
// sigue mandando por delante, y 'duele'/'leve'/'prudencia' siguen en CaCos aunque corran.
|
|
127
|
+
// Solo la cohorte web trae estos campos: la app legacy no cambia.
|
|
128
|
+
const lesionRecuperadaSigueCorriendo = (c) => c.objetivoPrincipal === 'Correr después de una lesión' &&
|
|
129
|
+
c.estadoLesion === 'recuperado' &&
|
|
130
|
+
['3-4', '5+'].includes(c.diasCorreActual);
|
|
131
|
+
const vaACaminarCorrer = (c) => necesitaCaminarCorrer(c) ||
|
|
132
|
+
Number(c.goalDistance) === -2 ||
|
|
133
|
+
(['Comenzar a correr', 'Correr después de una lesión'].includes(c.objetivoPrincipal) && !lesionRecuperadaSigueCorriendo(c));
|
|
121
134
|
const changeGoalDistanceByNivelActual = (c) => {
|
|
122
|
-
if (
|
|
135
|
+
if (vaACaminarCorrer(c))
|
|
123
136
|
(0, getPlanificacionPrueba7diasEmpezarCorrer_1.changeGoalDistanceByNivelActualEmpezarCorrer)(c);
|
|
124
137
|
else if (Number(c.goalDistance) > 1 && Number(c.goalDistance) < 8000)
|
|
125
138
|
(0, getPlanificacionPrueba7dias5k_1.changeGoalDistanceByNivelActual5k)(c);
|
|
126
139
|
else if ((Number(c.goalDistance) >= 8000 && Number(c.goalDistance) < 16000) ||
|
|
127
140
|
Number(c.goalDistance) === -1 ||
|
|
128
141
|
['Entrenamiento general', 'Entrenamiento funcional'].includes(c.objetivoPrincipal) ||
|
|
129
|
-
c.goalDistanceTriatlon
|
|
142
|
+
c.goalDistanceTriatlon ||
|
|
143
|
+
lesionRecuperadaSigueCorriendo(c))
|
|
130
144
|
(0, getPlanificacionPrueba7dias10k_1.changeGoalDistanceByNivelActual10k)(c);
|
|
131
145
|
else if (Number(c.goalDistance) >= 16000 && Number(c.goalDistance) < 30000)
|
|
132
146
|
(0, getPlanificacionPrueba7dias21k_1.changeGoalDistanceByNivelActual21k)(c);
|
|
@@ -134,7 +148,7 @@ const changeGoalDistanceByNivelActual = (c) => {
|
|
|
134
148
|
(0, getPlanificacionPrueba7dias42k_1.changeGoalDistanceByNivelActual42k)(c);
|
|
135
149
|
};
|
|
136
150
|
const getWorkoutsByGoalDistance = (c) => {
|
|
137
|
-
if (
|
|
151
|
+
if (vaACaminarCorrer(c))
|
|
138
152
|
return (0, getPlanificacionPrueba7diasEmpezarCorrer_1.getPlanificacionPrueba7diasEmpezarCorrer)(c);
|
|
139
153
|
if (Number(c.goalDistance) === 5000)
|
|
140
154
|
return (0, getPlanificacionPrueba7dias5k_1.getPlanificacionPrueba7dias5k)(c);
|