Skip Q2 voice delivery for wholesale-only carriers
Wholesale voice carriers run their own switching by definition — the Q2 options (reseller, UCaaS, own switch) are retail delivery models. When wholesale is selected in Q1b, Q2 is hidden and Q3 (infrastructure needs: LCR, DIDs, interconnection, STIR/SHAKEN) is shown directly. voiceDelivery is auto-set to own_switch for wholesale. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3273a7020e
commit
9c4d65c7a9
1 changed files with 19 additions and 1 deletions
|
|
@ -396,13 +396,29 @@ select:focus,input:focus{outline:none;border-color:#1e3a5f;box-shadow:0 0 0 2px
|
|||
}
|
||||
|
||||
// ── Q1: Service types ──
|
||||
function updateVoiceQuestions() {
|
||||
var hasVoice = wizard.serviceTypes.indexOf('voice') >= 0;
|
||||
var isWholesaleOnly = wizard.customerType === 'wholesale';
|
||||
// Wholesale voice carriers run their own switching by definition — skip Q2, show Q3 directly
|
||||
if (hasVoice && isWholesaleOnly) {
|
||||
document.getElementById('q2').classList.add('hidden');
|
||||
document.getElementById('q3').classList.remove('hidden');
|
||||
wizard.voiceDelivery = 'own_switch'; // implied for wholesale
|
||||
} else if (hasVoice) {
|
||||
document.getElementById('q2').classList.remove('hidden');
|
||||
// Q3 visibility still controlled by Q2 answer
|
||||
} else {
|
||||
document.getElementById('q2').classList.add('hidden');
|
||||
document.getElementById('q3').classList.add('hidden');
|
||||
}
|
||||
}
|
||||
document.querySelectorAll('[data-svc]').forEach(function(cb) {
|
||||
cb.addEventListener('change', function() {
|
||||
wizard.serviceTypes = Array.from(document.querySelectorAll('[data-svc]:checked')).map(function(c) { return c.dataset.svc; });
|
||||
var hasVoice = wizard.serviceTypes.indexOf('voice') >= 0;
|
||||
var hasBroadband = wizard.serviceTypes.indexOf('broadband') >= 0;
|
||||
document.getElementById('q1b').classList.toggle('hidden', !hasVoice && !hasBroadband);
|
||||
document.getElementById('q2').classList.toggle('hidden', !hasVoice);
|
||||
updateVoiceQuestions();
|
||||
document.getElementById('q4').classList.toggle('hidden', !hasBroadband);
|
||||
if (hasVoice || hasBroadband) document.getElementById('q5').classList.remove('hidden');
|
||||
});
|
||||
|
|
@ -413,6 +429,8 @@ select:focus,input:focus{outline:none;border-color:#1e3a5f;box-shadow:0 0 0 2px
|
|||
document.querySelectorAll('[data-custtype]').forEach(function(b) { b.classList.remove('selected'); });
|
||||
btn.classList.add('selected');
|
||||
wizard.customerType = btn.dataset.custtype;
|
||||
// Re-evaluate whether to show Q2 or skip to Q3
|
||||
updateVoiceQuestions();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue