@ciromaciel/contract 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/plan/notice.js +7 -5
package/package.json
CHANGED
package/src/plan/notice.js
CHANGED
|
@@ -38,11 +38,13 @@ export async function getPlanNotice(gate, cfg, ownerId, copy = {}, current = nul
|
|
|
38
38
|
* NO PLAN IS NOT A PROBLEM TO REPORT. Since the free floor became one
|
|
39
39
|
* resource (2026-09-17), an owner with no plan is simply on the free tier,
|
|
40
40
|
* and telling them "your subscription is not active" reads as a billing
|
|
41
|
-
* failure they never had.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* failure they never had. Using what the free tier gives — even all of it —
|
|
42
|
+
* is not a problem either: the refusal on the next creation already offers
|
|
43
|
+
* the upgrade at the right moment. The notice speaks only when the owner has
|
|
44
|
+
* MORE than the free tier covers (a lapsed plan left resources behind), and
|
|
45
|
+
* it can only know that from `current` — without it there is no notice.
|
|
44
46
|
*/
|
|
45
|
-
if (typeof current !== 'number' || limit === null || current
|
|
47
|
+
if (typeof current !== 'number' || limit === null || current <= limit) {
|
|
46
48
|
return { state: 'free', plan: ent.plan, limit, message: null }
|
|
47
49
|
}
|
|
48
50
|
const product = copy.product || 'este produto'
|
|
@@ -52,7 +54,7 @@ export async function getPlanNotice(gate, cfg, ownerId, copy = {}, current = nul
|
|
|
52
54
|
state: 'none',
|
|
53
55
|
plan: ent.plan,
|
|
54
56
|
limit,
|
|
55
|
-
message: `O plano gratuito do ${product}
|
|
57
|
+
message: `O plano gratuito do ${product} inclui ${limit} e você tem ${current}. ${keeps} — ${frozen}. Assine para voltar a criar.`,
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|