From d30efc1ecab83ae9463186e15c65f46d6b3eb056 Mon Sep 17 00:00:00 2001
From: paultranvan <paul@cozycloud.cc>
Date: Fri, 15 Dec 2023 11:07:32 +0100
Subject: [PATCH] docs: Add doc about OCR attributes

---
 .../docs/papersDefinitions.md                  | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/packages/cozy-mespapiers-lib/docs/papersDefinitions.md b/packages/cozy-mespapiers-lib/docs/papersDefinitions.md
index 5cc5bc394b..fa6e82ac6f 100644
--- a/packages/cozy-mespapiers-lib/docs/papersDefinitions.md
+++ b/packages/cozy-mespapiers-lib/docs/papersDefinitions.md
@@ -31,19 +31,27 @@
 
 ## The `ocrAttributes` property:
 
+This is an array containing information for OCR attributes detection. For instance, recognize a passport number,
+an expiration date, etc.
+
+Each version of a paper is an element in the `ocrAttributes` attribute. When there are several versions, each entry must have a `version` attribute.
+
+Some papers have 2 sides: front and back. Each side is a dedicated object in the OCR definition.
+The `front` and `back` entries have exactly the same structure and attributes.
+
+
 - `version`: {string} Version of the paper (e.g. "2020.01").
 - `ìllustration`: {string} Illustration of the choice of format displayed to the user.
 - `versionLabel`: {string} Translation key for the name of the format displayed to the user.
   - `label`: {string} The discriminating label.
   - `side`: {string} Side where the label is.
-- `front`: {object} All the front panel parameters allowing you to find the information to use.
-  - `referenceRules`: {object\[]} Rules that allow you to define the version of a paper.
-    - `regex`: {string} Regex that will be tested to deduce the paper version. (e.g. "^\[A-Z]")
-    - `[flag]`: {string} Regex flag (e.g. "/gi")
-- `[back]`: {object} All the front panel parameters allowing you to find the information to use.
+- `front|back`: {object} All the front panel parameters allowing you to find the information to use.
   - `referenceRules`: {object\[]} Rules that allow you to define the version of a paper.
     - `regex`: {string} Regex that will be tested to deduce the paper version. (e.g. "^\[A-Z]")
     - `[flag]`: {string} Regex flag (e.g. "/gi")
+  - `attributesRegex`: {Array<object>} Used to find attributes based on regex rules
+  - `attributesBoxes`: {Array<object>} Used to find attributes based on bouding box coordinates
+
 
 ## Steps of the `acquisitionSteps` property: