feat: full locations CRUD + legal policies in settings

Backend:
- CRUD completo para countries, regions y cities
- GET /settings/policy/:key — página HTML pública para políticas
- GET/PATCH /settings/policies/:key — admin endpoints protegidos

Admin:
- /locations: árbol interactivo País → Región → Ciudad con add/edit/delete
- /settings: editor de Política de Privacidad y Términos con enlace público copiable
- Sidebar: Ciudades → Ubicaciones

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-27 07:45:53 -05:00
co-authored by Claude Sonnet 4.6
parent 5c740420e9
commit 39c4301d1b
9 changed files with 604 additions and 196 deletions
+29
View File
@@ -0,0 +1,29 @@
import { PrismaClient } from '@prisma/client';
import * as bcrypt from 'bcryptjs';
const prisma = new PrismaClient();
async function main() {
const email = 'admin@prosapp.co';
const password = process.argv[2] || 'Admin2024!';
const password_hash = await bcrypt.hash(password, 10);
const user = await prisma.users.upsert({
where: { email },
create: {
email,
password_hash,
name: 'Admin',
},
update: {
password_hash,
},
});
console.log(`✓ Admin listo: ${user.email} | password: ${password}`);
}
main()
.catch(console.error)
.finally(() => prisma.$disconnect());