Skip to content
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

Refactor models according to refined API spec #6

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

Arlodotexe
Copy link
Member

@Arlodotexe Arlodotexe commented Nov 30, 2024

Fixes #3

Refactor models to align with the refined API spec.

  • Project Model Changes:

    • Remove HeroImage, CreatedAt, and Icon properties.
    • Add ExtendedDescription property.
    • Remove constructor.
    • Provide default values for Images, Features, Dependencies, Collaborators, Links, and Connections.
    • Mark Publisher, Name, Description, Category, and CreatedAt as required.
    • Replace Cid with DagCid.
    • Change Collaborators to a Dictionary<DagCid, Role> type.
    • Use an empty collection expression [] instead of Array.Empty<T>.
    • Remove all JSON-related attributes.
  • Publisher Model Changes:

    • Remove Owner, ContactEmail, and Icon properties.
    • Add Users + Roles, Connections, Links, ExtendedDescription, and ForgetMe properties.
    • Remove constructor.
    • Provide default values for Links, Projects, Users, ParentPublishers, and ChildPublishers.
    • Mark Name, Description, and Owner as required.
    • Replace Cid with DagCid.
    • Use an empty collection expression [] instead of Array.Empty<T>.
    • Remove all JSON-related attributes.
  • User Model Changes:

    • Remove MarkdownAboutMe and Icon properties.
    • Add Projects + Roles, Publisher + Roles, and ExtendedDescription properties.
    • Rename MarkdownAboutMe to ExtendedDescription.
    • Provide default values for Connections, Links, Projects, and Publishers.
    • Mark Name and ExtendedDescription as required.
    • Replace Cid with DagCid.
    • Use an empty collection expression [] instead of Array.Empty<T>.
    • Remove all JSON-related attributes.
  • Update Events Changes:

    • Update any mention of IsPrivate to IsUnlisted in ProjectUpdateEvent and PublisherUpdateEvent.
    • Remove lines 31 and 33 in ProjectUpdateEvent.
  • Link Model Changes:

    • Replace Cid with DagCid.
    • Remove all JSON-related attributes.
  • Role Model Changes:

    • Mark Name and Description as required.
  • IModifiableEntity Changes:

    • Add UpdateExtendedDescriptionAsync method.
    • Add ExtendedDescriptionUpdated event.
  • IReadOnlyEntity Changes:

    • Add ExtendedDescription property.
    • Add ExtendedDescriptionUpdated event.

For more details, open the Copilot Workspace session.

Fixes #3

Refactor models to align with the refined API spec.

* **Project Model Changes:**
  - Remove `HeroImage`, `CreatedAt`, and `Icon` properties.
  - Add `ExtendedDescription` property.
  - Remove constructor.
  - Provide default values for `Images`, `Features`, `Dependencies`, `Collaborators`, `Links`, and `Connections`.
  - Mark `Publisher`, `Name`, `Description`, `Category`, and `CreatedAt` as `required`.
  - Replace `Cid` with `DagCid`.
  - Change `Collaborators` to a `Dictionary<DagCid, Role>` type.
  - Use an empty collection expression `[]` instead of `Array.Empty<T>`.
  - Remove all JSON-related attributes.

* **Publisher Model Changes:**
  - Remove `Owner`, `ContactEmail`, and `Icon` properties.
  - Add `Users + Roles`, `Connections`, `Links`, `ExtendedDescription`, and `ForgetMe` properties.
  - Remove constructor.
  - Provide default values for `Links`, `Projects`, `Users`, `ParentPublishers`, and `ChildPublishers`.
  - Mark `Name`, `Description`, and `Owner` as `required`.
  - Replace `Cid` with `DagCid`.
  - Use an empty collection expression `[]` instead of `Array.Empty<T>`.
  - Remove all JSON-related attributes.

* **User Model Changes:**
  - Remove `MarkdownAboutMe` and `Icon` properties.
  - Add `Projects + Roles`, `Publisher + Roles`, and `ExtendedDescription` properties.
  - Rename `MarkdownAboutMe` to `ExtendedDescription`.
  - Provide default values for `Connections`, `Links`, `Projects`, and `Publishers`.
  - Mark `Name` and `ExtendedDescription` as `required`.
  - Replace `Cid` with `DagCid`.
  - Use an empty collection expression `[]` instead of `Array.Empty<T>`.
  - Remove all JSON-related attributes.

* **Update Events Changes:**
  - Update any mention of `IsPrivate` to `IsUnlisted` in `ProjectUpdateEvent` and `PublisherUpdateEvent`.
  - Remove lines 31 and 33 in `ProjectUpdateEvent`.

* **Link Model Changes:**
  - Replace `Cid` with `DagCid`.
  - Remove all JSON-related attributes.

* **Role Model Changes:**
  - Mark `Name` and `Description` as `required`.

* **IModifiableEntity Changes:**
  - Add `UpdateExtendedDescriptionAsync` method.
  - Add `ExtendedDescriptionUpdated` event.

* **IReadOnlyEntity Changes:**
  - Add `ExtendedDescription` property.
  - Add `ExtendedDescriptionUpdated` event.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/WindowsAppCommunity/WinAppCommunity.Sdk/issues/3?shareId=XXXX-XXXX-XXXX-XXXX).
@Arlodotexe
Copy link
Member Author

This is largely done. Next steps will be to fix up the UpdateEvents (aligning with the new API surface) so we can compile again.

@Arlodotexe
Copy link
Member Author

Latest changes fbf3eca should allow builds to pass. We can continue with refactoring UpdateEvents in another PR.

@Arlodotexe Arlodotexe merged commit b5e3d65 into main Nov 30, 2024
1 check passed
@Lamparter
Copy link
Contributor

@Arlodotexe you might want to delete the branch 😁

@Arlodotexe Arlodotexe deleted the Arlodotexe/refactor-models branch December 2, 2024 13:01
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.

Refactor Models Nov 30, 2024
2 participants