<?php

namespace api\models;

use OpenApi\Annotations as OA;

// วางไฟล์นี้ไว้ใน path ที่ถูก scan (เช่น @api/models)
final class OpenApiSchemas
{
  /**
   * @OA\Schema(
   *   schema="HisRequest",
   *   type="object",
   *   required={"id","hospital_code","status","import_at"},
   *   @OA\Property(property="id", type="integer", example=123),
   *   @OA\Property(property="hospital_code", type="string", example="H001"),
   *   @OA\Property(property="payload", type="object"),
   *   @OA\Property(property="status", type="string", example="pending"),
   *   @OA\Property(property="import_at", type="string", format="date-time", example="2025-08-14T12:34:56Z")
   * )
   */
  public static function schemaHisRequest() {}

  /**
   * @OA\Schema(
   *   schema="CreateHisRequest",
   *   type="object",
   *   required={"hospital_code"},
   *   @OA\Property(property="hospital_code", type="string", example="H001"),
   *   @OA\Property(
   *     property="payload",
   *     type="object",
   *     example={"labno":"123456789","patient":{"hn":"0001234","name":"ทดสอบ ระบบ"}}
   *   )
   * )
   */
  public static function schemaCreateHisRequest() {}

  /**
   * @OA\Schema(
   *   schema="UpdateHisRequest",
   *   type="object",
   *   @OA\Property(property="status", type="string", example="approved"),
   *   @OA\Property(property="payload", type="object")
   * )
   */
  public static function schemaUpdateHisRequest() {}

  /**
   * @OA\Schema(
   *   schema="ErrorValidate",
   *   type="object",
   *   required={"message","errors"},
   *   @OA\Property(property="message", type="string", example="Validation failed"),
   *   @OA\Property(
   *     property="errors",
   *     type="object",
   *     additionalProperties=true,
   *     example={"username":{"0":"Username is required"}}
   *   )
   * )
   */
  public static function schemaErrorValidate() {}

  /**
   * @OA\Schema(
   *   schema="Unauthorized",
   *   type="object",
   *   required={"message"},
   *   @OA\Property(property="message", type="string", example="Unauthorized")
   * )
   */
  public static function schemaUnauthorized() {}


  /**
   * @OA\Schema(
   *   schema="HisResult",
   *   type="object",
   *   required={"id","hospital_code","status","import_at"},
   *   @OA\Property(property="id", type="integer", example=123),
   *   @OA\Property(property="hospital_code", type="string", example="H001"),
   *   @OA\Property(property="payload", type="object"),
   *   @OA\Property(property="status", type="string", example="pending"),
   *   @OA\Property(property="import_at", type="string", format="date-time", example="2025-08-14T12:34:56+07:00")
   * )
   */
  public static function schemaHisResult() {}


  /**
   * @OA\Schema(
   *   schema="User",
   *   type="object",
   *   required={"id","username","email","status","created_at","updated_at"},
   *   @OA\Property(property="id", type="integer", example=1),
   *   @OA\Property(property="username", type="string", example="manop"),
   *   @OA\Property(property="email", type="string", format="email", example="manop@example.com"),
   *   @OA\Property(property="realname", type="string", nullable=true, example="Manop Kongoon"),
   *   @OA\Property(property="hospital_id", type="integer", nullable=true, example=101),
   *   @OA\Property(property="status", type="integer", description="10=active, 0=deleted", example=10),
   *   @OA\Property(property="token", type="string", nullable=true, example="eyJhbGciOi..."),
   *   @OA\Property(property="created_at", type="string", format="date-time", example="2025-08-14T12:34:56+07:00"),
   *   @OA\Property(property="updated_at", type="string", format="date-time", example="2025-08-14T12:40:00+07:00")
   * )
   */
  public static function schemaUser() {}
}
