Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import { Repository } from 'typeorm';
|
|
import { JwtService } from '@nestjs/jwt';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import { Tenant } from './entities/tenant.entity';
|
|
import { User } from './entities/user.entity';
|
|
import { RegisterDto, LoginDto } from './dto/register.dto';
|
|
export interface TokenPayload {
|
|
sub: string;
|
|
tenantId: string;
|
|
phone: string;
|
|
role: string;
|
|
}
|
|
export interface AuthResponse {
|
|
accessToken: string;
|
|
refreshToken: string;
|
|
user: {
|
|
id: string;
|
|
name: string;
|
|
role: string;
|
|
phone: string;
|
|
};
|
|
tenant: {
|
|
id: string;
|
|
name: string;
|
|
slug: string;
|
|
businessType: string;
|
|
subscriptionStatus: string;
|
|
};
|
|
}
|
|
export declare class AuthService {
|
|
private readonly tenantRepository;
|
|
private readonly userRepository;
|
|
private readonly jwtService;
|
|
private readonly configService;
|
|
constructor(tenantRepository: Repository<Tenant>, userRepository: Repository<User>, jwtService: JwtService, configService: ConfigService);
|
|
private generateSlug;
|
|
register(dto: RegisterDto): Promise<AuthResponse>;
|
|
login(dto: LoginDto): Promise<AuthResponse>;
|
|
refreshToken(refreshToken: string): Promise<AuthResponse>;
|
|
changePin(userId: string, currentPin: string, newPin: string): Promise<void>;
|
|
private generateTokens;
|
|
}
|