PacketRequest¶
PacketRequest is the working-state container PacketManager.CreatePackets builds for a single packeting run: it holds the packet definitions to evaluate (defaulting to every configured definition when none are supplied), the document groupings produced along the way, and the accumulating list of packets already created, tying together the grouping step of OP-DOM-19 (DOM-BR-201).
Purpose¶
- Resolves the set of packet definitions to evaluate for the request — either the caller-supplied definitions, or, when none are given, every definition from
PacketDefinition.GetPacketDefinitions— and initializes empty collections for packets and document groupings. - Exposes the document groupings and accumulated packets
PacketManagerreads and populates during a packeting run.
Context¶
- Namespace:
SAIF.Domain.Tasks.Documents.Packets - Assembly/package:
SAIF.Domain(packaged inSAIF.SAIFCode.Core) - Declares two
internalgrouping methods (CreateGroups,CreateGroupsByPeriod) that populateDocumentGroups/DocumentGroupsByPeriod; they are not part of this type's public surface and are described here only as context for how the public properties get populated.
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| PacketRequest (constructor) | public PacketRequest(IUnitOfWork unitOfWork, params PacketDefinition[] definitions) |
Sets Definitions to definitions when any are supplied, else to every definition from PacketDefinition.GetPacketDefinitions(unitOfWork); initializes Packets, DocumentGroups, and DocumentGroupsByPeriod as empty lists. |
| DocumentGroups | public IList<IList<PolicyOutputDocument>> DocumentGroups { get; } |
The document groups keyed by policy/document-date/release-date, populated by the internal CreateGroups method (DOM-BR-201). |
| DocumentGroupsByPeriod | public IList<IList<PolicyOutputDocument>> DocumentGroupsByPeriod { get; } |
The document groups keyed additionally by policy-period effective date, populated by the internal CreateGroupsByPeriod method for documents left over after the first grouping pass (DOM-BR-201). |
| Definitions | public IList<PacketDefinition> Definitions { get; } |
The packet definitions this request will evaluate against each document group. |
| Packets | public IList<PolicyDocument> Packets { get; set; } |
The packets accumulated so far by PacketGenerator.CreatePacket calls run against this request's document groups. |
Behavioral notes¶
Definitions,DocumentGroups,DocumentGroupsByPeriodhaveprivate setaccessors, so once constructed they can only be mutated through the internal grouping methods;Packetsalone has a public setter, letting callers replace the entire packet collection outright*.- Because the grouping methods are
internal, code outside this assembly can construct aPacketRequestand read its definitions, but cannot itself populateDocumentGroups/DocumentGroupsByPeriod— onlySAIF.Domaintypes such asPacketManagercan drive the grouping step*.
Constraints and usage notes¶
- Passing no
definitionsto the constructor causes a query for every configured packet definition; passing an explicit set (as some tests or specialized flows might) scopes the request to just those.
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Domain/SAIF.Domain/Tasks/Documents/Packets/PacketRequest.csDomain/SAIF.Domain/Tasks/Documents/Packets/PacketDefinition.csDomain/SAIF.Domain/Tasks/Documents/Packets/PacketManager.cs