feat: add reference values snapshot endpoints and data layer functions
- Introduced `get_profile_reference_values_current_snapshot` and `get_profile_reference_values_recent_snapshot` functions to retrieve current and recent reference values for profiles. - Updated the placeholder resolver to include new placeholders for current and recent reference values. - Added new API endpoints for fetching current and recent reference values snapshots. - Enhanced the frontend API utility to support the new snapshot endpoints. - Improved unit tests to validate the new data layer functions and their behavior.
This commit is contained in:
1 parent
df0165bee3
commit
42ae796448
7 files changed
+359
-1
No files matched your search
@@ -102,6 +102,16 @@ export const api = {
|
||||
listProfileReferenceValues: (typeKey) =>
|
||||
req(`/profile-reference-values?type_key=${encodeURIComponent(typeKey)}`),
|
||||
listProfileReferenceValuesSummary: () => req('/profile-reference-values/summary'),
|
||||
/** Layer-1-Snapshots (gleiche Daten wie KI-Platzhalter reference_values_*_json) */
|
||||
listProfileReferenceValuesSnapshotCurrent: () => req('/profile-reference-values/snapshot-current'),
|
||||
listProfileReferenceValuesSnapshotRecent: (opts = {}) => {
|
||||
const p = new URLSearchParams()
|
||||
if (opts.limit_per_type != null) p.set('limit_per_type', String(opts.limit_per_type))
|
||||
if (opts.date_from) p.set('date_from', opts.date_from)
|
||||
if (opts.date_to) p.set('date_to', opts.date_to)
|
||||
const q = p.toString()
|
||||
return req(`/profile-reference-values/snapshot-recent${q ? `?${q}` : ''}`)
|
||||
},
|
||||
createProfileReferenceValue: (d) => req('/profile-reference-values', json(d)),
|
||||
updateProfileReferenceValue: (id, d) => req(`/profile-reference-values/${id}`, jput(d)),
|
||||
deleteProfileReferenceValue: (id) => req(`/profile-reference-values/${id}`, { method: 'DELETE' }),
|
||||
|
||||
Reference in new issue
Block a user