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
This commit is contained in:
@@ -157,6 +157,231 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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": {
|
||||
@@ -190,6 +415,65 @@
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -197,6 +481,14 @@
|
||||
{
|
||||
"name": "Auth",
|
||||
"description": "Authentication endpoints"
|
||||
},
|
||||
{
|
||||
"name": "Profile",
|
||||
"description": "Profile"
|
||||
},
|
||||
{
|
||||
"name": "Wallet",
|
||||
"description": "Wallet"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user