chore: remove MVP positioning and align plan defaults (#15)

## Summary
- remove MVP wording from repository docs and guidance
- rename the system plan document and update references to it
- align the default subscription plan code/name with product wording
- document hard subscription expiry with no grace period

## Verification
- docker build -f infra/docker/web.Dockerfile .
- docker build -f infra/docker/migrate.Dockerfile .

Co-authored-by: sirily <sirily@git.shararam.party>
Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
2026-03-10 15:01:06 +03:00
parent ba029d8f3f
commit 55472de23d
11 changed files with 73 additions and 26 deletions

View File

@@ -4,7 +4,7 @@ Database package for `nproxy`.
## Implemented in this iteration
- Prisma package scaffold
- Initial Prisma schema for MVP persisted state
- Current Prisma schema for persisted state
- Shared schema path export for runtime tooling
## Current scope

View File

@@ -73,7 +73,7 @@ export function createPrismaAuthStore(database: PrismaClient = defaultPrisma) {
return database.$transaction(async (transaction) => {
const defaultPlan = await transaction.subscriptionPlan.findFirst({
where: {
code: "mvp_monthly",
code: "monthly",
isActive: true,
},
});

View File

@@ -10,8 +10,8 @@ export interface SubscriptionPlanSeedInput {
}
export const defaultSubscriptionPlanSeed: SubscriptionPlanSeedInput = {
code: "mvp_monthly",
displayName: "MVP Monthly",
code: "monthly",
displayName: "Monthly",
monthlyRequestLimit: 100,
monthlyPriceUsd: 9.99,
billingCurrency: "USDT",
@@ -21,6 +21,8 @@ export async function ensureSubscriptionPlan(
input: SubscriptionPlanSeedInput,
database: PrismaClient = defaultPrisma,
): Promise<void> {
await reconcileDefaultSubscriptionPlan(input, database);
await database.subscriptionPlan.upsert({
where: {
code: input.code,
@@ -48,3 +50,47 @@ export async function ensureDefaultSubscriptionPlan(
): Promise<void> {
await ensureSubscriptionPlan(defaultSubscriptionPlanSeed, database);
}
async function reconcileDefaultSubscriptionPlan(
input: SubscriptionPlanSeedInput,
database: PrismaClient,
): Promise<void> {
const existing = await database.subscriptionPlan.findUnique({
where: {
code: input.code,
},
select: {
id: true,
},
});
if (existing) {
return;
}
const candidate = await database.subscriptionPlan.findFirst({
where: {
monthlyRequestLimit: input.monthlyRequestLimit,
monthlyPriceUsd: new Prisma.Decimal(input.monthlyPriceUsd),
billingCurrency: input.billingCurrency,
},
orderBy: {
createdAt: "asc",
},
});
if (!candidate) {
return;
}
await database.subscriptionPlan.update({
where: {
id: candidate.id,
},
data: {
code: input.code,
displayName: input.displayName,
isActive: true,
},
});
}