Skip to content

add missing database attributes and introduce traits for general attributes #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Feb 6, 2023

Conversation

johguentner
Copy link
Member

  • add is_inline attribute to Database::class
  • add description attribute to Database::class
  • trait for archived (add to other classes)
  • trait for parent (add to other classes
  • move object (type) to Entity::class
  • introduce fillEntityBase() within Entity::class for base filling of general attributes (id, object)
    --
  • ✅ add test assertions for introduced features (no additional test cases necessary; at the moment)

johguentner and others added 19 commits February 4, 2023 18:21
- move properties created_time, last_updated_time, etc. to its own trait
- remove attributes and methods from entity classes (which are applied by traid)
- apply traid to according entity classes (database, page and block)
- add created_by, last_updated_by to this new trait
- refactor rawTitle into richTitle
- add description and rawDescription (with according fill and getter)
- within the database entity
- add description example to stub
- to ``HasTimestamps``
- for improved readability
- move page logic of ``HasParent`` to its on trait and did minor refactoring
- add ``HasParent`` to Database and Block entity
- tests already exist for page entity
- add to database and block tests
- add raw parent property to stubs within block and database
- add missing prop to stub
- add check for property within database test
- the handling of archived-flags can be added to entities by this trait
- add trait to database, page and block
- to database, block and pages
- change stubs regarding the archived-flag, to force testing to check for ``true`` as archived
- and do filling of ``id`` and ``object`` within a entity base class method
- call ``::fillEntityBase`` form the ``fillFromRaw`` within all according entitites
- add test-cases for checking ``getObjectType``
@johguentner johguentner added this to the 🌳 v1.0.0 milestone Feb 5, 2023
@what-the-diff
Copy link

what-the-diff bot commented Feb 5, 2023

  • Add HasTimestamps, HasArchive and HasParent traits to Block class
  • Add timestamps properties (createdTime & lastEditedTime) to Database class
  • Move fillId() method from Entity constructor into a new protected method called fillEntityBase(). This is done so that the id can be set in child classes before calling parent::fillFromRaw(), which will call this new function instead of the old one.
  • Rename $objectType property on Page and Database entities as it's not really an object type but rather just a string representation of what kind of entity they are (e.g page or database). The name has been changed to reflect this more accurately ($entityType). Also added getter for same reason as above change was made - i think it makes sense if we're going with these names now? I'm happy either way though! :)
    5a/b: Added some missing fields such as description, richTitle etc... These were all present in Notion API response data but weren't being filled out by our codebase yet so have been added here along with their respective getters too!
  • Added HasArchive trait to Block entity
  • Added HasParent trait to Database and Page entities
  • Added HasTimestamps trait to all entities (Database, Page, User)
  • Updated tests for new traits/properties added in the above steps 1-3

@johguentner johguentner requested a review from mechelon February 6, 2023 09:27
@johguentner johguentner merged commit ff4794a into dev Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants