Skip to content

feat: expose expirationDate on activate and floating checkout - #4

Merged
catsika merged 1 commit into
mainfrom
feat/expiration-date
Oct 26, 2026
Merged

catsika merged 1 commit into
mainfrom
feat/expiration-date

Conversation

@catsika

@catsika catsika commented Oct 26, 2026

Copy link
Copy Markdown
Member

What changed

  • ActivateKeyResponse.ExpirationDate and FloatingCheckoutResponse.ExpirationDate, typed DateTimeOffset?, mapped with [JsonPropertyName("expirationDate")] (System.Text.Json, like the rest of the SDK).
  • Contract tests: date value, explicit null, missing field, checkout ExpirationDate vs ExpiresAt, and a System.Text.Json round-trip.
  • README section on reading the expiry, days left, null = never expires, and storing the last value. CHANGELOG entry under Unreleased.

Contract (already live)

POST /key/activate and POST /key/checkout success responses include expirationDate: an ISO 8601 string (e.g. "2027-03-01T00:00:00.000Z") or null when the license never expires. On checkout it is separate from expiresAt, the floating seat lease. Additive only; failure responses are unchanged.

Why DateTimeOffset?

System.Text.Json's default converter parses the ISO 8601 ...Z string into a DateTimeOffset with a zero offset, so there is no DateTimeKind ambiguity and callers can subtract DateTimeOffset.UtcNow directly. The tests check the parsed value and offset. The older ExpirationDate fields on LicenseDetails and CustomerLicenseKey are DateTime? and are left alone (changing them would break callers). DateTime converts implicitly to DateTimeOffset, so the two can be compared. The property is nullable and optional, so a missing field also gives null, the same as the Go, Node and Python SDKs.

Build and tests

.NET isn't installed locally, and the Docker dotnet/sdk:9.0 image pull stalled, so I couldn't compile or run anything locally. This PR relies on the repo's CI (build plus non-live contract tests). No version bump: <Version> is bumped at release time, not per PR.

ActivateKeyResponse and FloatingCheckoutResponse gain a nullable
ExpirationDate (DateTimeOffset?) for the license expiry returned by
POST /key/activate and POST /key/checkout; null means the license
never expires. On checkout it is separate from ExpiresAt, the floating
seat lease. Additive, no breaking changes.
@catsika
catsika merged commit 1c468aa into main Oct 26, 2026
2 checks passed
@catsika
catsika deleted the feat/expiration-date branch October 26, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant