Preview a bulk adoption
First step of the bulk adoption. Shows, with no effect, what the confirmation would take now among the open MISSING_LOCALLY divergences of a COMPLETED inventory consumption, for productType or for every type.
Providers: Lerian (PCR).
How it works
- Divergences of product types 01 and 07 split into three groups, each counted in
groups. ADOPTABLE: the holder has a single ledger account, and the divergence is adopted on it.AMBIGUOUS_ACCOUNT: the holder has several accounts. Adopt each divergence withPOST /v1/collections/agreement-divergences/{divergence_id}/adopt, naming the account.NO_LEDGER_ACCOUNT: the holder has no account.- A divergence of another product type, or of none, is in no group and stays in the queue. So is one raised only by an earlier
FAILEDattempt and not raised again by the attempt that completed the consumption. - Only the adoptable group enters the bulk adoption.
eligibleCountis the size of the adoptable group. Send it asexpectedCountin the confirmation.previewFingerprintcovers the whole adoptable group. Send it as is in the confirmation. It is the SHA-256, in lower-case hex, of the UTF-8 text<inventoryRunId>\n<productType or empty>\nfollowed by one line<divergenceId>:<accountId>\nper adoptable divergence, in increasingdivergenceIdorder.adoptCountis how many the confirmation takes now:eligibleCountup to 5,000, oldest first.itemsis a page of the group ingroup(ADOPTABLEwhen omitted), oldest first bydetectedAtand then bydivergenceId, without personal data.nextCursorfetches the next page andprevCursorthe previous one. Each is null when there is no such page.- A cursor is valid only for the same inventory,
productTypeandgroup, as the same tenant.limitmay change from one page to the next. - Only the latest
COMPLETEDconsumption can be adopted in bulk. Any other is refused withPBP-0802.
GET
Preview a bulk adoption
Path Parameters
Query Parameters
Response
OK. The preview, with the group counts and one page of items.
Fingerprint of the whole adoptable group of this preview, recomputed by the confirmation: SHA-256, in lower-case hex, of the UTF-8 text \n\n followed by one line :\n per adoptable divergence, in increasing divergenceId order. The confirmation's previewFingerprint.
Pattern:
^[0-9a-f]{64}$Example:
"9f2c4e1a7b3d5f60812a4c6e8b0d2f4a6c8e0a2b4d6f8091a3c5e7f9b1d3f5a7"

