Apprentissage: une échéance OPCO facturée après la rupture du contrat
Objectif Joindre chaque ligne de facture OPCO au registre des contrats du CFA, et être prévenu quand la période facturée dépasse la rupture du contrat, même quand la rupture est saisie après la facture.
Le CFA d'une école de commerce, deux exports CSV: 36 contrats d'apprentissage, 40 lignes de facture OPCO.
une Entity joint le contrat à chaque ligne de facture;
un Process compare deux colonnes de la ligne jointe: period_end après rupture_on;
deux ruptures arrivent en retard dans le registre: les factures déjà envoyées sont jugées à nouveau.
apiVersion: apps.lumnik.io/v1kind: Processmetadata:name: scenario-cfa-billed-after-rupture-aspec:scope: cfa-billing-aon: { event: data.row.changed, table: connector.v_cfa_invoice_a }when: - "period_end>{rupture_on}"# the invoiced period runs past the contract's ruptureemit:type: decision.billed-after-rupture-amessage: "{invoice_line}: {amount_eur} EUR invoiced to {opco} for {period_start} to {period_end}; contract {contract_id} ({apprentice_id}) broken on {rupture_on}"key: invoice_line
$ lm process apply -f manifests/30-billed-after-rupture.yamlApplied process "scenario-cfa-billed-after-rupture-a" → table connector.v_cfa_invoice_a, emits decision.billed-after-rupture-awarning: managed index on connector.t_scenario_cfa_invoices_a is pending; Entity Process reads may be slower until it is ready
apply
Applied process "scenario-cfa-billed-after-rupture-a" → table connector.v_cfa_invoice_a, emits decision.billed-after-rupture-a
$ lm connector run scenario-cfa-invoices-arun scheduled: 8f613c14-720d-447c-91a4-8b27bdd28488$ lm run get 8f613c14-720d-447c-91a4-8b27bdd28488ID CONNECTOR ENDPOINT STATUS IN OUT SKIPPED DEAD-LETTERS STARTED ENDED EVALUATED
8f613c14 scenario-cfa-invoices-a default Completed 4 4 0 0 2026-11-11 12:09 2026-11-11 12:09 yes• 1 file(s) unchanged since they were last read — not read again$ lm inbox --process scenario-cfa-billed-after-rupture-aID WHEN PROCESS MESSAGE ENTITY_KEY
27391 just now scenario-cfa-billed-after-rupture-a F26-11-001: 2640.00 EUR invoiced to OPCO Commerce for 2026-11-13 to 2027-02-12; contract CTR-26-0027 (APP-26-0027) broken on 2026-10-09 F26-11-001
scenario-cfa-invoices-a
Completed · IN 4 · OUT 4
F26-11-001
F26-11-001: 2640.00 EUR invoiced to OPCO Commerce for 2026-11-13 to 2027-02-12; contract CTR-26-0027 (APP-26-0027) broken on 2026-10-09
$ lm connector run scenario-cfa-contracts-arun scheduled: 458b4d3c-e774-477f-bb3f-297f6e39fbe9$ lm run get 458b4d3c-e774-477f-bb3f-297f6e39fbe9ID CONNECTOR ENDPOINT STATUS IN OUT SKIPPED DEAD-LETTERS STARTED ENDED EVALUATED
458b4d3c scenario-cfa-contracts-a default Completed 36 36 0 0 2026-11-11 12:09 2026-11-11 12:09 yes$ lm inbox --process scenario-cfa-billed-after-rupture-aID WHEN PROCESS MESSAGE ENTITY_KEY
27397 just now scenario-cfa-billed-after-rupture-a F26-09-032: 3520.00 EUR invoiced to OPCO Commerce for 2026-09-01 to 2027-03-31; contract CTR-25-0003 (APP-25-0003) broken on 2026-10-30 F26-09-032
27396 just now scenario-cfa-billed-after-rupture-a F26-09-007: 3520.00 EUR invoiced to OPCO Commerce for 2026-09-01 to 2027-03-31; contract CTR-26-0007 (APP-26-0007) broken on 2026-10-28 F26-09-007
27391 just now scenario-cfa-billed-after-rupture-a F26-11-001: 2640.00 EUR invoiced to OPCO Commerce for 2026-11-13 to 2027-02-12; contract CTR-26-0027 (APP-26-0027) broken on 2026-10-09 F26-11-001
register
CTR-26-0007: rupture_on 2026-10-28
register
CTR-25-0003: rupture_on 2026-10-30
scenario-cfa-contracts-a
Completed · IN 36 · OUT 36
F26-09-007
F26-09-007: 3520.00 EUR invoiced to OPCO Commerce for 2026-09-01 to 2027-03-31; contract CTR-26-0007 (APP-26-0007) broken on 2026-10-28
F26-09-032
F26-09-032: 3520.00 EUR invoiced to OPCO Commerce for 2026-09-01 to 2027-03-31; contract CTR-25-0003 (APP-25-0003) broken on 2026-10-30
inbox
3 decisions: 1 in November's invoicing, 2 after the late ruptures