// Package services provides service client interfaces for inter-service communication.
package services

import (
	"context"
)

// IdentityServiceClient is the interface for communicating with the Identity Service.
type IdentityServiceClient interface {
	// GetUser retrieves a user by ID.
	GetUser(ctx context.Context, id string) (*User, error)

	// GetUserByEmail retrieves a user by email address.
	GetUserByEmail(ctx context.Context, email string) (*User, error)

	// CreateUser creates a new user.
	CreateUser(ctx context.Context, user *CreateUserRequest) (*User, error)

	// UpdateUser updates an existing user.
	UpdateUser(ctx context.Context, id string, user *UpdateUserRequest) (*User, error)

	// DeleteUser deletes a user.
	DeleteUser(ctx context.Context, id string) error

	// VerifyEmail verifies a user's email address using a verification token.
	VerifyEmail(ctx context.Context, token string) error

	// RequestPasswordReset requests a password reset token.
	RequestPasswordReset(ctx context.Context, email string) error

	// ResetPassword resets a user's password using a reset token.
	ResetPassword(ctx context.Context, token, newPassword string) error
}

// User represents a user in the system.
type User struct {
	ID            string `json:"id"`
	Email         string `json:"email"`
	Username      string `json:"username"`
	FirstName     string `json:"first_name"`
	LastName      string `json:"last_name"`
	EmailVerified bool   `json:"email_verified"`
	CreatedAt     int64  `json:"created_at"`
	UpdatedAt     int64  `json:"updated_at"`
}

// CreateUserRequest contains the data needed to create a new user.
type CreateUserRequest struct {
	Email     string `json:"email"`
	Username  string `json:"username"`
	Password  string `json:"password"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

// UpdateUserRequest contains the data needed to update a user.
type UpdateUserRequest struct {
	Email     *string `json:"email,omitempty"`
	Username  *string `json:"username,omitempty"`
	FirstName *string `json:"first_name,omitempty"`
	LastName  *string `json:"last_name,omitempty"`
}
