import { ApiProperty } from "@nestjs/swagger";
import { CustomerDocType } from "@prisma/client";

export class CustomerDto {
  @ApiProperty({ example: "cus_01HXYZABCDEFGHJKMNPQRSTV" })
  id!: string;

  @ApiProperty({ example: "mer_01HXYZABCDEFGHJKMNPQRSTV" })
  merchantId!: string;

  @ApiProperty({ required: false, nullable: true, example: "cliente@acme.com.py" })
  email!: string | null;

  @ApiProperty({ required: false, nullable: true, example: "Juan Pérez" })
  name!: string | null;

  @ApiProperty({ required: false, nullable: true, enum: CustomerDocType, example: CustomerDocType.ruc })
  docType!: CustomerDocType | null;

  @ApiProperty({ required: false, nullable: true, example: "80012345-6" })
  docNumber!: string | null;

  @ApiProperty({ required: false, nullable: true, example: "+595981000111" })
  phone!: string | null;

  @ApiProperty({ required: false, nullable: true, example: "PY" })
  country!: string | null;

  @ApiProperty({ required: false, nullable: true, example: { erpCustomerId: "C-00123" } })
  metadata!: Record<string, unknown> | null;

  @ApiProperty({ example: "2026-06-07T14:30:00.000Z" })
  createdAt!: Date;

  @ApiProperty({ example: "2026-06-07T14:30:00.000Z" })
  updatedAt!: Date;
}

export class CustomerListDto {
  @ApiProperty({ type: [CustomerDto] })
  data!: CustomerDto[];

  @ApiProperty({ required: false, nullable: true, example: null })
  nextCursor!: string | null;
}
