2022-03-09 12:43:17 +03:00
|
|
|
(* This file is part of the French law library, a collection of functions for
|
|
|
|
computing French taxes and benefits derived from Catala programs. Copyright
|
2022-07-22 13:34:46 +03:00
|
|
|
(C) 2021 Inria, contributor: Denis Merigoux <denis.merigoux@inria.fr>, Emile
|
|
|
|
Rolley <emile.rolley@tuta.io>
|
2021-02-01 22:09:16 +03:00
|
|
|
|
2022-03-09 12:43:17 +03:00
|
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
|
|
use this file except in compliance with the License. You may obtain a copy of
|
|
|
|
the License at
|
2021-02-01 22:09:16 +03:00
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
2022-03-09 12:43:17 +03:00
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
License for the specific language governing permissions and limitations under
|
2021-02-01 22:09:16 +03:00
|
|
|
the License. *)
|
|
|
|
|
|
|
|
open Js_of_ocaml
|
2022-07-22 13:34:46 +03:00
|
|
|
open Law_source
|
2022-07-28 15:47:42 +03:00
|
|
|
open Runtime_jsoo.Runtime
|
2022-07-22 13:34:46 +03:00
|
|
|
module AF = Allocations_familiales
|
|
|
|
module AF_web = Allocations_familiales_api_web
|
2022-07-23 19:00:04 +03:00
|
|
|
module AL = Aides_logement
|
|
|
|
module AL_web = Aides_logement_api_web
|
2022-06-16 18:24:35 +03:00
|
|
|
|
2021-02-01 22:09:16 +03:00
|
|
|
let _ =
|
|
|
|
Js.export_all
|
|
|
|
(object%js
|
2022-07-28 15:47:42 +03:00
|
|
|
val eventsManager = event_manager
|
2021-04-05 20:06:32 +03:00
|
|
|
|
|
|
|
method computeAllocationsFamiliales
|
2022-07-22 13:34:46 +03:00
|
|
|
: (AF_web.interface_allocations_familiales_in -> float) Js.callback =
|
|
|
|
Js.wrap_callback (fun interface_allocations_familiales_in ->
|
2022-07-29 18:04:34 +03:00
|
|
|
execute_or_throw_error (fun () ->
|
2022-07-28 15:47:42 +03:00
|
|
|
let result =
|
|
|
|
interface_allocations_familiales_in
|
|
|
|
|> AF_web.interface_allocations_familiales
|
|
|
|
in
|
2022-10-25 13:33:21 +03:00
|
|
|
result##.iMontantVerse))
|
2022-07-23 19:00:04 +03:00
|
|
|
|
|
|
|
method computeAidesAuLogement
|
|
|
|
: (AL_web.calculette_aides_au_logement_garde_alternee_in -> float)
|
|
|
|
Js.callback =
|
|
|
|
Js.wrap_callback (fun calculette_aides_au_logement_garde_alternee_in ->
|
2022-07-29 18:04:34 +03:00
|
|
|
execute_or_throw_error (fun () ->
|
2022-07-28 15:47:42 +03:00
|
|
|
let result =
|
|
|
|
calculette_aides_au_logement_garde_alternee_in
|
|
|
|
|> AL_web.calculette_aides_au_logement_garde_alternee
|
|
|
|
in
|
2022-10-25 13:33:21 +03:00
|
|
|
result##.aideFinale))
|
2021-02-01 22:09:16 +03:00
|
|
|
end)
|