|
|
@ -1412,7 +1412,7 @@ fastify.route({
|
|
|
|
handler: userController.updateQuotedAmountForSupplier,
|
|
|
|
handler: userController.updateQuotedAmountForSupplier,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
fastify.route({
|
|
|
|
method: 'PUT',
|
|
|
|
method: 'PUT',
|
|
|
|
url: '/api/request-booking-status/:_id/supplier/quotestatus',
|
|
|
|
url: '/api/request-booking-status/:_id/supplier/quotestatus',
|
|
|
|
schema: {
|
|
|
|
schema: {
|
|
|
@ -1453,7 +1453,48 @@ fastify.route({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
|
|
|
url: '/api/request-advance-amount/:_id/supplier/advance',
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
'Update adavance with reference number for particular supplier by user',
|
|
|
|
|
|
|
|
tags: ['User'],
|
|
|
|
|
|
|
|
summary: 'Update adavance with reference number for particular supplier by user',
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
_id: { type: 'string', description: 'Booking _id' },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
required: ['_id'],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
supplierId: { type: 'string' },
|
|
|
|
|
|
|
|
advance_paid: { type: 'number' }, // ✅ fixed
|
|
|
|
|
|
|
|
advance_ref_number: { type: 'string' }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
response: {
|
|
|
|
|
|
|
|
200: {
|
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
400: { type: 'object' },
|
|
|
|
|
|
|
|
404: { type: 'object' },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
security: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
basicAuth: [],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// preHandler: fastify.auth([fastify.authenticate]), // enable if needed
|
|
|
|
|
|
|
|
handler: userController.updateadvanceForSupplier,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
method: 'PUT',
|
|
|
|
method: 'PUT',
|
|
|
|
url: '/api/request-advance-amount/:_id/supplier/advance',
|
|
|
|
url: '/api/request-advance-amount/:_id/supplier/advance',
|
|
|
|
schema: {
|
|
|
|
schema: {
|
|
|
@ -1473,7 +1514,7 @@ fastify.route({
|
|
|
|
properties: {
|
|
|
|
properties: {
|
|
|
|
supplierId: { type: 'string' },
|
|
|
|
supplierId: { type: 'string' },
|
|
|
|
advance_paid: { type: 'number' }, // ✅ fixed
|
|
|
|
advance_paid: { type: 'number' }, // ✅ fixed
|
|
|
|
advance_ref_number: { type: 'string' }
|
|
|
|
advance_ref_number: { type: 'string' }
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -1494,5 +1535,42 @@ fastify.route({
|
|
|
|
handler: userController.updateadvanceForSupplier,
|
|
|
|
handler: userController.updateadvanceForSupplier,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
|
|
|
method: 'POST',
|
|
|
|
|
|
|
|
url: '/api/request-advance-amount/:id/supplier/split',
|
|
|
|
|
|
|
|
schema: {
|
|
|
|
|
|
|
|
description: 'Split a booking into multiple entries based on supplier-edited capacity & quantity',
|
|
|
|
|
|
|
|
tags: ['User'],
|
|
|
|
|
|
|
|
summary: 'Split booking by capacity and quantity',
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
id: { type: 'string', description: 'Booking _id' },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
required: ['id'],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
body: {
|
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
|
|
|
|
properties: {
|
|
|
|
|
|
|
|
capacity: { type: 'number' }, // supplier wants capacity per booking
|
|
|
|
|
|
|
|
quantity: { type: 'number' }, // number of bookings
|
|
|
|
|
|
|
|
date: { type: 'string' }, // optional new date
|
|
|
|
|
|
|
|
time: { type: 'string' }, // optional new time
|
|
|
|
|
|
|
|
quoted_amount: { type: 'number' } // optional new quoted amount
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
required: ['capacity', 'quantity'],
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
response: {
|
|
|
|
|
|
|
|
200: { type: 'object' },
|
|
|
|
|
|
|
|
400: { type: 'object' },
|
|
|
|
|
|
|
|
404: { type: 'object' },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handler: userController.splitBookingForSupplier,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next();
|
|
|
|
next();
|
|
|
|
};
|
|
|
|
};
|
|
|
|