mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Basic logging exposed in Javascript
Lacks value embedding though
This commit is contained in:
parent
14edecb92d
commit
eaeebba72c
6
Makefile
6
Makefile
@ -1,6 +1,8 @@
|
||||
help : Makefile
|
||||
@sed -n 's/^#> //p' $<
|
||||
|
||||
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
##########################################
|
||||
# Dependencies
|
||||
##########################################
|
||||
@ -179,7 +181,7 @@ build_french_law_library: generate_french_law_library format
|
||||
dune build $(FRENCH_LAW_LIB_DIR)/french_law.a
|
||||
|
||||
run_french_law_library_benchmark: generate_french_law_library
|
||||
dune exec $(FRENCH_LAW_LIB_DIR)/bench.exe
|
||||
dune exec --profile release $(FRENCH_LAW_LIB_DIR)/bench.exe
|
||||
|
||||
run_french_law_library_tests: generate_french_law_library
|
||||
dune exec $(FRENCH_LAW_LIB_DIR)/law_source/unit_tests/run_tests.exe
|
||||
@ -187,7 +189,7 @@ run_french_law_library_tests: generate_french_law_library
|
||||
#> build_french_law_library_js : Builds the JS version of the OCaml French law library
|
||||
build_french_law_library_js: generate_french_law_library format
|
||||
dune build --profile release $(FRENCH_LAW_LIB_DIR)/api_web.bc.js
|
||||
cp -f _build/default/$(FRENCH_LAW_LIB_DIR)/api_web.bc.js french_law_js/french_law.js
|
||||
cp -f $(ROOT_DIR)/_build/default/$(FRENCH_LAW_LIB_DIR)/api_web.bc.js $(ROOT_DIR)/french_law_js/french_law.js
|
||||
|
||||
##########################################
|
||||
# Website assets
|
||||
|
@ -25,7 +25,7 @@ champ d'application EnfantLePlusÂgé:
|
||||
|
||||
|
||||
champ d'application AllocationsFamiliales:
|
||||
définition montant_initial_majoration de enfant sous condition
|
||||
définition montant_initial_métropole_majoration de enfant sous condition
|
||||
non (droit_ouvert_majoration de enfant)
|
||||
conséquence égal à 0 €
|
||||
|
||||
|
@ -107,8 +107,6 @@ déclaration champ d'application AllocationsFamiliales:
|
||||
|
||||
# Variables liées à la base des allications familiales
|
||||
contexte droit_ouvert_base condition
|
||||
contexte montant_versé_base contenu argent
|
||||
contexte montant_avec_garde_alternée_base contenu argent
|
||||
contexte montant_initial_base contenu argent
|
||||
contexte montant_initial_base_premier_enfant contenu argent
|
||||
contexte montant_initial_base_deuxième_enfant contenu argent
|
||||
@ -116,6 +114,8 @@ déclaration champ d'application AllocationsFamiliales:
|
||||
contexte rapport_enfants_total_moyen contenu décimal
|
||||
contexte nombre_moyen_enfants contenu décimal
|
||||
contexte nombre_total_enfants contenu décimal
|
||||
contexte montant_avec_garde_alternée_base contenu argent
|
||||
contexte montant_versé_base contenu argent
|
||||
|
||||
# Variables liées à l'allocation forfaitaire
|
||||
contexte droit_ouvert_forfaitaire condition dépend de Enfant
|
||||
@ -123,16 +123,17 @@ déclaration champ d'application AllocationsFamiliales:
|
||||
|
||||
# Variables liées aux majorations des allocations familiales
|
||||
contexte droit_ouvert_majoration condition dépend de Enfant
|
||||
contexte montant_versé_majoration contenu argent
|
||||
contexte montant_avec_garde_alternée_majoration contenu argent dépend de Enfant
|
||||
contexte montant_initial_métropole_majoration contenu argent dépend de Enfant
|
||||
contexte montant_initial_majoration contenu argent dépend de Enfant
|
||||
contexte montant_avec_garde_alternée_majoration contenu argent dépend de Enfant
|
||||
contexte montant_versé_majoration contenu argent
|
||||
|
||||
# Variables liées au complément dégressif
|
||||
contexte droit_ouvert_complément condition
|
||||
contexte montant_versé_complément_pour_base_et_majoration contenu argent
|
||||
contexte montant_base_complément_pour_base_et_majoration contenu argent
|
||||
contexte montant_versé_complément_pour_forfaitaire contenu argent
|
||||
contexte complément_dégressif contenu argent dépend de argent
|
||||
contexte montant_versé_complément_pour_base_et_majoration contenu argent
|
||||
contexte montant_versé_complément_pour_forfaitaire contenu argent
|
||||
|
||||
# Sous-champs d'applications
|
||||
contexte prestations_familiales champ d'application PrestationsFamiliales
|
||||
|
@ -51,7 +51,7 @@ prestations familiales ;
|
||||
champ d'application AllocationsFamiliales sous condition
|
||||
ressources_ménage <=€ plafond_I_d521_3:
|
||||
|
||||
définition montant_initial_majoration de enfant
|
||||
définition montant_initial_métropole_majoration de enfant
|
||||
sous condition
|
||||
droit_ouvert_majoration de enfant
|
||||
conséquence égal à
|
||||
@ -92,7 +92,7 @@ champ d'application AllocationsFamiliales sous condition
|
||||
(ressources_ménage >€ plafond_I_d521_3) et
|
||||
(ressources_ménage <=€ plafond_II_d521_3):
|
||||
|
||||
définition montant_initial_majoration de enfant sous condition
|
||||
définition montant_initial_métropole_majoration de enfant sous condition
|
||||
droit_ouvert_majoration de enfant
|
||||
conséquence égal à
|
||||
prestations_familiales.base_mensuelle *€ 8 %
|
||||
@ -128,7 +128,7 @@ prestations familiales.
|
||||
champ d'application AllocationsFamiliales sous condition
|
||||
ressources_ménage >€ plafond_II_d521_3:
|
||||
|
||||
définition montant_initial_majoration de enfant sous condition
|
||||
définition montant_initial_métropole_majoration de enfant sous condition
|
||||
droit_ouvert_majoration de enfant
|
||||
conséquence égal à
|
||||
prestations_familiales.base_mensuelle *€ 4 %
|
||||
@ -354,8 +354,10 @@ champ d'application AllocationsFamiliales :
|
||||
sous condition prestations_familiales.régime_outre_mer_l751_1
|
||||
conséquence égal à âge_minimum_alinéa_1_l521_3_outre_mer de enfant
|
||||
|
||||
définition
|
||||
montant_initial_majoration de enfant
|
||||
définition montant_initial_majoration de enfant égal à
|
||||
montant_initial_métropole_majoration de enfant
|
||||
|
||||
exception définition montant_initial_majoration de enfant
|
||||
sous condition
|
||||
(droit_ouvert_majoration de enfant) et
|
||||
prestations_familiales.régime_outre_mer_l751_1 et
|
||||
|
@ -171,5 +171,26 @@ champ d'application Test8:
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 197,74€
|
||||
|
||||
déclaration champ d'application Test9:
|
||||
contexte f champ d'application InterfaceAllocationsFamiliales
|
||||
|
||||
champ d'application Test9:
|
||||
définition f.enfants égal à [EnfantEntrée {
|
||||
-- d_identifiant: 0
|
||||
-- d_date_de_naissance: |2001-07-27|
|
||||
-- d_rémuneration_mensuelle: 1258€
|
||||
-- d_prise_en_charge: ServicesSociauxAllocationVerséeAuxServicesSociaux
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
};EnfantEntrée {
|
||||
-- d_identifiant: 1
|
||||
-- d_date_de_naissance: |2008-04-27|
|
||||
-- d_rémuneration_mensuelle: 1766€
|
||||
-- d_prise_en_charge: ServicesSociauxAllocationVerséeAuxServicesSociaux
|
||||
-- d_a_déjà_ouvert_droit_aux_allocations_familiales: vrai
|
||||
}]
|
||||
définition f.ressources_ménage égal à 75786 €
|
||||
définition f.date_courante égal à |2020-05-01|
|
||||
définition f.résidence égal à Guadeloupe
|
||||
règle f.personne_charge_effective_permanente_est_parent rempli
|
||||
assertion f.montant_versé = 0€
|
||||
```
|
||||
|
@ -27,6 +27,7 @@ suite
|
||||
personneQuiAssumeLaChargeEffectivePermanenteEstParent: true,
|
||||
personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true,
|
||||
});
|
||||
Law.resetLog(true);
|
||||
})
|
||||
.on("cycle", function (event) {
|
||||
console.log(String(event.target));
|
||||
|
File diff suppressed because one or more lines are too long
@ -53,15 +53,23 @@ let log_ref : event list ref = ref []
|
||||
|
||||
let reset_log () = log_ref := []
|
||||
|
||||
let retrieve_log () = !log_ref
|
||||
let retrieve_log () = List.rev !log_ref
|
||||
|
||||
let log_begin_call _ f x = f x
|
||||
let log_begin_call info f x =
|
||||
log_ref := BeginCall info :: !log_ref;
|
||||
f x
|
||||
|
||||
let log_end_call _ x = x
|
||||
let log_end_call info x =
|
||||
log_ref := EndCall info :: !log_ref;
|
||||
x
|
||||
|
||||
let log_variable_definition _ x = x
|
||||
let log_variable_definition info x =
|
||||
log_ref := VariableDefinition info :: !log_ref;
|
||||
x
|
||||
|
||||
let log_decision_taken _ x = x
|
||||
let log_decision_taken pos x =
|
||||
if x then log_ref := DecisionTaken pos :: !log_ref;
|
||||
x
|
||||
|
||||
let money_of_cents_string (cents : string) : money = Z.of_string cents
|
||||
|
||||
|
@ -878,7 +878,7 @@ let process_def (precond : Scopelang.Ast.expr Pos.marked Bindlib.box option)
|
||||
if is_exception def then rule_name
|
||||
else
|
||||
match Desugared.Ast.ScopeDefMap.find_opt def_key scope_ctxt.default_rulemap with
|
||||
| None | Some Name_resolution.Ambiguous -> rule_name
|
||||
| None | Some (Name_resolution.Ambiguous _) -> rule_name
|
||||
| Some (Name_resolution.Unique x) -> x
|
||||
in
|
||||
let parent_rule =
|
||||
@ -888,7 +888,7 @@ let process_def (precond : Scopelang.Ast.expr Pos.marked Bindlib.box option)
|
||||
Some
|
||||
(match Desugared.Ast.ScopeDefMap.find_opt def_key scope_ctxt.default_rulemap with
|
||||
(* This should have been caught previously by check_unlabeled_exception *)
|
||||
| None | Some Name_resolution.Ambiguous -> assert false
|
||||
| None | Some (Name_resolution.Ambiguous _) -> assert false
|
||||
| Some (Name_resolution.Unique name) -> Pos.same_pos_as name def.Ast.definition_name)
|
||||
| ExceptionToLabel label ->
|
||||
Some
|
||||
@ -996,10 +996,11 @@ let check_unlabeled_exception (scope : Scopelang.Ast.ScopeName.t) (ctxt : Name_r
|
||||
| None ->
|
||||
Errors.raise_spanned_error "This exception does not have a corresponding definition"
|
||||
(Pos.get_position item)
|
||||
| Some Ambiguous ->
|
||||
Errors.raise_spanned_error
|
||||
| Some (Ambiguous pos) ->
|
||||
Errors.raise_multispanned_error
|
||||
"This exception can refer to several definitions. Try using labels to disambiguate"
|
||||
(Pos.get_position item)
|
||||
([ (Some "Ambiguous exception", Pos.get_position item) ]
|
||||
@ List.map (fun p -> (Some "Candidate definition", p)) pos)
|
||||
| Some (Unique _) -> ()))
|
||||
| Ast.Definition def -> (
|
||||
match def.definition_exception_to with
|
||||
@ -1014,10 +1015,11 @@ let check_unlabeled_exception (scope : Scopelang.Ast.ScopeName.t) (ctxt : Name_r
|
||||
| None ->
|
||||
Errors.raise_spanned_error "This exception does not have a corresponding definition"
|
||||
(Pos.get_position item)
|
||||
| Some Ambiguous ->
|
||||
Errors.raise_spanned_error
|
||||
| Some (Ambiguous pos) ->
|
||||
Errors.raise_multispanned_error
|
||||
"This exception can refer to several definitions. Try using labels to disambiguate"
|
||||
(Pos.get_position item)
|
||||
([ (Some "Ambiguous exception", Pos.get_position item) ]
|
||||
@ List.map (fun p -> (Some "Candidate definition", p)) pos)
|
||||
| Some (Unique _) -> ()))
|
||||
| _ -> ()
|
||||
|
||||
|
@ -23,7 +23,7 @@ type ident = string
|
||||
|
||||
type typ = Scopelang.Ast.typ
|
||||
|
||||
type unique_rulename = Ambiguous | Unique of Desugared.Ast.RuleName.t
|
||||
type unique_rulename = Ambiguous of Pos.t list | Unique of Desugared.Ast.RuleName.t
|
||||
|
||||
type scope_context = {
|
||||
var_idmap : Scopelang.Ast.ScopeVar.t Desugared.Ast.IdentMap.t; (** Scope variables *)
|
||||
@ -501,12 +501,23 @@ let process_rule (ctxt : context) (s_name : Scopelang.Ast.ScopeName.t) (r : Ast.
|
||||
let rulemap =
|
||||
match Desugared.Ast.ScopeDefMap.find_opt def_key scope_ctxt.default_rulemap with
|
||||
(* There was already a default definition for this key. If we need it, it is ambiguous *)
|
||||
| Some _ -> Desugared.Ast.ScopeDefMap.add def_key Ambiguous scope_ctxt.default_rulemap
|
||||
| Some old ->
|
||||
Desugared.Ast.ScopeDefMap.add def_key
|
||||
(Ambiguous
|
||||
([ Pos.get_position r.rule_name ]
|
||||
@
|
||||
match old with
|
||||
| Ambiguous old -> old
|
||||
| Unique n -> [ Pos.get_position (Desugared.Ast.RuleName.get_info n) ]))
|
||||
scope_ctxt.default_rulemap
|
||||
(* No definition has been set yet for this key *)
|
||||
| None -> (
|
||||
match r.Ast.rule_label with
|
||||
(* This default definition has a label. This is not allowed for unlabeled exceptions *)
|
||||
| Some _ -> Desugared.Ast.ScopeDefMap.add def_key Ambiguous scope_ctxt.default_rulemap
|
||||
| Some _ ->
|
||||
Desugared.Ast.ScopeDefMap.add def_key
|
||||
(Ambiguous [ Pos.get_position r.rule_name ])
|
||||
scope_ctxt.default_rulemap
|
||||
(* This is a possible default definition for this key. We create and store a fresh
|
||||
rulename *)
|
||||
| None ->
|
||||
@ -564,12 +575,23 @@ let process_definition (ctxt : context) (s_name : Scopelang.Ast.ScopeName.t) (d
|
||||
let rulemap =
|
||||
match Desugared.Ast.ScopeDefMap.find_opt def_key scope_ctxt.default_rulemap with
|
||||
(* There was already a default definition for this key. If we need it, it is ambiguous *)
|
||||
| Some _ -> Desugared.Ast.ScopeDefMap.add def_key Ambiguous scope_ctxt.default_rulemap
|
||||
| Some old ->
|
||||
Desugared.Ast.ScopeDefMap.add def_key
|
||||
(Ambiguous
|
||||
([ Pos.get_position d.definition_name ]
|
||||
@
|
||||
match old with
|
||||
| Ambiguous old -> old
|
||||
| Unique n -> [ Pos.get_position (Desugared.Ast.RuleName.get_info n) ]))
|
||||
scope_ctxt.default_rulemap
|
||||
(* No definition has been set yet for this key *)
|
||||
| None -> (
|
||||
match d.Ast.definition_label with
|
||||
(* This default definition has a label. This is not allowed for unlabeled exceptions *)
|
||||
| Some _ -> Desugared.Ast.ScopeDefMap.add def_key Ambiguous scope_ctxt.default_rulemap
|
||||
| Some _ ->
|
||||
Desugared.Ast.ScopeDefMap.add def_key
|
||||
(Ambiguous [ Pos.get_position d.definition_name ])
|
||||
scope_ctxt.default_rulemap
|
||||
(* This is a possible default definition for this key. We create and store a fresh
|
||||
rulename *)
|
||||
| None ->
|
||||
|
@ -23,7 +23,7 @@ type ident = string
|
||||
|
||||
type typ = Scopelang.Ast.typ
|
||||
|
||||
type unique_rulename = Ambiguous | Unique of Desugared.Ast.RuleName.t
|
||||
type unique_rulename = Ambiguous of Pos.t list | Unique of Desugared.Ast.RuleName.t
|
||||
|
||||
type scope_context = {
|
||||
var_idmap : Scopelang.Ast.ScopeVar.t Desugared.Ast.IdentMap.t; (** Scope variables *)
|
||||
|
@ -57,9 +57,79 @@ class type allocations_familiales_input =
|
||||
bool Js.t Js.readonly_prop
|
||||
end
|
||||
|
||||
class type source_position =
|
||||
object
|
||||
method fileName : Js.js_string Js.t Js.prop
|
||||
|
||||
method startLine : int Js.prop
|
||||
|
||||
method endLine : int Js.prop
|
||||
|
||||
method startColumn : int Js.prop
|
||||
|
||||
method endColumn : int Js.prop
|
||||
|
||||
method lawHeadings : Js.js_string Js.t Js.js_array Js.t Js.prop
|
||||
end
|
||||
|
||||
class type log_event =
|
||||
object
|
||||
method eventType : Js.js_string Js.t Js.prop
|
||||
|
||||
method information : Js.js_string Js.t Js.js_array Js.t Js.prop
|
||||
|
||||
method sourcePosition : source_position Js.t Js.optdef Js.prop
|
||||
end
|
||||
|
||||
let _ =
|
||||
Js.export_all
|
||||
(object%js
|
||||
method resetLog () : unit = reset_log ()
|
||||
|
||||
method retrieveLog () : log_event Js.t Js.js_array Js.t =
|
||||
Js.array
|
||||
(Array.of_list
|
||||
(List.map
|
||||
(fun evt ->
|
||||
object%js
|
||||
val mutable eventType =
|
||||
Js.string
|
||||
(match evt with
|
||||
| BeginCall _ -> "Begin call"
|
||||
| EndCall _ -> "End call"
|
||||
| VariableDefinition _ -> "Variable definition"
|
||||
| DecisionTaken _ -> "Decision taken")
|
||||
|
||||
val mutable information =
|
||||
Js.array
|
||||
(Array.of_list
|
||||
(match evt with
|
||||
| BeginCall info | EndCall info | VariableDefinition info ->
|
||||
List.map Js.string info
|
||||
| DecisionTaken _ -> []))
|
||||
|
||||
val mutable sourcePosition =
|
||||
match evt with
|
||||
| DecisionTaken pos ->
|
||||
Js.def
|
||||
(object%js
|
||||
val mutable fileName = Js.string pos.filename
|
||||
|
||||
val mutable startLine = pos.start_line
|
||||
|
||||
val mutable endLine = pos.end_line
|
||||
|
||||
val mutable startColumn = pos.start_column
|
||||
|
||||
val mutable endColumn = pos.end_column
|
||||
|
||||
val mutable lawHeadings =
|
||||
Js.array (Array.of_list (List.map Js.string pos.law_headings))
|
||||
end)
|
||||
| _ -> Js.undefined
|
||||
end)
|
||||
(retrieve_log ())))
|
||||
|
||||
method computeAllocationsFamiliales (input : allocations_familiales_input Js.t) : float =
|
||||
let result =
|
||||
AF.interface_allocations_familiales
|
||||
|
@ -72,9 +72,12 @@ let run_test () =
|
||||
incr num_successful;
|
||||
total_amount := Float.add !total_amount amount
|
||||
with
|
||||
| NoValueProvided ->
|
||||
Format.printf
|
||||
"No value provided somewhere!\n%a\nincome: %d\ncurrent_date: %s\nresidence: %a\n"
|
||||
| (NoValueProvided | ConflictError) as err ->
|
||||
Format.printf "%s\n%a\nincome: %d\ncurrent_date: %s\nresidence: %a\n"
|
||||
(match err with
|
||||
| NoValueProvided -> "No value provided somewhere!"
|
||||
| ConflictError -> "Conflict error!"
|
||||
| _ -> failwith "impossible")
|
||||
(Format.pp_print_list (fun fmt child ->
|
||||
Format.fprintf fmt "Child %d:\n income: %.2f\n birth date: %s\n prise en charge: %a"
|
||||
(integer_to_int child.AF.d_identifiant)
|
||||
|
@ -110,8 +110,6 @@ type allocations_familiales_out = {
|
||||
versement_out : enfant -> versement_allocations;
|
||||
montant_verse_out : money;
|
||||
droit_ouvert_base_out : bool;
|
||||
montant_verse_base_out : money;
|
||||
montant_avec_garde_alternee_base_out : money;
|
||||
montant_initial_base_out : money;
|
||||
montant_initial_base_premier_enfant_out : money;
|
||||
montant_initial_base_deuxieme_enfant_out : money;
|
||||
@ -119,17 +117,20 @@ type allocations_familiales_out = {
|
||||
rapport_enfants_total_moyen_out : decimal;
|
||||
nombre_moyen_enfants_out : decimal;
|
||||
nombre_total_enfants_out : decimal;
|
||||
montant_avec_garde_alternee_base_out : money;
|
||||
montant_verse_base_out : money;
|
||||
droit_ouvert_forfaitaire_out : enfant -> bool;
|
||||
montant_verse_forfaitaire_out : money;
|
||||
droit_ouvert_majoration_out : enfant -> bool;
|
||||
montant_verse_majoration_out : money;
|
||||
montant_avec_garde_alternee_majoration_out : enfant -> money;
|
||||
montant_initial_metropole_majoration_out : enfant -> money;
|
||||
montant_initial_majoration_out : enfant -> money;
|
||||
montant_avec_garde_alternee_majoration_out : enfant -> money;
|
||||
montant_verse_majoration_out : money;
|
||||
droit_ouvert_complement_out : bool;
|
||||
montant_verse_complement_pour_base_et_majoration_out : money;
|
||||
montant_base_complement_pour_base_et_majoration_out : money;
|
||||
montant_verse_complement_pour_forfaitaire_out : money;
|
||||
complement_degressif_out : money -> money;
|
||||
montant_verse_complement_pour_base_et_majoration_out : money;
|
||||
montant_verse_complement_pour_forfaitaire_out : money;
|
||||
nombre_enfants_l521_1_out : integer;
|
||||
age_minimum_alinea_1_l521_3_out : enfant -> integer;
|
||||
age_minimum_alinea_1_l521_3_metropole_out : enfant -> integer;
|
||||
@ -152,8 +153,6 @@ type allocations_familiales_in = {
|
||||
versement_in : unit -> enfant -> versement_allocations;
|
||||
montant_verse_in : unit -> money;
|
||||
droit_ouvert_base_in : unit -> bool;
|
||||
montant_verse_base_in : unit -> money;
|
||||
montant_avec_garde_alternee_base_in : unit -> money;
|
||||
montant_initial_base_in : unit -> money;
|
||||
montant_initial_base_premier_enfant_in : unit -> money;
|
||||
montant_initial_base_deuxieme_enfant_in : unit -> money;
|
||||
@ -161,17 +160,20 @@ type allocations_familiales_in = {
|
||||
rapport_enfants_total_moyen_in : unit -> decimal;
|
||||
nombre_moyen_enfants_in : unit -> decimal;
|
||||
nombre_total_enfants_in : unit -> decimal;
|
||||
montant_avec_garde_alternee_base_in : unit -> money;
|
||||
montant_verse_base_in : unit -> money;
|
||||
droit_ouvert_forfaitaire_in : unit -> enfant -> bool;
|
||||
montant_verse_forfaitaire_in : unit -> money;
|
||||
droit_ouvert_majoration_in : unit -> enfant -> bool;
|
||||
montant_verse_majoration_in : unit -> money;
|
||||
montant_avec_garde_alternee_majoration_in : unit -> enfant -> money;
|
||||
montant_initial_metropole_majoration_in : unit -> enfant -> money;
|
||||
montant_initial_majoration_in : unit -> enfant -> money;
|
||||
montant_avec_garde_alternee_majoration_in : unit -> enfant -> money;
|
||||
montant_verse_majoration_in : unit -> money;
|
||||
droit_ouvert_complement_in : unit -> bool;
|
||||
montant_verse_complement_pour_base_et_majoration_in : unit -> money;
|
||||
montant_base_complement_pour_base_et_majoration_in : unit -> money;
|
||||
montant_verse_complement_pour_forfaitaire_in : unit -> money;
|
||||
complement_degressif_in : unit -> money -> money;
|
||||
montant_verse_complement_pour_base_et_majoration_in : unit -> money;
|
||||
montant_verse_complement_pour_forfaitaire_in : unit -> money;
|
||||
nombre_enfants_l521_1_in : unit -> integer;
|
||||
age_minimum_alinea_1_l521_3_in : unit -> enfant -> integer;
|
||||
age_minimum_alinea_1_l521_3_metropole_in : unit -> enfant -> integer;
|
||||
@ -792,10 +794,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
in
|
||||
let montant_verse_ : unit -> money = allocations_familiales_in.montant_verse_in in
|
||||
let droit_ouvert_base_ : unit -> bool = allocations_familiales_in.droit_ouvert_base_in in
|
||||
let montant_verse_base_ : unit -> money = allocations_familiales_in.montant_verse_base_in in
|
||||
let montant_avec_garde_alternee_base_ : unit -> money =
|
||||
allocations_familiales_in.montant_avec_garde_alternee_base_in
|
||||
in
|
||||
let montant_initial_base_ : unit -> money = allocations_familiales_in.montant_initial_base_in in
|
||||
let montant_initial_base_premier_enfant_ : unit -> money =
|
||||
allocations_familiales_in.montant_initial_base_premier_enfant_in
|
||||
@ -811,6 +809,10 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
in
|
||||
let nombre_moyen_enfants_ : unit -> decimal = allocations_familiales_in.nombre_moyen_enfants_in in
|
||||
let nombre_total_enfants_ : unit -> decimal = allocations_familiales_in.nombre_total_enfants_in in
|
||||
let montant_avec_garde_alternee_base_ : unit -> money =
|
||||
allocations_familiales_in.montant_avec_garde_alternee_base_in
|
||||
in
|
||||
let montant_verse_base_ : unit -> money = allocations_familiales_in.montant_verse_base_in in
|
||||
let droit_ouvert_forfaitaire_ : unit -> enfant -> bool =
|
||||
allocations_familiales_in.droit_ouvert_forfaitaire_in
|
||||
in
|
||||
@ -820,30 +822,33 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
let droit_ouvert_majoration_ : unit -> enfant -> bool =
|
||||
allocations_familiales_in.droit_ouvert_majoration_in
|
||||
in
|
||||
let montant_verse_majoration_ : unit -> money =
|
||||
allocations_familiales_in.montant_verse_majoration_in
|
||||
in
|
||||
let montant_avec_garde_alternee_majoration_ : unit -> enfant -> money =
|
||||
allocations_familiales_in.montant_avec_garde_alternee_majoration_in
|
||||
let montant_initial_metropole_majoration_ : unit -> enfant -> money =
|
||||
allocations_familiales_in.montant_initial_metropole_majoration_in
|
||||
in
|
||||
let montant_initial_majoration_ : unit -> enfant -> money =
|
||||
allocations_familiales_in.montant_initial_majoration_in
|
||||
in
|
||||
let montant_avec_garde_alternee_majoration_ : unit -> enfant -> money =
|
||||
allocations_familiales_in.montant_avec_garde_alternee_majoration_in
|
||||
in
|
||||
let montant_verse_majoration_ : unit -> money =
|
||||
allocations_familiales_in.montant_verse_majoration_in
|
||||
in
|
||||
let droit_ouvert_complement_ : unit -> bool =
|
||||
allocations_familiales_in.droit_ouvert_complement_in
|
||||
in
|
||||
let montant_verse_complement_pour_base_et_majoration_ : unit -> money =
|
||||
allocations_familiales_in.montant_verse_complement_pour_base_et_majoration_in
|
||||
in
|
||||
let montant_base_complement_pour_base_et_majoration_ : unit -> money =
|
||||
allocations_familiales_in.montant_base_complement_pour_base_et_majoration_in
|
||||
in
|
||||
let montant_verse_complement_pour_forfaitaire_ : unit -> money =
|
||||
allocations_familiales_in.montant_verse_complement_pour_forfaitaire_in
|
||||
in
|
||||
let complement_degressif_ : unit -> money -> money =
|
||||
allocations_familiales_in.complement_degressif_in
|
||||
in
|
||||
let montant_verse_complement_pour_base_et_majoration_ : unit -> money =
|
||||
allocations_familiales_in.montant_verse_complement_pour_base_et_majoration_in
|
||||
in
|
||||
let montant_verse_complement_pour_forfaitaire_ : unit -> money =
|
||||
allocations_familiales_in.montant_verse_complement_pour_forfaitaire_in
|
||||
in
|
||||
let nombre_enfants_l521_1_ : unit -> integer =
|
||||
allocations_familiales_in.nombre_enfants_l521_1_in
|
||||
in
|
||||
@ -2542,11 +2547,11 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
else nombre_moyen_enfants_ /& nombre_total_enfants_
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_initial_majoration_ : enfant -> money =
|
||||
let montant_initial_metropole_majoration_ : enfant -> money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_initial_majoration" ]
|
||||
[ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ]
|
||||
(try
|
||||
try montant_initial_majoration_ ()
|
||||
try montant_initial_metropole_majoration_ ()
|
||||
with EmptyError -> (
|
||||
fun (param_ : enfant) ->
|
||||
try
|
||||
@ -2580,43 +2585,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
param_)))))
|
||||
then money_of_cents_string "0"
|
||||
else raise EmptyError);
|
||||
(fun (_ : _) ->
|
||||
if
|
||||
log_decision_taken
|
||||
{
|
||||
filename = "./securite_sociale_D.catala_fr";
|
||||
start_line = 360;
|
||||
start_column = 5;
|
||||
end_line = 362;
|
||||
end_column = 71;
|
||||
law_headings =
|
||||
[
|
||||
"Article D755-5";
|
||||
"Chapitre 5 : Prestations familiales et prestations assimilées";
|
||||
"Titre 5 : Départements d'outre-mer";
|
||||
"Livre 7 : Régimes divers - Dispositions diverses";
|
||||
"Partie réglementaire - Décrets simples";
|
||||
];
|
||||
}
|
||||
(log_end_call
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration" ]
|
||||
(log_variable_definition
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ]
|
||||
(log_begin_call
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration" ]
|
||||
droit_ouvert_majoration_
|
||||
(log_variable_definition
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ]
|
||||
param_)))
|
||||
&& prestations_familiales_dot_regime_outre_mer_l751_1_
|
||||
&& array_length enfants_a_charge_droit_ouvert_prestation_familiale_
|
||||
= integer_of_string "1")
|
||||
then
|
||||
prestations_familiales_dot_base_mensuelle_
|
||||
*$
|
||||
if param_.age >=! integer_of_string "16" then decimal_of_string "0.0567"
|
||||
else decimal_of_string "0.0369"
|
||||
else raise EmptyError);
|
||||
(fun (_ : _) ->
|
||||
if
|
||||
log_decision_taken
|
||||
@ -2786,6 +2754,77 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
else money_of_cents_string "0"
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_initial_majoration_ : enfant -> money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_initial_majoration" ]
|
||||
(try
|
||||
try montant_initial_majoration_ ()
|
||||
with EmptyError -> (
|
||||
fun (param_ : enfant) ->
|
||||
try
|
||||
try
|
||||
if
|
||||
log_decision_taken
|
||||
{
|
||||
filename = "./securite_sociale_D.catala_fr";
|
||||
start_line = 362;
|
||||
start_column = 5;
|
||||
end_line = 364;
|
||||
end_column = 71;
|
||||
law_headings =
|
||||
[
|
||||
"Article D755-5";
|
||||
"Chapitre 5 : Prestations familiales et prestations assimilées";
|
||||
"Titre 5 : Départements d'outre-mer";
|
||||
"Livre 7 : Régimes divers - Dispositions diverses";
|
||||
"Partie réglementaire - Décrets simples";
|
||||
];
|
||||
}
|
||||
(log_end_call
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration" ]
|
||||
(log_variable_definition
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration"; "output" ]
|
||||
(log_begin_call
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration" ]
|
||||
droit_ouvert_majoration_
|
||||
(log_variable_definition
|
||||
[ "AllocationsFamiliales"; "droit_ouvert_majoration"; "input" ]
|
||||
param_)))
|
||||
&& prestations_familiales_dot_regime_outre_mer_l751_1_
|
||||
&& array_length enfants_a_charge_droit_ouvert_prestation_familiale_
|
||||
= integer_of_string "1")
|
||||
then
|
||||
prestations_familiales_dot_base_mensuelle_
|
||||
*$
|
||||
if param_.age >=! integer_of_string "16" then decimal_of_string "0.0567"
|
||||
else decimal_of_string "0.0369"
|
||||
else raise EmptyError
|
||||
with EmptyError ->
|
||||
log_end_call
|
||||
[ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ]
|
||||
(log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_initial_métropole_majoration"; "output" ]
|
||||
(log_begin_call
|
||||
[ "AllocationsFamiliales"; "montant_initial_métropole_majoration" ]
|
||||
montant_initial_metropole_majoration_
|
||||
(log_variable_definition
|
||||
[
|
||||
"AllocationsFamiliales";
|
||||
"montant_initial_métropole_majoration";
|
||||
"input";
|
||||
]
|
||||
param_)))
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_avec_garde_alternee_base_ : money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_avec_garde_alternée_base" ]
|
||||
(try
|
||||
try montant_avec_garde_alternee_base_ ()
|
||||
with EmptyError -> montant_initial_base_ *$ rapport_enfants_total_moyen_
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_avec_garde_alternee_majoration_ : enfant -> money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_avec_garde_alternée_majoration" ]
|
||||
@ -2823,12 +2862,14 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_avec_garde_alternee_base_ : money =
|
||||
let montant_verse_base_ : money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_avec_garde_alternée_base" ]
|
||||
[ "AllocationsFamiliales"; "montant_versé_base" ]
|
||||
(try
|
||||
try montant_avec_garde_alternee_base_ ()
|
||||
with EmptyError -> montant_initial_base_ *$ rapport_enfants_total_moyen_
|
||||
try montant_verse_base_ ()
|
||||
with EmptyError ->
|
||||
if droit_ouvert_base_ then montant_avec_garde_alternee_base_
|
||||
else money_of_cents_string "0"
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_verse_majoration_ : money =
|
||||
@ -2863,16 +2904,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
else money_of_cents_string "0"
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_verse_base_ : money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_versé_base" ]
|
||||
(try
|
||||
try montant_verse_base_ ()
|
||||
with EmptyError ->
|
||||
if droit_ouvert_base_ then montant_avec_garde_alternee_base_
|
||||
else money_of_cents_string "0"
|
||||
with EmptyError -> raise NoValueProvided)
|
||||
in
|
||||
let montant_base_complement_pour_base_et_majoration_ : money =
|
||||
log_variable_definition
|
||||
[ "AllocationsFamiliales"; "montant_base_complément_pour_base_et_majoration" ]
|
||||
@ -2939,8 +2970,6 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
versement_out = versement_;
|
||||
montant_verse_out = montant_verse_;
|
||||
droit_ouvert_base_out = droit_ouvert_base_;
|
||||
montant_verse_base_out = montant_verse_base_;
|
||||
montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_;
|
||||
montant_initial_base_out = montant_initial_base_;
|
||||
montant_initial_base_premier_enfant_out = montant_initial_base_premier_enfant_;
|
||||
montant_initial_base_deuxieme_enfant_out = montant_initial_base_deuxieme_enfant_;
|
||||
@ -2949,19 +2978,22 @@ let allocations_familiales (allocations_familiales_in : allocations_familiales_i
|
||||
rapport_enfants_total_moyen_out = rapport_enfants_total_moyen_;
|
||||
nombre_moyen_enfants_out = nombre_moyen_enfants_;
|
||||
nombre_total_enfants_out = nombre_total_enfants_;
|
||||
montant_avec_garde_alternee_base_out = montant_avec_garde_alternee_base_;
|
||||
montant_verse_base_out = montant_verse_base_;
|
||||
droit_ouvert_forfaitaire_out = droit_ouvert_forfaitaire_;
|
||||
montant_verse_forfaitaire_out = montant_verse_forfaitaire_;
|
||||
droit_ouvert_majoration_out = droit_ouvert_majoration_;
|
||||
montant_verse_majoration_out = montant_verse_majoration_;
|
||||
montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_;
|
||||
montant_initial_metropole_majoration_out = montant_initial_metropole_majoration_;
|
||||
montant_initial_majoration_out = montant_initial_majoration_;
|
||||
montant_avec_garde_alternee_majoration_out = montant_avec_garde_alternee_majoration_;
|
||||
montant_verse_majoration_out = montant_verse_majoration_;
|
||||
droit_ouvert_complement_out = droit_ouvert_complement_;
|
||||
montant_verse_complement_pour_base_et_majoration_out =
|
||||
montant_verse_complement_pour_base_et_majoration_;
|
||||
montant_base_complement_pour_base_et_majoration_out =
|
||||
montant_base_complement_pour_base_et_majoration_;
|
||||
montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_;
|
||||
complement_degressif_out = complement_degressif_;
|
||||
montant_verse_complement_pour_base_et_majoration_out =
|
||||
montant_verse_complement_pour_base_et_majoration_;
|
||||
montant_verse_complement_pour_forfaitaire_out = montant_verse_complement_pour_forfaitaire_;
|
||||
nombre_enfants_l521_1_out = nombre_enfants_l521_1_;
|
||||
age_minimum_alinea_1_l521_3_out = age_minimum_alinea_1_l521_3_;
|
||||
age_minimum_alinea_1_l521_3_metropole_out = age_minimum_alinea_1_l521_3_metropole_;
|
||||
@ -3143,8 +3175,6 @@ let interface_allocations_familiales
|
||||
versement_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_in = (fun (_ : unit) -> raise EmptyError);
|
||||
droit_ouvert_base_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_base_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_avec_garde_alternee_base_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_initial_base_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_initial_base_premier_enfant_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_initial_base_deuxieme_enfant_in = (fun (_ : unit) -> raise EmptyError);
|
||||
@ -3152,18 +3182,21 @@ let interface_allocations_familiales
|
||||
rapport_enfants_total_moyen_in = (fun (_ : unit) -> raise EmptyError);
|
||||
nombre_moyen_enfants_in = (fun (_ : unit) -> raise EmptyError);
|
||||
nombre_total_enfants_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_avec_garde_alternee_base_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_base_in = (fun (_ : unit) -> raise EmptyError);
|
||||
droit_ouvert_forfaitaire_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_forfaitaire_in = (fun (_ : unit) -> raise EmptyError);
|
||||
droit_ouvert_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_avec_garde_alternee_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_initial_metropole_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_initial_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_avec_garde_alternee_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
droit_ouvert_complement_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_base_complement_pour_base_et_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
complement_degressif_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_complement_pour_base_et_majoration_in =
|
||||
(fun (_ : unit) -> raise EmptyError);
|
||||
montant_base_complement_pour_base_et_majoration_in = (fun (_ : unit) -> raise EmptyError);
|
||||
montant_verse_complement_pour_forfaitaire_in = (fun (_ : unit) -> raise EmptyError);
|
||||
complement_degressif_in = (fun (_ : unit) -> raise EmptyError);
|
||||
nombre_enfants_l521_1_in = (fun (_ : unit) -> raise EmptyError);
|
||||
age_minimum_alinea_1_l521_3_in = (fun (_ : unit) -> raise EmptyError);
|
||||
age_minimum_alinea_1_l521_3_metropole_in = (fun (_ : unit) -> raise EmptyError);
|
||||
@ -3196,10 +3229,6 @@ let interface_allocations_familiales
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_ : money = result_.montant_verse_out in
|
||||
let allocations_familiales_dot_droit_ouvert_base_ : bool = result_.droit_ouvert_base_out in
|
||||
let allocations_familiales_dot_montant_verse_base_ : money = result_.montant_verse_base_out in
|
||||
let allocations_familiales_dot_montant_avec_garde_alternee_base_ : money =
|
||||
result_.montant_avec_garde_alternee_base_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_initial_base_ : money = result_.montant_initial_base_out in
|
||||
let allocations_familiales_dot_montant_initial_base_premier_enfant_ : money =
|
||||
result_.montant_initial_base_premier_enfant_out
|
||||
@ -3219,6 +3248,10 @@ let interface_allocations_familiales
|
||||
let allocations_familiales_dot_nombre_total_enfants_ : decimal =
|
||||
result_.nombre_total_enfants_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_avec_garde_alternee_base_ : money =
|
||||
result_.montant_avec_garde_alternee_base_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_base_ : money = result_.montant_verse_base_out in
|
||||
let allocations_familiales_dot_droit_ouvert_forfaitaire_ : enfant -> bool =
|
||||
result_.droit_ouvert_forfaitaire_out
|
||||
in
|
||||
@ -3228,30 +3261,33 @@ let interface_allocations_familiales
|
||||
let allocations_familiales_dot_droit_ouvert_majoration_ : enfant -> bool =
|
||||
result_.droit_ouvert_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_majoration_ : money =
|
||||
result_.montant_verse_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_avec_garde_alternee_majoration_ : enfant -> money =
|
||||
result_.montant_avec_garde_alternee_majoration_out
|
||||
let allocations_familiales_dot_montant_initial_metropole_majoration_ : enfant -> money =
|
||||
result_.montant_initial_metropole_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_initial_majoration_ : enfant -> money =
|
||||
result_.montant_initial_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_avec_garde_alternee_majoration_ : enfant -> money =
|
||||
result_.montant_avec_garde_alternee_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_majoration_ : money =
|
||||
result_.montant_verse_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_droit_ouvert_complement_ : bool =
|
||||
result_.droit_ouvert_complement_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_ : money =
|
||||
result_.montant_verse_complement_pour_base_et_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_base_complement_pour_base_et_majoration_ : money =
|
||||
result_.montant_base_complement_pour_base_et_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_ : money =
|
||||
result_.montant_verse_complement_pour_forfaitaire_out
|
||||
in
|
||||
let allocations_familiales_dot_complement_degressif_ : money -> money =
|
||||
result_.complement_degressif_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_complement_pour_base_et_majoration_ : money =
|
||||
result_.montant_verse_complement_pour_base_et_majoration_out
|
||||
in
|
||||
let allocations_familiales_dot_montant_verse_complement_pour_forfaitaire_ : money =
|
||||
result_.montant_verse_complement_pour_forfaitaire_out
|
||||
in
|
||||
let allocations_familiales_dot_nombre_enfants_l521_1_ : integer =
|
||||
result_.nombre_enfants_l521_1_out
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user