Skip to content

Conversation

@fasteiner
Copy link
Owner

Summary of Changes

Added

  • Introduced internal documentation for GitHub Copilot (.github/copilot-instructions.md) describing project structure, coding/testing conventions, and module-specific practices.
  • Added utility function Remove-DefaultPropertyNames for filtering default .NET properties during conversions.
  • New cmdlet Add-NotionDatabaseToParent for simplified database creation.
  • Enhanced notion_pageproperties::ConvertFromObject to support hashtables and custom objects.
  • Re-implemented notion_databaseproperties::ConvertFromObject with validation and dynamic property extraction.
  • Complete reorganization of type accelerators (zz1_Type_Accelerator.ps1), covering all database and page property classes, removing internal structures, and improving maintainability.
  • Comprehensive Pester test coverage:
    • New-NotionDatabase.Tests.ps1 validating function behavior.
    • notion_database.Class.Tests.ps1 covering constructors, conversions, and edge cases.
    • Full suite for database property classes (simple & complex), with German inline documentation and consistent structure.

Changed

  • Refactored constructors and conversion logic across database and property classes for consistency, validation, and flexibility.
  • Improved error handling and validation in DatabasePropertiesBase and specific property structures (e.g., formula, multi_select, number, relation, select, status, unique_id).
  • Refactored notion_database constructor parameter ordering and conversion logic.
  • Added Create factory method to notion_rollup.
  • Extended constructors for notion_select and notion_status to improve defaults and usability.
  • Refactored Add-NotionPageToDatabase.ps1 for formatting and parameter consistency.
  • New-NotionDatabase.ps1: Simplified title conversion using rich_text::ConvertFromObjects, refactored to directly return notion_database object, and clarified documentation.
  • Invoke-NotionApiCall.ps1: Unified casing for param/process, standardized string formatting (-f), and streamlined spacing/flow.

Fixed

  • notion_database constructor now correctly handles all parameter types, including rich text titles.
  • Fixed Write-Error usage in relation property classes (-Category InvalidData, corrected error messages).

tsubotitsch and others added 4 commits August 16, 2025 14:46
Improves property conversion methods in Notion classes to support both hashtables and custom objects, ensuring better input validation and dynamic property extraction. Enhances constructors for flexibility, updating rich text handling and parameter ordering for consistency.

Streamlines API function logic by reducing redundancy, unifying formatting practices, and centralizing object creation. Updates documentation and adheres to PowerShell conventions for clarity and maintainability.

Co-authored-by: Fabian Franz Steiner <fasteiner@users.noreply.github.com>
Fixes #75

Co-authored-by: Fabian Franz Steiner <fasteiner@users.noreply.github.com>
Fixes #75
Enhance Unit Tests for Notion Database Properties and Add New Tests for Select and Status Classes

- Added type verification for title and URL database properties in their respective tests.
- Refactored unique_id database property tests to improve structure and clarity, including constructor and property tests.
- Introduced new tests for the notion_select class, covering various constructors and object conversion.
- Added tests for the notion_status class, validating constructors and conversion from PSCustomObject.
- Updated copilot instructions for better clarity and guidance on project structure and testing practices.

Co-authored-by: Fabian Franz Steiner <fasteiner@users.noreply.github.com>
Fixes #75
Changelog updated

Co-authored-by: Fabian Franz Steiner <fasteiner@users.noreply.github.com>
@fasteiner fasteiner merged commit 6d86394 into main Aug 23, 2025
1 check failed
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