/**
 * Facebook identity 绑定请求 DTO
 */
import {
  FacebookIdentityRequestSchema,
  type FacebookIdentityRequestInput,
  type FacebookIdentityRequestData,
} from "@/data/schemas/auth/request/facebook_identity_request";

export class FacebookIdentityRequest {
  private constructor(input: FacebookIdentityRequestInput) {
    const data = FacebookIdentityRequestSchema.parse(input);
    Object.assign(this, data);
    Object.freeze(this);
  }

  static from(input: FacebookIdentityRequestInput): FacebookIdentityRequest {
    return new FacebookIdentityRequest(input);
  }

  static fromJson(json: unknown): FacebookIdentityRequest {
    return FacebookIdentityRequest.from(json as FacebookIdentityRequestInput);
  }

  toJson(): FacebookIdentityRequestData {
    return FacebookIdentityRequestSchema.parse(this);
  }
}
