@@ -54,21 +54,21 @@ export function isNewerRead(license: AwsMarketplaceLicenseRecord, verifiedAt: Da
5454}
5555
5656/**
57- * No entitlements after AWS has said the license ended, or on a license that was already confirmed
58- * once, is a lapse. Otherwise AWS may simply not have finished, so the license stays pending.
57+ * No answer about access after AWS has said the license ended, or on a license that was already
58+ * confirmed once, is a lapse. Otherwise AWS may simply not have finished, so the license stays pending.
5959 */
6060function statusFromRead (
6161 prior : AwsMarketplaceLicenseStatus | null ,
6262 { summary, ended } : LicenseVerification
6363) : AwsMarketplaceLicenseStatus {
6464 if ( summary . active ) return 'active'
65- if ( summary . entitlementCount > 0 || ended ) return 'inactive'
65+ if ( summary . accessReported || ended ) return 'inactive'
6666 return prior === null || prior === 'pending' ? 'pending' : 'inactive'
6767}
6868
6969/**
70- * The columns a read writes. With no entitlements the last-known dimension, quantity, and expiry
71- * stay as they were, and only the status can change. An inactive license has nothing to claim.
70+ * The columns a read writes. With no answer about access the last-known dimension, quantity, and
71+ * expiry stay as they were, and only the status can change. An inactive license has nothing to claim.
7272 */
7373function verificationFields (
7474 prior : AwsMarketplaceLicenseStatus | null ,
@@ -81,7 +81,7 @@ function verificationFields(
8181 lastVerifiedAt : verifiedAt ,
8282 lastVerificationAttemptAt : verifiedAt ,
8383 updatedAt : new Date ( ) ,
84- ...( summary . entitlementCount > 0 && {
84+ ...( summary . accessReported && {
8585 dimension : summary . dimension ,
8686 quantity : summary . quantity ,
8787 expiresAt : summary . expiresAt ,
@@ -277,7 +277,7 @@ export async function recordLicenseVerification(input: {
277277 const stamp = licenseEventReceivedAt ? { licenseEventReceivedAt } : { }
278278 return db . transaction ( async ( tx ) => {
279279 const accountId = verification . summary . customerAwsAccountId ?? input . fallbackAccountId
280- if ( accountId && verification . summary . entitlementCount > 0 ) {
280+ if ( accountId && verification . summary . licenseSeen ) {
281281 const [ created ] = await tx
282282 . insert ( awsMarketplaceLicense )
283283 . values ( {
0 commit comments