chore: formatting updates and lockfile changes

This commit is contained in:
Tiago Yamamoto 2025-12-15 10:40:55 -03:00
parent 5c45557537
commit 3be9807d88
8 changed files with 4851 additions and 89 deletions

View file

@ -7,4 +7,4 @@ import { AdminController } from './admin.controller';
controllers: [AdminController],
exports: [AdminService],
})
export class AdminModule { }
export class AdminModule {}

View file

@ -16,4 +16,4 @@ import { AdminModule } from './admin';
controllers: [AppController],
providers: [AppService],
})
export class AppModule { }
export class AppModule {}

View file

@ -5,11 +5,17 @@ import { PlansService } from './plans.service';
@ApiTags('Plans')
@Controller('plans')
export class PlansController {
constructor(private readonly plansService: PlansService) { }
constructor(private readonly plansService: PlansService) {}
@Get() @ApiOperation({ summary: 'Get all plans' })
getAllPlans() { return this.plansService.getAllPlans(); }
@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(':id')
@ApiOperation({ summary: 'Get plan by ID' })
getPlanById(@Param('id') id: string) {
return this.plansService.getPlanById(id);
}
}

View file

@ -7,4 +7,4 @@ import { PlansController } from './plans.controller';
controllers: [PlansController],
exports: [PlansService],
})
export class PlansModule { }
export class PlansModule {}

View file

@ -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);
}
}

View file

@ -8,4 +8,4 @@ import { StripeService } from './stripe.service';
providers: [StripeService],
exports: [StripeService],
})
export class StripeModule { }
export class StripeModule {}

View file

@ -6,7 +6,7 @@ import Stripe from 'stripe';
export class StripeService implements OnModuleInit {
private stripe: Stripe;
constructor(private configService: ConfigService) { }
constructor(private configService: ConfigService) {}
onModuleInit() {
const secretKey = this.configService.get<string>('STRIPE_SECRET_KEY');
@ -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 {

File diff suppressed because it is too large Load diff