+ aml_officer_setup

This commit is contained in:
swrup 2025-12-21 19:11:45 +01:00
parent ef0a51c166
commit 4f27ad4d6d
2 changed files with 43 additions and 16 deletions

View file

@ -733,10 +733,10 @@ end
module AmlOfficerSetup = struct module AmlOfficerSetup = struct
type t = { type t = {
officer_pub: EddsaPublicKey.t; officer_pub: EddsaPublicKey.t;
master_sig: MasterAmlOfficerStatus.t;
officer_name: string; officer_name: string;
is_active: bool; is_active: bool;
read_only: bool; read_only: bool;
master_sig: MasterAmlOfficerStatus.t;
change_date: Timestamp.t; change_date: Timestamp.t;
} }

View file

@ -308,6 +308,46 @@ module Caqti_type = struct
}) })
Caqti_type.(t6 b32 string string time amount master_sig) Caqti_type.(t6 b32 string string time amount master_sig)
let aml_officer_setup =
let master_sig = Bin_sig.MasterAmlOfficerStatus.caqti in
Caqti_type.custom
~encode:(fun
AmlOfficerSetup.
{
officer_pub;
master_sig;
officer_name;
is_active;
read_only;
change_date;
}
->
Ok
( officer_pub,
master_sig,
officer_name,
is_active,
read_only,
change_date ))
~decode:(fun
( officer_pub,
master_sig,
officer_name,
is_active,
read_only,
change_date )
->
Ok
{
officer_pub;
master_sig;
officer_name;
is_active;
read_only;
change_date;
})
Caqti_type.(t6 eddsa_pub master_sig string bool bool time)
include Caqti_request.Infix include Caqti_request.Infix
end end
@ -550,24 +590,11 @@ let insert_drain_profit =
let insert_aml_officer = let insert_aml_officer =
let exchange_do_insert_aml_officer = let exchange_do_insert_aml_officer =
let master_sig = Bin_sig.MasterAmlOfficerStatus.caqti in Caqti_type.(aml_officer_setup ->! time)
Caqti_type.(t6 eddsa_pub master_sig string bool bool time ->! time)
"SELECT out_last_change FROM exchange_do_insert_aml_officer ($1, $2, $3, \ "SELECT out_last_change FROM exchange_do_insert_aml_officer ($1, $2, $3, \
$4, $5, $6)" $4, $5, $6)"
in in
fun (module Conn : CONN) fun (module Conn : CONN) v -> Conn.find exchange_do_insert_aml_officer v
AmlOfficerSetup.
{
officer_pub;
officer_name;
is_active;
read_only;
master_sig;
change_date;
}
->
Conn.find exchange_do_insert_aml_officer
(officer_pub, master_sig, officer_name, is_active, read_only, change_date)
let insert_partner = let insert_partner =
let insert_partner = let insert_partner =