Class AchievementPushPlanExecutor
Pure sequencer that turns a Push-direction AchievementSyncPlan and its accepted AchievementSyncReviewSelection into the ordered list of work a push actually sends.
Inherited Members
Namespace: Serenity.Achievements.Application.Sync
Assembly: Serenity.Achievements.Application.dll
Syntax
public static class AchievementPushPlanExecutor
Remarks
Determinism mirrors AchievementSyncPlanner: items come out ordered by ApiName
(ordinal), and within one achievement a SaveAchievement item
always precedes that achievement's own icon uploads — an upload addresses the achievement by the
identity a new achievement only receives once its save (or the creation call ahead of it) has run.
This type never decides whether an achievement is new or already exists on the platform — that reads a platform-specific identity convention (a pair of internal ids, say) this pure model has no business knowing about. It only decides WHAT to send; a connector's own push transport decides HOW, including that classification.
Methods
BuildWorkItems(AchievementSyncPlan, AchievementSyncReviewSelection, IReadOnlyList<AchievementSyncRecord>)
Builds the ordered work items for one push.
Declaration
public static IReadOnlyList<AchievementPushWorkItem> BuildWorkItems(AchievementSyncPlan plan, AchievementSyncReviewSelection selection, IReadOnlyList<AchievementSyncRecord> pushRecords)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementSyncPlan | plan | A Push-direction plan. Conflicted items are skipped. |
| AchievementSyncReviewSelection | selection | Which of the plan's field changes were accepted. |
| IReadOnlyList<AchievementSyncRecord> | pushRecords | The record to source each work item's payload from, one per api name. Typically the authored records, already carrying whatever platform identity extras a connector needs to tell a new achievement from an existing one. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementPushWorkItem> | The work items, ordered by api name then kind. Empty when nothing was accepted. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When no plan or selection were given. |
BuildWorkItems(IReadOnlyList<AchievementSyncRecord>)
Builds the ordered work items for a batch of records a caller already fully resolved — the shape a connector's own push transport decomposes, since by the time a connector receives an AchievementPushBatch the plan and selection that produced it are long gone. Every record becomes a SaveAchievement item, followed by an icon upload item for whichever of its icons actually carries bytes to send.
Declaration
public static IReadOnlyList<AchievementPushWorkItem> BuildWorkItems(IReadOnlyList<AchievementSyncRecord> records)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<AchievementSyncRecord> | records | The records to push, one per api name. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementPushWorkItem> | The work items, ordered by api name then kind. |