feat: add city/state/country to complex, new settings page with sidebar, and Biome linting
- Added city, state, and country optional fields to Complex model - Updated onboarding to include optional location fields - Created new settings page with sidebar navigation (Datos del Complejo, Canchas) - Replaced ESLint with Biome for frontend and backend linting - Added parallel dev script with concurrently - Migrated register-routes to use direct app.route() pattern
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
import 'dotenv/config'
|
||||
import { PrismaPg } from '@prisma/adapter-pg'
|
||||
import { PrismaClient } from '../src/generated/prisma/client'
|
||||
import { planSeeds } from './plans.seed-data'
|
||||
import 'dotenv/config';
|
||||
import { PrismaPg } from '@prisma/adapter-pg';
|
||||
import { PrismaClient } from '../src/generated/prisma/client';
|
||||
import { planSeeds } from './plans.seed-data';
|
||||
|
||||
const databaseUrl = process.env.DATABASE_URL
|
||||
const databaseUrl = process.env.DATABASE_URL;
|
||||
|
||||
if (!databaseUrl) {
|
||||
throw new Error('Missing DATABASE_URL in environment for plan reset.')
|
||||
throw new Error('Missing DATABASE_URL in environment for plan reset.');
|
||||
}
|
||||
|
||||
const adapter = new PrismaPg({
|
||||
connectionString: databaseUrl,
|
||||
})
|
||||
});
|
||||
|
||||
const prisma = new PrismaClient({ adapter })
|
||||
const prisma = new PrismaClient({ adapter });
|
||||
|
||||
async function run() {
|
||||
const complexesUsingPlans = await prisma.complex.count({
|
||||
where: { planCode: { not: null } },
|
||||
})
|
||||
});
|
||||
|
||||
if (complexesUsingPlans > 0) {
|
||||
throw new Error(
|
||||
`No se puede resetear planes: hay ${complexesUsingPlans} complejos con plan asignado.`,
|
||||
)
|
||||
`No se puede resetear planes: hay ${complexesUsingPlans} complejos con plan asignado.`
|
||||
);
|
||||
}
|
||||
|
||||
await prisma.$transaction(async (tx) => {
|
||||
await tx.plan.deleteMany({})
|
||||
await tx.plan.deleteMany({});
|
||||
|
||||
for (const plan of planSeeds) {
|
||||
await tx.plan.create({
|
||||
@@ -37,19 +37,19 @@ async function run() {
|
||||
price: plan.price,
|
||||
rules: plan.rules,
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
console.log('Planes reseteados: BASIC, ADVANCED, ENTERPRISE')
|
||||
console.log('Planes reseteados: BASIC, ADVANCED, ENTERPRISE');
|
||||
}
|
||||
|
||||
run()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect()
|
||||
await prisma.$disconnect();
|
||||
})
|
||||
.catch(async (error) => {
|
||||
console.error(error)
|
||||
await prisma.$disconnect()
|
||||
process.exit(1)
|
||||
})
|
||||
console.error(error);
|
||||
await prisma.$disconnect();
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user