package com.reading.platform.common.enums;

import lombok.Getter;

/**
 * Error Code Enum
 */
@Getter
public enum ErrorCode {

    SUCCESS(200, "success"),
    BAD_REQUEST(400, "Bad Request"),
    UNAUTHORIZED(401, "Unauthorized"),
    FORBIDDEN(403, "Forbidden"),
    NOT_FOUND(404, "Resource Not Found"),
    METHOD_NOT_ALLOWED(405, "Method Not Allowed"),
    INTERNAL_ERROR(500, "Internal Server Error"),

    // Business Errors (1000+)
    LOGIN_FAILED(1001, "Login failed"),
    ACCOUNT_DISABLED(1002, "Account is disabled"),
    TOKEN_EXPIRED(1003, "Token expired"),
    TOKEN_INVALID(1004, "Token invalid"),
    PERMISSION_DENIED(1005, "Permission denied"),

    // Data Errors (2000+)
    DATA_NOT_FOUND(2001, "Data not found"),
    DATA_ALREADY_EXISTS(2002, "Data already exists"),
    DATA_IN_USE(2003, "Data is in use"),
    INVALID_PARAMETER(2004, "Invalid parameter"),

    // Tenant Errors (3000+)
    TENANT_NOT_FOUND(3001, "Tenant not found"),
    TENANT_EXPIRED(3002, "Tenant has expired"),
    TENANT_DISABLED(3003, "Tenant is disabled"),

    // User Errors (4000+)
    USER_NOT_FOUND(4001, "User not found"),
    USER_ALREADY_EXISTS(4002, "User already exists"),
    PASSWORD_MISMATCH(4003, "Password mismatch"),
    OLD_PASSWORD_ERROR(4004, "Old password is incorrect");

    private final Integer code;
    private final String message;

    ErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
