feat(profile): surface daily free quotas

This commit is contained in:
2026-07-03 16:56:06 +08:00
parent 1fcad49baa
commit d17ab6c23d
11 changed files with 152 additions and 20 deletions
+28
View File
@@ -14,6 +14,25 @@ describe("User", () => {
countryCode: "HK",
intimacy: 0,
dolBalance: 0,
creditBalance: 0,
dailyFreeChatLimit: 30,
dailyFreeChatUsed: 1,
dailyFreeChatRemaining: 29,
dailyFreePrivateLimit: 2,
dailyFreePrivateUsed: 0,
dailyFreePrivateRemaining: 2,
dailyQuotas: {
chat: {
limit: 30,
used: 1,
remaining: 29,
},
privateMessage: {
limit: 2,
used: 0,
remaining: 2,
},
},
personalityTraits: {
caring: 0.5,
playful: 0.5,
@@ -35,6 +54,13 @@ describe("User", () => {
countryCode: "HK",
intimacy: 0,
dolBalance: 0,
creditBalance: 0,
dailyFreeChatLimit: 30,
dailyFreeChatUsed: 1,
dailyFreeChatRemaining: 29,
dailyFreePrivateLimit: 2,
dailyFreePrivateUsed: 0,
dailyFreePrivateRemaining: 2,
personalityTraits: {
caring: 0.5,
playful: 0.5,
@@ -46,6 +72,8 @@ describe("User", () => {
createdAt: "2026-06-12T08:08:27.378706+00:00",
lastMessageAt: "2026-06-24T11:00:23.156561+00:00",
});
expect("dailyQuotas" in user.toJson()).toBe(false);
});
it("parses the latest backend entitlements payload", () => {