Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
leximpact-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur dotations aux communes
leximpact-client
Commits
1e52e3e2
Commit
1e52e3e2
authored
Dec 8, 2020
by
Loïc Poullain
Browse files
Options
Downloads
Patches
Plain Diff
Do not include gender and name in requests
parent
6326d88f
Branches
Branches containing commit
No related tags found
1 merge request
!120
Use new cas type format (request and redux state)
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
redux/actions/api-metdata-cas-types.ts
+6
-0
6 additions, 0 deletions
redux/actions/api-metdata-cas-types.ts
redux/actions/simulations/simulate-cas-types.ts
+14
-1
14 additions, 1 deletion
redux/actions/simulations/simulate-cas-types.ts
with
20 additions
and
1 deletion
redux/actions/api-metdata-cas-types.ts
+
6
−
0
View file @
1e52e3e2
...
...
@@ -8,6 +8,12 @@ const fetchMetadataCasTypes = () => (dispatch, getState) => {
.
post
(
"
/metadata/description_cas_types
"
)
.
then
((
payload
)
=>
{
// dispatch(loadingComplete());
for
(
const
casType
of
payload
)
{
casType
.
name
=
'
Foyer fiscal type
'
;
for
(
const
declarant
of
casType
.
declarants
)
{
declarant
.
gender
=
Math
.
random
()
<
0.49
?
'
male
'
:
'
female
'
;
}
}
dispatch
({
payload
,
token
,
type
:
"
onInitializeCasTypes
"
});
})
.
catch
((
err
)
=>
{
// eslint-disable-line no-unused-vars
...
...
This diff is collapsed.
Click to expand it.
redux/actions/simulations/simulate-cas-types.ts
+
14
−
1
View file @
1e52e3e2
...
...
@@ -73,7 +73,20 @@ export const simulateCasTypes = () => (dispatch, getState) => {
const
{
descriptions
,
parameters
}
=
getState
()
as
RootState
;
const
body
=
{
description_cas_types
:
descriptions
.
ir
.
casTypes
,
description_cas_types
:
descriptions
.
ir
.
casTypes
.
map
(
casType
=>
({
// No name
residence
:
casType
.
residence
,
revenuImposable
:
casType
.
revenuImposable
,
declarants
:
casType
.
declarants
.
map
(
declarant
=>
({
veuf
:
declarant
.
veuf
,
retraite
:
declarant
.
retraite
,
ancienCombattant
:
declarant
.
ancienCombattant
,
invalide
:
declarant
.
invalide
,
parentIsole
:
declarant
.
parentIsole
,
// No gende
})),
personnesACharge
:
casType
.
personnesACharge
,
})),
reforme
:
formatReforme
(
parameters
.
amendement
),
};
...
...
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