Skip to content

Create Entity Classes with Lifecycle Fields #3

@mediapills

Description

@mediapills

Design and implement three Python classes to represent different types of entities with specific lifecycle fields:

1. ImmutableEntity

Description:
Represents an entity that, once created, cannot be changed.
Fields:

  • created_at: A timestamp indicating when the record was created.

2. MutableEntity

Description:
Represents an entity that can be updated after creation.
Inheritance:
Extends ImmutableEntity.
Additional Fields:

  • updated_at: A timestamp indicating when the record was last updated.

3. PermanentEntity

Description:
Represents an entity that can be marked as deleted but is never physically removed (soft delete).
Inheritance:
Extends MutableEntity.
Additional Fields:

  • deleted_at: A timestamp indicating when the record was marked as deleted.
  • deleted: A boolean flag indicating whether the record is considered deleted.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions