Skip to content
Snippets Groups Projects
Commit f5352887 authored by Agustin's avatar Agustin
Browse files

Height input in xlsx now converts to weight

parent d441d26d
Branches master
No related tags found
No related merge requests found
Pipeline #16180 passed with stage
in 1 minute and 54 seconds
...@@ -3,25 +3,9 @@ import { SheetNames } from '../Config/Constants'; ...@@ -3,25 +3,9 @@ import { SheetNames } from '../Config/Constants';
import AgeGroupJSON from '../DTOs/AgeGroupJSON'; import AgeGroupJSON from '../DTOs/AgeGroupJSON';
import Sex from '../Enum/Sex'; import Sex from '../Enum/Sex';
import { import {
SheetParserResponse, Menores, Mayores, MenoresSheet, MayoresSheet, Menores, Mayores, MenoresSheet, MayoresSheet,
} from '../Models/SheetParserResponse'; } from '../Models/SheetParserResponse';
/* PRIVATE FUNCTIONS */
// const ec = (r: number, c: number): string => XLSX.utils.encode_cell({ r, c });
// const deleteRow = (ws: XLSX.WorkSheet, rowIndex: number): XLSX.WorkSheet => {
// const work = ws;
// if (work['!ref'] === undefined) throw new Error('An error has ocurred in deleteRow');
// const variable = XLSX.utils.decode_range(work['!ref']);
// for (let R = rowIndex; R < variable.e.r; R += 1) {
// for (let C = variable.s.c; C <= variable.e.c; C += 1) {
// work[ec(R, C)] = work[ec(R + 1, C)];
// }
// }
// variable.e.r -= 1;
// work['!ref'] = XLSX.utils.encode_range(variable.s, variable.e);
// return work;
// };
const parseAdults = (worksheet: XLSX.WorkSheet): Mayores[] => { const parseAdults = (worksheet: XLSX.WorkSheet): Mayores[] => {
const res: Mayores[] = []; const res: Mayores[] = [];
const ref = worksheet['!ref']; const ref = worksheet['!ref'];
...@@ -200,8 +184,7 @@ const parseSheetService = (data: Buffer): AgeGroupJSON[] => { ...@@ -200,8 +184,7 @@ const parseSheetService = (data: Buffer): AgeGroupJSON[] => {
let peso; let peso;
if (!item.peso) { if (!item.peso) {
if (!item.talla) { throw new Error('Talla and Peso not defined'); } if (!item.talla) { throw new Error('Talla and Peso not defined'); }
// ParameterService. TODO: peso = 22 * (item.talla / 100) ** 2;
peso = 0;
} else { } else {
peso = item.peso; peso = item.peso;
} }
...@@ -230,8 +213,7 @@ const parseSheetService = (data: Buffer): AgeGroupJSON[] => { ...@@ -230,8 +213,7 @@ const parseSheetService = (data: Buffer): AgeGroupJSON[] => {
let peso; let peso;
if (!item.peso) { if (!item.peso) {
if (!item.talla) { throw new Error('Talla and Peso not defined'); } if (!item.talla) { throw new Error('Talla and Peso not defined'); }
// ParameterService. TODO: peso = 22 * (item.talla / 100) ** 2;
peso = 0;
} else { } else {
peso = item.peso; peso = item.peso;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment