Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
2.5 KiB
Recurring Service-Period Edit Surfaces
F251 defines the first shared UI/API transport surface for editing future persisted service periods with explicit provenance and validation feedback.
Request Contract
The shared request contract now lives in:
packages/types/src/interfaces/recurringTiming.interfaces.tsasIRecurringServicePeriodEditRequestshared/billingClients/recurringServicePeriodEditRequests.tsasapplyRecurringServicePeriodEditRequest(...)
The v1 request envelope carries:
operation = boundary_adjustment | skip | deferrecordIdeditedAtsourceRuleVersion- optional
sourceRunKey - optional sibling schedule rows for continuity validation feedback
Operation-specific request fields remain narrow:
boundary_adjustmentmay carryupdatedServicePeriod,updatedInvoiceWindow, andupdatedActivityWindowskipneeds only the targetrecordIddefermust carrydeferredInvoiceWindow
This keeps the transport surface aligned with the already-supported v1 edit operations instead of implying split, merge, or repair capabilities that are still deferred.
Success Response
A successful edit response returns:
ok = true- the
supersededRecord - the new
editedRecord - explicit
provenance validationIssues = []
That makes provenance transport explicit for later controllers and dashboard flows: callers do not need to infer whether a boundary edit, skip, or defer happened by diffing rows after the fact.
Validation Feedback
Validation failures are returned as structured validationIssues[] instead of raw thrown strings.
The first v1 issue codes are:
record_mismatchimmutable_recordno_changesinvalid_service_period_rangeinvalid_invoice_window_rangeinvalid_activity_window_rangemissing_deferred_invoice_windowinvalid_deferred_invoice_windowunchanged_deferred_invoice_windowcontinuity_gap_beforecontinuity_overlap_beforecontinuity_gap_aftercontinuity_overlap_afterunknown_validation_error
Each issue carries:
codefieldmessage
That gives later API controllers and dashboard forms one stable surface for inline validation copy without changing the underlying edit primitives yet.
Deliberate Boundary
This checkpoint still does not define:
- permission or audit-policy transport beyond the existing mutation guard
- repository/controller wiring for loading
recordIdtargets from the database - repair, regeneration, or administrative edit flows
Those remain sequenced behind F253-F259.