Files
hoshpoint-backend/storage/api-docs/api-docs.json
soheil khaledabadi ae974c2afa feat: add ApiResponse trait for standardized API responses
chore: update composer dependencies to include phppresentation

chore: update composer.lock after adding phppresentation

feat: create categories migration for category management

feat: create templates migration for template storage

feat: create template generations migration for tracking template usage

feat: create template keys migration for template customization

feat: create notifications migration for user notifications

feat: update API routes for categories, templates, and user profile management

docs: update API documentation to include new endpoints for profile and wallet
2026-07-07 01:03:12 +03:30

494 lines
19 KiB
JSON

{
"openapi": "3.0.0",
"info": {
"title": "Hoshpoint API",
"description": "API documentation for Hoshpoint backend",
"version": "1.0.0"
},
"servers": [
{
"url": "/api",
"description": "API server"
}
],
"paths": {
"/auth/register": {
"post": {
"tags": [
"Auth"
],
"summary": "Register",
"description": "Register a new user account",
"operationId": "08136088c4862c313b35d6518bab8d3a",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"required": [
"name",
"mobile",
"email",
"password"
],
"properties": {
"name": {
"type": "string",
"example": "علی رضایی"
},
"mobile": {
"type": "string",
"example": "09123456789"
},
"email": {
"type": "string",
"format": "email",
"example": "ali@example.com"
},
"password": {
"type": "string",
"format": "password",
"example": "password123"
}
},
"type": "object"
}
}
}
},
"responses": {
"201": {
"description": "Registered successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "ثبت‌نام با موفقیت انجام شد."
},
"data": {
"properties": {
"user": {
"$ref": "#/components/schemas/User"
},
"token": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"422": {
"description": "Validation error"
}
}
}
},
"/auth/login": {
"post": {
"tags": [
"Auth"
],
"summary": "Login",
"description": "Login with email or username",
"operationId": "99d66635c4992aeaa6aa44ff653d0563",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"required": [
"login",
"password"
],
"properties": {
"login": {
"description": "Email or username",
"type": "string",
"example": "ali@example.com"
},
"password": {
"type": "string",
"format": "password",
"example": "password123"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Logged in successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "ورود با موفقیت انجام شد."
},
"data": {
"properties": {
"user": {
"$ref": "#/components/schemas/User"
},
"token": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"422": {
"description": "Invalid credentials"
}
}
}
},
"/profile": {
"get": {
"tags": [
"Profile"
],
"summary": "Show profile",
"description": "Get the authenticated user profile",
"operationId": "c6a79007a56511faa6f48397a2d15867",
"responses": {
"200": {
"description": "Profile fetched successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "اطلاعات پروفایل با موفقیت دریافت شد."
},
"data": {
"properties": {
"user": {
"$ref": "#/components/schemas/User"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"401": {
"description": "Unauthenticated"
}
},
"security": [
{
"sanctum": []
}
]
},
"put": {
"tags": [
"Profile"
],
"summary": "Update profile",
"description": "Update the authenticated user profile",
"operationId": "74599296b1816be41ad4228975229966",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"name": {
"type": "string",
"example": "علی رضایی"
},
"username": {
"type": "string",
"example": "ali"
},
"email": {
"type": "string",
"format": "email",
"example": "ali@example.com"
},
"mobile": {
"type": "string",
"example": "09123456789"
},
"password": {
"type": "string",
"format": "password",
"example": "password123"
}
},
"type": "object"
}
}
}
},
"responses": {
"200": {
"description": "Profile updated successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "پروفایل با موفقیت به‌روزرسانی شد."
},
"data": {
"properties": {
"user": {
"$ref": "#/components/schemas/User"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"401": {
"description": "Unauthenticated"
},
"422": {
"description": "Validation error"
}
},
"security": [
{
"sanctum": []
}
]
}
},
"/wallet": {
"get": {
"tags": [
"Wallet"
],
"summary": "Show wallet",
"description": "Get the authenticated user wallet",
"operationId": "4f659600ab1fd5e3ab27775fea03ec91",
"responses": {
"200": {
"description": "Wallet fetched successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "اطلاعات کیف پول با موفقیت دریافت شد."
},
"data": {
"properties": {
"wallet": {
"$ref": "#/components/schemas/Wallet"
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"401": {
"description": "Unauthenticated"
}
},
"security": [
{
"sanctum": []
}
]
}
},
"/wallet/transactions": {
"get": {
"tags": [
"Wallet"
],
"summary": "List wallet transactions",
"description": "Get the authenticated user wallet transactions",
"operationId": "3ea6e910cbeabfdd2ca4db13b8d358b2",
"parameters": [
{
"name": "per_page",
"in": "query",
"description": "Items per page",
"schema": {
"type": "integer",
"example": 15
}
}
],
"responses": {
"200": {
"description": "Wallet transactions fetched successfully",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "تراکنش‌های کیف پول با موفقیت دریافت شد."
},
"data": {
"properties": {
"transactions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WalletTransaction"
}
}
},
"type": "object"
}
},
"type": "object"
}
}
}
},
"401": {
"description": "Unauthenticated"
}
},
"security": [
{
"sanctum": []
}
]
}
}
},
"components": {
"schemas": {
"User": {
"properties": {
"id": {
"type": "integer",
"example": 1
},
"name": {
"type": "string",
"example": "علی رضایی"
},
"username": {
"type": "string",
"example": "ali"
},
"email": {
"type": "string",
"format": "email",
"example": "ali@example.com"
},
"mobile": {
"type": "string",
"example": "09123456789"
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"type": "object"
},
"Wallet": {
"properties": {
"id": {
"type": "integer",
"example": 1
},
"balance": {
"type": "integer",
"example": 500000
},
"is_active": {
"type": "boolean",
"example": true
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"type": "object"
},
"WalletTransaction": {
"properties": {
"id": {
"type": "integer",
"example": 1
},
"type": {
"type": "string",
"example": "credit"
},
"type_label": {
"type": "string",
"example": "واریز"
},
"amount": {
"type": "integer",
"example": 100000
},
"balance_before": {
"type": "integer",
"example": 400000
},
"balance_after": {
"type": "integer",
"example": 500000
},
"description": {
"type": "string",
"example": "شارژ کیف پول",
"nullable": true
},
"created_at": {
"type": "string",
"format": "date-time"
}
},
"type": "object"
}
}
},
"tags": [
{
"name": "Auth",
"description": "Authentication endpoints"
},
{
"name": "Profile",
"description": "Profile"
},
{
"name": "Wallet",
"description": "Wallet"
}
]
}