Service Layer low complexity mobile
1
Dependencies
1
Dependents
1
Entities
0
Integrations

Description

Computes and provides pre-filled default values for the wizard, combining today's date and 30-minute duration constants with the last-used activity type retrieved from local preferences. Acts as a single source of truth for the 'zero-interaction happy path' that makes the feature feel like a check-in.

Feature: Quick Activity Registration

registration-defaults-manager

Summaries

The Registration Defaults Manager is a small but high-impact component that dramatically reduces the friction of logging an activity. By pre-filling today's date, a standard 30-minute duration, and the user's last-used activity type, it enables a one-tap check-in experience for users who perform the same activity regularly. Reducing required interactions increases daily engagement with the platform, which directly improves the quality and completeness of activity data used for performance reporting and compensation calculations. Higher data completeness reduces administrative overhead from manual corrections and improves employee trust in the accuracy of their records.

Registration Defaults Manager is a low-complexity component with a single dependency on the Registration Preferences Store, making it one of the earliest deliverables in the feature track. It can be built and unit-tested independently before the wizard UI or submission service are complete, which makes it a good candidate for early sprint inclusion to unblock Cubit initialisation work. The primary delivery risk is ensuring the async getLastUsedActivityType() call resolves within an acceptable latency budget on first app launch when preferences may be empty — a null-safe fallback must be defined. No server-side deployment is required; this component is entirely client-side and local-storage backed.

Registration Defaults Manager is a mobile-tier service component that acts as the initialisation source for the activity registration Cubit. getDefaults() is the primary entry point, returning a merged RegistrationDefaults object composed from three sources: getDefaultDate() (returns DateTime.now()), getDefaultDurationMinutes() (returns the constant 30), and getLastUsedActivityType() which performs an async read from RegistrationPreferencesStore. The async boundary is isolated to the activity-type lookup; callers should await getDefaults() once at Cubit init and cache the result for the session. When RegistrationPreferencesStore returns null (first-run scenario), the component must return a sensible fallback — likely the most common ActivityType or null with UI prompting user selection.

Depends on the activity-type data model for type-safety of the returned defaults object.

Responsibilities

  • Return today's date as the default registration date
  • Return 30 minutes as the default duration
  • Load the last-used activity type from local preferences
  • Provide a merged defaults object for Cubit initialisation

Interfaces

getDefaults() -> Future<RegistrationDefaults>
getDefaultDate() -> DateTime
getDefaultDurationMinutes() -> int
getLastUsedActivityType() -> Future<ActivityType?>

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component

API Contract

View full contract →
REST /api/v1/registration-defaults 5 endpoints
GET /api/v1/registration-defaults List all default profiles (supports multiple mentor/user profiles)
GET /api/v1/registration-defaults/:id Get a specific defaults profile
POST /api/v1/registration-defaults Create a defaults profile for a user
PUT /api/v1/registration-defaults/:id Update defaults (called after each successful submission to persist last used activity type and duration)
DELETE /api/v1/registration-defaults/:id Delete a defaults profile