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
68a05e52
Commit
68a05e52
authored
Dec 7, 2020
by
Loïc Poullain
Browse files
Options
Downloads
Patches
Plain Diff
Update CasType interface
parent
5ab0ca28
No related branches found
No related tags found
1 merge request
!120
Use new cas type format (request and redux state)
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
redux/reducers/descriptions/ir/cas-types.ts
+18
-23
18 additions, 23 deletions
redux/reducers/descriptions/ir/cas-types.ts
with
18 additions
and
23 deletions
redux/reducers/descriptions/ir/cas-types.ts
+
18
−
23
View file @
68a05e52
import
{
transformDataToCasTypes
}
from
"
../../../../components/common/utils/transform-data-to-cas-types
"
;
// eslint-disable-next-line no-unused-vars
import
{
Action
}
from
"
../../../actions
"
;
interface
Person
{
/* All are actually booleans. */
ancienCombattant
:
number
;
chargePartagee
:
number
;
gender
:
number
;
invalide
:
number
;
isChild
:
number
;
parentIsole
:
number
;
plus65ans
:
number
;
veufVeuve
:
number
;
}
export
interface
CasType
{
// Only for frontend
name
:
string
;
// Actually a boolean.
lieuResidence
:
number
;
nbCouple
:
number
;
nbEnfants
:
number
;
persons
:
{
childs
:
Person
[];
parents
:
Person
[];
};
revenusNetMensuel
:
number
;
residence
:
"
metropole
"
|
"
GuyMay
"
|
"
GuadMarReu
"
;
revenuImposable
:
number
;
declarants
:
{
veuf
:
boolean
;
// previously named veufVeuve
retraite
:
boolean
;
// previously named plus65ans
ancienCombattant
:
boolean
;
invalide
:
boolean
;
parentIsole
:
boolean
;
// Only for frontend
gender
:
'
male
'
|
'
female
'
;
}[];
personnesACharge
:
{
invalide
:
boolean
;
chargePartagee
:
boolean
;
}[];
}
// Cet état est initialisé via "redux-cookies-middleware" dans "./pages/_app.jsx".
...
...
@@ -37,7 +32,7 @@ export const casTypes = (state: CasType[] = DEFAULT_STATE, action: Action | any)
return
[];
case
"
onInitializeCasTypes
"
:
if
(
action
.
token
)
return
state
;
return
transformDataToCasTypes
(
action
.
payload
)
;
return
action
.
payload
;
case
"
ADD_CAS_TYPE
"
:
return
[...
state
,
action
.
casType
];
case
"
UPDATE_CAS_TYPE
"
:
...
...
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