(refactor): separate domain objects from core library
This commit is contained in:
parent
916c1ff1b3
commit
dcc37d0a3e
@ -61,63 +61,6 @@
|
||||
|
||||
"tokens": [],
|
||||
|
||||
"authorizations": [
|
||||
{
|
||||
"controller": 0,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 1,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 2,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 3,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 4,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 5,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 6,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 7,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 8,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 9,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 10,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 11,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 12,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
},
|
||||
{
|
||||
"controller": 13,
|
||||
"actions": [ 0, 1, 2, 3 ]
|
||||
}
|
||||
]
|
||||
"role": 0
|
||||
}
|
||||
]
|
||||
|
||||
17
src/DomainObjects/Abstractions/AddressSectionBase.cs
Normal file
17
src/DomainObjects/Abstractions/AddressSectionBase.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using DomainObjects;
|
||||
|
||||
namespace DomainObjects.Abstractions;
|
||||
|
||||
public abstract class AddressSectionBase<T> : PageSectionBase<T> {
|
||||
public FormItem FirstName { get; set; }
|
||||
public FormItem LastName { get; set; }
|
||||
|
||||
public FormItem Address { get; set; }
|
||||
public FormItem Address2 { get; set; }
|
||||
public FormItem Country { get; set; }
|
||||
public FormItem State { get; set; }
|
||||
|
||||
public FormItem City { get; set; }
|
||||
public FormItem Zip { get; set; }
|
||||
|
||||
}
|
||||
8
src/DomainObjects/Abstractions/DomainObjectBase.cs
Normal file
8
src/DomainObjects/Abstractions/DomainObjectBase.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using Core.Abstractions;
|
||||
|
||||
namespace DomainObjects.Abstractions;
|
||||
|
||||
public abstract class DomainObjectBase<T> : EquatableBase<T> {
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
namespace DomainObjects.Abstractions;
|
||||
|
||||
public abstract class DomainObjectDocumentBase<T> : DomainObjectBase<T> {
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
9
src/DomainObjects/Abstractions/PageBase.cs
Normal file
9
src/DomainObjects/Abstractions/PageBase.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Abstractions;
|
||||
|
||||
public abstract class PageBase<T> : DomainObjectBase<T> {
|
||||
public Header Header { get; set; }
|
||||
public TitleSection? TitleSection { get; set; }
|
||||
}
|
||||
|
||||
7
src/DomainObjects/Abstractions/PageSectionBase.cs
Normal file
7
src/DomainObjects/Abstractions/PageSectionBase.cs
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
namespace DomainObjects.Abstractions;
|
||||
public abstract class PageSectionBase<T> : DomainObjectBase<T> {
|
||||
public string? Title { get; set; }
|
||||
public string? Text { get; set; }
|
||||
}
|
||||
|
||||
6
src/DomainObjects/Abstractions/PersonBase.cs
Normal file
6
src/DomainObjects/Abstractions/PersonBase.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace DomainObjects.Abstractions;
|
||||
|
||||
public abstract class PersonBase<T> : DomainObjectBase<T> {
|
||||
public Guid Id { get; set; }
|
||||
public Image? Image { get; set; }
|
||||
}
|
||||
25
src/DomainObjects/Abstractions/PostItemBase.cs
Normal file
25
src/DomainObjects/Abstractions/PostItemBase.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using DomainObjects.L10n;
|
||||
|
||||
namespace DomainObjects.Abstractions;
|
||||
|
||||
public abstract class PostItemBase<T> : DomainObjectDocumentBase<T> {
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public List<PostItemL10n> L10n { get; set; }
|
||||
|
||||
public List<MediaAttachment>? MediaAttachments { get; set; }
|
||||
|
||||
public Guid Author { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public DateTime? Published { get; set; }
|
||||
|
||||
|
||||
public List<string>? Tags { get; set; }
|
||||
|
||||
public List<Guid> Categories { get; set; }
|
||||
|
||||
public bool? FamilyFriendly { get; set; }
|
||||
}
|
||||
8
src/DomainObjects/Address.cs
Normal file
8
src/DomainObjects/Address.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Address {
|
||||
public string Street { get; set; }
|
||||
public string City { get; set; }
|
||||
public string PostCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
namespace DomainObjects {
|
||||
public class Author : PersonBase<Author>{
|
||||
public string NickName { get; set; }
|
||||
|
||||
13
src/DomainObjects/Comment.cs
Normal file
13
src/DomainObjects/Comment.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Comment : DomainObjectBase<Comment> {
|
||||
public Author Author { get; set; }
|
||||
public string Text { get; set; }
|
||||
public List<Comment>? Responses { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
14
src/DomainObjects/Contact.cs
Normal file
14
src/DomainObjects/Contact.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Contact : DomainObjectBase<Contact> {
|
||||
public ContactTypes Type { get; set; }
|
||||
public string Value { get; set; }
|
||||
public bool Confirmed { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
34
src/DomainObjects/Documents/BlogDocument.cs
Normal file
34
src/DomainObjects/Documents/BlogDocument.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.Documents;
|
||||
|
||||
public class BlogDocument : PostItemBase<BlogDocument> {
|
||||
|
||||
public uint? ReadTime { get; set; }
|
||||
|
||||
public uint? Likes { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Id.GetHashCode();
|
||||
hash = hash * 23 + SiteId.GetHashCode();
|
||||
hash = hash * 23 + L10n.GetHashCode();
|
||||
if (MediaAttachments != null)
|
||||
hash = hash * 23 + MediaAttachments.Sum(x => x.GetHashCode());
|
||||
hash = hash * 23 + Author.GetHashCode();
|
||||
hash = hash * 23 + Created.GetHashCode();
|
||||
if(Tags != null)
|
||||
hash = hash * 23 + Tags.Sum(x => x.GetHashCode());
|
||||
|
||||
if(Categories != null)
|
||||
hash = hash * 23 + Categories.Sum(x => x.GetHashCode());
|
||||
|
||||
hash = hash * 23 + ReadTime.GetHashCode();
|
||||
hash = hash * 23 + Likes.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.DomainObjects.L10n;
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.L10n;
|
||||
|
||||
namespace Core.DomainObjects.Documents {
|
||||
public class Category : DomainObjectDocumentBase<Category> {
|
||||
namespace DomainObjects.Documents {
|
||||
public class CategoryDocument : DomainObjectDocumentBase<CategoryDocument> {
|
||||
public Guid SiteId { get; set; }
|
||||
public List<CategoryL10n> L10n { get; set; }
|
||||
|
||||
41
src/DomainObjects/Documents/ContentDocument.cs
Normal file
41
src/DomainObjects/Documents/ContentDocument.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.Pages;
|
||||
|
||||
namespace DomainObjects.Documents;
|
||||
|
||||
public class ContentDocument : DomainObjectDocumentBase<ContentDocument> {
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public string SiteName { get; set; }
|
||||
public string SiteUrl { get; set; }
|
||||
|
||||
public Header Header { get; set; }
|
||||
|
||||
public Localization Localization { get; set; }
|
||||
|
||||
public List<Route> Routes { get; set; }
|
||||
public List<Route> AdminRoutes { get; set; }
|
||||
public List<Route> ServiceRoutes { get; set; }
|
||||
|
||||
public List<MenuItem> TopMenu { get; set; }
|
||||
public List<MenuItem> SideMenu { get; set; }
|
||||
|
||||
public HomePage HomePage { get; set; }
|
||||
|
||||
public ShopCatalogPage ShopCatalog { get; set; }
|
||||
public ShopItemPage ShopItem { get; set; }
|
||||
public ShopCartPage ShopCart { get; set; }
|
||||
public ShopCheckoutPage ShopCheckout { get; set; }
|
||||
|
||||
|
||||
public BlogCatalogPage BlogCatalog { get; set; }
|
||||
public BlogItemPage BlogItem { get; set; }
|
||||
|
||||
public SignInPage SignIn { get; set; }
|
||||
public SignUpPage SignUp { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
27
src/DomainObjects/Documents/ShopCartDocument.cs
Normal file
27
src/DomainObjects/Documents/ShopCartDocument.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.Documents;
|
||||
|
||||
public class ShopCartDocument : DomainObjectDocumentBase<ShopCartDocument> {
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Sku { get; set; }
|
||||
public uint Quantity { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
// https://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-overriding-gethashcode
|
||||
// Overflow is fine, just wrap
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
hash = hash * 23 + Id.GetHashCode();
|
||||
hash = hash * 23 + UserId.GetHashCode();
|
||||
hash = hash * 23 + Sku.GetHashCode();
|
||||
hash = hash * 23 + Quantity.GetHashCode();
|
||||
hash = hash * 23 + Created.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
36
src/DomainObjects/Documents/ShopDocument.cs
Normal file
36
src/DomainObjects/Documents/ShopDocument.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.Documents;
|
||||
|
||||
public class ShopDocument : PostItemBase<ShopDocument> {
|
||||
public string BrandName { get; set; }
|
||||
public string Sku { get; set; }
|
||||
public decimal? Rating { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public decimal? NewPrice { get; set; }
|
||||
public uint Quantity { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Id.GetHashCode();
|
||||
hash = hash * 23 + SiteId.GetHashCode();
|
||||
hash = hash * 23 + L10n.GetHashCode();
|
||||
if (MediaAttachments != null)
|
||||
hash = hash * 23 + MediaAttachments.Sum(x => x.GetHashCode());
|
||||
hash = hash * 23 + Author.GetHashCode();
|
||||
hash = hash * 23 + Created.GetHashCode();
|
||||
hash = hash * 23 + Tags.GetHashCode();
|
||||
hash = hash * 23 + Categories.Sum(x => x.GetHashCode());
|
||||
|
||||
hash = hash * 23 + BrandName.GetHashCode();
|
||||
hash = hash * 23 + Sku.GetHashCode();
|
||||
hash = hash * 23 + Rating.GetHashCode();
|
||||
hash = hash * 23 + Price.GetHashCode();
|
||||
hash = hash * 23 + NewPrice.GetHashCode();
|
||||
hash = hash * 23 + Quantity.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/DomainObjects/Documents/UserDocument.cs
Normal file
44
src/DomainObjects/Documents/UserDocument.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace DomainObjects.Documents;
|
||||
|
||||
public class UserDocument : DomainObjectDocumentBase<UserDocument> {
|
||||
|
||||
public List<Guid> Sites { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public string Username { get; set; }
|
||||
|
||||
public Passwords Passwords { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string LastName { get; set; }
|
||||
|
||||
public List<Contact> Contacts { get; set; }
|
||||
|
||||
public Address BillingAddress { get; set; }
|
||||
|
||||
public Address ShippingAddress { get; set; }
|
||||
|
||||
public List<Token> Tokens { get; set; }
|
||||
|
||||
public Roles Role { get; set; }
|
||||
|
||||
|
||||
|
||||
public void SetPassword (string password) {
|
||||
|
||||
|
||||
|
||||
var old = Passwords.Password.Prototype();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
14
src/DomainObjects/DomainObjects.csproj
Normal file
14
src/DomainObjects/DomainObjects.csproj
Normal file
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\webapi\Core\Core.csproj" />
|
||||
<ProjectReference Include="..\..\webapi\CryptoProvider\CryptoProvider.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
10
src/DomainObjects/Enumerations/ContactTypes.cs
Normal file
10
src/DomainObjects/Enumerations/ContactTypes.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Core.Abstractions;
|
||||
|
||||
namespace DomainObjects.Enumerations;
|
||||
public class ContactTypes : Enumeration {
|
||||
|
||||
public static ContactTypes Email = new(0, "email");
|
||||
public static ContactTypes Mobile = new(1, "mobile");
|
||||
|
||||
private ContactTypes(int id, string displayName) : base (id, displayName) {}
|
||||
}
|
||||
10
src/DomainObjects/Enumerations/Locales.cs
Normal file
10
src/DomainObjects/Enumerations/Locales.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Core.Abstractions;
|
||||
|
||||
namespace DomainObjects.Enumerations;
|
||||
public class Locales : Enumeration {
|
||||
public static Locales Us = new(0, "en-US");
|
||||
public static Locales Ru = new(1, "ru-RU");
|
||||
public static Locales It = new(2, "it-IT");
|
||||
|
||||
private Locales(int id, string displayName) : base (id, displayName) { }
|
||||
}
|
||||
22
src/DomainObjects/Enumerations/ReservedWords.cs
Normal file
22
src/DomainObjects/Enumerations/ReservedWords.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using Core.Abstractions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DomainObjects.Enumerations;
|
||||
public class ReservedWords : Enumeration {
|
||||
public static readonly ReservedWords SiteName = new (0, "{siteName}" );
|
||||
public static readonly ReservedWords SiteUrl = new (0, "{siteUrl}");
|
||||
public static readonly ReservedWords Quantity = new (0, "{quantity}");
|
||||
public static readonly ReservedWords ProductTitle = new (0, "{productTitle}");
|
||||
public static readonly ReservedWords Currency = new (0, "{currency}");
|
||||
public static readonly ReservedWords Date = new (0, "{date}");
|
||||
public static readonly ReservedWords ReadTime = new (0, "{readTime}");
|
||||
public static readonly ReservedWords BlogTitle = new (0, "{blogTitle}");
|
||||
public static readonly ReservedWords NickName = new (0, "{nickName}");
|
||||
|
||||
private ReservedWords(int id, string name) : base(id, name) { }
|
||||
}
|
||||
|
||||
44
src/DomainObjects/Enumerations/Roles.cs
Normal file
44
src/DomainObjects/Enumerations/Roles.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using Core.Abstractions;
|
||||
|
||||
namespace DomainObjects.Enumerations;
|
||||
|
||||
public class Roles : Enumeration {
|
||||
|
||||
/// <summary>
|
||||
/// The most powerful user role because it gives you access to everything. As the website owner, this should be your role
|
||||
/// </summary>
|
||||
public static readonly Roles Admin = new(0, "Admin");
|
||||
|
||||
/// <summary>
|
||||
/// This user is typically responsible for managing content. Editors can add, edit, publish, and delete any posts and media, including those written by other users. Editors can also moderate, edit, and delete comments, and add and edit categories and tags
|
||||
/// </summary>
|
||||
public static readonly Roles Editor = new(1, "Editor");
|
||||
|
||||
/// <summary>
|
||||
/// Typically responsible for tasks related to writing content. They can create, edit, and publish their own posts. They can also delete their own posts (even when they’re already published), but cannot edit or delete posts written by other user
|
||||
/// </summary>
|
||||
public static readonly Roles Author = new(2, "Author");
|
||||
|
||||
/// <summary>
|
||||
/// The contributor is a more basic version of the author role. Contributors can perform three tasks on your site: read all posts, create and edit their own posts, and delete their own posts. However, this role stops short of allowing them to directly publish their posts on your site. This gives you a chance to review and have final control over any content they create before it goes live
|
||||
/// </summary>
|
||||
public static readonly Roles Contributor = new(3, "Contributor");
|
||||
|
||||
/// <summary>
|
||||
/// Assigned to new users if you enable registrations on your site. This role has the least number of permissions. Users are only able to update their own profile, read the content on your site, and leave comments
|
||||
/// </summary>
|
||||
public static readonly Roles Subscriber = new(4, "Subscriber");
|
||||
|
||||
/// <summary>
|
||||
/// Assigned to new customers when they create an account on your website. This role is basically equivalent to that of a normal blog subscriber, but customers can edit their own account information and view past or current orders
|
||||
/// </summary>
|
||||
public static readonly Roles Customer = new(5, "Customer");
|
||||
|
||||
/// <summary>
|
||||
/// This allows the user to run the operations side of your store without the ability to edit back-end functionality like files and code. A manager has the same permissions as a customer, plus they’re also granted the ability to manage all settings within eCommerce, create/edit products, and access all eCommerce reports. Important: They ALSO have access to the site editor capabilities mentioned above
|
||||
/// </summary>
|
||||
public static readonly Roles ShopManager = new(6, "Shop manager");
|
||||
|
||||
private Roles(int id, string displayName) : base(id, displayName) { }
|
||||
|
||||
}
|
||||
10
src/DomainObjects/Enumerations/TextFormat.cs
Normal file
10
src/DomainObjects/Enumerations/TextFormat.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using Core.Abstractions;
|
||||
|
||||
namespace DomainObjects.Enumerations;
|
||||
public class TextFormat : Enumeration {
|
||||
|
||||
public static readonly TextFormat Html = new(0, "HTML");
|
||||
public static readonly TextFormat Md = new(1, "MD");
|
||||
|
||||
private TextFormat(int id, string displayName) : base(id, displayName) { }
|
||||
}
|
||||
12
src/DomainObjects/Feature.cs
Normal file
12
src/DomainObjects/Feature.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
public class Feature : DomainObjectBase<Feature> {
|
||||
public string Icon { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
14
src/DomainObjects/FormItem.cs
Normal file
14
src/DomainObjects/FormItem.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class FormItem : DomainObjectBase<FormItem> {
|
||||
public string? Title { get; set; }
|
||||
|
||||
public string? Optional { get; set; }
|
||||
public string? PlaceHolder { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
16
src/DomainObjects/Header.cs
Normal file
16
src/DomainObjects/Header.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Header : DomainObjectBase<Header> {
|
||||
|
||||
public string? Title { get; set; }
|
||||
|
||||
public Dictionary<string, string>? Meta { get; set; }
|
||||
|
||||
public Dictionary<string, string>? Link { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
17
src/DomainObjects/Image.cs
Normal file
17
src/DomainObjects/Image.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Image : DomainObjectBase<MediaAttachment> {
|
||||
public string Src { get; set; }
|
||||
|
||||
public string Alt { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Src.GetHashCode();
|
||||
hash = hash * 23 + Alt.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
21
src/DomainObjects/L10n/CategoryL10n.cs
Normal file
21
src/DomainObjects/L10n/CategoryL10n.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace DomainObjects.L10n;
|
||||
|
||||
public class CategoryL10n : DomainObjectBase<CategoryL10n> {
|
||||
public Locales Locale { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Locale.GetHashCode();
|
||||
hash = hash * 23 + Slug.GetHashCode();
|
||||
hash = hash * 23 + Text.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
src/DomainObjects/L10n/MediaAttachmentL10n.cs
Normal file
29
src/DomainObjects/L10n/MediaAttachmentL10n.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace DomainObjects.L10n;
|
||||
|
||||
public class MediaAttachmentL10n : DomainObjectBase<MediaAttachmentL10n> {
|
||||
public Locales Locale { get; set; }
|
||||
public string Alt { get; set; }
|
||||
public string? Target { get; set; }
|
||||
public string? Titile { get; set; }
|
||||
public string? Description { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Locale.GetHashCode();
|
||||
hash = hash * 23 + Alt.GetHashCode();
|
||||
|
||||
if(Target != null)
|
||||
hash = hash * 23 + Target.GetHashCode();
|
||||
|
||||
if (Titile != null)
|
||||
hash = hash * 23 + Target.GetHashCode();
|
||||
|
||||
if (Description != null)
|
||||
hash = hash * 23 + Description.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
32
src/DomainObjects/L10n/PostItemL10n.cs
Normal file
32
src/DomainObjects/L10n/PostItemL10n.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.Enumerations;
|
||||
|
||||
namespace DomainObjects.L10n;
|
||||
|
||||
public class PostItemL10n : DomainObjectBase<PostItemL10n> {
|
||||
public Locales Locale { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Text { get; set; }
|
||||
public TextFormat TextFormat { get; set; }
|
||||
public string PlainText { get; set; }
|
||||
public string ShortText { get; set; }
|
||||
public List<string>? Badges { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Locale.GetHashCode();
|
||||
hash = hash * 23 + Slug.GetHashCode();
|
||||
hash = hash * 23 + Description.GetHashCode();
|
||||
hash = hash * 23 + Title.GetHashCode();
|
||||
hash = hash * 23 + Text.GetHashCode();
|
||||
hash = hash * 23 + TextFormat.GetHashCode();
|
||||
hash = hash * 23 + ShortText.GetHashCode();
|
||||
hash = hash * 23 + Badges.Sum(x => x.GetHashCode());
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
src/DomainObjects/Link.cs
Normal file
12
src/DomainObjects/Link.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Link : DomainObjectBase<Link> {
|
||||
public string Target { get; set; }
|
||||
public string AnchorText { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
22
src/DomainObjects/Localization.cs
Normal file
22
src/DomainObjects/Localization.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Localization : DomainObjectBase<Localization> {
|
||||
|
||||
public string? TimeZone { get; set; }
|
||||
|
||||
public string? Locale { get; set; }
|
||||
|
||||
public string? DateFormat { get; set; }
|
||||
|
||||
public string? TimeFormat { get; set; }
|
||||
|
||||
public string? Currency { get; set; }
|
||||
|
||||
public string? CurrencySymbol { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
21
src/DomainObjects/MediaAttachment.cs
Normal file
21
src/DomainObjects/MediaAttachment.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.L10n;
|
||||
|
||||
using Core.Enumerations;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class MediaAttachment : DomainObjectBase<MediaAttachment> {
|
||||
public string Src { get; set; }
|
||||
|
||||
public MediaTypes MediaType { get; set; }
|
||||
public List<MediaAttachmentL10n> L10n { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Src.GetHashCode();
|
||||
hash = hash * 23 + L10n.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
15
src/DomainObjects/MenuItem.cs
Normal file
15
src/DomainObjects/MenuItem.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class MenuItem : DomainObjectBase<MenuItem> {
|
||||
|
||||
public string? Icon { get; set; }
|
||||
public string? Title { get; set; }
|
||||
public string? Target { get; set; }
|
||||
public List<MenuItem>? ChildItems { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
10
src/DomainObjects/PageSections/BillingAddressSection.cs
Normal file
10
src/DomainObjects/PageSections/BillingAddressSection.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class BillingAddressSection : AddressSectionBase<BillingAddressSection> {
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
13
src/DomainObjects/PageSections/CallToActionSection.cs
Normal file
13
src/DomainObjects/PageSections/CallToActionSection.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class CallToActionSection : PageSectionBase<CallToActionSection> {
|
||||
public string PrivacyDisclaimer { get; set; }
|
||||
|
||||
public FormItem Email { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/PageSections/CommentsSection.cs
Normal file
12
src/DomainObjects/PageSections/CommentsSection.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class CommentsSection : PageSectionBase<CommentsSection> {
|
||||
public string LeaveComment { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
12
src/DomainObjects/PageSections/FeaturedBlogSection.cs
Normal file
12
src/DomainObjects/PageSections/FeaturedBlogSection.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class FeaturedBlogSection : PageSectionBase<FeaturedBlogSection> {
|
||||
public string ReadTime { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
11
src/DomainObjects/PageSections/FeaturedBlogsSection.cs
Normal file
11
src/DomainObjects/PageSections/FeaturedBlogsSection.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class FeaturedBlogsSection : PageSectionBase<FeaturedBlogsSection> {
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
11
src/DomainObjects/PageSections/FeaturesSection.cs
Normal file
11
src/DomainObjects/PageSections/FeaturesSection.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class FeaturesSection : PageSectionBase<FeaturesSection> {
|
||||
public List<Feature> Items { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
15
src/DomainObjects/PageSections/PaymentSection.cs
Normal file
15
src/DomainObjects/PageSections/PaymentSection.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class PaymentSection : PageSectionBase<PaymentSection> {
|
||||
|
||||
public FormItem NameOnCard { get; set; }
|
||||
public FormItem CardNumber { get; set; }
|
||||
|
||||
public FormItem Expiration { get; set; }
|
||||
public FormItem Cvv { get; set; }
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/PageSections/ProductSection.cs
Normal file
12
src/DomainObjects/PageSections/ProductSection.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class ProductSection : PageSectionBase<ProductSection> {
|
||||
public string AvailableQuantity { get; set; }
|
||||
public string AddToCart { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
21
src/DomainObjects/PageSections/ProductsSection.cs
Normal file
21
src/DomainObjects/PageSections/ProductsSection.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class ProductsSection : PageSectionBase<ProductsSection> {
|
||||
public string Product { get; set; }
|
||||
|
||||
public string Price { get; set; }
|
||||
|
||||
public string Quantity { get; set; }
|
||||
|
||||
public string Subtotal { get; set; }
|
||||
|
||||
public Link ContinueShopping { get; set; }
|
||||
|
||||
public Link Checkout { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
11
src/DomainObjects/PageSections/RelatedProductsSection.cs
Normal file
11
src/DomainObjects/PageSections/RelatedProductsSection.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
public class RelatedProductsSection : PageSectionBase<RelatedProductsSection> {
|
||||
|
||||
public string AddToCart { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/PageSections/SettingsSection.cs
Normal file
12
src/DomainObjects/PageSections/SettingsSection.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class SettingsSection : PageSectionBase<SettingsSection> {
|
||||
|
||||
public string ShippingAddressSameAsBillingAddress { get; set; }
|
||||
public string SaveThisInformation { get; set; }
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
9
src/DomainObjects/PageSections/ShippingAddressSection.cs
Normal file
9
src/DomainObjects/PageSections/ShippingAddressSection.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class ShippingAddressSection : AddressSectionBase<ShippingAddressSection> {
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/PageSections/ShopItemsSection.cs
Normal file
12
src/DomainObjects/PageSections/ShopItemsSection.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class ShopItemsSection : PageSectionBase<ShopItemsSection> {
|
||||
|
||||
public string AddToCart { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
16
src/DomainObjects/PageSections/SummarySection.cs
Normal file
16
src/DomainObjects/PageSections/SummarySection.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class SummarySection : PageSectionBase<SummarySection> {
|
||||
|
||||
public string Total { get; set; }
|
||||
|
||||
public FormItem PromoCode { get; set; }
|
||||
|
||||
public FormItem Submit { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
10
src/DomainObjects/PageSections/TestimonialsSection.cs
Normal file
10
src/DomainObjects/PageSections/TestimonialsSection.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class TestimonialsSection : PageSectionBase<TestimonialsSection> {
|
||||
public List<Testimonial> Items { get; set; }
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
14
src/DomainObjects/PageSections/TitleSection.cs
Normal file
14
src/DomainObjects/PageSections/TitleSection.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.PageSections;
|
||||
|
||||
public class TitleSection : PageSectionBase<TitleSection> {
|
||||
public Image? Image { get; set; }
|
||||
public Link? PrimaryLink { get; set; }
|
||||
public Link? SecondaryLink { get; set; }
|
||||
public string? PostedOnBy { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/Pages/BlogCatalogPage.cs
Normal file
12
src/DomainObjects/Pages/BlogCatalogPage.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class BlogCatalogPage : PageBase<BlogCatalogPage> {
|
||||
public FeaturedBlogSection FeaturedBlogSection { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
13
src/DomainObjects/Pages/BlogItemPage.cs
Normal file
13
src/DomainObjects/Pages/BlogItemPage.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class BlogItemPage : PageBase<BlogItemPage> {
|
||||
public CommentsSection CommentsSection { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
15
src/DomainObjects/Pages/HomePage.cs
Normal file
15
src/DomainObjects/Pages/HomePage.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class HomePage : PageBase<HomePage> {
|
||||
public FeaturesSection FeaturesSection { get; set; }
|
||||
public TestimonialsSection TestimonialsSection { get; set; }
|
||||
public FeaturedBlogsSection FeaturedBlogsSection { get; set; }
|
||||
public CallToActionSection CallToActionSection { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/Pages/ShopCartPage.cs
Normal file
12
src/DomainObjects/Pages/ShopCartPage.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class ShopCartPage : PageBase<ShopCartPage> {
|
||||
public ProductsSection ProductsSection { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
13
src/DomainObjects/Pages/ShopCatalogPage.cs
Normal file
13
src/DomainObjects/Pages/ShopCatalogPage.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class ShopCatalogPage : PageBase<ShopCatalogPage> {
|
||||
public ShopItemsSection ShopItemsSection { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
24
src/DomainObjects/Pages/ShopCheckoutPage.cs
Normal file
24
src/DomainObjects/Pages/ShopCheckoutPage.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class ShopCheckoutPage : PageBase<ShopCheckoutPage> {
|
||||
|
||||
|
||||
public BillingAddressSection BillingAddressSection { get; set; }
|
||||
|
||||
public ShippingAddressSection ShippingAddressSection { get; set; }
|
||||
|
||||
public SettingsSection SettingsSection { get; set; }
|
||||
|
||||
public SummarySection SummarySection { get; set; }
|
||||
|
||||
public PaymentSection PaymentSection { get; set; }
|
||||
|
||||
public FormItem Submit { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
16
src/DomainObjects/Pages/ShopItemPage.cs
Normal file
16
src/DomainObjects/Pages/ShopItemPage.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using DomainObjects.Abstractions;
|
||||
using DomainObjects.PageSections;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class ShopItemPage : PageBase<ShopItemPage> {
|
||||
|
||||
public ProductSection ProductSection { get; set; }
|
||||
|
||||
public RelatedProductsSection RelatedProductsSection { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
26
src/DomainObjects/Pages/SignUpPage.cs
Normal file
26
src/DomainObjects/Pages/SignUpPage.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class SignUpPage : PageBase<SignUpPage> {
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public FormItem Username { get; set; }
|
||||
|
||||
public FormItem Email { get; set; }
|
||||
|
||||
public FormItem ReEmail { get; set; }
|
||||
public FormItem Password { get; set; }
|
||||
|
||||
public FormItem RePassword { get; set; }
|
||||
|
||||
public string AcceptTermsAndConditions { get; set; }
|
||||
|
||||
public FormItem Submit { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
21
src/DomainObjects/Pages/SingInPage.cs
Normal file
21
src/DomainObjects/Pages/SingInPage.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects.Pages;
|
||||
|
||||
public class SignInPage : PageBase<SignInPage> {
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public FormItem Email { get; set; }
|
||||
public FormItem Password { get; set; }
|
||||
|
||||
public string DontHaveAnAccount { get; set; }
|
||||
|
||||
public Link SignUpLink { get; set; }
|
||||
|
||||
public FormItem Submit { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
35
src/DomainObjects/Password.cs
Normal file
35
src/DomainObjects/Password.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
using CryptoProvider;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Password : DomainObjectBase<Password> {
|
||||
|
||||
public string Hash { get; }
|
||||
|
||||
public string Salt { get; }
|
||||
|
||||
public DateTime Created { get; }
|
||||
|
||||
|
||||
public Password(string password) {
|
||||
var (salt, hash) = HashService.CreateSaltedHash(password);
|
||||
|
||||
Hash = hash;
|
||||
Salt = salt;
|
||||
Created = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
private Password(string salt, string hash, DateTime created) {
|
||||
Hash = hash;
|
||||
Salt = salt;
|
||||
Created = created;
|
||||
}
|
||||
|
||||
public Password Prototype() => new (Hash, Salt, Created);
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/PasswordExpiration.cs
Normal file
12
src/DomainObjects/PasswordExpiration.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class PasswordExpiration : DomainObjectBase<PasswordExpiration> {
|
||||
public bool Enabled { get; set; }
|
||||
public int Days { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
16
src/DomainObjects/Passwords.cs
Normal file
16
src/DomainObjects/Passwords.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Passwords : DomainObjectBase<Passwords> {
|
||||
|
||||
public Password? Password { get; set; }
|
||||
|
||||
public PasswordExpiration Expiration { get; set; }
|
||||
|
||||
public List<Password> Expired { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/Reviewer.cs
Normal file
12
src/DomainObjects/Reviewer.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Reviewer : PersonBase<Reviewer> {
|
||||
public string FullName { get; set; }
|
||||
public string Position { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
14
src/DomainObjects/Route.cs
Normal file
14
src/DomainObjects/Route.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Route : DomainObjectBase<Route> {
|
||||
|
||||
public string Target { get; set; }
|
||||
public string? Component { get; set; }
|
||||
public List<Route>? ChildRoutes { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
12
src/DomainObjects/Testimonial.cs
Normal file
12
src/DomainObjects/Testimonial.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Testimonial : DomainObjectBase<Testimonial> {
|
||||
public string Text { get; set; }
|
||||
public Reviewer Reviewer { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
13
src/DomainObjects/Token.cs
Normal file
13
src/DomainObjects/Token.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using DomainObjects.Abstractions;
|
||||
|
||||
namespace DomainObjects;
|
||||
|
||||
public class Token : DomainObjectBase<Token> {
|
||||
public string Value { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime Expires { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
60
src/EmailProvider/EmailMessageBuilder.cs
Normal file
60
src/EmailProvider/EmailMessageBuilder.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using MimeKit;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace EmailProvider {
|
||||
|
||||
public interface IEmailMessageBuilder {
|
||||
|
||||
}
|
||||
|
||||
public class EmailMessageBuilder : IEmailMessageBuilder {
|
||||
|
||||
private MimeMessage _mimeMessage;
|
||||
|
||||
public EmailMessageBuilder() => Initialize();
|
||||
|
||||
public EmailMessageBuilder(byte[] bytes) => Initialize(bytes);
|
||||
|
||||
public void Initialize() => _mimeMessage = new MimeMessage();
|
||||
|
||||
public void Initialize(byte[] bytes) {
|
||||
using var stream = new MemoryStream(bytes);
|
||||
_mimeMessage = new MimeMessage(stream);
|
||||
}
|
||||
|
||||
public void AddTos(Dictionary<string, string> tos) {
|
||||
foreach (var address in tos)
|
||||
_mimeMessage.To.Add(new MailboxAddress(address.Value, address.Key));
|
||||
}
|
||||
|
||||
public void AddCcs(Dictionary<string, string> ccs) {
|
||||
foreach (var address in ccs)
|
||||
_mimeMessage.Cc.Add(new MailboxAddress(address.Value, address.Key));
|
||||
}
|
||||
|
||||
public void AddBcs(Dictionary<string, string> bccs) {
|
||||
foreach (var address in bccs)
|
||||
_mimeMessage.Bcc.Add(new MailboxAddress(address.Value, address.Key));
|
||||
}
|
||||
|
||||
public void AddSubject(string subject) => _mimeMessage.Subject = subject;
|
||||
|
||||
public void AddHtmlBody(string htmlBody) {
|
||||
var bodyBuilder = new BodyBuilder();
|
||||
bodyBuilder.HtmlBody = htmlBody;
|
||||
_mimeMessage.Body = bodyBuilder.ToMessageBody();
|
||||
}
|
||||
|
||||
public void AddTextBody(string textBody) {
|
||||
var bodyBuilder = new BodyBuilder();
|
||||
bodyBuilder.TextBody = textBody;
|
||||
_mimeMessage.Body = bodyBuilder.ToMessageBody();
|
||||
}
|
||||
|
||||
public byte [] Build() {
|
||||
using var stream = new MemoryStream();
|
||||
_mimeMessage.WriteTo(stream);
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
13
src/EmailProvider/EmailProvider.csproj
Normal file
13
src/EmailProvider/EmailProvider.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="3.4.2" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
5
src/EmailProvider/IMAPService.cs
Normal file
5
src/EmailProvider/IMAPService.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace EmailProvider {
|
||||
public class IMAPService {
|
||||
|
||||
}
|
||||
}
|
||||
24
src/EmailProvider/SMTPService.cs
Normal file
24
src/EmailProvider/SMTPService.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using MailKit.Net.Smtp;
|
||||
using MimeKit;
|
||||
|
||||
namespace EmailProvider {
|
||||
public class SMTPService : IDisposable {
|
||||
|
||||
private readonly SmtpClient _client;
|
||||
|
||||
public SMTPService() {
|
||||
_client = new SmtpClient();
|
||||
}
|
||||
|
||||
public void Send(byte[] message) {
|
||||
using var ms = new MemoryStream(message);
|
||||
var mimeMessage = new MimeMessage(ms);
|
||||
|
||||
_client.Send(mimeMessage);
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
_client.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
using Core.DomainObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
public abstract class AddressSectionBase<T> : PageSectionBase<T> {
|
||||
public FormItem FirstName { get; set; }
|
||||
public FormItem LastName { get; set; }
|
||||
|
||||
public FormItem Address { get; set; }
|
||||
public FormItem Address2 { get; set; }
|
||||
public FormItem Country { get; set; }
|
||||
public FormItem State { get; set; }
|
||||
|
||||
public FormItem City { get; set; }
|
||||
public FormItem Zip { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
public abstract class DomainObjectBase<T> : EquatableBase<T> {
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
public abstract class DomainObjectDocumentBase<T> : DomainObjectBase<T> {
|
||||
public Guid Id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
|
||||
|
||||
using Core.DomainObjects;
|
||||
using Core.DomainObjects.PageSections;
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
public abstract class PageBase<T> : DomainObjectBase<T> {
|
||||
public Header Header { get; set; }
|
||||
public TitleSection? TitleSection { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
public abstract class PageSectionBase<T> : DomainObjectBase<T> {
|
||||
public string? Title { get; set; }
|
||||
public string? Text { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
using Core.DomainObjects;
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
public abstract class PersonBase<T> : DomainObjectBase<T> {
|
||||
public Guid Id { get; set; }
|
||||
public Image? Image { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
using Core.DomainObjects;
|
||||
using Core.DomainObjects.L10n;
|
||||
using Core.Enumerations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.Abstractions.DomainObjects {
|
||||
|
||||
public abstract class PostItemBase<T> : DomainObjectDocumentBase<T> {
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public List<PostItemL10n> L10n { get; set; }
|
||||
|
||||
public List<MediaAttachment>? MediaAttachments { get; set; }
|
||||
|
||||
public Guid Author { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
|
||||
public List<string>? Tags { get; set; }
|
||||
|
||||
public List<Guid> Categories { get; set; }
|
||||
|
||||
public bool? FamilyFriendly { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Address {
|
||||
public string Street { get; set; }
|
||||
public string City { get; set; }
|
||||
public string PostCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Comment : DomainObjectBase<Comment> {
|
||||
public Author Author { get; set; }
|
||||
public string Text { get; set; }
|
||||
public List<Comment>? Responses { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.Enumerations;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Contact : DomainObjectBase<Contact> {
|
||||
public ContactTypes Type { get; set; }
|
||||
public string Value { get; set; }
|
||||
public bool Confirmed { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects.Documents {
|
||||
public class BlogItem : PostItemBase<BlogItem> {
|
||||
|
||||
public uint? ReadTime { get; set; }
|
||||
|
||||
public uint? Likes { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Id.GetHashCode();
|
||||
hash = hash * 23 + SiteId.GetHashCode();
|
||||
hash = hash * 23 + L10n.GetHashCode();
|
||||
if (MediaAttachments != null)
|
||||
hash = hash * 23 + MediaAttachments.Sum(x => x.GetHashCode());
|
||||
hash = hash * 23 + Author.GetHashCode();
|
||||
hash = hash * 23 + Created.GetHashCode();
|
||||
if(Tags != null)
|
||||
hash = hash * 23 + Tags.Sum(x => x.GetHashCode());
|
||||
|
||||
if(Categories != null)
|
||||
hash = hash * 23 + Categories.Sum(x => x.GetHashCode());
|
||||
|
||||
hash = hash * 23 + ReadTime.GetHashCode();
|
||||
hash = hash * 23 + Likes.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,42 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.DomainObjects.Pages;
|
||||
|
||||
namespace Core.DomainObjects.Documents {
|
||||
|
||||
public class Content : DomainObjectDocumentBase<Content> {
|
||||
|
||||
public Guid SiteId { get; set; }
|
||||
|
||||
public string SiteName { get; set; }
|
||||
public string SiteUrl { get; set; }
|
||||
|
||||
public Header Header { get; set; }
|
||||
|
||||
public Localization Localization { get; set; }
|
||||
|
||||
public List<Route> Routes { get; set; }
|
||||
public List<Route> AdminRoutes { get; set; }
|
||||
public List<Route> ServiceRoutes { get; set; }
|
||||
|
||||
public List<MenuItem> TopMenu { get; set; }
|
||||
public List<MenuItem> SideMenu { get; set; }
|
||||
|
||||
public HomePage HomePage { get; set; }
|
||||
|
||||
public ShopCatalogPage ShopCatalog { get; set; }
|
||||
public ShopItemPage ShopItem { get; set; }
|
||||
public ShopCartPage ShopCart { get; set; }
|
||||
public ShopCheckoutPage ShopCheckout { get; set; }
|
||||
|
||||
|
||||
public BlogCatalogPage BlogCatalog { get; set; }
|
||||
public BlogItemPage BlogItem { get; set; }
|
||||
|
||||
public SignInPage SignIn { get; set; }
|
||||
public SignUpPage SignUp { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects.Documents {
|
||||
public class ShopCartItem : DomainObjectDocumentBase<ShopCartItem> {
|
||||
public Guid SiteId { get; set; }
|
||||
public Guid UserId { get; set; }
|
||||
public string Sku { get; set; }
|
||||
public uint Quantity { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
// https://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-overriding-gethashcode
|
||||
// Overflow is fine, just wrap
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
hash = hash * 23 + Id.GetHashCode();
|
||||
hash = hash * 23 + UserId.GetHashCode();
|
||||
hash = hash * 23 + Sku.GetHashCode();
|
||||
hash = hash * 23 + Quantity.GetHashCode();
|
||||
hash = hash * 23 + Created.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects.Documents {
|
||||
public class ShopItem : PostItemBase<ShopItem> {
|
||||
public string BrandName { get; set; }
|
||||
public string Sku { get; set; }
|
||||
public decimal? Rating { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public decimal? NewPrice { get; set; }
|
||||
public uint Quantity { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Id.GetHashCode();
|
||||
hash = hash * 23 + SiteId.GetHashCode();
|
||||
hash = hash * 23 + L10n.GetHashCode();
|
||||
if (MediaAttachments != null)
|
||||
hash = hash * 23 + MediaAttachments.Sum(x => x.GetHashCode());
|
||||
hash = hash * 23 + Author.GetHashCode();
|
||||
hash = hash * 23 + Created.GetHashCode();
|
||||
hash = hash * 23 + Tags.GetHashCode();
|
||||
hash = hash * 23 + Categories.Sum(x => x.GetHashCode());
|
||||
|
||||
hash = hash * 23 + BrandName.GetHashCode();
|
||||
hash = hash * 23 + Sku.GetHashCode();
|
||||
hash = hash * 23 + Rating.GetHashCode();
|
||||
hash = hash * 23 + Price.GetHashCode();
|
||||
hash = hash * 23 + NewPrice.GetHashCode();
|
||||
hash = hash * 23 + Quantity.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
|
||||
public class User : DomainObjectDocumentBase<User> {
|
||||
|
||||
public List<Guid> Sites { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public string Username { get; set; }
|
||||
|
||||
public Passwords Passwords { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string LastName { get; set; }
|
||||
|
||||
public List<Contact> Contacts { get; set; }
|
||||
|
||||
public Address BillingAddress { get; set; }
|
||||
|
||||
public Address ShippingAddress { get; set; }
|
||||
|
||||
public List<Token> Tokens { get; set; }
|
||||
|
||||
public List<UserAuthorizations> Authorizations { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Feature : DomainObjectBase<Feature> {
|
||||
public string Icon { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class FormItem : DomainObjectBase<FormItem> {
|
||||
public string? Title { get; set; }
|
||||
|
||||
public string? Optional { get; set; }
|
||||
public string? PlaceHolder { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Header : DomainObjectBase<Header> {
|
||||
|
||||
public string? Title { get; set; }
|
||||
|
||||
public Dictionary<string, string>? Meta { get; set; }
|
||||
|
||||
public Dictionary<string, string>? Link { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.DomainObjects.L10n;
|
||||
using Core.Enumerations;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
|
||||
|
||||
|
||||
public class Image : DomainObjectBase<MediaAttachment> {
|
||||
public string Src { get; set; }
|
||||
|
||||
public string Alt { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Src.GetHashCode();
|
||||
hash = hash * 23 + Alt.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.Enumerations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects.L10n {
|
||||
public class CategoryL10n : DomainObjectBase<CategoryL10n> {
|
||||
public Locales Locale { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Locale.GetHashCode();
|
||||
hash = hash * 23 + Slug.GetHashCode();
|
||||
hash = hash * 23 + Text.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.Enumerations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects.L10n {
|
||||
public class MediaAttachmentL10n : DomainObjectBase<MediaAttachmentL10n> {
|
||||
public Locales Locale { get; set; }
|
||||
public string Alt { get; set; }
|
||||
public string? Target { get; set; }
|
||||
public string? Titile { get; set; }
|
||||
public string? Description { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Locale.GetHashCode();
|
||||
hash = hash * 23 + Alt.GetHashCode();
|
||||
|
||||
if(Target != null)
|
||||
hash = hash * 23 + Target.GetHashCode();
|
||||
|
||||
if (Titile != null)
|
||||
hash = hash * 23 + Target.GetHashCode();
|
||||
|
||||
if (Description != null)
|
||||
hash = hash * 23 + Description.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.Enumerations;
|
||||
|
||||
namespace Core.DomainObjects.L10n {
|
||||
public class PostItemL10n : DomainObjectBase<PostItemL10n> {
|
||||
public Locales Locale { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Text { get; set; }
|
||||
public TextFormat TextFormat { get; set; }
|
||||
public string PlainText { get; set; }
|
||||
public string ShortText { get; set; }
|
||||
public List<string>? Badges { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
unchecked {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Locale.GetHashCode();
|
||||
hash = hash * 23 + Slug.GetHashCode();
|
||||
hash = hash * 23 + Description.GetHashCode();
|
||||
hash = hash * 23 + Title.GetHashCode();
|
||||
hash = hash * 23 + Text.GetHashCode();
|
||||
hash = hash * 23 + TextFormat.GetHashCode();
|
||||
hash = hash * 23 + ShortText.GetHashCode();
|
||||
hash = hash * 23 + Badges.Sum(x => x.GetHashCode());
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Link : DomainObjectBase<Link> {
|
||||
public string Target { get; set; }
|
||||
public string AnchorText { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class Localization : DomainObjectBase<Localization> {
|
||||
|
||||
public string? TimeZone { get; set; }
|
||||
|
||||
public string? Locale { get; set; }
|
||||
|
||||
public string? DateFormat { get; set; }
|
||||
|
||||
public string? TimeFormat { get; set; }
|
||||
|
||||
public string? Currency { get; set; }
|
||||
|
||||
public string? CurrencySymbol { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using Core.DomainObjects.L10n;
|
||||
using Core.Enumerations;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
|
||||
|
||||
|
||||
public class MediaAttachment : DomainObjectBase<MediaAttachment> {
|
||||
public string Src { get; set; }
|
||||
|
||||
public MediaTypes MediaType { get; set; }
|
||||
public List<MediaAttachmentL10n> L10n { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
int hash = 17;
|
||||
hash = hash * 23 + Src.GetHashCode();
|
||||
hash = hash * 23 + L10n.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
namespace Core.DomainObjects {
|
||||
public class MenuItem : DomainObjectBase<MenuItem> {
|
||||
|
||||
public string? Icon { get; set; }
|
||||
public string? Title { get; set; }
|
||||
public string? Target { get; set; }
|
||||
public List<MenuItem>? ChildItems { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects.PageSections {
|
||||
public class BillingAddressSection : AddressSectionBase<BillingAddressSection> {
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
|
||||
|
||||
namespace Core.DomainObjects.PageSections {
|
||||
public class CallToActionSection : PageSectionBase<CallToActionSection> {
|
||||
public string PrivacyDisclaimer { get; set; }
|
||||
|
||||
public FormItem Email { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
using Core.Abstractions.DomainObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Core.DomainObjects.PageSections {
|
||||
public class CommentsSection : PageSectionBase<CommentsSection> {
|
||||
public string LeaveComment { get; set; }
|
||||
|
||||
public override int GetHashCode() {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user