summaryrefslogtreecommitdiff
path: root/lib/operation.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/operation.ml')
-rw-r--r--lib/operation.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/operation.ml b/lib/operation.ml
index 3c8df2a..bce6ac2 100644
--- a/lib/operation.ml
+++ b/lib/operation.ml
@@ -49,5 +49,9 @@ let decoder : transaction_op Utils.Decoder.decoder =
(fun value transaction_type description -> transaction_type { value; description })
<$> ("valor" <: int)
<*> ("tipo" <: transaction_type_decoder)
- <*> ("descricao" <: string)
+ <*> ("descricao"
+ <: (string
+ >>= fun s ->
+ let len = String.length s in
+ if len <= 10 && len >= 1 then return s else fail))
;;