Path: redb-route/demo/SerialNumbersDemo/SerialNumbers.Core/Names.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/demo/SerialNumbersDemo/SerialNumbers.Core/Names.cs
----
using redb.Route.Abstractions;
using SerialNumbers.Domain.Entities;
namespace SerialNumbers.Core;
/// Exchange headers the routes of this module set and read.
public static class SerialHeaders
{
public const string Partner = "serials.partner";
public const string Transport = "serials.transport";
public const string FileName = "serials.fileName";
public const string ArchivePath = "serials.archivePath";
/// Root element of the XML; absent when the file is not well-formed XML.
public const string MessageType = "serials.messageType";
public const string RequestId = "serials.requestId";
///
/// Set by the request registration: Accepted, Rejected or OnHold, or
/// when a release finds the request decided already.
///
public const string Decision = "serials.decision";
///
/// The object id of a request on hold whose archived file is sent through the request route again.
/// Absent for a file a partner delivered.
///
public const string ReleaseOf = "serials.releaseOf";
/// File name of the quota report, stamped with the time the schedule fired.
public const string ReportFileName = "serials.reportFileName";
/// The GTIN in the path of the product API, /api/products/{gtin}/status.
public const string Gtin = "gtin";
/// The status a product has after the status change.
public const string ProductStatus = "serials.productStatus";
/// One of .
public const string ProductChange = "serials.productChange";
/// How many requests on hold a product activation found.
public const string HeldCount = "serials.heldCount";
}
/// Exchange properties that carry redb objects between the steps of one transaction.
public static class SerialProperties
{
public const string Request = "serials.request";
public const string Response = "serials.response";
}
/// Internal endpoints that join the routes of the module.
public static class RouteUris
{
public const string Intake = "direct:intake";
public const string SerialNumberRequest = "direct:serial-number-request";
/// Changes a product's status: called by the REST API and by the debug host's console.
public const string SetProductStatus = "direct:set-product-status";
public const string ReleaseHeldRequests = "direct:release-held-requests";
public static string Delivery(string partnerCode) => $"direct:deliver-{partnerCode}";
/// as a template resolved per exchange from the outbox row.
public const string DeliveryForOutboxRow = "direct:deliver-${header.partner_code}";
}
/// What a status change did.
public static class ProductChangeOutcomes
{
public const string Changed = "Changed";
public const string Unchanged = "Unchanged";
/// Unknown product or status: answered with an error, nothing written.
public const string Refused = "Refused";
}
/// Outcomes of the request route that are not a decision on the request.
public static class ReleaseOutcomes
{
/// A release found the request no longer on hold: a concurrent release got there first.
public const string AlreadyDecided = "AlreadyDecided";
}
///
/// Properties the module adds to its route context, next to the configuration Tsak put there. Route
/// builders read both in Configure() through Context.
///
public static class ContextProperties
{
/// The partners read from redb when the module loads; inbound and delivery routes are built per partner.
public const string Partners = "serials.partners";
public static IReadOnlyList PartnersOf(IRouteContext context) =>
context.GetProperty>(Partners)
?? throw new InvalidOperationException("The partner list is not in the route context; InitRoute.main puts it there before the routes are built.");
}
/// Names of the objects registered in the route context registry.
public static class RegistryNames
{
/// The sql: data source: the same SQL Server database redb lives in.
public const string SerialsDatabase = "serials";
}