Metadata-Version: 2.5
Name: trytond_ticket_hub
Version: 8.0.7.3
Summary: Ticket Hub
Author: Clemens Hupka
Maintainer-email: Clemens Hupka <clemens.hupka@backend.at>
License-Expression: GPL-3.0-or-later
License-File: COPYRIGHT
License-File: LICENSE
Keywords: helpdesk,heptapod,ticket,tryton,zammad
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Topic :: Office/Business
Classifier: Topic :: Office/Business :: Groupware
Requires-Python: >=3.10
Requires-Dist: trytond-company<8.1,>=8.0
Requires-Dist: trytond-party<8.1,>=8.0
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Description-Content-Type: text/x-rst

Ticket Hub
==========

The ``ticket_hub`` module is the base of the Ticket Hub flywheel: it
consolidates support tickets (Zammad), project issues (Heptapod) and
internal tickets (cmdb incidents) in Tryton, with portal exposure via
``flask_board``/``flask_portal``.

It registers the module, its security groups and the shared menu that
the platform-specific extension modules attach to:

- ``Ticket Hub Administration`` — full control, including connection
  configuration and credentials.
- ``Ticket Hub User`` — working on tickets only.

It owns the core ``ticket_hub.ticket`` model: the single,
platform-agnostic ticket the flywheel consolidates around, with a
sequence-based number, the source platform reference, the lifecycle
state, the requester/assignee and the ticket timestamps, together with
its append-only ``ticket_hub.message`` journal.

It also owns the core ``ticket_hub.connection`` model: the
per-platform connection configuration (Zammad/Heptapod) with its
credential security (the API token is readable and writable only by
the administration group and rendered with the ``password`` widget)
and its *Test Connection* wizard, plus the ``connection`` reference on
``ticket_hub.ticket``.

It also owns the mapping models that translate between the platforms
and the neutral ticket: ``ticket_hub.state.mapping`` maps an external
platform state to a ticket state (and back, when ``sync_back`` is set),
with ``Connection.default_state`` as the configurable fall-back for an
unmapped state, and ``ticket_hub.tag.mapping`` maps external tags or
labels to internal tags in the ``import``, ``export`` or ``both``
direction.  Both are configuration and are restricted to the
administration group.

It also owns the ``ticket_hub.sync.log`` model: the audit trail of
every synchronization operation (import, update, push, webhook),
together with the pluggable ``SyncAdapter`` contract the platform
modules implement, the exponential-backoff retry framework (a
transient failure is retried with a growing delay and a backoff
counter until it is marked permanent) and the ``ir.cron``-driven
scheduler that runs each active connection at its own
``sync_interval``, retries the due failures and prunes the old
successful entries.  The *Sync Log* and *Failed Syncs* watch views
surface the outcome; both the log and the scheduler are restricted to
the administration group.

It also owns the webhook ingestion framework: the public endpoint
``POST /<database_name>/ticket_hub/webhook/<connection_token>`` routes
a delivery to the connection whose generated ``webhook_token`` it
matches and authenticates it, the pluggable ``WebhookHandler`` contract
lets a platform module parse and queue its own payloads, and every
delivery is recorded in the sync log with its raw payload for replay.
The token is a credential: it is redacted outside the administration
group and can be rotated with the *Regenerate Webhook Token* button,
and an unknown token, an inactive connection and a failed token check
all answer the same bare ``404``, so the endpoint never reveals whether
a token exists.

Dependencies
------------

- Tryton modules: ``ir``, ``res``, ``party``, ``company``.
