Skip to main content
This capability is under development. It is available in homologation on Lerian Cloud, and its behavior can change before release. Confirm availability with Lerian before integration.
A source can publish a correction after Reporter generated a regulatory filing. The source then shows another version of the data that the filing read. A source version mark tells you about this. Your mapping declares which column of a table holds the version of the data. Reporter records that version with each filing that it generates. Reporter then checks the source on a schedule. When the source shows another version of the same data, Reporter adds a mark to the filing. The capability applies to regulatory filings that Reporter generates from a catalog document. Declare the source version on a query that reads a database data source. For a mapping with no declaration, Reporter records no source version and marks no filing. This page is for the engineer who writes the mapping and for the person who reviews filings.

Declare the source version


Add the key sourceVersion to a query of your mapping. The key takes two entries: This example is trimmed from the reference mapping of SCR 3040:
Write the key on a query that reads a table of a database data source. A file dataset already records the revision of each day that it delivers. The query can aggregate. Reporter reads the declared columns of the rows that the filters keep, and it ignores the aggregation. The declaration does not change what the generation reads, and it does not change the file.

What Reporter refuses when you save

Reporter refuses the mapping with HTTP 400 and the code RPT-0143 in these cases:
  • The query reads the rows of another query.
  • The query filters by the values of another query.
  • The query reads the Midaz CRM data source.
  • The key has no column, or column is empty.
  • The key has an entry other than column and digest.
The detail of the refusal names the query to correct. See the regulatory mapping reference for the other checks that Reporter makes when you save.

What your data must hold

Each declared column must hold one value for the rows that the query reads. A generation can fail with RPT-0143 when a row holds no version, or when the rows hold more than one value.

What a filing records


Reporter stores the source version with the draft. The filing then shows the field sourceReads on GET /v1/reports/{id} and on the list of reports. The field is a list of reads. A filing from a mapping with no declaration has no sourceReads. A report from a template has none either.

When the source changes during a generation


The source can change while Reporter reads it. The filing would then mix two versions of the data. Reporter does not accept this. The generation fails with RPT-0261. The report ends in the status Error. Its metadata holds the code, the title, and a message that names the data source and the table. Generate the filing again.

How Reporter marks a filing


Reporter checks the sources on a schedule. The check runs once every hour by default. The check reads a filing only when it meets these conditions:
  • The filing is Draft or Final.
  • The filing carries sourceReads.
  • The filing was created within the window. The window is 400 days by default.
Reporter reads the source again with the mapping, the parameters, and the institution that the filing holds from its generation. It does not use your current mapping. It checks only the reads that the filing recorded. Reporter compares the state that the source shows now with the last known state of each read. The last known state is the newest mark of that read. A read with no mark yet uses the state that the filing recorded.
  • When the states differ, Reporter adds one mark to republishedReads.
  • When the states are the same, Reporter writes nothing and sends nothing.
A mark has these fields: The list republishedReads only grows. Reporter does not remove a mark. A source can return to the state that the filing read. Reporter then adds a new mark, because the new state differs from the newest mark. If the source of a read does not answer, Reporter adds no mark for that read. It tries again at the next check. Reporter does not check a filing again after its window ends. The marks that the filing already has stay.

What a mark does not do


A mark does not say that the file would come out different. It records a change in what the source shows for the data that the filing read. Reporter never refuses an approval because of a mark. A mark changes neither the file nor the status of the filing. Reporter does not generate a new filing by itself. What you do with a marked filing is your decision.

Find the filings to review


Use the query parameter republished on GET /v1/reports. The values are true and false. The value false narrows nothing. Send republished=true with regulatory=true, with document_id, or with subscription_id. With republished=true, Reporter returns a filing only when all three conditions are true:
  1. The filing is Draft or Final.
  2. No newer Draft or Final exists for the same document, the same CNPJ of the institution, and the same filing period.
  3. The source shows another version of what the filing read.
The third condition is true in two cases. A file dataset day that the filing read has a newer revision. Or the newest mark of at least one read differs from what the filing read. A filing leaves the result in two cases. A newer Draft or Final of the same document, CNPJ, and filing period exists. Or the source returns to the state that the filing read. The marks stay on the filing in both cases. A newer generation that is still Processing, or ended in Error, does not take the filing out of the result. The list keeps its cursor pagination. A page holds only filings that pass the filter. Reporter refuses the request with HTTP 400 and RPT-0019 in these cases:
  • You send republished=true on a list that is not a list of filings.
  • You send republished=true with current=true.
  • The value is not true or false.

The event


Reporter emits the event regulatory.source_republished when it adds a mark. The delivery profile is Critical. The payload carries no report status, because a status can be old when you read the event. Read the filing to get its status. The ce-type of the event is studio.lerian.reporter.regulatory.source_republished. Reporter sends events only when event publication is enabled. When it is off, Reporter still writes the marks and sends no event. Reporter does not send later an event for a mark that it wrote while publication was off. If a Streaming Hub subscription lists its event types, add regulatory.source_republished to its event_types. For the deduplication by event id, read Delivery. A repeated delivery of the same mark carries the same event id.

Settings


Two environment variables set the check. A value of zero or less stops the service at start. See Environment variables for the other settings.

SCR 3040


From version 1.1.0 of the SCR 3040 document, the reference mapping declares the source version. It declares it on the queries that read the three Lender views. Reporter then stores the version of each view that a filing read. It marks the filing when a view shows another version of the same reference month. For the document itself, read SCR 3040. The version of the views is per reference month of the source database. It is not per institution. A correction that Lender publishes for another institution of the same database also marks your filing. A subscription that you activated before version 1.1.0 gets the declaration in one of two ways:
  1. Adopt version 1.1.0, then restart the mapping from the reference. Adopting a version alone keeps your current mapping. The restart builds your mapping again from the reference mapping, and that brings in the declaration. Copy your mapping before the restart. The restart does not keep the manualOverrides values or your edits to the queries of the reference. Enter them again after the restart.
  2. Add the declaration by hand. Edit the mapping and add sourceVersion: {column: version, digest: dataset_digest} to each query that reads one of the three views. Use this way when you customized your mapping and want to keep it.
If you do neither, your mapping has no declaration. Reporter then marks none of your filings.

Next steps


SCR 3040

The catalog document, its data sources, and its reference mapping.

Regulatory mapping reference

The keys, values, and refusals of a mapping.

Reporter events

The event catalog, the envelope, and the delivery rules.

File datasets

Files that your systems deliver each day. Reporter records the revision of each day.