Skip to content

Commit 7af82b0

Browse files
committed
feat(api): register dashboard summary model
1 parent 51670e9 commit 7af82b0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/src/registry/model_registry.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,27 @@ final modelRegistry = <String, ModelConfig<dynamic>>{
313313
type: RequiredPermissionType.adminOnly, // Only administrators can delete
314314
),
315315
),
316+
'dashboard_summary': ModelConfig<DashboardSummary>(
317+
fromJson: DashboardSummary.fromJson,
318+
getId: (summary) => summary.id,
319+
getOwnerId: null, // Not a user-owned resource
320+
// Permissions: Read-only for admins, all other actions unsupported.
321+
getCollectionPermission: const ModelActionPermission(
322+
type: RequiredPermissionType.unsupported,
323+
),
324+
getItemPermission: const ModelActionPermission(
325+
type: RequiredPermissionType.adminOnly,
326+
),
327+
postPermission: const ModelActionPermission(
328+
type: RequiredPermissionType.unsupported,
329+
),
330+
putPermission: const ModelActionPermission(
331+
type: RequiredPermissionType.unsupported,
332+
),
333+
deletePermission: const ModelActionPermission(
334+
type: RequiredPermissionType.unsupported,
335+
),
336+
),
316337
};
317338

318339
/// Type alias for the ModelRegistry map for easier provider usage.

0 commit comments

Comments
 (0)