From 79c1094fd6aad3314aa89fe2d5106b12154302ed Mon Sep 17 00:00:00 2001 From: Fajrian Aidil Pratama Date: Mon, 8 Sep 2025 21:59:14 +0700 Subject: [PATCH] feat: update API documentation to match latest backend implementation - Add comprehensive pagination parameters (limit, offset, page, all) to national historical endpoint - Include complete province response structure with ODP/PDP tracking data - Add statistics fields including percentages and reproduction rate calculations - Update authentication section with detailed rate limiting headers information - Replace generic response references with complete field structures - Ensure documentation accuracy matches Go backend API v2.3.0 implementation --- .../documentation/AuthenticationSection.vue | 27 ++++ .../NationalHistoricalSection.vue | 56 +++++++- .../documentation/ProvinceCasesSection.vue | 123 +++++++++++++++++- 3 files changed, 203 insertions(+), 3 deletions(-) diff --git a/src/components/documentation/AuthenticationSection.vue b/src/components/documentation/AuthenticationSection.vue index b51402a..8712095 100644 --- a/src/components/documentation/AuthenticationSection.vue +++ b/src/components/documentation/AuthenticationSection.vue @@ -49,6 +49,33 @@ + + +
+

Rate Limit Response Headers

+
+
+
+
+ X-RateLimit-Limit + Request limit per window +
+
+ X-RateLimit-Remaining + Requests remaining in current window +
+
+ X-RateLimit-Reset + Unix timestamp when rate limit resets +
+
+ Retry-After + Seconds to wait before retrying (on 429 errors) +
+
+
+
+
diff --git a/src/components/documentation/NationalHistoricalSection.vue b/src/components/documentation/NationalHistoricalSection.vue index 220788d..751de97 100644 --- a/src/components/documentation/NationalHistoricalSection.vue +++ b/src/components/documentation/NationalHistoricalSection.vue @@ -50,6 +50,30 @@ + + limit + integer + Records per page (default: 50, max: 1000) + Optional + + + offset + integer + Records to skip (default: 0) + Optional + + + page + integer + Page number (1-based, alternative to offset) + Optional + + + all + boolean + Return all data without pagination + Optional + start_date string @@ -145,11 +169,41 @@ integer Daily new death cases - + daily.active integer Daily change in active cases + + statistics.percentages.active + float + Percentage of active cases + + + statistics.percentages.recovered + float + Percentage of recovered cases + + + statistics.percentages.deceased + float + Percentage of deceased cases + + + statistics.reproduction_rate.value + float + Reproduction rate (Rt) estimate + + + statistics.reproduction_rate.upper_bound + float + Upper confidence bound for reproduction rate + + + statistics.reproduction_rate.lower_bound + float + Lower confidence bound for reproduction rate + diff --git a/src/components/documentation/ProvinceCasesSection.vue b/src/components/documentation/ProvinceCasesSection.vue index 571182e..d03efc8 100644 --- a/src/components/documentation/ProvinceCasesSection.vue +++ b/src/components/documentation/ProvinceCasesSection.vue @@ -98,8 +98,127 @@

Response Fields

-
-

Returns paginated province case data. Each province object contains the same COVID-19 case structure as national data with province-specific information.

+ + +
+
+ + + +
+

Provincial Data Structure

+

Returns array of province COVID-19 data with enhanced ODP/PDP tracking. Each object includes:

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
datestringDate of the case report (YYYY-MM-DD format)
dayintegerDay number since first case reported
province.idstringProvince ID (e.g., '72' for Sulawesi Tengah)
province.namestringProvince name
daily.positiveintegerDaily new confirmed cases
daily.recoveredintegerDaily new recovered cases
daily.deceasedintegerDaily new death cases
daily.odp.activeintegerDaily active ODP (Orang Dalam Pengawasan)
daily.odp.finishedintegerDaily finished ODP observations
daily.pdp.activeintegerDaily active PDP (Pasien Dalam Pengawasan)
daily.pdp.finishedintegerDaily finished PDP supervisions
cumulative.positiveintegerTotal confirmed cases
cumulative.recoveredintegerTotal recovered cases
cumulative.deceasedintegerTotal death cases
cumulative.activeintegerCurrent active cases
cumulative.odp.totalintegerTotal ODP cases (active + finished)
cumulative.pdp.totalintegerTotal PDP cases (active + finished)
statistics.percentages.*floatPercentage breakdown (active, recovered, deceased)
statistics.reproduction_rate.*objectReproduction rate with confidence bounds