{
    "openapi": "3.0.0",
    "info": {
        "title": "Attendance Documentation",
        "description": "API Documentation for Klizo's Attendance System",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "http://127.0.0.1:8000/",
            "description": "Local server"
        },
        {
            "url": "https://dev.new.attendance.klizos.com/",
            "description": "Dev server"
        },
        {
            "url": "https://attendance.klizos.com/",
            "description": "Production server"
        }
    ],
    "paths": {
        "/api/upcoming-events": {
            "get": {
                "tags": [
                    "Events"
                ],
                "summary": "Get all the events",
                "description": "Get the list of upcoming events including birthdays and work anniversaries",
                "operationId": "4b4b3f38457cb451a3e056fd317f0127",
                "parameters": [
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "Filter events by time period",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "this_week",
                            "enum": [
                                "this_week",
                                "last_week"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Items per page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Events retrieved successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "Events retrieved successfully"
                                        },
                                        "data": {
                                            "properties": {
                                                "events": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "employee_name": {
                                                                "type": "string"
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            },
                                                            "event_type": {
                                                                "type": "string"
                                                            },
                                                            "event_date": {
                                                                "type": "string"
                                                            },
                                                            "designation": {
                                                                "type": "string"
                                                            },
                                                            "is_today": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "pagination": {
                                                    "properties": {
                                                        "current_page": {
                                                            "type": "integer"
                                                        },
                                                        "total": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/increments": {
            "post": {
                "tags": [
                    "Increments"
                ],
                "summary": "Create a new increment",
                "operationId": "32a203185684c0efa77cc9894ad14bb5",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "user_id",
                                    "last_increment_date",
                                    "non_resignation_period"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "string"
                                    },
                                    "last_increment_date": {
                                        "type": "string",
                                        "format": "date"
                                    },
                                    "non_resignation_period": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Increment created successfully"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                }
            }
        },
        "/api/increments-reminder": {
            "get": {
                "tags": [
                    "Increments"
                ],
                "summary": "Get increment reminders",
                "description": "Returns a list of upcoming and/or pending increments. You can filter by bucket (all, upcoming, pending) and by month (YYYY-MM).",
                "operationId": "da7de6a6884bc6431b9f6517216d60c4",
                "parameters": [
                    {
                        "name": "bucket",
                        "in": "query",
                        "description": "Filter by bucket: all, upcoming, or pending. If not set, both are returned.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "all",
                                "upcoming",
                                "pending"
                            ]
                        }
                    },
                    {
                        "name": "month",
                        "in": "query",
                        "description": "Filter by month in format YYYY-MM (e.g., 2025-07).",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}$"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "upcoming": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "_id": {
                                                        "type": "string"
                                                    },
                                                    "user_name": {
                                                        "type": "string"
                                                    },
                                                    "designation": {
                                                        "type": "string"
                                                    },
                                                    "last_increment": {
                                                        "type": "string",
                                                        "example": "02/02/2025"
                                                    },
                                                    "next_increment": {
                                                        "type": "string",
                                                        "example": "02/08/2025"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "upcoming"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        },
                                        "pending": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "_id": {
                                                        "type": "string"
                                                    },
                                                    "user_name": {
                                                        "type": "string"
                                                    },
                                                    "designation": {
                                                        "type": "string"
                                                    },
                                                    "last_increment": {
                                                        "type": "string",
                                                        "example": "02/01/2025"
                                                    },
                                                    "next_increment": {
                                                        "type": "string",
                                                        "example": "02/07/2025"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "example": "pending"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/login": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Login user",
                "operationId": "bddf55e8520016eea030ebf5dc40daec",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "email",
                                    "password"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "john@klizos.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "format": "password",
                                        "example": "password123"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Login successful",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "name": "Authorization",
                "in": "header",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Events",
            "description": "Events"
        },
        {
            "name": "Increments",
            "description": "Increments"
        },
        {
            "name": "User",
            "description": "User"
        }
    ]
}