import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
import { Customer } from '../models/customer-identity.model';
import { VkIdGateway } from './vk-id-gateway.interface';

/**
 * No real VK OAuth app is configured yet - this mock exists so the
 * VkIdLoginButtonComponent has something to call and the flow shape is
 * provable end-to-end before a real client id/secret exist. Swap
 * VK_ID_GATEWAY once docs/backend/PHASE-8-IDENTITY-MESSAGING-CONTRACT.md §2
 * ships; the real backend completes OAuth server-side, this interface never
 * exposes a client secret regardless of implementation.
 */
@Injectable({ providedIn: 'root' })
export class VkIdLocalGateway implements VkIdGateway {
  getAuthorizeUrl(): Observable<string> {
    return of('about:blank#vk-id-not-configured');
  }

  completeCallback(_code: string, _codeVerifier: string): Observable<Customer> {
    return of({
      id: 'customer_vk_mock',
      marketplaceId: 'default',
      status: 'active',
      createdAt: new Date().toISOString(),
    });
  }
}
