Added Money System

This commit is contained in:
2026-01-22 19:25:25 +01:00
parent d5d0d5aaf4
commit bb5c3058b1
12 changed files with 703 additions and 266 deletions

View File

@@ -22,8 +22,10 @@ export async function GET(
nom: true,
prenom: true,
telephone: true,
telephoneSecondaire: true,
email: true,
adresse: true,
forfait: true,
},
},
chauffeur: {
@@ -64,7 +66,7 @@ export async function PUT(
}
const body = await request.json();
const { date, adresseDepart, adresseArrivee, commentaire, statut, adherentId, chauffeurId } = body;
const { date, adresseDepart, adresseArrivee, commentaire, instructions, statut, adherentId, chauffeurId } = body;
const trajet = await prisma.trajet.update({
where: { id: params.id },
@@ -73,6 +75,7 @@ export async function PUT(
...(adresseDepart && { adresseDepart }),
...(adresseArrivee && { adresseArrivee }),
...(commentaire !== undefined && { commentaire }),
...(instructions !== undefined && { instructions }),
...(statut && { statut }),
...(adherentId && { adherentId }),
...(chauffeurId !== undefined && { chauffeurId }),
@@ -84,7 +87,9 @@ export async function PUT(
nom: true,
prenom: true,
telephone: true,
telephoneSecondaire: true,
email: true,
forfait: true,
},
},
chauffeur: {

View File

@@ -45,7 +45,9 @@ export async function GET(request: NextRequest) {
nom: true,
prenom: true,
telephone: true,
telephoneSecondaire: true,
email: true,
forfait: true,
},
},
chauffeur: {
@@ -80,7 +82,7 @@ export async function POST(request: NextRequest) {
}
const body = await request.json();
const { date, adresseDepart, adresseArrivee, commentaire, statut, adherentId, chauffeurId } = body;
const { date, adresseDepart, adresseArrivee, commentaire, instructions, statut, adherentId, chauffeurId } = body;
if (!date || !adresseDepart || !adresseArrivee || !adherentId) {
return NextResponse.json(
@@ -95,6 +97,7 @@ export async function POST(request: NextRequest) {
adresseDepart,
adresseArrivee,
commentaire: commentaire || null,
instructions: instructions || null,
statut: statut || 'Planifié',
adherentId,
chauffeurId: chauffeurId || null,
@@ -106,7 +109,9 @@ export async function POST(request: NextRequest) {
nom: true,
prenom: true,
telephone: true,
telephoneSecondaire: true,
email: true,
forfait: true,
},
},
chauffeur: {