/**
 * Smoke: register unlocked, lock it, then unlock. Proves setDomainLock().
 */
import { registerDomain, setDomainLock, type RegistrationContact } from '../lib/opensrs';

const CONTACT: RegistrationContact = {
  first_name: 'Mark', last_name: 'Henderson', org_name: 'Get Acquired Inc',
  address1: '123 King St W', city: 'Toronto', state: 'ON',
  country: 'CA', postal_code: 'M5H 1A1',
  phone: '+1.4165551234', email: 'mark@getacquired.com',
};

async function main() {
  const domain = `vibnai-lock-${Date.now()}.com`;
  const reg = await registerDomain({ domain, period: 1, contact: CONTACT });
  console.log('[lock-smoke] registered', domain, 'order=', reg.orderId);
  console.log('[lock-smoke] lock ->', await setDomainLock(domain, true));
  console.log('[lock-smoke] unlock ->', await setDomainLock(domain, false));
}

main().catch(err => { console.error('[lock-smoke] FAILED:', err); process.exit(1); });
