Skip to content

Commit

Permalink
Cleanup, add PublishedProjectConnections
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlodotexe committed Feb 21, 2024
1 parent 1125a8d commit 2200162
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
19 changes: 11 additions & 8 deletions src/Models/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public record Project
/// Creates a new instance of <see cref="Project"/>.
/// </summary>
[JsonConstructor]
public Project(Cid publisher, string name, string description, Cid icon, Cid heroImage, Cid[] images, string[] features, string? accentColor, string category, DateTime createdAt, Cid[] dependencies, Collaborator[] collaborators, Link[] links, bool? forgetMe, bool isPrivate)
public Project(Cid publisher, string name, string description, Cid icon, Cid heroImage, Cid[] images, string[] features, string? accentColor, string category, DateTime createdAt, Cid[] dependencies, bool? forgetMe, bool isPrivate)
{
Publisher = publisher;
Name = name;
Expand All @@ -26,8 +26,6 @@ public Project(Cid publisher, string name, string description, Cid icon, Cid her
Category = category;
CreatedAt = createdAt;
Dependencies = dependencies;
Collaborators = collaborators;
Links = links;
ForgetMe = forgetMe;
IsPrivate = isPrivate;
}
Expand Down Expand Up @@ -68,7 +66,7 @@ public Project(Cid publisher, string name, string description, Cid icon, Cid her
public string[] Features { get; set; }

/// <summary>
/// An hex-encoded accent color for this publisher.
/// A hex-encoded accent color for this publisher.
/// </summary>
public string? AccentColor { get; set; }

Expand All @@ -83,19 +81,24 @@ public Project(Cid publisher, string name, string description, Cid icon, Cid her
public DateTime CreatedAt { get; set; }

/// <summary>
/// Other projects which depend on this project.
/// Other projects which this project may depend on.
/// </summary>
public Cid[] Dependencies { get; set; }
public Cid[] Dependencies { get; set; } = [];

/// <summary>
/// The <see cref="User"/>s who collaborate on this project, and their corresponding roles.
/// </summary>
public Collaborator[] Collaborators { get; set; }
public Collaborator[] Collaborators { get; set; } = [];

/// <summary>
/// Represents links to external profiles or resources added by the user.
/// </summary>
public Link[] Links { get; set; }
public Link[] Links { get; set; } = [];

/// <summary>
/// Holds information about project assets that have been published for consumption by an end user, such as a Microsoft Store app, a package on nuget.org, a git repo, etc.
/// </summary>
public ApplicationConnection[] PublishedProjectConnections { get; set; } = [];

/// <summary>
/// A flag that indicates whether the profile has requested to be forgotten.
Expand Down
15 changes: 7 additions & 8 deletions src/Models/Publisher.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using Ipfs;
using System.Text.Json.Serialization;

Expand All @@ -12,15 +13,13 @@ public record Publisher
/// Creates a new instance of <see cref="Publisher"/>.
/// </summary>
[JsonConstructor]
public Publisher(string name, string description, Cid icon, string? accentColor, Link[] links, Cid[] projects, EmailConnection? contactEmail = null)
public Publisher(string name, string description, Cid icon, string? accentColor, EmailConnection? contactEmail = null)
{
Name = name;
Description = description;
Icon = icon;
AccentColor = accentColor;
Links = links;
ContactEmail = contactEmail;
Projects = projects;
}

/// <summary>
Expand All @@ -39,27 +38,27 @@ public Publisher(string name, string description, Cid icon, string? accentColor,
public Cid Icon { get; set; }

/// <summary>
/// An hex-encoded accent color for this publisher.
/// A hex-encoded accent color for this publisher.
/// </summary>
public string? AccentColor { get; set; }

/// <summary>
/// Represents links to external profiles or resources added by the publisher.
/// </summary>
public Link[] Links { get; set; }
public Link[] Links { get; set; } = [];

/// <summary>
/// An <see cref="EmailConnection"/> that can be used to contact this publisher.
/// A <see cref="EmailConnection"/> that can be used to contact this publisher.
/// </summary>
public EmailConnection? ContactEmail { get; set; }

/// <summary>
/// A list of the projects published by this publisher.
/// </summary>
public Cid[] Projects { get; set; }
public Cid[] Projects { get; set; } = [];

/// <summary>
/// A flag indicating whether this is a non-public project.
/// </summary>
public bool IsPrivate { get; set; }
}
}

0 comments on commit 2200162

Please sign in to comment.