frctc

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

GOBL ➡️ French CTC

French Continuous Transaction Control (CTC) addon for GOBL.

Released under the Apache 2.0 LICENSE, Copyright 2026 Invopop S.L..

Lint Test Go Go Report Card codecov GoDoc Latest Tag Ask DeepWiki

This module implements the French e-invoicing / e-reporting reform as a set of GOBL tax addons covering the three exchange flows:

  • Flow 2 (fr-ctc-flow2-v1) — B2B clearance of domestic invoices between two French parties.
  • Flow 6 (fr-ctc-flow6-v1) — "Cycle de Vie" lifecycle statuses and payment messages (bill.Status, bill.Payment).
  • Flow 10 (fr-ctc-flow10-v1) — e-reporting for B2C and cross-border B2B.

A meta-addon (fr-ctc-v1) auto-dispatches an invoice or payment to the correct flow based on its parties.

Unlike the format converters in the GOBL ecosystem, this is a true addon: it registers extensions, normalizers, and validation rules into GOBL's global registry. It lives in its own module so that only projects handling French CTC documents take on its weight.

Layout

  • addon/ — the GOBL addon: extensions, normalizers, scenarios, and validation rules that register into GOBL on import (addon/flow2, addon/flow6, addon/flow10 plus the fr-ctc-v1 meta-addon). This package is kept dependency- light so importing it never pulls in conversion tooling.
  • the module root (and future subpackages) is reserved for converters and other CTC logic that build on the addon.

Usage

Add a blank import of the addon so it registers itself, then use GOBL as normal:

import (
	"github.com/invopop/gobl"
	_ "github.com/invopop/gobl.fr.ctc/addon"
)

Declare the addon on a document (or let the regime/scenario add it) and Calculate + Validate will run the full CTC normalization and rules.

Note: the fr-ctc-* keys are listed in GOBL core's approved external-addon registry, so they are recognised as valid $addons values in the JSON Schema. The runtime check stays strict, however: a document declaring an fr-ctc-* addon will fail validation with add-on must be registered unless this module is imported. Any service that processes French CTC documents must import it.

Development

The addon builds on core GOBL features (the bill lifecycle and the approved external-addon registry) that are not yet in a tagged release. The go.mod therefore pins github.com/invopop/gobl to a commit on the core branch (a pseudo-version); bump it to the release tag once core is published.

go test ./...
Examples

examples/ holds sample documents for each flow, with their expected JSON envelopes under examples/out/. They are verified via GOBL's shared pkg/examples helpers. Regenerate the golden output after intentional changes with:

go test . -run TestExamples -update

License

Apache 2.0 — see LICENSE.

Documentation

Overview

Package frctc is the root of the French CTC module for GOBL. The GOBL addon itself lives in the addon subpackage (and addon/flow2, addon/flow6, addon/flow10); this root package is reserved for converters and other CTC tooling built on top of the addon.

Directories

Path Synopsis
Package addon is a convenience aggregator that registers all of the French CTC flow-specific addons:
Package addon is a convenience aggregator that registers all of the French CTC flow-specific addons:
dgfip
Package dgfip defines the French tax authority (Direction Générale des Finances Publiques) billing-mode code list used by the French CTC (Continuous Transaction Control) reform.
Package dgfip defines the French tax authority (Direction Générale des Finances Publiques) billing-mode code list used by the French CTC (Continuous Transaction Control) reform.
flow10
Package flow10 implements the French CTC Flow 10 ("e-reporting") rules for transactions that fall outside the Flow 2 clearance perimeter: B2C sales, cross-border B2B invoices, and payment receipts subject to e-reporting to the French tax authority.
Package flow10 implements the French CTC Flow 10 ("e-reporting") rules for transactions that fall outside the Flow 2 clearance perimeter: B2C sales, cross-border B2B invoices, and payment receipts subject to e-reporting to the French tax authority.
flow2
Package flow2 implements the French CTC Flow 2 ("facturation") rules for domestic B2B clearance invoices exchanged between two French parties.
Package flow2 implements the French CTC Flow 2 ("facturation") rules for domestic B2B clearance invoices exchanged between two French parties.
flow6
Package flow6 implements the French CTC Flow 6 ("Cycle de Vie") lifecycle status messages exchanged between registered platforms on a bill.Status document.
Package flow6 implements the French CTC Flow 6 ("Cycle de Vie") lifecycle status messages exchanged between registered platforms on a bill.Status document.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL