chore: formatting updates and lockfile changes
This commit is contained in:
parent
5c45557537
commit
3be9807d88
8 changed files with 4851 additions and 89 deletions
|
|
@ -7,9 +7,15 @@ import { PlansService } from './plans.service';
|
|||
export class PlansController {
|
||||
constructor(private readonly plansService: PlansService) {}
|
||||
|
||||
@Get() @ApiOperation({ summary: 'Get all plans' })
|
||||
getAllPlans() { return this.plansService.getAllPlans(); }
|
||||
|
||||
@Get(':id') @ApiOperation({ summary: 'Get plan by ID' })
|
||||
getPlanById(@Param('id') id: string) { return this.plansService.getPlanById(id); }
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'Get all plans' })
|
||||
getAllPlans() {
|
||||
return this.plansService.getAllPlans();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Get plan by ID' })
|
||||
getPlanById(@Param('id') id: string) {
|
||||
return this.plansService.getPlanById(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,22 +14,46 @@ export interface Plan {
|
|||
export class PlansService {
|
||||
private readonly plans: Plan[] = [
|
||||
{
|
||||
id: 'starter', name: 'Starter', description: 'For small companies',
|
||||
monthlyPrice: 99, yearlyPrice: 990,
|
||||
id: 'starter',
|
||||
name: 'Starter',
|
||||
description: 'For small companies',
|
||||
monthlyPrice: 99,
|
||||
yearlyPrice: 990,
|
||||
features: ['5 job postings', 'Basic analytics', 'Email support'],
|
||||
},
|
||||
{
|
||||
id: 'professional', name: 'Professional', description: 'For growing companies',
|
||||
monthlyPrice: 299, yearlyPrice: 2990, popular: true,
|
||||
features: ['25 job postings', 'Advanced analytics', 'Priority support', 'Featured listings'],
|
||||
id: 'professional',
|
||||
name: 'Professional',
|
||||
description: 'For growing companies',
|
||||
monthlyPrice: 299,
|
||||
yearlyPrice: 2990,
|
||||
popular: true,
|
||||
features: [
|
||||
'25 job postings',
|
||||
'Advanced analytics',
|
||||
'Priority support',
|
||||
'Featured listings',
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'enterprise', name: 'Enterprise', description: 'For large organizations',
|
||||
monthlyPrice: 799, yearlyPrice: 7990,
|
||||
features: ['Unlimited postings', 'Custom analytics', 'Dedicated support', 'API access'],
|
||||
id: 'enterprise',
|
||||
name: 'Enterprise',
|
||||
description: 'For large organizations',
|
||||
monthlyPrice: 799,
|
||||
yearlyPrice: 7990,
|
||||
features: [
|
||||
'Unlimited postings',
|
||||
'Custom analytics',
|
||||
'Dedicated support',
|
||||
'API access',
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
getAllPlans(): Plan[] { return this.plans; }
|
||||
getPlanById(id: string): Plan | undefined { return this.plans.find(p => p.id === id); }
|
||||
getAllPlans(): Plan[] {
|
||||
return this.plans;
|
||||
}
|
||||
getPlanById(id: string): Plan | undefined {
|
||||
return this.plans.find((p) => p.id === id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,10 +14,14 @@ export class StripeService implements OnModuleInit {
|
|||
console.warn('STRIPE_SECRET_KEY not configured');
|
||||
return;
|
||||
}
|
||||
this.stripe = new Stripe(secretKey, { apiVersion: '2025-11-17.clover' as const });
|
||||
this.stripe = new Stripe(secretKey, {
|
||||
apiVersion: '2025-11-17.clover' as const,
|
||||
});
|
||||
}
|
||||
|
||||
getClient(): Stripe { return this.stripe; }
|
||||
getClient(): Stripe {
|
||||
return this.stripe;
|
||||
}
|
||||
|
||||
async createCustomer(email: string, name: string) {
|
||||
return this.stripe.customers.create({ email, name });
|
||||
|
|
@ -37,10 +41,18 @@ export class StripeService implements OnModuleInit {
|
|||
}
|
||||
|
||||
async listSubscriptions(customerId: string) {
|
||||
return this.stripe.subscriptions.list({ customer: customerId, status: 'all' });
|
||||
return this.stripe.subscriptions.list({
|
||||
customer: customerId,
|
||||
status: 'all',
|
||||
});
|
||||
}
|
||||
|
||||
async createCheckoutSession(customerId: string, priceId: string, successUrl: string, cancelUrl: string) {
|
||||
async createCheckoutSession(
|
||||
customerId: string,
|
||||
priceId: string,
|
||||
successUrl: string,
|
||||
cancelUrl: string,
|
||||
) {
|
||||
return this.stripe.checkout.sessions.create({
|
||||
customer: customerId,
|
||||
payment_method_types: ['card'],
|
||||
|
|
@ -52,7 +64,10 @@ export class StripeService implements OnModuleInit {
|
|||
}
|
||||
|
||||
async createBillingPortalSession(customerId: string, returnUrl: string) {
|
||||
return this.stripe.billingPortal.sessions.create({ customer: customerId, return_url: returnUrl });
|
||||
return this.stripe.billingPortal.sessions.create({
|
||||
customer: customerId,
|
||||
return_url: returnUrl,
|
||||
});
|
||||
}
|
||||
|
||||
constructWebhookEvent(body: Buffer, signature: string): Stripe.Event {
|
||||
|
|
|
|||
4719
frontend/package-lock.json
generated
4719
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue