Table of Contents

Class ColoradoCardReplacementService

Namespace
SEBT.Portal.StatePlugins.CO
Assembly
SEBT.Portal.StatePlugins.CO.dll

Colorado card-replacement via CBMS update-std-dtls with reqNewCard = "Y". Resolves the household via SEBT.Portal.StatePlugins.CO.Cbms.Cache.ICbmsHouseholdCache using SEBT.Portal.StatePlugins.CO.PhoneNormalizer on HouseholdIdentifierValue, filters enrollment rows to those whose sebtChldCwin matches the requested CaseRefs, then sends a single PATCH with one array element per matched student. The portal's SummerEBTCaseID maps to CBMS sebtChldCwin (cross-year); the PATCH body uses the per-year sebtChldId / sebtAppId. Successful updates require CBMS respCd 200 (spec) or 00 (observed UAT). Card-replacement cooldown is tracked in the portal database — no write-through to the cache.

[Export(typeof(IStatePlugin))]
[ExportMetadata("StateCode", "CO")]
public class ColoradoCardReplacementService : ColoradoCbmsServiceBase, ICardReplacementService, IStatePlugin
Inheritance
object
ColoradoCardReplacementService
Implements
Inherited Members

Constructors

ColoradoCardReplacementService(IServiceProvider, IConfiguration?, ILoggerFactory?, HybridCache?)

[ImportingConstructor]
public ColoradoCardReplacementService(IServiceProvider hostProvider, IConfiguration? configuration = null, ILoggerFactory? loggerFactory = null, HybridCache? cache = null)

Parameters

hostProvider IServiceProvider
configuration IConfiguration
loggerFactory ILoggerFactory
cache HybridCache

Methods

GetOrCreateClient(CbmsConnectionOptions)

Overrides the base GetOrCreateClient(CbmsConnectionOptions) when a test HTTP handler has been injected via the internal constructor. This preserves the test seam for the PATCH path while the read path is served by the SEBT.Portal.StatePlugins.CO.Cbms.Cache.PluginCache substitute. In production (where SEBT.Portal.StatePlugins.CO.ColoradoCardReplacementService._testHttpMessageHandler is null) the base implementation is used.

protected CbmsSebtApiClient GetOrCreateClient(CbmsConnectionOptions options)

Parameters

options CbmsConnectionOptions

Returns

CbmsSebtApiClient

RequestCardReplacementAsync(CardReplacementRequest, CancellationToken)

Initiates a replacement card request for one or more cases in the identified household. Implementations are expected to update any cooldown timestamp the state tracks so subsequent portal reads reflect the new request time.

public Task<CardReplacementResult> RequestCardReplacementAsync(CardReplacementRequest request, CancellationToken cancellationToken = default)

Parameters

request CardReplacementRequest

Household identifier, case IDs, and replacement reason.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<CardReplacementResult>

Result indicating success, policy rejection, or backend error.