Phase 0 - Base modules (100% copy): - shared/ (errors, middleware, services, utils, types) - auth, users, tenants (multi-tenancy) - ai, audit, notifications, mcp, payment-terminals - billing-usage, branches, companies, core Phase 1 - Modules to adapt (70-95%): - partners (for shippers/consignees) - inventory (for refacciones) - financial (for transport costing) Phase 2 - Pattern modules (50-70%): - ordenes-transporte (from sales) - gestion-flota (from products) - viajes (from projects) Phase 3 - New transport-specific modules: - tracking (GPS, events, alerts) - tarifas-transporte (pricing, surcharges) - combustible-gastos (fuel, tolls, expenses) - carta-porte (CFDI complement 3.1) Estimated token savings: ~65% (~10,675 lines) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
CreateDateColumn,
|
|
Index,
|
|
ManyToOne,
|
|
JoinColumn,
|
|
} from 'typeorm';
|
|
import { User } from './user.entity.js';
|
|
|
|
@Entity({ schema: 'auth', name: 'password_resets' })
|
|
@Index('idx_password_resets_user_id', ['userId'])
|
|
@Index('idx_password_resets_token', ['token'])
|
|
@Index('idx_password_resets_expires_at', ['expiresAt'])
|
|
export class PasswordReset {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ type: 'uuid', nullable: false, name: 'user_id' })
|
|
userId: string;
|
|
|
|
@Column({ type: 'varchar', length: 500, unique: true, nullable: false })
|
|
token: string;
|
|
|
|
@Column({ type: 'timestamp', nullable: false, name: 'expires_at' })
|
|
expiresAt: Date;
|
|
|
|
@Column({ type: 'timestamp', nullable: true, name: 'used_at' })
|
|
usedAt: Date | null;
|
|
|
|
@Column({ type: 'inet', nullable: true, name: 'ip_address' })
|
|
ipAddress: string | null;
|
|
|
|
// Relaciones
|
|
@ManyToOne(() => User, (user) => user.passwordResets, {
|
|
onDelete: 'CASCADE',
|
|
})
|
|
@JoinColumn({ name: 'user_id' })
|
|
user: User;
|
|
|
|
// Timestamps
|
|
@CreateDateColumn({ name: 'created_at', type: 'timestamp' })
|
|
createdAt: Date;
|
|
}
|