Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
repp_backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julieta Dubra Raimunde
repp_backend
Commits
f5352887
Commit
f5352887
authored
3 years ago
by
Agustin
Browse files
Options
Downloads
Patches
Plain Diff
Height input in xlsx now converts to weight
parent
d441d26d
No related branches found
No related tags found
No related merge requests found
Pipeline
#16180
passed with stage
Stage: test
in 1 minute and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Services/SheetService.ts
+3
-21
3 additions, 21 deletions
src/Services/SheetService.ts
with
3 additions
and
21 deletions
src/Services/SheetService.ts
+
3
−
21
View file @
f5352887
...
...
@@ -3,25 +3,9 @@ import { SheetNames } from '../Config/Constants';
import
AgeGroupJSON
from
'
../DTOs/AgeGroupJSON
'
;
import
Sex
from
'
../Enum/Sex
'
;
import
{
SheetParserResponse
,
Menores
,
Mayores
,
MenoresSheet
,
MayoresSheet
,
Menores
,
Mayores
,
MenoresSheet
,
MayoresSheet
,
}
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
res
:
Mayores
[]
=
[];
const
ref
=
worksheet
[
'
!ref
'
];
...
...
@@ -200,8 +184,7 @@ const parseSheetService = (data: Buffer): AgeGroupJSON[] => {
let
peso
;
if
(
!
item
.
peso
)
{
if
(
!
item
.
talla
)
{
throw
new
Error
(
'
Talla and Peso not defined
'
);
}
// ParameterService. TODO:
peso
=
0
;
peso
=
22
*
(
item
.
talla
/
100
)
**
2
;
}
else
{
peso
=
item
.
peso
;
}
...
...
@@ -230,8 +213,7 @@ const parseSheetService = (data: Buffer): AgeGroupJSON[] => {
let
peso
;
if
(
!
item
.
peso
)
{
if
(
!
item
.
talla
)
{
throw
new
Error
(
'
Talla and Peso not defined
'
);
}
// ParameterService. TODO:
peso
=
0
;
peso
=
22
*
(
item
.
talla
/
100
)
**
2
;
}
else
{
peso
=
item
.
peso
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment