Skip to content

Add non-nullable lastUpdatedAt field to Task entity and update creation flow #201

Description

@MessiasLima

Description

To support future synchronization logic, every task must store a lastUpdatedAt timestamp that is always populated and reflects when the task was last modified. Existing tasks must receive a sensible default during migration.

Scope and constraints

  • In scope: add lastUpdatedAt to Task, update the database schema and migration, backfill existing tasks with creationDate as default, update CreateTaskViewModel to set lastUpdatedAt on save.
  • Out of scope: sync logic, UI changes, exposing lastUpdatedAt to users.

References

  • None

Scope

  • In scope: Task entity, database migration, CreateTaskViewModel save flow, test updates.
  • Out of scope: other ViewModels, UI display of lastUpdatedAt.

Acceptance criteria

  • Task entity has a non-nullable lastUpdatedAt: Instant property
  • Existing tasks are migrated with lastUpdatedAt set to their existing creationDate
  • CreateTaskViewModel sets lastUpdatedAt to timeProvider.now() when creating or editing a task
  • DAO and Repository tests are updated to include the new field
  • App compiles and existing JVM tests pass

Additional information

  • CreateTaskViewModel currently constructs a Task in onSaveClick() with creationDate = timeProvider.now(). The new field should be populated with the same value on creation and on every edit.
  • The Room/KMP migration may require a default-value SQL statement or an AutoMigration depending on the current database configuration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions