#P1629
DELETE /v2/redis-accounting/clear-all
Clear All Documents
این اندپوینت تمام اسناد حسابداری ذخیرهشده در Redis را حذف میکند. عملیات شامل حذف تمامی Hashها، پاکسازی کامل تمام ایندکسها (Set / Sorted Set)، و حذف همه کلیدهای بالانس در سطوح گروه، کل، معین و تفضیلی است. این عملیات یک عملیات مخرب و غیرقابل بازگشت محسوب میشود.
Request Overview
URL:
/v2/redis-accounting/clear-allMethod: DELETE
Auth: Bearer Token (Required)
Content-Type: application/json
Request Body Schema
این اندپوینت هیچ ورودیای نمیپذیرد.
| Field | Type | Required | Description |
|---|---|---|---|
| — | — | — | بدون ورودی |
Request Example
DELETE /v2/redis-accounting/clear-all
Response (Success)
| Field | Type | Description |
|---|---|---|
success |
boolean | وضعیت عملیات |
message |
string | پیام نهایی |
{
"success": true,
"message": "تمام اسناد از Redis حذف شدند"
}
Response (Server Error)
{
"success": false,
"message": "خطا در حذف اسناد: Internal server error..."
}
Internal Redis Architecture
| Key Pattern | Type | Description |
|---|---|---|
accounting:doc:* |
Hash | تمام اسناد ذخیرهشده — همگی حذف میشوند |
accounting:docs:* |
Set / SortedSet | تمام ایندکسها شامل تاریخ، گروه، کل، معین، تفضیلی — حذف کامل |
balance:group:* |
Hash | تمام ماندههای سطح گروه — حذف کامل |
balance:general:* |
Hash | تمام ماندههای سطح کل — حذف کامل |
balance:account:* |
Hash | تمام ماندههای سطح معین — حذف کامل |
balance:subsidiary:* |
Hash | تمام ماندههای سطح تفضیلی — حذف کامل |
Process Flow
Receive Request
↓
Call redisAccountingService.clearAllDocuments()
↓
Delete All Document Hashes
↓
Delete All Indexes (Sets & ZSets)
↓
Delete All Balance Keys
↓
Return Final Response