This commit is contained in:
2026-10-01 14:01:17 +05:30
parent fe5a009b66
commit a40274fdd8
3 changed files with 32 additions and 3 deletions
+28
View File
@@ -280,6 +280,34 @@ async function run(port) {
assert(paid.status === 200 && paid.json.data.paymentType === 'lease', 'lease payment failed');
assert(paid.json.data.stageLogDates.paymentApproved, 'payment stage log missing');
for (const stage of ['orderedByCustomer', 'documentsProcessed']) {
const stepped = await request(port, 'PATCH', '/api/stocks/CH-RED/stage', {
token: dealerToken,
body: { stage },
});
assert(stepped.status === 200, `CH-RED stage ${stage} failed`);
}
const bothMissingName = await request(port, 'PATCH', '/api/stocks/CH-RED/stage', {
token: dealerToken,
body: { stage: 'paymentApproved', paymentType: 'lease', leaseProviderType: 'both' },
});
assert(bothMissingName.status === 400, 'both lease options should require a finance company');
const bothPaid = await request(port, 'PATCH', '/api/stocks/CH-RED/stage', {
token: dealerToken,
body: {
stage: 'paymentApproved',
paymentType: 'lease',
leaseProviderType: 'both',
financeCompanyName: 'GCI Finance',
},
});
assert(
bothPaid.status === 200 &&
bothPaid.json.data.leaseProviderType === 'both' &&
bothPaid.json.data.financeCompanyName === 'GCI Finance',
'lease with both GCI and finance failed'
);
const outside = await request(port, 'POST', '/api/stocks/CH-YELLOW/transfer', {
token: repToken,
body: { dealerId: dealerC.json.data.id },