Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Grand.Domain - Code cleanup (ReSharper)

support6f8ba5e6ccb8
diff --git a/src/Core/Grand.Domain/Admin/AdminSearchSettings.cs b/src/Core/Grand.Domain/Admin/AdminSearchSettings.cs
index 4f2c3125f..b386e92c4 100644
--- a/src/Core/Grand.Domain/Admin/AdminSearchSettings.cs
+++ b/src/Core/Grand.Domain/Admin/AdminSearchSettings.cs
@@ -1,53 +1,52 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Admin
+namespace Grand.Domain.Admin;
+
+public class AdminSearchSettings : ISettings
{
- public class AdminSearchSettings : ISettings
- {
- public bool SearchInProducts { get; set; }
+ public bool SearchInProducts { get; set; }
- public bool SearchInCategories { get; set; }
+ public bool SearchInCategories { get; set; }
- public bool SearchInCollections { get; set; }
+ public bool SearchInCollections { get; set; }
- public bool SearchInPages { get; set; }
+ public bool SearchInPages { get; set; }
- public bool SearchInNews { get; set; }
+ public bool SearchInNews { get; set; }
- public bool SearchInBlogs { get; set; }
+ public bool SearchInBlogs { get; set; }
- public bool SearchInCustomers { get; set; }
+ public bool SearchInCustomers { get; set; }
- public bool SearchInOrders { get; set; }
+ public bool SearchInOrders { get; set; }
- public int MinSearchTermLength { get; set; }
+ public int MinSearchTermLength { get; set; }
- public int MaxSearchResultsCount { get; set; }
+ public int MaxSearchResultsCount { get; set; }
- public int ProductsDisplayOrder { get; set; }
+ public int ProductsDisplayOrder { get; set; }
- public int CategoriesDisplayOrder { get; set; }
+ public int CategoriesDisplayOrder { get; set; }
- public int CollectionsDisplayOrder { get; set; }
+ public int CollectionsDisplayOrder { get; set; }
- public int PagesDisplayOrder { get; set; }
+ public int PagesDisplayOrder { get; set; }
- public int NewsDisplayOrder { get; set; }
+ public int NewsDisplayOrder { get; set; }
- public int BlogsDisplayOrder { get; set; }
+ public int BlogsDisplayOrder { get; set; }
- public int CustomersDisplayOrder { get; set; }
+ public int CustomersDisplayOrder { get; set; }
- public int OrdersDisplayOrder { get; set; }
+ public int OrdersDisplayOrder { get; set; }
- public bool SearchInMenu { get; set; }
+ public bool SearchInMenu { get; set; }
- public int MenuDisplayOrder { get; set; }
+ public int MenuDisplayOrder { get; set; }
- public int CategorySizeLimit { get; set; }
- public int BrandSizeLimit { get; set; }
- public int CollectionSizeLimit { get; set; }
- public int VendorSizeLimit { get; set; }
- public int CustomerGroupSizeLimit { get; set; }
- }
-}
+ public int CategorySizeLimit { get; set; }
+ public int BrandSizeLimit { get; set; }
+ public int CollectionSizeLimit { get; set; }
+ public int VendorSizeLimit { get; set; }
+ public int CustomerGroupSizeLimit { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Admin/AdminSiteMap.cs b/src/Core/Grand.Domain/Admin/AdminSiteMap.cs
index 230c36d5b..72d9beaa3 100644
--- a/src/Core/Grand.Domain/Admin/AdminSiteMap.cs
+++ b/src/Core/Grand.Domain/Admin/AdminSiteMap.cs
@@ -1,69 +1,68 @@
-namespace Grand.Domain.Admin
+namespace Grand.Domain.Admin;
+
+/// <summary>
+/// Represents an admin menu
+/// </summary>
+public class AdminSiteMap : BaseEntity
{
- /// <summary>
- /// Represents an admin menu
- /// </summary>
- public class AdminSiteMap : BaseEntity
+ public AdminSiteMap()
{
- public AdminSiteMap()
- {
- ChildNodes = new List<AdminSiteMap>();
- PermissionNames = new List<string>();
- }
+ ChildNodes = new List<AdminSiteMap>();
+ PermissionNames = new List<string>();
+ }
- /// <summary>
- /// Gets or sets the system name.
- /// </summary>
- public string SystemName { get; set; }
+ /// <summary>
+ /// Gets or sets the system name.
+ /// </summary>
+ public string SystemName { get; set; }
- /// <summary>
- /// Gets or sets the resource name.
- /// </summary>
- public string ResourceName { get; set; }
+ /// <summary>
+ /// Gets or sets the resource name.
+ /// </summary>
+ public string ResourceName { get; set; }
- /// <summary>
- /// Gets or sets the name of the controller.
- /// </summary>
- public string ControllerName { get; set; }
+ /// <summary>
+ /// Gets or sets the name of the controller.
+ /// </summary>
+ public string ControllerName { get; set; }
- /// <summary>
- /// Gets or sets the name of the action.
- /// </summary>
- public string ActionName { get; set; }
+ /// <summary>
+ /// Gets or sets the name of the action.
+ /// </summary>
+ public string ActionName { get; set; }
- /// <summary>
- /// Gets or sets the URL.
- /// </summary>
- public string Url { get; set; }
+ /// <summary>
+ /// Gets or sets the URL.
+ /// </summary>
+ public string Url { get; set; }
- /// <summary>
- /// Gets or sets the child nodes.
- /// </summary>
- public virtual IList<AdminSiteMap> ChildNodes { get; set; }
+ /// <summary>
+ /// Gets or sets the child nodes.
+ /// </summary>
+ public virtual IList<AdminSiteMap> ChildNodes { get; set; }
- /// <summary>
- /// Gets or sets the icon class
- /// </summary>
- public string IconClass { get; set; }
+ /// <summary>
+ /// Gets or sets the icon class
+ /// </summary>
+ public string IconClass { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to open url in new tab (window) or not
- /// </summary>
- public bool OpenUrlInNewTab { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to open url in new tab (window) or not
+ /// </summary>
+ public bool OpenUrlInNewTab { get; set; }
- /// <summary>
- /// Gets or sets permissions
- /// </summary>
- public IList<string> PermissionNames { get; set; }
+ /// <summary>
+ /// Gets or sets permissions
+ /// </summary>
+ public IList<string> PermissionNames { get; set; }
- /// <summary>
- /// Gets or sets all permissions
- /// </summary>
- public bool AllPermissions { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets all permissions
+ /// </summary>
+ public bool AllPermissions { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Affiliates/Affiliate.cs b/src/Core/Grand.Domain/Affiliates/Affiliate.cs
index 94f028ec0..dd6ae020a 100644
--- a/src/Core/Grand.Domain/Affiliates/Affiliate.cs
+++ b/src/Core/Grand.Domain/Affiliates/Affiliate.cs
@@ -1,35 +1,34 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Affiliates
+namespace Grand.Domain.Affiliates;
+
+/// <summary>
+/// Represents an affiliate
+/// </summary>
+public class Affiliate : BaseEntity
{
/// <summary>
- /// Represents an affiliate
+ /// Gets or sets the name
/// </summary>
- public class Affiliate : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
- /// <summary>
- /// Gets or sets the friendly url name for affiliate
- /// </summary>
- public string FriendlyUrlName { get; set; }
+ /// <summary>
+ /// Gets or sets the friendly url name for affiliate
+ /// </summary>
+ public string FriendlyUrlName { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is active
- /// </summary>
- public bool Active { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is active
+ /// </summary>
+ public bool Active { get; set; }
- /// <summary>
- /// Gets or sets the address
- /// </summary>
- public virtual Address Address { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the address
+ /// </summary>
+ public virtual Address Address { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/BaseEntity.cs b/src/Core/Grand.Domain/BaseEntity.cs
index e27a362c5..38639f9e7 100644
--- a/src/Core/Grand.Domain/BaseEntity.cs
+++ b/src/Core/Grand.Domain/BaseEntity.cs
@@ -1,17 +1,16 @@
using Grand.Domain.Common;
-namespace Grand.Domain
+namespace Grand.Domain;
+
+/// <summary>
+/// Base class for entities
+/// </summary>
+public abstract class BaseEntity : ParentEntity, IAuditableEntity
{
- /// <summary>
- /// Base class for entities
- /// </summary>
- public abstract class BaseEntity : ParentEntity, IAuditableEntity
- {
- public IList<UserField> UserFields { get; set; } = new List<UserField>();
+ public IList<UserField> UserFields { get; set; } = new List<UserField>();
- public DateTime CreatedOnUtc { get; set; }
- public string CreatedBy { get; set; }
- public DateTime? UpdatedOnUtc { get; set; }
- public string UpdatedBy { get; set; }
- }
-}
+ public DateTime CreatedOnUtc { get; set; }
+ public string CreatedBy { get; set; }
+ public DateTime? UpdatedOnUtc { get; set; }
+ public string UpdatedBy { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogCategory.cs b/src/Core/Grand.Domain/Blogs/BlogCategory.cs
index 6b0c2c25e..aefc7bede 100644
--- a/src/Core/Grand.Domain/Blogs/BlogCategory.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogCategory.cs
@@ -1,36 +1,36 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+public class BlogCategory : BaseEntity, IStoreLinkEntity, ITranslationEntity
{
- public class BlogCategory : BaseEntity, IStoreLinkEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the blog category name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the blog category sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- public IList<BlogCategoryPost> BlogPosts { get; set; } = new List<BlogCategoryPost>();
- }
-}
+ /// <summary>
+ /// Gets or sets the blog category name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the blog category sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ public IList<BlogCategoryPost> BlogPosts { get; set; } = new List<BlogCategoryPost>();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogCategoryPost.cs b/src/Core/Grand.Domain/Blogs/BlogCategoryPost.cs
index 0fa14d0c2..b0558e932 100644
--- a/src/Core/Grand.Domain/Blogs/BlogCategoryPost.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogCategoryPost.cs
@@ -1,7 +1,6 @@
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+public class BlogCategoryPost : SubBaseEntity
{
- public class BlogCategoryPost : SubBaseEntity
- {
- public string BlogPostId { get; set; }
- }
-}
+ public string BlogPostId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogComment.cs b/src/Core/Grand.Domain/Blogs/BlogComment.cs
index 4833e9261..d4d71be03 100644
--- a/src/Core/Grand.Domain/Blogs/BlogComment.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogComment.cs
@@ -1,34 +1,32 @@
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+/// <summary>
+/// Represents a blog comment
+/// </summary>
+public class BlogComment : BaseEntity
{
/// <summary>
- /// Represents a blog comment
+ /// Gets or sets the customer identifier
/// </summary>
- public class BlogComment : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the comment text
- /// </summary>
- public string CommentText { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the blog post title
- /// </summary>
- public string BlogPostTitle { get; set; }
+ /// <summary>
+ /// Gets or sets the comment text
+ /// </summary>
+ public string CommentText { get; set; }
- /// <summary>
- /// Gets or sets the blog post identifier
- /// </summary>
- public string BlogPostId { get; set; }
+ /// <summary>
+ /// Gets or sets the blog post title
+ /// </summary>
+ public string BlogPostTitle { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the blog post identifier
+ /// </summary>
+ public string BlogPostId { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogExtensions.cs b/src/Core/Grand.Domain/Blogs/BlogExtensions.cs
index 2e65d1fd2..86d2ccd24 100644
--- a/src/Core/Grand.Domain/Blogs/BlogExtensions.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogExtensions.cs
@@ -1,36 +1,39 @@
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+public static class BlogExtensions
{
- public static class BlogExtensions
+ public static string[] ParseTags(this BlogPost blogPost)
{
- public static string[] ParseTags(this BlogPost blogPost)
- {
- ArgumentNullException.ThrowIfNull(blogPost);
+ ArgumentNullException.ThrowIfNull(blogPost);
- var parsedTags = new List<string>();
- if (!String.IsNullOrEmpty(blogPost.Tags))
+ var parsedTags = new List<string>();
+ if (!string.IsNullOrEmpty(blogPost.Tags))
+ {
+ var tags2 = blogPost.Tags.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+ foreach (var tag2 in tags2)
{
- var tags2 = blogPost.Tags.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- foreach (var tag2 in tags2)
- {
- var tmp = tag2.Trim();
- if (!String.IsNullOrEmpty(tmp))
- parsedTags.Add(tmp);
- }
+ var tmp = tag2.Trim();
+ if (!string.IsNullOrEmpty(tmp))
+ parsedTags.Add(tmp);
}
- return parsedTags.ToArray();
}
- /// <summary>
- /// Returns all posts published between the two dates.
- /// </summary>
- /// <param name="source">Source</param>
- /// <param name="dateFrom">Date from</param>
- /// <param name="dateTo">Date to</param>
- /// <returns>Filtered posts</returns>
- public static IList<BlogPost> GetPostsByDate(this IList<BlogPost> source,
- DateTime dateFrom, DateTime dateTo)
- {
- return source.Where(p => dateFrom.Date <= (p.StartDateUtc ?? p.CreatedOnUtc) && (p.StartDateUtc ?? p.CreatedOnUtc).Date <= dateTo).ToList();
- }
+ return parsedTags.ToArray();
+ }
+
+ /// <summary>
+ /// Returns all posts published between the two dates.
+ /// </summary>
+ /// <param name="source">Source</param>
+ /// <param name="dateFrom">Date from</param>
+ /// <param name="dateTo">Date to</param>
+ /// <returns>Filtered posts</returns>
+ public static IList<BlogPost> GetPostsByDate(this IList<BlogPost> source,
+ DateTime dateFrom, DateTime dateTo)
+ {
+ return source.Where(p =>
+ dateFrom.Date <= (p.StartDateUtc ?? p.CreatedOnUtc) &&
+ (p.StartDateUtc ?? p.CreatedOnUtc).Date <= dateTo)
+ .ToList();
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogPost.cs b/src/Core/Grand.Domain/Blogs/BlogPost.cs
index b6d27d1ae..2f17decf7 100644
--- a/src/Core/Grand.Domain/Blogs/BlogPost.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogPost.cs
@@ -2,91 +2,90 @@ using Grand.Domain.Localization;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+/// <summary>
+/// Represents a blog post
+/// </summary>
+public class BlogPost : BaseEntity, ISlugEntity, IStoreLinkEntity, ITranslationEntity
{
/// <summary>
- /// Represents a blog post
+ /// Gets or sets the blog post title
+ /// </summary>
+ public string Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the blog post body
+ /// </summary>
+ public string Body { get; set; }
+
+ /// <summary>
+ /// Gets or sets the blog post overview. If specified, then it's used on the blog page instead of the "Body"
+ /// </summary>
+ public string BodyOverview { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the blog post comments are allowed
+ /// </summary>
+ public bool AllowComments { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total number of comments
+ /// <remarks>
+ /// We use this property for performance optimization (no SQL command executed)
+ /// </remarks>
+ /// </summary>
+ public int CommentCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the blog tags
+ /// </summary>
+ public string Tags { get; set; }
+
+ /// <summary>
+ /// Gets or sets the blog post start date and time
+ /// </summary>
+ public DateTime? StartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the blog post end date and time
+ /// </summary>
+ public DateTime? EndDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public virtual bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
/// </summary>
- public class BlogPost : BaseEntity, ISlugEntity, IStoreLinkEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the blog post title
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the blog post body
- /// </summary>
- public string Body { get; set; }
-
- /// <summary>
- /// Gets or sets the blog post overview. If specified, then it's used on the blog page instead of the "Body"
- /// </summary>
- public string BodyOverview { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the blog post comments are allowed
- /// </summary>
- public bool AllowComments { get; set; }
-
- /// <summary>
- /// Gets or sets the total number of comments
- /// <remarks>
- /// We use this property for performance optimization (no SQL command executed)
- /// </remarks>
- /// </summary>
- public int CommentCount { get; set; }
-
- /// <summary>
- /// Gets or sets the blog tags
- /// </summary>
- public string Tags { get; set; }
-
- /// <summary>
- /// Gets or sets the blog post start date and time
- /// </summary>
- public DateTime? StartDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the blog post end date and time
- /// </summary>
- public DateTime? EndDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public virtual bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- }
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogPostTag.cs b/src/Core/Grand.Domain/Blogs/BlogPostTag.cs
index 7a21c3726..5d1534eec 100644
--- a/src/Core/Grand.Domain/Blogs/BlogPostTag.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogPostTag.cs
@@ -1,18 +1,17 @@
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+/// <summary>
+/// Represents a blog post tag
+/// </summary>
+public class BlogPostTag
{
/// <summary>
- /// Represents a blog post tag
+ /// Gets or sets the name
/// </summary>
- public class BlogPostTag
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the tagged product count
- /// </summary>
- public int BlogPostCount { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the tagged product count
+ /// </summary>
+ public int BlogPostCount { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogProduct.cs b/src/Core/Grand.Domain/Blogs/BlogProduct.cs
index 3e17ba9f3..d31b7000d 100644
--- a/src/Core/Grand.Domain/Blogs/BlogProduct.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogProduct.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+public class BlogProduct : BaseEntity
{
- public class BlogProduct : BaseEntity
- {
- public string BlogPostId { get; set; }
- public string ProductId { get; set; }
- public int DisplayOrder { get; set; }
- }
-}
+ public string BlogPostId { get; set; }
+ public string ProductId { get; set; }
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Blogs/BlogSettings.cs b/src/Core/Grand.Domain/Blogs/BlogSettings.cs
index 0c94c68da..d2f3005ce 100644
--- a/src/Core/Grand.Domain/Blogs/BlogSettings.cs
+++ b/src/Core/Grand.Domain/Blogs/BlogSettings.cs
@@ -1,53 +1,51 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Blogs
+namespace Grand.Domain.Blogs;
+
+public class BlogSettings : ISettings
{
- public class BlogSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether blog is enabled
- /// </summary>
- public bool Enabled { get; set; }
-
- /// <summary>
- /// Gets or sets the page size for posts
- /// </summary>
- public int PostsPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether not registered user can leave comments
- /// </summary>
- public bool AllowNotRegisteredUsersToLeaveComments { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to notify about new blog comments
- /// </summary>
- public bool NotifyAboutNewBlogComments { get; set; }
-
- /// <summary>
- /// Gets or sets a number of blog tags that appear in the tag cloud
- /// </summary>
- public int NumberOfTags { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show blog on the home page
- /// </summary>
- public bool ShowBlogOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating blog count displayed on the home page
- /// </summary>
- public int HomePageBlogCount { get; set; }
-
- /// <summary>
- /// Gets or sets a value the maximum size of the text on home page
- /// </summary>
- public int MaxTextSizeHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show blog posts in the auto complete search
- /// </summary>
- public bool ShowBlogPostsInSearchAutoComplete { get; set; }
-
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether blog is enabled
+ /// </summary>
+ public bool Enabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets the page size for posts
+ /// </summary>
+ public int PostsPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether not registered user can leave comments
+ /// </summary>
+ public bool AllowNotRegisteredUsersToLeaveComments { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to notify about new blog comments
+ /// </summary>
+ public bool NotifyAboutNewBlogComments { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of blog tags that appear in the tag cloud
+ /// </summary>
+ public int NumberOfTags { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show blog on the home page
+ /// </summary>
+ public bool ShowBlogOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating blog count displayed on the home page
+ /// </summary>
+ public int HomePageBlogCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value the maximum size of the text on home page
+ /// </summary>
+ public int MaxTextSizeHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show blog posts in the auto complete search
+ /// </summary>
+ public bool ShowBlogPostsInSearchAutoComplete { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/AttributeControlType.cs b/src/Core/Grand.Domain/Catalog/AttributeControlType.cs
index 0f1ee2ed4..5b8c9a344 100644
--- a/src/Core/Grand.Domain/Catalog/AttributeControlType.cs
+++ b/src/Core/Grand.Domain/Catalog/AttributeControlType.cs
@@ -1,53 +1,62 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents an attribute control type
+/// </summary>
+public enum AttributeControlType
{
/// <summary>
- /// Represents an attribute control type
- /// </summary>
- public enum AttributeControlType
- {
- /// <summary>
- /// Dropdown list
- /// </summary>
- DropdownList = 1,
- /// <summary>
- /// Radio list
- /// </summary>
- RadioList = 2,
- /// <summary>
- /// Checkboxes
- /// </summary>
- Checkboxes = 3,
- /// <summary>
- /// TextBox
- /// </summary>
- TextBox = 4,
- /// <summary>
- /// Hidden
- /// </summary>
- Hidden = 5,
- /// <summary>
- /// Multiline textbox
- /// </summary>
- MultilineTextbox = 10,
- /// <summary>
- /// Datepicker
- /// </summary>
- Datepicker = 20,
- /// <summary>
- /// File upload control
- /// </summary>
- FileUpload = 30,
- /// <summary>
- /// Color squares
- /// </summary>
- ColorSquares = 40,
- /// <summary>
- /// Image squares
- /// </summary>
- ImageSquares = 45,
- /// <summary>
- /// Read-only checkboxes
- /// </summary>
- ReadonlyCheckboxes = 50
- }
+ /// Dropdown list
+ /// </summary>
+ DropdownList = 1,
+
+ /// <summary>
+ /// Radio list
+ /// </summary>
+ RadioList = 2,
+
+ /// <summary>
+ /// Checkboxes
+ /// </summary>
+ Checkboxes = 3,
+
+ /// <summary>
+ /// TextBox
+ /// </summary>
+ TextBox = 4,
+
+ /// <summary>
+ /// Hidden
+ /// </summary>
+ Hidden = 5,
+
+ /// <summary>
+ /// Multiline textbox
+ /// </summary>
+ MultilineTextbox = 10,
+
+ /// <summary>
+ /// Datepicker
+ /// </summary>
+ Datepicker = 20,
+
+ /// <summary>
+ /// File upload control
+ /// </summary>
+ FileUpload = 30,
+
+ /// <summary>
+ /// Color squares
+ /// </summary>
+ ColorSquares = 40,
+
+ /// <summary>
+ /// Image squares
+ /// </summary>
+ ImageSquares = 45,
+
+ /// <summary>
+ /// Read-only checkboxes
+ /// </summary>
+ ReadonlyCheckboxes = 50
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/AttributeValueType.cs b/src/Core/Grand.Domain/Catalog/AttributeValueType.cs
index ef205147a..4956f6bd7 100644
--- a/src/Core/Grand.Domain/Catalog/AttributeValueType.cs
+++ b/src/Core/Grand.Domain/Catalog/AttributeValueType.cs
@@ -1,17 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents an attribute value type
+/// </summary>
+public enum AttributeValueType
{
/// <summary>
- /// Represents an attribute value type
+ /// Simple attribute value
/// </summary>
- public enum AttributeValueType
- {
- /// <summary>
- /// Simple attribute value
- /// </summary>
- Simple = 0,
- /// <summary>
- /// Associated to a product (used when configuring bundled products)
- /// </summary>
- AssociatedToProduct = 10
- }
-}
+ Simple = 0,
+
+ /// <summary>
+ /// Associated to a product (used when configuring bundled products)
+ /// </summary>
+ AssociatedToProduct = 10
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/BackorderMode.cs b/src/Core/Grand.Domain/Catalog/BackorderMode.cs
index 2e9ed88e2..1446d4189 100644
--- a/src/Core/Grand.Domain/Catalog/BackorderMode.cs
+++ b/src/Core/Grand.Domain/Catalog/BackorderMode.cs
@@ -1,17 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a backorder mode
+/// </summary>
+public enum BackorderMode
{
/// <summary>
- /// Represents a backorder mode
+ /// No backorders
/// </summary>
- public enum BackorderMode
- {
- /// <summary>
- /// No backorders
- /// </summary>
- NoBackorders = 0,
- /// <summary>
- /// Allow qty below 0
- /// </summary>
- AllowQtyBelowZero = 1
- }
-}
+ NoBackorders = 0,
+
+ /// <summary>
+ /// Allow qty below 0
+ /// </summary>
+ AllowQtyBelowZero = 1
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/Bid.cs b/src/Core/Grand.Domain/Catalog/Bid.cs
index 470605fa0..37fc9ed71 100644
--- a/src/Core/Grand.Domain/Catalog/Bid.cs
+++ b/src/Core/Grand.Domain/Catalog/Bid.cs
@@ -1,47 +1,53 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a auction bid
+/// </summary>
+public class Bid : BaseEntity
{
/// <summary>
- /// Represents a auction bid
- /// </summary>
- public class Bid : BaseEntity
- {
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
-
- /// <summary>
- /// Gets or sets the bid date
- /// </summary>
- public DateTime Date { get; set; }
- /// <summary>
- /// Gets or sets the customer id
- /// </summary>
- public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets Amount
- /// </summary>
- public double Amount { get; set; }
- /// <summary>
- /// Gets or sets Order Id
- /// </summary>
- public string OrderId { get; set; }
- /// <summary>/
- /// Gets or sets Store Id
- /// </summary>
- public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets buy it now
- /// </summary>
- public bool Bin { get; set; }
- /// <summary>
- /// Gets or sets win bid
- /// </summary>
- public bool Win { get; set; }
- }
+ /// Gets or sets the product identifier
+ /// </summary>
+ public string ProductId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the bid date
+ /// </summary>
+ public DateTime Date { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer id
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets Amount
+ /// </summary>
+ public double Amount { get; set; }
+
+ /// <summary>
+ /// Gets or sets Order Id
+ /// </summary>
+ public string OrderId { get; set; }
+
+ /// <summary>
+ /// /
+ /// Gets or sets Store Id
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets buy it now
+ /// </summary>
+ public bool Bin { get; set; }
+
+ /// <summary>
+ /// Gets or sets win bid
+ /// </summary>
+ public bool Win { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/Brand.cs b/src/Core/Grand.Domain/Catalog/Brand.cs
index 27db2bb3e..4c34ce098 100644
--- a/src/Core/Grand.Domain/Catalog/Brand.cs
+++ b/src/Core/Grand.Domain/Catalog/Brand.cs
@@ -3,134 +3,134 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a brand
+/// </summary>
+public class Brand : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
{
+ private ICollection<string> _appliedDiscounts;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string BottomDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of used brand layout identifier
+ /// </summary>
+ public string BrandLayoutId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the page size
+ /// </summary>
+ public int PageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can select the page size
+ /// </summary>
+ public bool AllowCustomersToSelectPageSize { get; set; }
+
/// <summary>
- /// Represents a brand
- /// </summary>
- public class Brand : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- private ICollection<string> _appliedDiscounts;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string BottomDescription { get; set; }
-
- /// <summary>
- /// Gets or sets a value of used brand layout identifier
- /// </summary>
- public string BrandLayoutId { get; set; }
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the page size
- /// </summary>
- public int PageSize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can select the page size
- /// </summary>
- public bool AllowCustomersToSelectPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the available customer selectable page size options
- /// </summary>
- public string PageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show the collection on home page
- /// </summary>
- public bool ShowOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to include this collection in the menu
- /// </summary>
- public bool IncludeInMenu { get; set; }
-
- /// <summary>
- /// Gets or sets the Icon
- /// </summary>
- public string Icon { get; set; }
-
- /// <summary>
- /// Gets or sets the Default sort
- /// </summary>
- public int DefaultSort { get; set; } = -1;
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the ExternalId
- /// </summary>
- public string ExternalId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the collection of applied discounts
- /// </summary>
- public virtual ICollection<string> AppliedDiscounts
- {
- get => _appliedDiscounts ??= new List<string>();
- protected set => _appliedDiscounts = value;
- }
+ /// Gets or sets the available customer selectable page size options
+ /// </summary>
+ public string PageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show the collection on home page
+ /// </summary>
+ public bool ShowOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include this collection in the menu
+ /// </summary>
+ public bool IncludeInMenu { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Icon
+ /// </summary>
+ public string Icon { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Default sort
+ /// </summary>
+ public int DefaultSort { get; set; } = -1;
+
+ /// <summary>
+ /// Gets or sets the ExternalId
+ /// </summary>
+ public string ExternalId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of applied discounts
+ /// </summary>
+ public virtual ICollection<string> AppliedDiscounts {
+ get => _appliedDiscounts ??= new List<string>();
+ protected set => _appliedDiscounts = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/BrandLayout.cs b/src/Core/Grand.Domain/Catalog/BrandLayout.cs
index 44ade71eb..16f639041 100644
--- a/src/Core/Grand.Domain/Catalog/BrandLayout.cs
+++ b/src/Core/Grand.Domain/Catalog/BrandLayout.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a brand layout
+/// </summary>
+public class BrandLayout : BaseEntity
{
/// <summary>
- /// Represents a brand layout
+ /// Gets or sets the layout name
/// </summary>
- public class BrandLayout : BaseEntity
- {
- /// <summary>
- /// Gets or sets the layout name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the view path
- /// </summary>
- public string ViewPath { get; set; }
+ /// <summary>
+ /// Gets or sets the view path
+ /// </summary>
+ public string ViewPath { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/BundleProduct.cs b/src/Core/Grand.Domain/Catalog/BundleProduct.cs
index b62852bd9..23c7397ca 100644
--- a/src/Core/Grand.Domain/Catalog/BundleProduct.cs
+++ b/src/Core/Grand.Domain/Catalog/BundleProduct.cs
@@ -1,24 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a bundle product
+/// </summary>
+public class BundleProduct : SubBaseEntity
{
/// <summary>
- /// Represents a bundle product
+ /// Gets or sets the product identifier
/// </summary>
- public class BundleProduct : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
+ public string ProductId { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/CatalogSettings.cs b/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
index aeaacde6b..f70f3847a 100644
--- a/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
+++ b/src/Core/Grand.Domain/Catalog/CatalogSettings.cs
@@ -1,418 +1,437 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public class CatalogSettings : ISettings
{
- public class CatalogSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating details pages of unpublished product details pages could be open (for SEO optimization)
- /// </summary>
- public bool AllowViewUnpublishedProductPage { get; set; }
- /// <summary>
- /// Gets or sets a value indicating customers should see "discontinued" message when visiting details pages of unpublished products (if "AllowViewUnpublishedProductPage" is "true)
- /// </summary>
- public bool DisplayDiscontinuedMessageForUnpublishedProducts { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether "Published" or "Disable buy/wishlist buttons" flags should be updated after order cancellation (deletion).
- /// Of course, when qty > configured minimum stock level
- /// </summary>
- public bool PublishBackProductWhenCancellingOrders { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to display product SKU on product details page
- /// </summary>
- public bool ShowSkuOnProductDetailsPage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to display product SKU on catalog pages
- /// </summary>
- public bool ShowSkuOnCatalogPages { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to display specification attribute on catalog pages
- /// </summary>
- public bool ShowSpecAttributeOnCatalogPages { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to generate second picture on catalog pages
- /// </summary>
- public bool SecondPictureOnCatalogPages { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to display collection part number of a product
- /// </summary>
- public bool ShowMpn { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to display GTIN of a product
- /// </summary>
- public bool ShowGtin { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Free shipping" icon should be displayed for products
- /// </summary>
- public bool ShowFreeShippingNotification { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether product sorting is enabled
- /// </summary>
- public bool AllowProductSorting { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to change product view mode
- /// </summary>
- public bool AllowProductViewModeChanging { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to change product view mode
- /// </summary>
- public string DefaultViewMode { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a category details page should include products from subcategories
- /// </summary>
- public bool ShowProductsFromSubcategories { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a search box should include products from subcategories
- /// </summary>
- public bool ShowProductsFromSubcategoriesInSearchBox { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether number of products should be displayed beside each category
- /// </summary>
- public bool ShowCategoryProductNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we include subcategories (when 'ShowCategoryProductNumber' is 'true')
- /// </summary>
- public bool ShowCategoryProductNumberIncludingSubcategories { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether category breadcrumb is enabled
- /// </summary>
- public bool CategoryBreadcrumbEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a 'Share button' is enabled
- /// </summary>
- public bool ShowShareButton { get; set; }
-
- /// <summary>
- /// Gets or sets a share code (e.g. AddThis button code)
- /// </summary>
- public string PageShareCode { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating product reviews must be approved
- /// </summary>
- public bool ProductReviewsMustBeApproved { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the default rating value of the product reviews
- /// </summary>
- public int DefaultProductRatingValue { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to allow anonymous users write product reviews.
- /// </summary>
- public bool AllowAnonymousUsersToReviewProduct { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether notification of a store owner about new product reviews is enabled
- /// </summary>
- public bool NotifyStoreOwnerAboutNewProductReviews { get; set; }
-
- /// <summary>
- /// Gets or sets a value the filtering by product review
- /// </summary>
- public string FilterProductRating { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether product 'Email a friend' feature is enabled
- /// </summary>
- public bool EmailAFriendEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'contact us on the product page' feature is enabled
- /// </summary>
- public bool AskQuestionOnProduct { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to allow anonymous users to email a friend.
- /// </summary>
- public bool AllowAnonymousUsersToEmailAFriend { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether product can be reviewed only by customer who have already ordered it
- /// </summary>
- public bool ProductReviewPossibleOnlyAfterPurchasing { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether product can be reviewed only once by customer
- /// </summary>
- public bool ProductReviewPossibleOnlyOnce { get; set; }
-
- /// <summary>
- /// Gets or sets a number of "Recently viewed products"
- /// </summary>
- public int RecentlyViewedProductsNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Recently viewed products" feature is enabled
- /// </summary>
- public bool RecentlyViewedProductsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Recommended products" feature is enabled
- /// </summary>
- public bool RecommendedProductsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Suggested products" feature is enabled
- /// </summary>
- public bool SuggestedProductsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a number of "Suggested products"
- /// </summary>
- public int SuggestedProductsNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Personalized products" feature is enabled
- /// </summary>
- public bool PersonalizedProductsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a number of "Personalized products"
- /// </summary>
- public int PersonalizedProductsNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a number of products on the "New products" page
- /// </summary>
- public int NewProductsNumber { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether "New products" page is enabled
- /// </summary>
- public bool NewProductsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "New products" is show on home page
- /// </summary>
- public bool NewProductsOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a number of products on the "New products" on home page
- /// </summary>
- public int NewProductsNumberOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Compare products" feature is enabled
- /// </summary>
- public bool CompareProductsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets an allowed number of products to be compared
- /// </summary>
- public int CompareProductsNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether autocomplete is enabled
- /// </summary>
- public bool ProductSearchAutoCompleteEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether search by sku is enabled
- /// </summary>
- public bool SearchBySku { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether search by description is enabled
- /// </summary>
- public bool SearchByDescription { get; set; }
-
- /// <summary>
- /// Gets or sets a number of products to return when using "autocomplete" feature
- /// </summary>
- public int ProductSearchAutoCompleteNumberOfProducts { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show product images in the auto complete search
- /// </summary>
- public bool ShowProductImagesInSearchAutoComplete { get; set; }
-
-
- /// <summary>
- /// Gets or sets a minimum search term length
- /// </summary>
- public int ProductSearchTermMinimumLength { get; set; }
-
- /// <summary>
- /// Gets or sets save search autocomplete
- /// </summary>
- public bool SaveSearchAutoComplete { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show bestsellers on home page
- /// </summary>
- public bool ShowBestsellersOnHomepage { get; set; }
-
- /// <summary>
- /// Gets or sets a number of bestsellers on home page
- /// </summary>
- public int NumberOfBestsellersOnHomepage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to use bestsellers from reports
- /// </summary>
- public bool BestsellersFromReports { get; set; }
-
- /// <summary>
- /// Gets or sets a number of time period for bestsellers on home page
- /// </summary>
- public int PeriodBestsellers { get; set; }
-
- /// <summary>
- /// Gets or sets a number of review on product page
- /// </summary>
- public int NumberOfReview { get; set; }
-
- /// <summary>
- /// Gets or sets a number of products per page on the search products page
- /// </summary>
- public int SearchPageProductsPerPage { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to select page size on the search products page
- /// </summary>
- public bool SearchPageAllowCustomersToSelectPageSize { get; set; }
- /// <summary>
- /// Gets or sets the available customer selectable page size options on the search products page
- /// </summary>
- public string SearchPagePageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets "List of products purchased by other customers who purchased the above" option is enable
- /// </summary>
- public bool ProductsAlsoPurchasedEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a number of products also purchased by other customers to display
- /// </summary>
- public int ProductsAlsoPurchasedNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a number of product tags that appear in the tag cloud
- /// </summary>
- public int NumberOfProductTags { get; set; }
-
- /// <summary>
- /// Gets or sets a number of products per page on 'products by tag' page
- /// </summary>
- public int ProductsByTagPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can select the page size for 'products by tag'
- /// </summary>
- public bool ProductsByTagAllowCustomersToSelectPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the available customer selectable page size options for 'products by tag'
- /// </summary>
- public string ProductsByTagPageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to include "Short description" in compare products
- /// </summary>
- public bool IncludeShortDescriptionInCompareProducts { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to include "Full description" in compare products
- /// </summary>
- public bool IncludeFullDescriptionInCompareProducts { get; set; }
-
- /// <summary>
- /// An option indicating whether products on category and collection pages should include featured products as well
- /// </summary>
- public bool IncludeFeaturedProductsInNormalLists { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether tier prices should be displayed with applied discounts (if available)
- /// </summary>
- public bool DisplayTierPricesWithDiscounts { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to ignore discounts (side-wide). It can significantly improve performance when enabled.
- /// </summary>
- public bool IgnoreDiscounts { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to ignore featured products (side-wide). It can significantly improve performance when enabled.
- /// </summary>
- public bool IgnoreFeaturedProducts { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to use customer product prices. It can significantly improve performance when disable.
- /// </summary>
- public bool CustomerProductPrice { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to ignore load Filterable Specification Attribute Option (side-wide). It can significantly improve performance when enabled.
- /// </summary>
- public bool IgnoreFilterableSpecAttributeOption { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to ignore load Filterable available start and end date products (side-wide). It can significantly improve performance when enabled.
- /// </summary>
- public bool IgnoreFilterableAvailableStartEndDateTime { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating how many collections to display in collections block
- /// </summary>
- public int CollectionsBlockItemsToDisplay { get; set; }
-
- /// <summary>
- /// Gets or sets the default value to use for Category page size options (for new categories)
- /// </summary>
- public string DefaultCategoryPageSizeOptions { get; set; }
- /// <summary>
- /// Gets or sets the default value to use for Category page size (for new categories)
- /// </summary>
- public int DefaultCategoryPageSize { get; set; }
- /// <summary>
- /// Gets or sets the default value to use for Collection page size options (for new collections)
- /// </summary>
- public string DefaultCollectionPageSizeOptions { get; set; }
- /// <summary>
- /// Gets or sets the default value to use for Collection page size (for new collections)
- /// </summary>
- public int DefaultCollectionPageSize { get; set; }
- /// <summary>
- /// Gets or sets the default value to use show extra field quantity on catalog pages
- /// </summary>
- public bool DisplayQuantityOnCatalogPages { get; set; }
- /// <summary>
- /// Limit of featured products
- /// </summary>
- public int LimitOfFeaturedProducts { get; set; }
- /// <summary>
- /// Gets or sets a list of disabled values of ProductSortingEnum
- /// </summary>
- public List<int> ProductSortingEnumDisabled { get; set; } = new();
-
- /// <summary>
- /// Gets or sets a display order of ProductSortingEnum values
- /// </summary>
- public Dictionary<int, int> ProductSortingEnumDisplayOrder { get; set; } = new();
-
- /// <summary>
- /// Gets or sets a sorting by availability
- /// </summary>
- public bool SortingByAvailability { get; set; }
-
- /// <summary>
- /// Gets or sets the max value for page size to use for pagination on all brands/all collection/all vendors/ all categories page
- /// </summary>
- public int MaxCatalogPageSize { get; set; } = 10;
-
- }
+ /// <summary>
+ /// Gets or sets a value indicating details pages of unpublished product details pages could be open (for SEO
+ /// optimization)
+ /// </summary>
+ public bool AllowViewUnpublishedProductPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating customers should see "discontinued" message when visiting details pages of
+ /// unpublished products (if "AllowViewUnpublishedProductPage" is "true)
+ /// </summary>
+ public bool DisplayDiscontinuedMessageForUnpublishedProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Published" or "Disable buy/wishlist buttons" flags should be updated after
+ /// order cancellation (deletion).
+ /// Of course, when qty > configured minimum stock level
+ /// </summary>
+ public bool PublishBackProductWhenCancellingOrders { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display product SKU on product details page
+ /// </summary>
+ public bool ShowSkuOnProductDetailsPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display product SKU on catalog pages
+ /// </summary>
+ public bool ShowSkuOnCatalogPages { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display specification attribute on catalog pages
+ /// </summary>
+ public bool ShowSpecAttributeOnCatalogPages { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to generate second picture on catalog pages
+ /// </summary>
+ public bool SecondPictureOnCatalogPages { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display collection part number of a product
+ /// </summary>
+ public bool ShowMpn { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display GTIN of a product
+ /// </summary>
+ public bool ShowGtin { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Free shipping" icon should be displayed for products
+ /// </summary>
+ public bool ShowFreeShippingNotification { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether product sorting is enabled
+ /// </summary>
+ public bool AllowProductSorting { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to change product view mode
+ /// </summary>
+ public bool AllowProductViewModeChanging { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to change product view mode
+ /// </summary>
+ public string DefaultViewMode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a category details page should include products from subcategories
+ /// </summary>
+ public bool ShowProductsFromSubcategories { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a search box should include products from subcategories
+ /// </summary>
+ public bool ShowProductsFromSubcategoriesInSearchBox { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether number of products should be displayed beside each category
+ /// </summary>
+ public bool ShowCategoryProductNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we include subcategories (when 'ShowCategoryProductNumber' is 'true')
+ /// </summary>
+ public bool ShowCategoryProductNumberIncludingSubcategories { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether category breadcrumb is enabled
+ /// </summary>
+ public bool CategoryBreadcrumbEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a 'Share button' is enabled
+ /// </summary>
+ public bool ShowShareButton { get; set; }
+
+ /// <summary>
+ /// Gets or sets a share code (e.g. AddThis button code)
+ /// </summary>
+ public string PageShareCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating product reviews must be approved
+ /// </summary>
+ public bool ProductReviewsMustBeApproved { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the default rating value of the product reviews
+ /// </summary>
+ public int DefaultProductRatingValue { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to allow anonymous users write product reviews.
+ /// </summary>
+ public bool AllowAnonymousUsersToReviewProduct { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether notification of a store owner about new product reviews is enabled
+ /// </summary>
+ public bool NotifyStoreOwnerAboutNewProductReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value the filtering by product review
+ /// </summary>
+ public string FilterProductRating { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether product 'Email a friend' feature is enabled
+ /// </summary>
+ public bool EmailAFriendEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'contact us on the product page' feature is enabled
+ /// </summary>
+ public bool AskQuestionOnProduct { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to allow anonymous users to email a friend.
+ /// </summary>
+ public bool AllowAnonymousUsersToEmailAFriend { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether product can be reviewed only by customer who have already ordered it
+ /// </summary>
+ public bool ProductReviewPossibleOnlyAfterPurchasing { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether product can be reviewed only once by customer
+ /// </summary>
+ public bool ProductReviewPossibleOnlyOnce { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of "Recently viewed products"
+ /// </summary>
+ public int RecentlyViewedProductsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Recently viewed products" feature is enabled
+ /// </summary>
+ public bool RecentlyViewedProductsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Recommended products" feature is enabled
+ /// </summary>
+ public bool RecommendedProductsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Suggested products" feature is enabled
+ /// </summary>
+ public bool SuggestedProductsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of "Suggested products"
+ /// </summary>
+ public int SuggestedProductsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Personalized products" feature is enabled
+ /// </summary>
+ public bool PersonalizedProductsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of "Personalized products"
+ /// </summary>
+ public int PersonalizedProductsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of products on the "New products" page
+ /// </summary>
+ public int NewProductsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "New products" page is enabled
+ /// </summary>
+ public bool NewProductsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "New products" is show on home page
+ /// </summary>
+ public bool NewProductsOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of products on the "New products" on home page
+ /// </summary>
+ public int NewProductsNumberOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Compare products" feature is enabled
+ /// </summary>
+ public bool CompareProductsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets an allowed number of products to be compared
+ /// </summary>
+ public int CompareProductsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether autocomplete is enabled
+ /// </summary>
+ public bool ProductSearchAutoCompleteEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether search by sku is enabled
+ /// </summary>
+ public bool SearchBySku { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether search by description is enabled
+ /// </summary>
+ public bool SearchByDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of products to return when using "autocomplete" feature
+ /// </summary>
+ public int ProductSearchAutoCompleteNumberOfProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show product images in the auto complete search
+ /// </summary>
+ public bool ShowProductImagesInSearchAutoComplete { get; set; }
+
+
+ /// <summary>
+ /// Gets or sets a minimum search term length
+ /// </summary>
+ public int ProductSearchTermMinimumLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets save search autocomplete
+ /// </summary>
+ public bool SaveSearchAutoComplete { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show bestsellers on home page
+ /// </summary>
+ public bool ShowBestsellersOnHomepage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of bestsellers on home page
+ /// </summary>
+ public int NumberOfBestsellersOnHomepage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use bestsellers from reports
+ /// </summary>
+ public bool BestsellersFromReports { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of time period for bestsellers on home page
+ /// </summary>
+ public int PeriodBestsellers { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of review on product page
+ /// </summary>
+ public int NumberOfReview { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of products per page on the search products page
+ /// </summary>
+ public int SearchPageProductsPerPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to select page size on the search products page
+ /// </summary>
+ public bool SearchPageAllowCustomersToSelectPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the available customer selectable page size options on the search products page
+ /// </summary>
+ public string SearchPagePageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets "List of products purchased by other customers who purchased the above" option is enable
+ /// </summary>
+ public bool ProductsAlsoPurchasedEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of products also purchased by other customers to display
+ /// </summary>
+ public int ProductsAlsoPurchasedNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of product tags that appear in the tag cloud
+ /// </summary>
+ public int NumberOfProductTags { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of products per page on 'products by tag' page
+ /// </summary>
+ public int ProductsByTagPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can select the page size for 'products by tag'
+ /// </summary>
+ public bool ProductsByTagAllowCustomersToSelectPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the available customer selectable page size options for 'products by tag'
+ /// </summary>
+ public string ProductsByTagPageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include "Short description" in compare products
+ /// </summary>
+ public bool IncludeShortDescriptionInCompareProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include "Full description" in compare products
+ /// </summary>
+ public bool IncludeFullDescriptionInCompareProducts { get; set; }
+
+ /// <summary>
+ /// An option indicating whether products on category and collection pages should include featured products as well
+ /// </summary>
+ public bool IncludeFeaturedProductsInNormalLists { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether tier prices should be displayed with applied discounts (if available)
+ /// </summary>
+ public bool DisplayTierPricesWithDiscounts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to ignore discounts (side-wide). It can significantly improve performance
+ /// when enabled.
+ /// </summary>
+ public bool IgnoreDiscounts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to ignore featured products (side-wide). It can significantly improve
+ /// performance when enabled.
+ /// </summary>
+ public bool IgnoreFeaturedProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use customer product prices. It can significantly improve performance
+ /// when disable.
+ /// </summary>
+ public bool CustomerProductPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to ignore load Filterable Specification Attribute Option (side-wide). It
+ /// can significantly improve performance when enabled.
+ /// </summary>
+ public bool IgnoreFilterableSpecAttributeOption { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to ignore load Filterable available start and end date products
+ /// (side-wide). It can significantly improve performance when enabled.
+ /// </summary>
+ public bool IgnoreFilterableAvailableStartEndDateTime { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating how many collections to display in collections block
+ /// </summary>
+ public int CollectionsBlockItemsToDisplay { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value to use for Category page size options (for new categories)
+ /// </summary>
+ public string DefaultCategoryPageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value to use for Category page size (for new categories)
+ /// </summary>
+ public int DefaultCategoryPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value to use for Collection page size options (for new collections)
+ /// </summary>
+ public string DefaultCollectionPageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value to use for Collection page size (for new collections)
+ /// </summary>
+ public int DefaultCollectionPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value to use show extra field quantity on catalog pages
+ /// </summary>
+ public bool DisplayQuantityOnCatalogPages { get; set; }
+
+ /// <summary>
+ /// Limit of featured products
+ /// </summary>
+ public int LimitOfFeaturedProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a list of disabled values of ProductSortingEnum
+ /// </summary>
+ public List<int> ProductSortingEnumDisabled { get; set; } = new();
+
+ /// <summary>
+ /// Gets or sets a display order of ProductSortingEnum values
+ /// </summary>
+ public Dictionary<int, int> ProductSortingEnumDisplayOrder { get; set; } = new();
+
+ /// <summary>
+ /// Gets or sets a sorting by availability
+ /// </summary>
+ public bool SortingByAvailability { get; set; }
+
+ /// <summary>
+ /// Gets or sets the max value for page size to use for pagination on all brands/all collection/all vendors/ all
+ /// categories page
+ /// </summary>
+ public int MaxCatalogPageSize { get; set; } = 10;
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/Category.cs b/src/Core/Grand.Domain/Catalog/Category.cs
index 25a3eb879..e84eb54bc 100644
--- a/src/Core/Grand.Domain/Catalog/Category.cs
+++ b/src/Core/Grand.Domain/Catalog/Category.cs
@@ -3,170 +3,170 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a category
+/// </summary>
+public class Category : BaseEntity, ISlugEntity, IGroupLinkEntity, ITranslationEntity, IStoreLinkEntity
{
+ private ICollection<string> _appliedDiscounts;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+
+ /// <summary>
+ /// Gets or sets the bottom description
+ /// </summary>
+ public string BottomDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of used category layout identifier
+ /// </summary>
+ public string CategoryLayoutId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
/// <summary>
- /// Represents a category
- /// </summary>
- public class Category : BaseEntity, ISlugEntity, IGroupLinkEntity, ITranslationEntity, IStoreLinkEntity
- {
- private ICollection<string> _appliedDiscounts;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
-
- /// <summary>
- /// Gets or sets the bottom description
- /// </summary>
- public string BottomDescription { get; set; }
-
- /// <summary>
- /// Gets or sets a value of used category layout identifier
- /// </summary>
- public string CategoryLayoutId { get; set; }
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the parent category identifier
- /// </summary>
- public string ParentCategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the page size
- /// </summary>
- public int PageSize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can select the page size
- /// </summary>
- public bool AllowCustomersToSelectPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the available customer selectable page size options
- /// </summary>
- public string PageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show the category on home page
- /// </summary>
- public bool ShowOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show featured products on home page
- /// </summary>
- public bool FeaturedProductsOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show the category on search box
- /// </summary>
- public bool ShowOnSearchBox { get; set; }
-
- /// <summary>
- /// Gets or sets the display order on search box category
- /// </summary>
- public int SearchBoxDisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to include this category in the menu
- /// </summary>
- public bool IncludeInMenu { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the ExternalId
- /// </summary>
- public string ExternalId { get; set; }
-
- /// <summary>
- /// Gets or sets the flag
- /// </summary>
- public string Flag { get; set; }
-
- /// <summary>
- /// Gets or sets the flag style
- /// </summary>
- public string FlagStyle { get; set; }
-
- /// <summary>
- /// Gets or sets the Icon
- /// </summary>
- public string Icon { get; set; }
-
- /// <summary>
- /// Gets or sets the Default sort
- /// </summary>
- public int DefaultSort { get; set; } = -1;
-
- /// <summary>
- /// Gets or sets the hide on catalog page (subcategories)
- /// </summary>
- public bool HideOnCatalog { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the collection of applied discounts
- /// </summary>
- public virtual ICollection<string> AppliedDiscounts
- {
- get => _appliedDiscounts ??= new List<string>();
- protected set => _appliedDiscounts = value;
- }
+ /// Gets or sets the parent category identifier
+ /// </summary>
+ public string ParentCategoryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the page size
+ /// </summary>
+ public int PageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can select the page size
+ /// </summary>
+ public bool AllowCustomersToSelectPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the available customer selectable page size options
+ /// </summary>
+ public string PageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show the category on home page
+ /// </summary>
+ public bool ShowOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show featured products on home page
+ /// </summary>
+ public bool FeaturedProductsOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show the category on search box
+ /// </summary>
+ public bool ShowOnSearchBox { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order on search box category
+ /// </summary>
+ public int SearchBoxDisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include this category in the menu
+ /// </summary>
+ public bool IncludeInMenu { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ExternalId
+ /// </summary>
+ public string ExternalId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the flag
+ /// </summary>
+ public string Flag { get; set; }
+
+ /// <summary>
+ /// Gets or sets the flag style
+ /// </summary>
+ public string FlagStyle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Icon
+ /// </summary>
+ public string Icon { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Default sort
+ /// </summary>
+ public int DefaultSort { get; set; } = -1;
+
+ /// <summary>
+ /// Gets or sets the hide on catalog page (subcategories)
+ /// </summary>
+ public bool HideOnCatalog { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of applied discounts
+ /// </summary>
+ public virtual ICollection<string> AppliedDiscounts {
+ get => _appliedDiscounts ??= new List<string>();
+ protected set => _appliedDiscounts = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/CategoryLayout.cs b/src/Core/Grand.Domain/Catalog/CategoryLayout.cs
index 9a53ff84f..a56a707b9 100644
--- a/src/Core/Grand.Domain/Catalog/CategoryLayout.cs
+++ b/src/Core/Grand.Domain/Catalog/CategoryLayout.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a category layout
+/// </summary>
+public class CategoryLayout : BaseEntity
{
/// <summary>
- /// Represents a category layout
+ /// Gets or sets the layout name
/// </summary>
- public class CategoryLayout : BaseEntity
- {
- /// <summary>
- /// Gets or sets the layout name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the view path
- /// </summary>
- public string ViewPath { get; set; }
+ /// <summary>
+ /// Gets or sets the view path
+ /// </summary>
+ public string ViewPath { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/Collection.cs b/src/Core/Grand.Domain/Catalog/Collection.cs
index fb964dc8e..e341d25fd 100644
--- a/src/Core/Grand.Domain/Catalog/Collection.cs
+++ b/src/Core/Grand.Domain/Catalog/Collection.cs
@@ -3,139 +3,139 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a collection
+/// </summary>
+public class Collection : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
{
+ private ICollection<string> _appliedDiscounts;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string BottomDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of used collection layout identifier
+ /// </summary>
+ public string CollectionLayoutId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the page size
+ /// </summary>
+ public int PageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can select the page size
+ /// </summary>
+ public bool AllowCustomersToSelectPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the available customer selectable page size options
+ /// </summary>
+ public string PageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show the collection on home page
+ /// </summary>
+ public bool ShowOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show featured products on home page
+ /// </summary>
+ public bool FeaturedProductsOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to include this collection in the menu
+ /// </summary>
+ public bool IncludeInMenu { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Icon
+ /// </summary>
+ public string Icon { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Default sort
+ /// </summary>
+ public int DefaultSort { get; set; } = -1;
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
/// <summary>
- /// Represents a collection
- /// </summary>
- public class Collection : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- private ICollection<string> _appliedDiscounts;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string BottomDescription { get; set; }
-
- /// <summary>
- /// Gets or sets a value of used collection layout identifier
- /// </summary>
- public string CollectionLayoutId { get; set; }
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the page size
- /// </summary>
- public int PageSize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can select the page size
- /// </summary>
- public bool AllowCustomersToSelectPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the available customer selectable page size options
- /// </summary>
- public string PageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show the collection on home page
- /// </summary>
- public bool ShowOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show featured products on home page
- /// </summary>
- public bool FeaturedProductsOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to include this collection in the menu
- /// </summary>
- public bool IncludeInMenu { get; set; }
-
- /// <summary>
- /// Gets or sets the Icon
- /// </summary>
- public string Icon { get; set; }
-
- /// <summary>
- /// Gets or sets the Default sort
- /// </summary>
- public int DefaultSort { get; set; } = -1;
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the ExternalId
- /// </summary>
- public string ExternalId { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the collection of applied discounts
- /// </summary>
- public virtual ICollection<string> AppliedDiscounts
- {
- get => _appliedDiscounts ??= new List<string>();
- protected set => _appliedDiscounts = value;
- }
+ /// Gets or sets the ExternalId
+ /// </summary>
+ public string ExternalId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of applied discounts
+ /// </summary>
+ public virtual ICollection<string> AppliedDiscounts {
+ get => _appliedDiscounts ??= new List<string>();
+ protected set => _appliedDiscounts = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/CollectionLayout.cs b/src/Core/Grand.Domain/Catalog/CollectionLayout.cs
index 0f099e085..9533c1a2d 100644
--- a/src/Core/Grand.Domain/Catalog/CollectionLayout.cs
+++ b/src/Core/Grand.Domain/Catalog/CollectionLayout.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a collection layout
+/// </summary>
+public class CollectionLayout : BaseEntity
{
/// <summary>
- /// Represents a collection layout
+ /// Gets or sets the layout name
/// </summary>
- public class CollectionLayout : BaseEntity
- {
- /// <summary>
- /// Gets or sets the layout name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the view path
- /// </summary>
- public string ViewPath { get; set; }
+ /// <summary>
+ /// Gets or sets the view path
+ /// </summary>
+ public string ViewPath { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/CrossSellProduct.cs b/src/Core/Grand.Domain/Catalog/CrossSellProduct.cs
index f5e42ef3a..6b6b45809 100644
--- a/src/Core/Grand.Domain/Catalog/CrossSellProduct.cs
+++ b/src/Core/Grand.Domain/Catalog/CrossSellProduct.cs
@@ -1,19 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a cross-sell product
+/// </summary>
+public class CrossSellProduct : BaseEntity
{
/// <summary>
- /// Represents a cross-sell product
+ /// Gets or sets the first product identifier
/// </summary>
- public class CrossSellProduct : BaseEntity
- {
- /// <summary>
- /// Gets or sets the first product identifier
- /// </summary>
- public string ProductId1 { get; set; }
-
- /// <summary>
- /// Gets or sets the second product identifier
- /// </summary>
- public string ProductId2 { get; set; }
- }
+ public string ProductId1 { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the second product identifier
+ /// </summary>
+ public string ProductId2 { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/CustomerReservationsHelper.cs b/src/Core/Grand.Domain/Catalog/CustomerReservationsHelper.cs
index cc54686e9..6dfd737e0 100644
--- a/src/Core/Grand.Domain/Catalog/CustomerReservationsHelper.cs
+++ b/src/Core/Grand.Domain/Catalog/CustomerReservationsHelper.cs
@@ -1,21 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a customer reservation helper to the product
+/// </summary>
+public class CustomerReservationsHelper : BaseEntity
{
/// <summary>
- /// Represents a customer reservation helper to the product
+ /// Gets or sets customer identifier
/// </summary>
- public class CustomerReservationsHelper : BaseEntity
- {
- /// <summary>
- /// Gets or sets customer identifier
- /// </summary>
- public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets shopping cart identifier
- /// </summary>
- public string ShoppingCartItemId { get; set; }
- /// <summary>
- /// Gets or sets reservation identifier
- /// </summary>
- public string ReservationId { get; set; }
- }
-}
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets shopping cart identifier
+ /// </summary>
+ public string ShoppingCartItemId { get; set; }
+
+ /// <summary>
+ /// Gets or sets reservation identifier
+ /// </summary>
+ public string ReservationId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/DownloadActivationType.cs b/src/Core/Grand.Domain/Catalog/DownloadActivationType.cs
index 202a318bb..c734d9a20 100644
--- a/src/Core/Grand.Domain/Catalog/DownloadActivationType.cs
+++ b/src/Core/Grand.Domain/Catalog/DownloadActivationType.cs
@@ -1,17 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a download activation type
+/// </summary>
+public enum DownloadActivationType
{
/// <summary>
- /// Represents a download activation type
+ /// When order is paid
/// </summary>
- public enum DownloadActivationType
- {
- /// <summary>
- /// When order is paid
- /// </summary>
- WhenOrderIsPaid = 0,
- /// <summary>
- /// Manually
- /// </summary>
- Manually = 10
- }
-}
+ WhenOrderIsPaid = 0,
+
+ /// <summary>
+ /// Manually
+ /// </summary>
+ Manually = 10
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/GiftVoucherType.cs b/src/Core/Grand.Domain/Catalog/GiftVoucherType.cs
index de6ce0a59..5810184ad 100644
--- a/src/Core/Grand.Domain/Catalog/GiftVoucherType.cs
+++ b/src/Core/Grand.Domain/Catalog/GiftVoucherType.cs
@@ -1,17 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a gift voucher type
+/// </summary>
+public enum GiftVoucherType
{
/// <summary>
- /// Represents a gift voucher type
+ /// Virtual
/// </summary>
- public enum GiftVoucherType
- {
- /// <summary>
- /// Virtual
- /// </summary>
- Virtual = 0,
- /// <summary>
- /// Physical
- /// </summary>
- Physical = 1
- }
-}
+ Virtual = 0,
+
+ /// <summary>
+ /// Physical
+ /// </summary>
+ Physical = 1
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/IntervalUnit.cs b/src/Core/Grand.Domain/Catalog/IntervalUnit.cs
index e8bf61eed..d5663e146 100644
--- a/src/Core/Grand.Domain/Catalog/IntervalUnit.cs
+++ b/src/Core/Grand.Domain/Catalog/IntervalUnit.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a interval unit type for product
+/// </summary>
+public enum IntervalUnit
{
/// <summary>
- /// Represents a interval unit type for product
+ /// Minute
/// </summary>
- public enum IntervalUnit
- {
- /// <summary>
- /// Minute
- /// </summary>
- Minute = 0,
+ Minute = 0,
- /// <summary>
- /// Hour
- /// </summary>
- Hour = 5,
+ /// <summary>
+ /// Hour
+ /// </summary>
+ Hour = 5,
- /// <summary>
- /// Day
- /// </summary>
- Day = 10
- }
-}
+ /// <summary>
+ /// Day
+ /// </summary>
+ Day = 10
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/InventoryJournal.cs b/src/Core/Grand.Domain/Catalog/InventoryJournal.cs
index caca7e81b..683187c12 100644
--- a/src/Core/Grand.Domain/Catalog/InventoryJournal.cs
+++ b/src/Core/Grand.Domain/Catalog/InventoryJournal.cs
@@ -1,19 +1,18 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public class InventoryJournal : BaseEntity
{
- public class InventoryJournal : BaseEntity
- {
- public string ObjectId { get; set; }
- public string ObjectType { get; set; }
- public string PositionId { get; set; }
- public DateTime CreateDateUtc { get; set; }
- public string ProductId { get; set; }
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
- public string WarehouseId { get; set; }
- public int InQty { get; set; }
- public int OutQty { get; set; }
- public string Comments { get; set; }
- public string Reference { get; set; }
- }
-}
+ public string ObjectId { get; set; }
+ public string ObjectType { get; set; }
+ public string PositionId { get; set; }
+ public DateTime CreateDateUtc { get; set; }
+ public string ProductId { get; set; }
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+ public string WarehouseId { get; set; }
+ public int InQty { get; set; }
+ public int OutQty { get; set; }
+ public string Comments { get; set; }
+ public string Reference { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/LowStockActivity.cs b/src/Core/Grand.Domain/Catalog/LowStockActivity.cs
index 1f24b1f8d..431665ea2 100644
--- a/src/Core/Grand.Domain/Catalog/LowStockActivity.cs
+++ b/src/Core/Grand.Domain/Catalog/LowStockActivity.cs
@@ -1,21 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a low stock activity
+/// </summary>
+public enum LowStockActivity
{
/// <summary>
- /// Represents a low stock activity
+ /// Nothing
/// </summary>
- public enum LowStockActivity
- {
- /// <summary>
- /// Nothing
- /// </summary>
- Nothing = 0,
- /// <summary>
- /// Disable buy button
- /// </summary>
- DisableBuyButton = 1,
- /// <summary>
- /// Unpublish
- /// </summary>
- Unpublish = 2
- }
-}
+ Nothing = 0,
+
+ /// <summary>
+ /// Disable buy button
+ /// </summary>
+ DisableBuyButton = 1,
+
+ /// <summary>
+ /// Unpublish
+ /// </summary>
+ Unpublish = 2
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ManageInventoryMethod.cs b/src/Core/Grand.Domain/Catalog/ManageInventoryMethod.cs
index b33571509..e7aac606a 100644
--- a/src/Core/Grand.Domain/Catalog/ManageInventoryMethod.cs
+++ b/src/Core/Grand.Domain/Catalog/ManageInventoryMethod.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a method of inventory management
+/// </summary>
+public enum ManageInventoryMethod
{
/// <summary>
- /// Represents a method of inventory management
+ /// Don't track inventory for product
/// </summary>
- public enum ManageInventoryMethod
- {
- /// <summary>
- /// Don't track inventory for product
- /// </summary>
- DontManageStock = 0,
- /// <summary>
- /// Track inventory for product
- /// </summary>
- ManageStock = 1,
- /// <summary>
- /// Track inventory for product by product attributes
- /// </summary>
- ManageStockByAttributes = 2,
- /// <summary>
- /// Track inventory for product by bundle products
- /// </summary>
- ManageStockByBundleProducts = 3
- }
-}
+ DontManageStock = 0,
+
+ /// <summary>
+ /// Track inventory for product
+ /// </summary>
+ ManageStock = 1,
+
+ /// <summary>
+ /// Track inventory for product by product attributes
+ /// </summary>
+ ManageStockByAttributes = 2,
+
+ /// <summary>
+ /// Track inventory for product by bundle products
+ /// </summary>
+ ManageStockByBundleProducts = 3
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/OutOfStockSubscription.cs b/src/Core/Grand.Domain/Catalog/OutOfStockSubscription.cs
index f68a247a1..f51106d13 100644
--- a/src/Core/Grand.Domain/Catalog/OutOfStockSubscription.cs
+++ b/src/Core/Grand.Domain/Catalog/OutOfStockSubscription.cs
@@ -1,41 +1,39 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a out of stock subscription
+/// </summary>
+public class OutOfStockSubscription : BaseEntity
{
/// <summary>
- /// Represents a out of stock subscription
+ /// Gets or sets the store identifier
/// </summary>
- public class OutOfStockSubscription : BaseEntity
- {
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the attribute
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+ /// <summary>
+ /// Gets or sets the product identifier
+ /// </summary>
+ public string ProductId { get; set; }
- /// <summary>
- /// Gets or sets the attribute info (format)
- /// </summary>
- public string AttributeInfo { get; set; }
+ /// <summary>
+ /// Gets or sets the attribute
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
+ /// <summary>
+ /// Gets or sets the attribute info (format)
+ /// </summary>
+ public string AttributeInfo { get; set; }
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/PredefinedProductAttributeValue.cs b/src/Core/Grand.Domain/Catalog/PredefinedProductAttributeValue.cs
index fef4cd8fa..09fb25ff0 100644
--- a/src/Core/Grand.Domain/Catalog/PredefinedProductAttributeValue.cs
+++ b/src/Core/Grand.Domain/Catalog/PredefinedProductAttributeValue.cs
@@ -1,45 +1,44 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a predefined (default) product attribute value
+/// </summary>
+public class PredefinedProductAttributeValue : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a predefined (default) product attribute value
+ /// Gets or sets the product attribute name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the price adjustment
+ /// </summary>
+ public double PriceAdjustment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the weight adjustment
+ /// </summary>
+ public double WeightAdjustment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attibute value cost
+ /// </summary>
+ public double Cost { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the value is pre-selected
+ /// </summary>
+ public bool IsPreSelected { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of locales
/// </summary>
- public class PredefinedProductAttributeValue : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the product attribute name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the price adjustment
- /// </summary>
- public double PriceAdjustment { get; set; }
-
- /// <summary>
- /// Gets or sets the weight adjustment
- /// </summary>
- public double WeightAdjustment { get; set; }
-
- /// <summary>
- /// Gets or sets the attibute value cost
- /// </summary>
- public double Cost { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the value is pre-selected
- /// </summary>
- public bool IsPreSelected { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/Product.cs b/src/Core/Grand.Domain/Catalog/Product.cs
index 2a0ea8255..b09f25fbd 100644
--- a/src/Core/Grand.Domain/Catalog/Product.cs
+++ b/src/Core/Grand.Domain/Catalog/Product.cs
@@ -4,687 +4,759 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product
+/// </summary>
+public class Product : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
{
+ private ICollection<string> _appliedDiscounts;
+ private ICollection<BundleProduct> _bundleProduct;
+ private ICollection<string> _crossSellProduct;
+ private ICollection<ProductAttributeCombination> _productAttributeCombinations;
+ private ICollection<ProductAttributeMapping> _productAttributeMappings;
+ private ICollection<ProductCategory> _productCategories;
+ private ICollection<ProductCollection> _productCollections;
+ private ICollection<ProductPicture> _productPictures;
+ private ICollection<ProductPrice> _productPrices;
+ private ICollection<ProductSpecificationAttribute> _productSpecificationAttributes;
+ private ICollection<string> _productTags;
+ private ICollection<ProductWarehouseInventory> _productWarehouseInventory;
+ private ICollection<string> _recommendedProduct;
+ private ICollection<RelatedProduct> _relatedProduct;
+ private ICollection<SimilarProduct> _similarProduct;
+ private ICollection<TierPrice> _tierPrices;
+
+ /// <summary>
+ /// Gets or sets the product type identifier
+ /// </summary>
+ public ProductType ProductTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped"
+ /// products)
+ /// </summary>
+ public string ParentGroupedProductId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the values indicating whether this product is visible in catalog or search results.
+ /// It's used when this product is associated to some "grouped" one
+ /// This way associated products could be accessed/added/etc only from a grouped product details page
+ /// </summary>
+ public bool VisibleIndividually { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the short description
+ /// </summary>
+ public string ShortDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the full description
+ /// </summary>
+ public string FullDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of used product layout identifier
+ /// </summary>
+ public string ProductLayoutId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a brand identifier
+ /// </summary>
+ public string BrandId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a vendor identifier
+ /// </summary>
+ public string VendorId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show the product on home page
+ /// </summary>
+ public bool ShowOnHomePage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show the product on the bestseller section
+ /// </summary>
+ public bool BestSeller { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product allows customer reviews
+ /// </summary>
+ public bool AllowCustomerReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rating sum (approved reviews)
+ /// </summary>
+ public int ApprovedRatingSum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rating sum (not approved reviews)
+ /// </summary>
+ public int NotApprovedRatingSum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total rating votes (approved reviews)
+ /// </summary>
+ public int ApprovedTotalReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the average rating (approved reviews)
+ /// </summary>
+ public double AvgRating { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total rating votes (not approved reviews)
+ /// </summary>
+ public int NotApprovedTotalReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ExternalId
+ /// </summary>
+ public string ExternalId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the SKU
+ /// </summary>
+ public string Sku { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection part number
+ /// </summary>
+ public string Mpn { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in
+ /// Europe), JAN (in Japan), and ISBN (for books).
+ /// </summary>
+ public string Gtin { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is gift voucher
+ /// </summary>
+ public bool IsGiftVoucher { get; set; }
+
+ /// <summary>
+ /// Gets or sets the gift voucher type identifier
+ /// </summary>
+ public GiftVoucherType GiftVoucherTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets gift voucher amount that can be used after purchase. If not specified, then product price will be
+ /// used.
+ /// </summary>
+ public double? OverGiftAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product requires that other products are added to the cart (Product X
+ /// requires Product Y)
+ /// </summary>
+ public bool RequireOtherProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a required product identifiers (comma separated)
+ /// </summary>
+ public string RequiredProductIds { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether required products are automatically added to the cart
+ /// </summary>
+ public bool AutoAddRequiredProducts { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is download
+ /// </summary>
+ public bool IsDownload { get; set; }
+
+ /// <summary>
+ /// Gets or sets the download identifier
+ /// </summary>
+ public string DownloadId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times
+ /// </summary>
+ public bool UnlimitedDownloads { get; set; }
+
+ /// <summary>
+ /// Gets or sets the maximum number of downloads
+ /// </summary>
+ public int MaxNumberOfDownloads { get; set; }
+
+ /// <summary>
+ /// Gets or sets the number of days during customers keeps access to the file.
+ /// </summary>
+ public int? DownloadExpirationDays { get; set; }
+
+ /// <summary>
+ /// Gets or sets the download activation type
+ /// </summary>
+ public DownloadActivationType DownloadActivationTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product has a sample download file
+ /// </summary>
+ public bool HasSampleDownload { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sample download identifier
+ /// </summary>
+ public string SampleDownloadId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product has user agreement
+ /// </summary>
+ public bool HasUserAgreement { get; set; }
+
+ /// <summary>
+ /// Gets or sets the text of license agreement
+ /// </summary>
+ public string UserAgreementText { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is recurring
+ /// </summary>
+ public bool IsRecurring { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cycle length
+ /// </summary>
+ public int RecurringCycleLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cycle period
+ /// </summary>
+ public RecurringCyclePeriod RecurringCyclePeriodId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total cycles
+ /// </summary>
+ public int RecurringTotalCycles { get; set; }
+
+ /// <summary>
+ /// Gets or sets include both dates
+ /// </summary>
+ public bool IncBothDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets Interval
+ /// </summary>
+ public int Interval { get; set; }
+
+ /// <summary>
+ /// Gets or sets IntervalUnitId
+ /// </summary>
+ public IntervalUnit IntervalUnitId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is ship enabled
+ /// </summary>
+ public bool IsShipEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is free shipping
+ /// </summary>
+ public bool IsFreeShipping { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value this product should be shipped separately (each item)
+ /// </summary>
+ public bool ShipSeparately { get; set; }
+
+ /// <summary>
+ /// Gets or sets the additional shipping charge
+ /// </summary>
+ public double AdditionalShippingCharge { get; set; }
+
+ /// <summary>
+ /// Gets or sets a delivery date identifier
+ /// </summary>
+ public string DeliveryDateId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is marked as tax exempt
+ /// </summary>
+ public bool IsTaxExempt { get; set; }
+
+ /// <summary>
+ /// Gets or sets the tax category identifier
+ /// </summary>
+ public string TaxCategoryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is telecommunications or broadcasting or electronic services
+ /// </summary>
+ public bool IsTele { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating how to manage inventory
+ /// </summary>
+ public ManageInventoryMethod ManageInventoryMethodId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether multiple warehouses are used for this product
+ /// </summary>
+ public bool UseMultipleWarehouses { get; set; }
+
+ /// <summary>
+ /// Gets or sets a warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the stock quantity
+ /// </summary>
+ public int StockQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the reserved quantity (ordered but not shipped yet)
+ /// </summary>
+ public int ReservedQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display stock availability
+ /// </summary>
+ public bool StockAvailability { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display stock quantity
+ /// </summary>
+ public bool DisplayStockQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minimum stock quantity
+ /// </summary>
+ public int MinStockQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the low stock
+ /// </summary>
+ public bool LowStock { get; set; }
+
+ /// <summary>
+ /// Gets or sets the low stock activity identifier
+ /// </summary>
+ public LowStockActivity LowStockActivityId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quantity when admin should be notified
+ /// </summary>
+ public int NotifyAdminForQuantityBelow { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value backorder mode identifier
+ /// </summary>
+ public BackorderMode BackorderModeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to out of stock subscriptions are allowed
+ /// </summary>
+ public bool AllowOutOfStockSubscriptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order minimum quantity
+ /// </summary>
+ public int OrderMinimumQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order maximum quantity
+ /// </summary>
+ public int OrderMaximumQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the comma seperated list of allowed quantities. null or empty if any quantity is allowed
+ /// </summary>
+ public string AllowedQuantities { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this product is returnable (a customer is allowed to submit merchandise
+ /// return with this product)
+ /// </summary>
+ public bool NotReturnable { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to disable buy (Add to cart) button
+ /// </summary>
+ public bool DisableBuyButton { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to disable "Add to wishlist" button
+ /// </summary>
+ public bool DisableWishlistButton { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this item is available for Pre-Order
+ /// </summary>
+ public bool AvailableForPreOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the start date and time of the product availability (for pre-order products)
+ /// </summary>
+ public DateTime? PreOrderDateTimeUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price
+ /// </summary>
+ public bool CallForPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the price
+ /// </summary>
+ public double Price { get; set; }
+
+ /// <summary>
+ /// Gets or sets the old price
+ /// </summary>
+ public double OldPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the catalog price
+ /// </summary>
+ public double CatalogPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the product cost
+ /// </summary>
+ public double ProductCost { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer enters price
+ /// </summary>
+ public bool EnteredPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minimum price entered by a customer
+ /// </summary>
+ public double MinEnteredPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the maximum price entered by a customer
+ /// </summary>
+ public double MaxEnteredPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether base price (PAngV) is enabled. Used by German users.
+ /// </summary>
+ public bool BasepriceEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets an amount in product for PAngV
+ /// </summary>
+ public double BasepriceAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a unit of product for PAngV (MeasureWeight entity)
+ /// </summary>
+ public string BasepriceUnitId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a reference amount for PAngV
+ /// </summary>
+ public double BasepriceBaseAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a reference unit for PAngV (MeasureWeight entity)
+ /// </summary>
+ public string BasepriceBaseUnitId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a unit of product
+ /// </summary>
+ public string UnitId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a course ident
+ /// </summary>
+ public string CourseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this product is marked as new
+ /// </summary>
+ public bool MarkAsNew { get; set; }
+
+ /// <summary>
+ /// Gets or sets the start date and time of the new product (set product as "New" from date). Leave empty to ignore
+ /// this property
+ /// </summary>
+ public DateTime? MarkAsNewStartDateTimeUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the end date and time of the new product (set product as "New" to date). Leave empty to ignore this
+ /// property
+ /// </summary>
+ public DateTime? MarkAsNewEndDateTimeUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the weight
+ /// </summary>
+ public double Weight { get; set; }
+
+ /// <summary>
+ /// Gets or sets the length
+ /// </summary>
+ public double Length { get; set; }
+
+ /// <summary>
+ /// Gets or sets the width
+ /// </summary>
+ public double Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets the height
+ /// </summary>
+ public double Height { get; set; }
+
/// <summary>
- /// Represents a product
- /// </summary>
- public class Product : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- private ICollection<ProductCategory> _productCategories;
- private ICollection<ProductCollection> _productCollections;
- private ICollection<ProductPicture> _productPictures;
- private ICollection<ProductSpecificationAttribute> _productSpecificationAttributes;
- private ICollection<ProductAttributeMapping> _productAttributeMappings;
- private ICollection<ProductAttributeCombination> _productAttributeCombinations;
- private ICollection<TierPrice> _tierPrices;
- private ICollection<string> _appliedDiscounts;
- private ICollection<ProductWarehouseInventory> _productWarehouseInventory;
- private ICollection<string> _crossSellProduct;
- private ICollection<string> _recommendedProduct;
- private ICollection<RelatedProduct> _relatedProduct;
- private ICollection<SimilarProduct> _similarProduct;
- private ICollection<BundleProduct> _bundleProduct;
- private ICollection<ProductPrice> _productPrices;
- private ICollection<string> _productTags;
-
- /// <summary>
- /// Gets or sets the product type identifier
- /// </summary>
- public ProductType ProductTypeId { get; set; }
- /// <summary>
- /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped" products)
- /// </summary>
- public string ParentGroupedProductId { get; set; }
- /// <summary>
- /// Gets or sets the values indicating whether this product is visible in catalog or search results.
- /// It's used when this product is associated to some "grouped" one
- /// This way associated products could be accessed/added/etc only from a grouped product details page
- /// </summary>
- public bool VisibleIndividually { get; set; }
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
- /// <summary>
- /// Gets or sets the short description
- /// </summary>
- public string ShortDescription { get; set; }
- /// <summary>
- /// Gets or sets the full description
- /// </summary>
- public string FullDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
-
- /// <summary>
- /// Gets or sets a value of used product layout identifier
- /// </summary>
- public string ProductLayoutId { get; set; }
-
- /// <summary>
- /// Gets or sets a brand identifier
- /// </summary>
- public string BrandId { get; set; }
-
- /// <summary>
- /// Gets or sets a vendor identifier
- /// </summary>
- public string VendorId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show the product on home page
- /// </summary>
- public bool ShowOnHomePage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show the product on the bestseller section
- /// </summary>
- public bool BestSeller { get; set; }
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the product allows customer reviews
- /// </summary>
- public bool AllowCustomerReviews { get; set; }
- /// <summary>
- /// Gets or sets the rating sum (approved reviews)
- /// </summary>
- public int ApprovedRatingSum { get; set; }
- /// <summary>
- /// Gets or sets the rating sum (not approved reviews)
- /// </summary>
- public int NotApprovedRatingSum { get; set; }
- /// <summary>
- /// Gets or sets the total rating votes (approved reviews)
- /// </summary>
- public int ApprovedTotalReviews { get; set; }
- /// <summary>
- /// Gets or sets the average rating (approved reviews)
- /// </summary>
- public double AvgRating { get; set; }
- /// <summary>
- /// Gets or sets the total rating votes (not approved reviews)
- /// </summary>
- public int NotApprovedTotalReviews { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the ExternalId
- /// </summary>
- public string ExternalId { get; set; }
- /// <summary>
- /// Gets or sets the SKU
- /// </summary>
- public string Sku { get; set; }
- /// <summary>
- /// Gets or sets the collection part number
- /// </summary>
- public string Mpn { get; set; }
- /// <summary>
- /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books).
- /// </summary>
- public string Gtin { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the product is gift voucher
- /// </summary>
- public bool IsGiftVoucher { get; set; }
- /// <summary>
- /// Gets or sets the gift voucher type identifier
- /// </summary>
- public GiftVoucherType GiftVoucherTypeId { get; set; }
- /// <summary>
- /// Gets or sets gift voucher amount that can be used after purchase. If not specified, then product price will be used.
- /// </summary>
- public double? OverGiftAmount { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the product requires that other products are added to the cart (Product X requires Product Y)
- /// </summary>
- public bool RequireOtherProducts { get; set; }
- /// <summary>
- /// Gets or sets a required product identifiers (comma separated)
- /// </summary>
- public string RequiredProductIds { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether required products are automatically added to the cart
- /// </summary>
- public bool AutoAddRequiredProducts { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the product is download
- /// </summary>
- public bool IsDownload { get; set; }
- /// <summary>
- /// Gets or sets the download identifier
- /// </summary>
- public string DownloadId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times
- /// </summary>
- public bool UnlimitedDownloads { get; set; }
- /// <summary>
- /// Gets or sets the maximum number of downloads
- /// </summary>
- public int MaxNumberOfDownloads { get; set; }
- /// <summary>
- /// Gets or sets the number of days during customers keeps access to the file.
- /// </summary>
- public int? DownloadExpirationDays { get; set; }
- /// <summary>
- /// Gets or sets the download activation type
- /// </summary>
- public DownloadActivationType DownloadActivationTypeId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the product has a sample download file
- /// </summary>
- public bool HasSampleDownload { get; set; }
- /// <summary>
- /// Gets or sets the sample download identifier
- /// </summary>
- public string SampleDownloadId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the product has user agreement
- /// </summary>
- public bool HasUserAgreement { get; set; }
- /// <summary>
- /// Gets or sets the text of license agreement
- /// </summary>
- public string UserAgreementText { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the product is recurring
- /// </summary>
- public bool IsRecurring { get; set; }
- /// <summary>
- /// Gets or sets the cycle length
- /// </summary>
- public int RecurringCycleLength { get; set; }
- /// <summary>
- /// Gets or sets the cycle period
- /// </summary>
- public RecurringCyclePeriod RecurringCyclePeriodId { get; set; }
- /// <summary>
- /// Gets or sets the total cycles
- /// </summary>
- public int RecurringTotalCycles { get; set; }
- /// <summary>
- /// Gets or sets include both dates
- /// </summary>
- public bool IncBothDate { get; set; }
- /// <summary>
- /// Gets or sets Interval
- /// </summary>
- public int Interval { get; set; }
- /// <summary>
- /// Gets or sets IntervalUnitId
- /// </summary>
- public IntervalUnit IntervalUnitId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is ship enabled
- /// </summary>
- public bool IsShipEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is free shipping
- /// </summary>
- public bool IsFreeShipping { get; set; }
- /// <summary>
- /// Gets or sets a value this product should be shipped separately (each item)
- /// </summary>
- public bool ShipSeparately { get; set; }
- /// <summary>
- /// Gets or sets the additional shipping charge
- /// </summary>
- public double AdditionalShippingCharge { get; set; }
- /// <summary>
- /// Gets or sets a delivery date identifier
- /// </summary>
- public string DeliveryDateId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the product is marked as tax exempt
- /// </summary>
- public bool IsTaxExempt { get; set; }
- /// <summary>
- /// Gets or sets the tax category identifier
- /// </summary>
- public string TaxCategoryId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the product is telecommunications or broadcasting or electronic services
- /// </summary>
- public bool IsTele { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating how to manage inventory
- /// </summary>
- public ManageInventoryMethod ManageInventoryMethodId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether multiple warehouses are used for this product
- /// </summary>
- public bool UseMultipleWarehouses { get; set; }
- /// <summary>
- /// Gets or sets a warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
- /// <summary>
- /// Gets or sets the stock quantity
- /// </summary>
- public int StockQuantity { get; set; }
- /// <summary>
- /// Gets or sets the reserved quantity (ordered but not shipped yet)
- /// </summary>
- public int ReservedQuantity { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to display stock availability
- /// </summary>
- public bool StockAvailability { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to display stock quantity
- /// </summary>
- public bool DisplayStockQuantity { get; set; }
- /// <summary>
- /// Gets or sets the minimum stock quantity
- /// </summary>
- public int MinStockQuantity { get; set; }
- /// <summary>
- /// Gets or sets the low stock
- /// </summary>
- public bool LowStock { get; set; }
-
- /// <summary>
- /// Gets or sets the low stock activity identifier
- /// </summary>
- public LowStockActivity LowStockActivityId { get; set; }
- /// <summary>
- /// Gets or sets the quantity when admin should be notified
- /// </summary>
- public int NotifyAdminForQuantityBelow { get; set; }
- /// <summary>
- /// Gets or sets a value backorder mode identifier
- /// </summary>
- public BackorderMode BackorderModeId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to out of stock subscriptions are allowed
- /// </summary>
- public bool AllowOutOfStockSubscriptions { get; set; }
- /// <summary>
- /// Gets or sets the order minimum quantity
- /// </summary>
- public int OrderMinimumQuantity { get; set; }
- /// <summary>
- /// Gets or sets the order maximum quantity
- /// </summary>
- public int OrderMaximumQuantity { get; set; }
- /// <summary>
- /// Gets or sets the comma seperated list of allowed quantities. null or empty if any quantity is allowed
- /// </summary>
- public string AllowedQuantities { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this product is returnable (a customer is allowed to submit merchandise return with this product)
- /// </summary>
- public bool NotReturnable { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to disable buy (Add to cart) button
- /// </summary>
- public bool DisableBuyButton { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to disable "Add to wishlist" button
- /// </summary>
- public bool DisableWishlistButton { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this item is available for Pre-Order
- /// </summary>
- public bool AvailableForPreOrder { get; set; }
- /// <summary>
- /// Gets or sets the start date and time of the product availability (for pre-order products)
- /// </summary>
- public DateTime? PreOrderDateTimeUtc { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price
- /// </summary>
- public bool CallForPrice { get; set; }
- /// <summary>
- /// Gets or sets the price
- /// </summary>
- public double Price { get; set; }
- /// <summary>
- /// Gets or sets the old price
- /// </summary>
- public double OldPrice { get; set; }
-
- /// <summary>
- /// Gets or sets the catalog price
- /// </summary>
- public double CatalogPrice { get; set; }
-
- /// <summary>
- /// Gets or sets the product cost
- /// </summary>
- public double ProductCost { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a customer enters price
- /// </summary>
- public bool EnteredPrice { get; set; }
- /// <summary>
- /// Gets or sets the minimum price entered by a customer
- /// </summary>
- public double MinEnteredPrice { get; set; }
- /// <summary>
- /// Gets or sets the maximum price entered by a customer
- /// </summary>
- public double MaxEnteredPrice { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether base price (PAngV) is enabled. Used by German users.
- /// </summary>
- public bool BasepriceEnabled { get; set; }
- /// <summary>
- /// Gets or sets an amount in product for PAngV
- /// </summary>
- public double BasepriceAmount { get; set; }
- /// <summary>
- /// Gets or sets a unit of product for PAngV (MeasureWeight entity)
- /// </summary>
- public string BasepriceUnitId { get; set; }
- /// <summary>
- /// Gets or sets a reference amount for PAngV
- /// </summary>
- public double BasepriceBaseAmount { get; set; }
- /// <summary>
- /// Gets or sets a reference unit for PAngV (MeasureWeight entity)
- /// </summary>
- public string BasepriceBaseUnitId { get; set; }
-
- /// <summary>
- /// Gets or sets a unit of product
- /// </summary>
- public string UnitId { get; set; }
-
- /// <summary>
- /// Gets or sets a course ident
- /// </summary>
- public string CourseId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this product is marked as new
- /// </summary>
- public bool MarkAsNew { get; set; }
- /// <summary>
- /// Gets or sets the start date and time of the new product (set product as "New" from date). Leave empty to ignore this property
- /// </summary>
- public DateTime? MarkAsNewStartDateTimeUtc { get; set; }
- /// <summary>
- /// Gets or sets the end date and time of the new product (set product as "New" to date). Leave empty to ignore this property
- /// </summary>
- public DateTime? MarkAsNewEndDateTimeUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the weight
- /// </summary>
- public double Weight { get; set; }
- /// <summary>
- /// Gets or sets the length
- /// </summary>
- public double Length { get; set; }
- /// <summary>
- /// Gets or sets the width
- /// </summary>
- public double Width { get; set; }
- /// <summary>
- /// Gets or sets the height
- /// </summary>
- public double Height { get; set; }
-
- /// <summary>
- /// Gets or sets the available start date and time
- /// </summary>
- public DateTime? AvailableStartDateTimeUtc { get; set; }
- /// <summary>
- /// Gets or sets the available end date and time
- /// </summary>
- public DateTime? AvailableEndDateTimeUtc { get; set; }
-
- /// <summary>
- /// Gets or sets auction start price
- /// </summary>
- public double StartPrice { get; set; }
-
- /// <summary>
- /// Gets or sets current highest bid
- /// </summary>
- public double HighestBid { get; set; }
-
- /// <summary>
- /// Gets or sets current highest bidder customer id
- /// </summary>
- public string HighestBidder { get; set; }
-
- /// <summary>
- /// Gets or sets auction ended
- /// </summary>
- public bool AuctionEnded { get; set; }
-
- /// <summary>
- /// Gets or sets a display order.
- /// This value is used when sorting associated products (used with "grouped" products)
- /// This value is used when sorting home page products
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a display order for category page.
- /// This value is used when sorting products on category page
- /// </summary>
- public int DisplayOrderCategory { get; set; }
-
- /// <summary>
- /// Gets or sets a display order for brand page.
- /// This value is used when sorting products on brand page
- /// </summary>
- public int DisplayOrderBrand { get; set; }
-
- /// <summary>
- /// Gets or sets a display order for collection page.
- /// This value is used when sorting products on collection page
- /// </summary>
- public int DisplayOrderCollection { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the sold
- /// </summary>
- public int Sold { get; set; }
-
- /// <summary>
- /// Gets or sets the viewed
- /// </summary>
- public Int64 Viewed { get; set; }
-
- /// <summary>
- /// Gets or sets the onsale
- /// </summary>
- public int OnSale { get; set; }
-
- /// <summary>
- /// Gets or sets the flag
- /// </summary>
- public string Flag { get; set; }
-
- /// <summary>
- /// Gets or sets the ticks
- /// </summary>
- public long Ticks { get; set; }
-
- /// <summary>
- /// Gets or sets the coordinates
- /// </summary>
- public GeoCoordinates Coordinates { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the collection of ProductCategory
- /// </summary>
- public virtual ICollection<ProductCategory> ProductCategories
- {
- get => _productCategories ??= new List<ProductCategory>();
- protected set => _productCategories = value;
- }
-
- /// <summary>
- /// Gets or sets the collection of ProductCollection
- /// </summary>
- public virtual ICollection<ProductCollection> ProductCollections
- {
- get => _productCollections ??= new List<ProductCollection>();
- protected set => _productCollections = value;
- }
-
- /// <summary>
- /// Gets or sets the collection of ProductPicture
- /// </summary>
- public virtual ICollection<ProductPicture> ProductPictures
- {
- get => _productPictures ??= new List<ProductPicture>();
- protected set => _productPictures = value;
- }
-
- /// <summary>
- /// Gets or sets the product specification attribute
- /// </summary>
- public virtual ICollection<ProductSpecificationAttribute> ProductSpecificationAttributes
- {
- get => _productSpecificationAttributes ??= new List<ProductSpecificationAttribute>();
- protected set => _productSpecificationAttributes = value;
- }
-
- /// <summary>
- /// Gets or sets the product tags
- /// </summary>
- public virtual ICollection<string> ProductTags
- {
- get => _productTags ??= new List<string>();
- protected set => _productTags = value;
- }
-
- /// <summary>
- /// Gets or sets the product attribute mappings
- /// </summary>
- public virtual ICollection<ProductAttributeMapping> ProductAttributeMappings
- {
- get => _productAttributeMappings ??= new List<ProductAttributeMapping>();
- protected set => _productAttributeMappings = value;
- }
-
- /// <summary>
- /// Gets or sets the product attribute combinations
- /// </summary>
- public virtual ICollection<ProductAttributeCombination> ProductAttributeCombinations
- {
- get => _productAttributeCombinations ??= new List<ProductAttributeCombination>();
- protected set => _productAttributeCombinations = value;
- }
- /// <summary>
- /// Gets or sets the product prices
- /// </summary>
- public virtual ICollection<ProductPrice> ProductPrices {
- get => _productPrices ??= new List<ProductPrice>();
- protected set => _productPrices = value;
- }
- /// <summary>
- /// Gets or sets the tier prices
- /// </summary>
- public virtual ICollection<TierPrice> TierPrices
- {
- get => _tierPrices ??= new List<TierPrice>();
- protected set => _tierPrices = value;
- }
-
- /// <summary>
- /// Gets or sets the collection of applied discounts
- /// </summary>
- public virtual ICollection<string> AppliedDiscounts
- {
- get => _appliedDiscounts ??= new List<string>();
- protected set => _appliedDiscounts = value;
- }
-
- /// <summary>
- /// Gets or sets the collection of "ProductWarehouseInventory". We use it only when "UseMultipleWarehouses" is set to "true" and ManageInventoryMethod" to "ManageStock"
- /// </summary>
- public virtual ICollection<ProductWarehouseInventory> ProductWarehouseInventory
- {
- get => _productWarehouseInventory ??= new List<ProductWarehouseInventory>();
- protected set => _productWarehouseInventory = value;
- }
-
- public virtual ICollection<string> CrossSellProduct
- {
- get => _crossSellProduct ??= new List<string>();
- protected set => _crossSellProduct = value;
- }
-
- public virtual ICollection<string> RecommendedProduct
- {
- get => _recommendedProduct ??= new List<string>();
- protected set => _recommendedProduct = value;
- }
-
- public virtual ICollection<RelatedProduct> RelatedProducts
- {
- get => _relatedProduct ??= new List<RelatedProduct>();
- protected set => _relatedProduct = value;
- }
- public virtual ICollection<SimilarProduct> SimilarProducts {
- get => _similarProduct ??= new List<SimilarProduct>();
- protected set => _similarProduct = value;
- }
- public virtual ICollection<BundleProduct> BundleProducts
- {
- get => _bundleProduct ??= new List<BundleProduct>();
- protected set => _bundleProduct = value;
- }
+ /// Gets or sets the available start date and time
+ /// </summary>
+ public DateTime? AvailableStartDateTimeUtc { get; set; }
+ /// <summary>
+ /// Gets or sets the available end date and time
+ /// </summary>
+ public DateTime? AvailableEndDateTimeUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets auction start price
+ /// </summary>
+ public double StartPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets current highest bid
+ /// </summary>
+ public double HighestBid { get; set; }
+
+ /// <summary>
+ /// Gets or sets current highest bidder customer id
+ /// </summary>
+ public string HighestBidder { get; set; }
+
+ /// <summary>
+ /// Gets or sets auction ended
+ /// </summary>
+ public bool AuctionEnded { get; set; }
+
+ /// <summary>
+ /// Gets or sets a display order.
+ /// This value is used when sorting associated products (used with "grouped" products)
+ /// This value is used when sorting home page products
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a display order for category page.
+ /// This value is used when sorting products on category page
+ /// </summary>
+ public int DisplayOrderCategory { get; set; }
+
+ /// <summary>
+ /// Gets or sets a display order for brand page.
+ /// This value is used when sorting products on brand page
+ /// </summary>
+ public int DisplayOrderBrand { get; set; }
+
+ /// <summary>
+ /// Gets or sets a display order for collection page.
+ /// This value is used when sorting products on collection page
+ /// </summary>
+ public int DisplayOrderCollection { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sold
+ /// </summary>
+ public int Sold { get; set; }
+
+ /// <summary>
+ /// Gets or sets the viewed
+ /// </summary>
+ public long Viewed { get; set; }
+
+ /// <summary>
+ /// Gets or sets the onsale
+ /// </summary>
+ public int OnSale { get; set; }
+
+ /// <summary>
+ /// Gets or sets the flag
+ /// </summary>
+ public string Flag { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ticks
+ /// </summary>
+ public long Ticks { get; set; }
+
+ /// <summary>
+ /// Gets or sets the coordinates
+ /// </summary>
+ public GeoCoordinates Coordinates { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of ProductCategory
+ /// </summary>
+ public virtual ICollection<ProductCategory> ProductCategories {
+ get => _productCategories ??= new List<ProductCategory>();
+ protected set => _productCategories = value;
}
+
+ /// <summary>
+ /// Gets or sets the collection of ProductCollection
+ /// </summary>
+ public virtual ICollection<ProductCollection> ProductCollections {
+ get => _productCollections ??= new List<ProductCollection>();
+ protected set => _productCollections = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the collection of ProductPicture
+ /// </summary>
+ public virtual ICollection<ProductPicture> ProductPictures {
+ get => _productPictures ??= new List<ProductPicture>();
+ protected set => _productPictures = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the product specification attribute
+ /// </summary>
+ public virtual ICollection<ProductSpecificationAttribute> ProductSpecificationAttributes {
+ get => _productSpecificationAttributes ??= new List<ProductSpecificationAttribute>();
+ protected set => _productSpecificationAttributes = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the product tags
+ /// </summary>
+ public virtual ICollection<string> ProductTags {
+ get => _productTags ??= new List<string>();
+ protected set => _productTags = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the product attribute mappings
+ /// </summary>
+ public virtual ICollection<ProductAttributeMapping> ProductAttributeMappings {
+ get => _productAttributeMappings ??= new List<ProductAttributeMapping>();
+ protected set => _productAttributeMappings = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the product attribute combinations
+ /// </summary>
+ public virtual ICollection<ProductAttributeCombination> ProductAttributeCombinations {
+ get => _productAttributeCombinations ??= new List<ProductAttributeCombination>();
+ protected set => _productAttributeCombinations = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the product prices
+ /// </summary>
+ public virtual ICollection<ProductPrice> ProductPrices {
+ get => _productPrices ??= new List<ProductPrice>();
+ protected set => _productPrices = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the tier prices
+ /// </summary>
+ public virtual ICollection<TierPrice> TierPrices {
+ get => _tierPrices ??= new List<TierPrice>();
+ protected set => _tierPrices = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the collection of applied discounts
+ /// </summary>
+ public virtual ICollection<string> AppliedDiscounts {
+ get => _appliedDiscounts ??= new List<string>();
+ protected set => _appliedDiscounts = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the collection of "ProductWarehouseInventory". We use it only when "UseMultipleWarehouses" is set to
+ /// "true" and ManageInventoryMethod" to "ManageStock"
+ /// </summary>
+ public virtual ICollection<ProductWarehouseInventory> ProductWarehouseInventory {
+ get => _productWarehouseInventory ??= new List<ProductWarehouseInventory>();
+ protected set => _productWarehouseInventory = value;
+ }
+
+ public virtual ICollection<string> CrossSellProduct {
+ get => _crossSellProduct ??= new List<string>();
+ protected set => _crossSellProduct = value;
+ }
+
+ public virtual ICollection<string> RecommendedProduct {
+ get => _recommendedProduct ??= new List<string>();
+ protected set => _recommendedProduct = value;
+ }
+
+ public virtual ICollection<RelatedProduct> RelatedProducts {
+ get => _relatedProduct ??= new List<RelatedProduct>();
+ protected set => _relatedProduct = value;
+ }
+
+ public virtual ICollection<SimilarProduct> SimilarProducts {
+ get => _similarProduct ??= new List<SimilarProduct>();
+ protected set => _similarProduct = value;
+ }
+
+ public virtual ICollection<BundleProduct> BundleProducts {
+ get => _bundleProduct ??= new List<BundleProduct>();
+ protected set => _bundleProduct = value;
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductAlsoPurchased.cs b/src/Core/Grand.Domain/Catalog/ProductAlsoPurchased.cs
index 70224ffc4..fad720fbc 100644
--- a/src/Core/Grand.Domain/Catalog/ProductAlsoPurchased.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductAlsoPurchased.cs
@@ -1,16 +1,14 @@
-namespace Grand.Domain.Catalog
-{
- /// <summary>
- /// Represents a product also purchased
- /// </summary>
- public class ProductAlsoPurchased : BaseEntity
- {
- public string ProductId { get; set; }
- public string ProductId2 { get; set; }
- public string OrderId { get; set; }
- public DateTime CreatedOrderOnUtc { get; set; }
- public int Quantity { get; set; }
- public string StoreId { get; set; }
- }
+namespace Grand.Domain.Catalog;
-}
+/// <summary>
+/// Represents a product also purchased
+/// </summary>
+public class ProductAlsoPurchased : BaseEntity
+{
+ public string ProductId { get; set; }
+ public string ProductId2 { get; set; }
+ public string OrderId { get; set; }
+ public DateTime CreatedOrderOnUtc { get; set; }
+ public int Quantity { get; set; }
+ public string StoreId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductAttribute.cs b/src/Core/Grand.Domain/Catalog/ProductAttribute.cs
index 687060b7c..4c6a0b942 100644
--- a/src/Core/Grand.Domain/Catalog/ProductAttribute.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductAttribute.cs
@@ -1,39 +1,40 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product attribute
+/// </summary>
+public class ProductAttribute : BaseEntity, IStoreLinkEntity, ITranslationEntity
{
/// <summary>
- /// Represents a product attribute
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ public IList<PredefinedProductAttributeValue> PredefinedProductAttributeValues { get; set; } =
+ new List<PredefinedProductAttributeValue>();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
/// </summary>
- public class ProductAttribute : BaseEntity, IStoreLinkEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- public IList<PredefinedProductAttributeValue> PredefinedProductAttributeValues { get; set; } = new List<PredefinedProductAttributeValue>();
- }
-}
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductAttributeCombination.cs b/src/Core/Grand.Domain/Catalog/ProductAttributeCombination.cs
index ecbd2dd80..5ef747323 100644
--- a/src/Core/Grand.Domain/Catalog/ProductAttributeCombination.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductAttributeCombination.cs
@@ -1,90 +1,91 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product attribute combination
+/// </summary>
+public class ProductAttributeCombination : SubBaseEntity, ICloneable
{
+ private ICollection<ProductCombinationTierPrices> _tierPrices;
+ private ICollection<ProductCombinationWarehouseInventory> _warehouseInventory;
+
+ /// <summary>
+ /// Gets or sets the custom attributes (see "ProductAttribute" entity for more info)
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets or sets the stock quantity
+ /// </summary>
+ public int StockQuantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the reserved quantity (ordered but not shipped yet)
+ /// </summary>
+ public int ReservedQuantity { get; set; }
+
/// <summary>
- /// Represents a product attribute combination
+ /// Gets or sets a value indicating whether to allow orders when out of stock
/// </summary>
- public class ProductAttributeCombination : SubBaseEntity, ICloneable
+ public bool AllowOutOfStockOrders { get; set; }
+
+ /// <summary>
+ /// Gets or sets the text
+ /// </summary>
+ public string Text { get; set; }
+
+ /// <summary>
+ /// Gets or sets the SKU
+ /// </summary>
+ public string Sku { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection part number
+ /// </summary>
+ public string Mpn { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in
+ /// Europe), JAN (in Japan), and ISBN (for books).
+ /// </summary>
+ public string Gtin { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attribute combination price. This way a store owner can override the default product price when
+ /// this attribute combination is added to the cart. For example, you can give a discount this way.
+ /// </summary>
+ public double? OverriddenPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quantity when admin should be notified
+ /// </summary>
+ public int NotifyAdminForQuantityBelow { get; set; }
+
+ /// <summary>
+ /// Gets or sets the identifier of picture associated with this combination
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of "ProductCombinationWarehouseInventory". We use it only when "UseMultipleWarehouses"
+ /// is set to "true"
+ /// </summary>
+ public virtual ICollection<ProductCombinationWarehouseInventory> WarehouseInventory {
+ get => _warehouseInventory ??= new List<ProductCombinationWarehouseInventory>();
+ protected set => _warehouseInventory = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the collection of "ProductCombinationTierPrices".
+ /// </summary>
+ public virtual ICollection<ProductCombinationTierPrices> TierPrices {
+ get => _tierPrices ??= new List<ProductCombinationTierPrices>();
+ protected set => _tierPrices = value;
+ }
+
+ public object Clone()
{
- private ICollection<ProductCombinationWarehouseInventory> _warehouseInventory;
- private ICollection<ProductCombinationTierPrices> _tierPrices;
-
- /// <summary>
- /// Gets or sets the custom attributes (see "ProductAttribute" entity for more info)
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets the stock quantity
- /// </summary>
- public int StockQuantity { get; set; }
- /// <summary>
- /// Gets or sets the reserved quantity (ordered but not shipped yet)
- /// </summary>
- public int ReservedQuantity { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to allow orders when out of stock
- /// </summary>
- public bool AllowOutOfStockOrders { get; set; }
-
- /// <summary>
- /// Gets or sets the text
- /// </summary>
- public string Text { get; set; }
-
- /// <summary>
- /// Gets or sets the SKU
- /// </summary>
- public string Sku { get; set; }
-
- /// <summary>
- /// Gets or sets the collection part number
- /// </summary>
- public string Mpn { get; set; }
-
- /// <summary>
- /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books).
- /// </summary>
- public string Gtin { get; set; }
-
- /// <summary>
- /// Gets or sets the attribute combination price. This way a store owner can override the default product price when this attribute combination is added to the cart. For example, you can give a discount this way.
- /// </summary>
- public double? OverriddenPrice { get; set; }
-
- /// <summary>
- /// Gets or sets the quantity when admin should be notified
- /// </summary>
- public int NotifyAdminForQuantityBelow { get; set; }
-
- /// <summary>
- /// Gets or sets the identifier of picture associated with this combination
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of "ProductCombinationWarehouseInventory". We use it only when "UseMultipleWarehouses" is set to "true"
- /// </summary>
- public virtual ICollection<ProductCombinationWarehouseInventory> WarehouseInventory
- {
- get => _warehouseInventory ??= new List<ProductCombinationWarehouseInventory>();
- protected set => _warehouseInventory = value;
- }
-
- /// <summary>
- /// Gets or sets the collection of "ProductCombinationTierPrices".
- /// </summary>
- public virtual ICollection<ProductCombinationTierPrices> TierPrices
- {
- get => _tierPrices ??= new List<ProductCombinationTierPrices>();
- protected set => _tierPrices = value;
- }
-
- public object Clone()
- {
- return this.MemberwiseClone();
- }
+ return MemberwiseClone();
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductAttributeExtensions.cs b/src/Core/Grand.Domain/Catalog/ProductAttributeExtensions.cs
index f50f70840..62d4f51c2 100644
--- a/src/Core/Grand.Domain/Catalog/ProductAttributeExtensions.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductAttributeExtensions.cs
@@ -1,59 +1,58 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public static class ProductAttributeExtensions
{
- public static class ProductAttributeExtensions
+ public static bool ShouldHaveValues(this ProductAttributeMapping productAttributeMapping)
{
- public static bool ShouldHaveValues(this ProductAttributeMapping productAttributeMapping)
- {
- if (productAttributeMapping == null)
- return false;
+ if (productAttributeMapping == null)
+ return false;
+
+ if (productAttributeMapping.AttributeControlTypeId == AttributeControlType.TextBox ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.Datepicker ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.FileUpload)
+ return false;
- if (productAttributeMapping.AttributeControlTypeId == AttributeControlType.TextBox ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.Datepicker ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.FileUpload)
- return false;
+ return true;
+ }
+
+ public static bool ValidationRulesAllowed(this ProductAttributeMapping productAttributeMapping)
+ {
+ if (productAttributeMapping == null)
+ return false;
+ if (productAttributeMapping.AttributeControlTypeId == AttributeControlType.TextBox ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.FileUpload)
return true;
- }
- public static bool ValidationRulesAllowed(this ProductAttributeMapping productAttributeMapping)
- {
- if (productAttributeMapping == null)
- return false;
+ return false;
+ }
- if (productAttributeMapping.AttributeControlTypeId == AttributeControlType.TextBox ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.FileUpload)
- return true;
+ public static bool CanBeUsedAsCondition(this ProductAttributeMapping productAttributeMapping)
+ {
+ if (productAttributeMapping == null)
+ return false;
+ if (productAttributeMapping.AttributeControlTypeId == AttributeControlType.ReadonlyCheckboxes ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.TextBox ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.Datepicker ||
+ productAttributeMapping.AttributeControlTypeId == AttributeControlType.FileUpload)
return false;
- }
- public static bool CanBeUsedAsCondition(this ProductAttributeMapping productAttributeMapping)
- {
- if (productAttributeMapping == null)
- return false;
+ return true;
+ }
- if (productAttributeMapping.AttributeControlTypeId == AttributeControlType.ReadonlyCheckboxes ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.TextBox ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.Datepicker ||
- productAttributeMapping.AttributeControlTypeId == AttributeControlType.FileUpload)
- return false;
+ public static bool IsNonCombinable(this ProductAttributeMapping productAttributeMapping)
+ {
+ if (productAttributeMapping == null)
+ return false;
+ if (!productAttributeMapping.Combination)
return true;
- }
-
- public static bool IsNonCombinable(this ProductAttributeMapping productAttributeMapping)
- {
- if (productAttributeMapping == null)
- return false;
-
- if (!productAttributeMapping.Combination)
- return true;
- var result = !ShouldHaveValues(productAttributeMapping);
- return result;
- }
+ var result = !ShouldHaveValues(productAttributeMapping);
+ return result;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductAttributeMapping.cs b/src/Core/Grand.Domain/Catalog/ProductAttributeMapping.cs
index 95875af9a..44fcce333 100644
--- a/src/Core/Grand.Domain/Catalog/ProductAttributeMapping.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductAttributeMapping.cs
@@ -1,94 +1,90 @@
using Grand.Domain.Common;
using Grand.Domain.Localization;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product attribute mapping
+/// </summary>
+public class ProductAttributeMapping : SubBaseEntity, ITranslationEntity
{
+ private ICollection<ProductAttributeValue> _productAttributeValues;
+
+ /// <summary>
+ /// Gets or sets the product attribute identifier
+ /// </summary>
+ public string ProductAttributeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value a text prompt
+ /// </summary>
+ public string TextPrompt { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is required
+ /// </summary>
+ public bool IsRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether the attribute will be shown on the catalog page
+ /// </summary>
+ public bool ShowOnCatalogPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether the attribute will be used in combinations
+ /// </summary>
+ public bool Combination { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attribute control type identifier
+ /// </summary>
+ public AttributeControlType AttributeControlTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox)
+ /// </summary>
+ public int? ValidationMinLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox)
+ /// </summary>
+ public int? ValidationMaxLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for file allowed extensions (for file upload)
+ /// </summary>
+ public string ValidationFileAllowedExtensions { get; set; }
+
/// <summary>
- /// Represents a product attribute mapping
+ /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload)
/// </summary>
- public class ProductAttributeMapping : SubBaseEntity, ITranslationEntity
- {
- private ICollection<ProductAttributeValue> _productAttributeValues;
-
- /// <summary>
- /// Gets or sets the product attribute identifier
- /// </summary>
- public string ProductAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets a value a text prompt
- /// </summary>
- public string TextPrompt { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is required
- /// </summary>
- public bool IsRequired { get; set; }
-
- /// <summary>
- /// Gets or sets whether the attribute will be shown on the catalog page
- /// </summary>
- public bool ShowOnCatalogPage { get; set; }
-
- /// <summary>
- /// Gets or sets whether the attribute will be used in combinations
- /// </summary>
- public bool Combination { get; set; }
-
- /// <summary>
- /// Gets or sets the attribute control type identifier
- /// </summary>
- public AttributeControlType AttributeControlTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox)
- /// </summary>
- public int? ValidationMinLength { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox)
- /// </summary>
- public int? ValidationMaxLength { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for file allowed extensions (for file upload)
- /// </summary>
- public string ValidationFileAllowedExtensions { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload)
- /// </summary>
- public int? ValidationFileMaximumSize { get; set; }
-
- /// <summary>
- /// Gets or sets the default value (for textbox and multiline textbox)
- /// </summary>
- public string DefaultValue { get; set; }
-
- /// <summary>
- /// Gets or sets the custom attributes (see "ProductAttribute" entity for more info)
- /// </summary>
- public IList<CustomAttribute> ConditionAttribute { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets the product attribute values
- /// </summary>
- public virtual ICollection<ProductAttributeValue> ProductAttributeValues
- {
- get => _productAttributeValues ??= new List<ProductAttributeValue>();
- protected set => _productAttributeValues = value;
- }
+ public int? ValidationFileMaximumSize { get; set; }
+ /// <summary>
+ /// Gets or sets the default value (for textbox and multiline textbox)
+ /// </summary>
+ public string DefaultValue { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom attributes (see "ProductAttribute" entity for more info)
+ /// </summary>
+ public IList<CustomAttribute> ConditionAttribute { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets the product attribute values
+ /// </summary>
+ public virtual ICollection<ProductAttributeValue> ProductAttributeValues {
+ get => _productAttributeValues ??= new List<ProductAttributeValue>();
+ protected set => _productAttributeValues = value;
}
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductAttributeValue.cs b/src/Core/Grand.Domain/Catalog/ProductAttributeValue.cs
index 3059371cb..8e36dd72a 100644
--- a/src/Core/Grand.Domain/Catalog/ProductAttributeValue.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductAttributeValue.cs
@@ -1,75 +1,75 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product attribute value
+/// </summary>
+public class ProductAttributeValue : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a product attribute value
+ /// Gets or sets the attribute value type identifier
/// </summary>
- public class ProductAttributeValue : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the attribute value type identifier
- /// </summary>
- public AttributeValueType AttributeValueTypeId { get; set; }
+ public AttributeValueType AttributeValueTypeId { get; set; }
- /// <summary>
- /// Gets or sets the associated product identifier (used only with AttributeValueType.AssociatedToProduct)
- /// </summary>
- public string AssociatedProductId { get; set; }
+ /// <summary>
+ /// Gets or sets the associated product identifier (used only with AttributeValueType.AssociatedToProduct)
+ /// </summary>
+ public string AssociatedProductId { get; set; }
- /// <summary>
- /// Gets or sets the product attribute name
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the product attribute name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the color RGB value (used with "Color squares" attribute type)
- /// </summary>
- public string ColorSquaresRgb { get; set; }
+ /// <summary>
+ /// Gets or sets the color RGB value (used with "Color squares" attribute type)
+ /// </summary>
+ public string ColorSquaresRgb { get; set; }
- /// <summary>
- /// Gets or sets the picture ID for image square (used with "Image squares" attribute type)
- /// </summary>
- public string ImageSquaresPictureId { get; set; }
+ /// <summary>
+ /// Gets or sets the picture ID for image square (used with "Image squares" attribute type)
+ /// </summary>
+ public string ImageSquaresPictureId { get; set; }
- /// <summary>
- /// Gets or sets the price adjustment (used only with AttributeValueType.Simple)
- /// </summary>
- public double PriceAdjustment { get; set; }
+ /// <summary>
+ /// Gets or sets the price adjustment (used only with AttributeValueType.Simple)
+ /// </summary>
+ public double PriceAdjustment { get; set; }
- /// <summary>
- /// Gets or sets the weight adjustment (used only with AttributeValueType.Simple)
- /// </summary>
- public double WeightAdjustment { get; set; }
+ /// <summary>
+ /// Gets or sets the weight adjustment (used only with AttributeValueType.Simple)
+ /// </summary>
+ public double WeightAdjustment { get; set; }
- /// <summary>
- /// Gets or sets the attibute value cost (used only with AttributeValueType.Simple)
- /// </summary>
- public double Cost { get; set; }
+ /// <summary>
+ /// Gets or sets the attibute value cost (used only with AttributeValueType.Simple)
+ /// </summary>
+ public double Cost { get; set; }
- /// <summary>
- /// Gets or sets the quantity of associated product (used only with AttributeValueType.AssociatedToProduct)
- /// </summary>
- public int Quantity { get; set; }
+ /// <summary>
+ /// Gets or sets the quantity of associated product (used only with AttributeValueType.AssociatedToProduct)
+ /// </summary>
+ public int Quantity { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the value is pre-selected
- /// </summary>
- public bool IsPreSelected { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the value is pre-selected
+ /// </summary>
+ public bool IsPreSelected { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the picture (identifier) associated with this value. This picture should replace a product main picture once clicked (selected).
- /// </summary>
- public string PictureId { get; set; }
+ /// <summary>
+ /// Gets or sets the picture (identifier) associated with this value. This picture should replace a product main
+ /// picture once clicked (selected).
+ /// </summary>
+ public string PictureId { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductCategory.cs b/src/Core/Grand.Domain/Catalog/ProductCategory.cs
index f59d6f574..c37d08557 100644
--- a/src/Core/Grand.Domain/Catalog/ProductCategory.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductCategory.cs
@@ -1,26 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product category mapping
+/// </summary>
+public class ProductCategory : SubBaseEntity
{
/// <summary>
- /// Represents a product category mapping
+ /// Gets or sets the category identifier
/// </summary>
- public class ProductCategory : SubBaseEntity
- {
-
- /// <summary>
- /// Gets or sets the category identifier
- /// </summary>
- public string CategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the product is featured
- /// </summary>
- public bool IsFeaturedProduct { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ public string CategoryId { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is featured
+ /// </summary>
+ public bool IsFeaturedProduct { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductCollection.cs b/src/Core/Grand.Domain/Catalog/ProductCollection.cs
index fd7c428c9..c4de7079c 100644
--- a/src/Core/Grand.Domain/Catalog/ProductCollection.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductCollection.cs
@@ -1,26 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product collection mapping
+/// </summary>
+public class ProductCollection : SubBaseEntity
{
/// <summary>
- /// Represents a product collection mapping
+ /// Gets or sets the collection identifier
/// </summary>
- public class ProductCollection : SubBaseEntity
- {
-
- /// <summary>
- /// Gets or sets the collection identifier
- /// </summary>
- public string CollectionId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the product is featured
- /// </summary>
- public bool IsFeaturedProduct { get; set; }
+ public string CollectionId { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether the product is featured
+ /// </summary>
+ public bool IsFeaturedProduct { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductCombinationTierPrices.cs b/src/Core/Grand.Domain/Catalog/ProductCombinationTierPrices.cs
index 7f95ef4ac..656883795 100644
--- a/src/Core/Grand.Domain/Catalog/ProductCombinationTierPrices.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductCombinationTierPrices.cs
@@ -1,29 +1,27 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Manage product combination tier prices
+/// </summary>
+public class ProductCombinationTierPrices : SubBaseEntity
{
/// <summary>
- /// Manage product combination tier prices
+ /// Gets or sets the store identifier
/// </summary>
- public class ProductCombinationTierPrices : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the customer group identifier
- /// </summary>
- public string CustomerGroupId { get; set; }
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
+ /// <summary>
+ /// Gets or sets the customer group identifier
+ /// </summary>
+ public string CustomerGroupId { get; set; }
- /// <summary>
- /// Gets or sets the price
- /// </summary>
- public double Price { get; set; }
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the price
+ /// </summary>
+ public double Price { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductCombinationWarehouseInventory.cs b/src/Core/Grand.Domain/Catalog/ProductCombinationWarehouseInventory.cs
index 75042b722..d25fe836b 100644
--- a/src/Core/Grand.Domain/Catalog/ProductCombinationWarehouseInventory.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductCombinationWarehouseInventory.cs
@@ -1,25 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Manage product inventory per warehouse
+/// </summary>
+public class ProductCombinationWarehouseInventory : SubBaseEntity
{
/// <summary>
- /// Manage product inventory per warehouse
+ /// Gets or sets the warehouse identifier
/// </summary>
- public class ProductCombinationWarehouseInventory : SubBaseEntity
- {
-
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
+ public string WarehouseId { get; set; }
- /// <summary>
- /// Gets or sets the stock quantity
- /// </summary>
- public int StockQuantity { get; set; }
-
- /// <summary>
- /// Gets or sets the reserved quantity (ordered but not shipped yet)
- /// </summary>
- public int ReservedQuantity { get; set; }
+ /// <summary>
+ /// Gets or sets the stock quantity
+ /// </summary>
+ public int StockQuantity { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the reserved quantity (ordered but not shipped yet)
+ /// </summary>
+ public int ReservedQuantity { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductDeleted.cs b/src/Core/Grand.Domain/Catalog/ProductDeleted.cs
index b8cdd2400..143d0e6a7 100644
--- a/src/Core/Grand.Domain/Catalog/ProductDeleted.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductDeleted.cs
@@ -1,7 +1,6 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public class ProductDeleted : Product
{
- public class ProductDeleted: Product
- {
- public DateTime DeletedOnUtc { get; set; }
- }
-}
+ public DateTime DeletedOnUtc { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductExtensions.cs b/src/Core/Grand.Domain/Catalog/ProductExtensions.cs
index dfacdee67..3768e132e 100644
--- a/src/Core/Grand.Domain/Catalog/ProductExtensions.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductExtensions.cs
@@ -2,485 +2,460 @@
using Grand.Domain.Customers;
using Grand.SharedKernel.Extensions;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Product extensions
+/// </summary>
+public static class ProductExtensions
{
/// <summary>
- /// Product extensions
+ /// Used to get an appropriate tier price
/// </summary>
- public static class ProductExtensions
+ /// <param name="product">Product</param>
+ /// <param name="customer">Customer</param>
+ /// <param name="storeId">Store id</param>
+ /// <param name="currencyCode"></param>
+ /// <param name="quantity">Quantity</param>
+ /// <returns>Price</returns>
+ public static TierPrice GetPreferredTierPrice(this Product product, Customer customer, string storeId,
+ string currencyCode, int quantity)
{
- /// <summary>
- /// Used to get an appropriate tier price
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="customer">Customer</param>
- /// <param name="storeId">Store id</param>
- /// <param name="currencyCode"></param>
- /// <param name="quantity">Quantity</param>
- /// <returns>Price</returns>
- public static TierPrice GetPreferredTierPrice(this Product product, Customer customer, string storeId, string currencyCode, int quantity)
- {
- if (!product.TierPrices.Any())
- return null;
-
- var actualTierPrices = product.TierPrices.OrderBy(price => price.Quantity).ToList()
- .FilterByStore(storeId)
- .FilterByCurrency(currencyCode)
- .FilterForCustomer(customer)
- .FilterByDate()
- .RemoveDuplicatedQuantities();
+ if (!product.TierPrices.Any())
+ return null;
- var tierPrice = actualTierPrices.LastOrDefault(price => quantity >= price.Quantity);
+ var actualTierPrices = product.TierPrices.OrderBy(price => price.Quantity).ToList()
+ .FilterByStore(storeId)
+ .FilterByCurrency(currencyCode)
+ .FilterForCustomer(customer)
+ .FilterByDate()
+ .RemoveDuplicatedQuantities();
- return tierPrice;
- }
+ var tierPrice = actualTierPrices.LastOrDefault(price => quantity >= price.Quantity);
- /// <summary>
- /// Check if product tag exists
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="productTagName"></param>
- /// <returns>Result</returns>
- public static bool ProductTagExists(this Product product,
- string productTagName)
- {
- ArgumentNullException.ThrowIfNull(product);
+ return tierPrice;
+ }
- var result = product.ProductTags.FirstOrDefault(pt => pt == productTagName) != null;
- return result;
- }
+ /// <summary>
+ /// Check if product tag exists
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="productTagName"></param>
+ /// <returns>Result</returns>
+ public static bool ProductTagExists(this Product product,
+ string productTagName)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- /// <summary>
- /// List of allowed quantities
- /// </summary>
- /// <param name="product">Product</param>
- /// <returns>Result</returns>
- public static int[] ParseAllowedQuantities(this Product product)
- {
- ArgumentNullException.ThrowIfNull(product);
+ var result = product.ProductTags.FirstOrDefault(pt => pt == productTagName) != null;
+ return result;
+ }
- var result = new List<int>();
- if (!String.IsNullOrWhiteSpace(product.AllowedQuantities))
- {
- product.AllowedQuantities
- .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
- .ToList()
- .ForEach(qtyStr =>
- {
- int qty;
- if (int.TryParse(qtyStr.Trim(), out qty))
- {
- result.Add(qty);
- }
- });
- }
+ /// <summary>
+ /// List of allowed quantities
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <returns>Result</returns>
+ public static int[] ParseAllowedQuantities(this Product product)
+ {
+ ArgumentNullException.ThrowIfNull(product);
+
+ var result = new List<int>();
+ if (!string.IsNullOrWhiteSpace(product.AllowedQuantities))
+ product.AllowedQuantities
+ .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
+ .ToList()
+ .ForEach(qtyStr =>
+ {
+ int qty;
+ if (int.TryParse(qtyStr.Trim(), out qty)) result.Add(qty);
+ });
- return result.ToArray();
- }
+ return result.ToArray();
+ }
- /// <summary>
- /// Gets SKU, Collection part number and GTIN
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="attributes">Attributes</param>
- /// <param name="sku">SKU</param>
- /// <param name="mpn">MPN</param>
- /// <param name="gtin">GTIN</param>
- private static void GetSkuMpnGtin(this Product product, IList<CustomAttribute> attributes,
- out string sku, out string mpn, out string gtin)
- {
- ArgumentNullException.ThrowIfNull(product);
+ /// <summary>
+ /// Gets SKU, Collection part number and GTIN
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="attributes">Attributes</param>
+ /// <param name="sku">SKU</param>
+ /// <param name="mpn">MPN</param>
+ /// <param name="gtin">GTIN</param>
+ private static void GetSkuMpnGtin(this Product product, IList<CustomAttribute> attributes,
+ out string sku, out string mpn, out string gtin)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- sku = null;
- mpn = null;
- gtin = null;
+ sku = null;
+ mpn = null;
+ gtin = null;
- if (attributes != null && attributes.Any())
+ if (attributes != null && attributes.Any())
+ {
+ var combination = FindProductAttributeCombination(product, attributes);
+ if (combination != null)
{
- var combination = FindProductAttributeCombination(product, attributes);
- if (combination != null)
- {
- sku = combination.Sku;
- mpn = combination.Mpn;
- gtin = combination.Gtin;
- }
+ sku = combination.Sku;
+ mpn = combination.Mpn;
+ gtin = combination.Gtin;
}
-
- if (string.IsNullOrEmpty(sku))
- sku = product.Sku;
- if (string.IsNullOrEmpty(mpn))
- mpn = product.Mpn;
- if (string.IsNullOrEmpty(gtin))
- gtin = product.Gtin;
}
- /// <summary>
- /// Finds a product attribute combination by attributes stored
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="customAttributes">Attributes</param>
- /// <param name="ignoreNonCombinableAttributes">A value indicating whether we should ignore non-combinable attributes</param>
- /// <returns>Found product attribute combination</returns>
- public static ProductAttributeCombination FindProductAttributeCombination(this Product product,
- IList<CustomAttribute> customAttributes, bool ignoreNonCombinableAttributes = true)
- {
- ArgumentNullException.ThrowIfNull(product);
+ if (string.IsNullOrEmpty(sku))
+ sku = product.Sku;
+ if (string.IsNullOrEmpty(mpn))
+ mpn = product.Mpn;
+ if (string.IsNullOrEmpty(gtin))
+ gtin = product.Gtin;
+ }
- var combinations = product.ProductAttributeCombinations;
- return combinations.FirstOrDefault(x =>
- AreProductAttributesEqual(product, x.Attributes, customAttributes, ignoreNonCombinableAttributes));
- }
+ /// <summary>
+ /// Finds a product attribute combination by attributes stored
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="customAttributes">Attributes</param>
+ /// <param name="ignoreNonCombinableAttributes">A value indicating whether we should ignore non-combinable attributes</param>
+ /// <returns>Found product attribute combination</returns>
+ public static ProductAttributeCombination FindProductAttributeCombination(this Product product,
+ IList<CustomAttribute> customAttributes, bool ignoreNonCombinableAttributes = true)
+ {
+ ArgumentNullException.ThrowIfNull(product);
+ var combinations = product.ProductAttributeCombinations;
+ return combinations.FirstOrDefault(x =>
+ AreProductAttributesEqual(product, x.Attributes, customAttributes, ignoreNonCombinableAttributes));
+ }
- /// <summary>
- /// Gets selected product attribute mappings
- /// </summary>
- /// <param name="product"></param>
- /// <param name="customAttributes">Attributes</param>
- /// <returns>Selected product attribute mappings</returns>
- public static IList<ProductAttributeMapping> ParseProductAttributeMappings(this Product product, IList<CustomAttribute> customAttributes)
- {
- var result = new List<ProductAttributeMapping>();
- if (customAttributes == null || !customAttributes.Any())
- return result;
- foreach (var customAttribute in customAttributes.GroupBy(x => x.Key))
- {
- var attribute = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == customAttribute.Key);
- if (attribute != null)
- {
- result.Add(attribute);
- }
- }
+ /// <summary>
+ /// Gets selected product attribute mappings
+ /// </summary>
+ /// <param name="product"></param>
+ /// <param name="customAttributes">Attributes</param>
+ /// <returns>Selected product attribute mappings</returns>
+ public static IList<ProductAttributeMapping> ParseProductAttributeMappings(this Product product,
+ IList<CustomAttribute> customAttributes)
+ {
+ var result = new List<ProductAttributeMapping>();
+ if (customAttributes == null || !customAttributes.Any())
return result;
- }
- /// <summary>
- /// Get product attribute values
- /// </summary>
- /// <param name="product"></param>
- /// <param name="customAttributes">Attributes</param>
- /// <returns>Product attribute values</returns>
- public static IList<ProductAttributeValue> ParseProductAttributeValues(this Product product, IList<CustomAttribute> customAttributes)
+ foreach (var customAttribute in customAttributes.GroupBy(x => x.Key))
{
- var values = new List<ProductAttributeValue>();
- if (customAttributes == null || !customAttributes.Any())
- return values;
+ var attribute = product.ProductAttributeMappings.FirstOrDefault(x => x.Id == customAttribute.Key);
+ if (attribute != null) result.Add(attribute);
+ }
- var attributes = ParseProductAttributeMappings(product, customAttributes);
- foreach (var attribute in attributes)
- {
- if (!attribute.ShouldHaveValues())
- continue;
+ return result;
+ }
- var valuesStr = ParseValues(customAttributes, attribute.Id);
- foreach (var valueStr in valuesStr)
- {
- if (!string.IsNullOrEmpty(valueStr))
+ /// <summary>
+ /// Get product attribute values
+ /// </summary>
+ /// <param name="product"></param>
+ /// <param name="customAttributes">Attributes</param>
+ /// <returns>Product attribute values</returns>
+ public static IList<ProductAttributeValue> ParseProductAttributeValues(this Product product,
+ IList<CustomAttribute> customAttributes)
+ {
+ var values = new List<ProductAttributeValue>();
+ if (customAttributes == null || !customAttributes.Any())
+ return values;
+
+ var attributes = ParseProductAttributeMappings(product, customAttributes);
+ foreach (var attribute in attributes)
+ {
+ if (!attribute.ShouldHaveValues())
+ continue;
+
+ var valuesStr = ParseValues(customAttributes, attribute.Id);
+ foreach (var valueStr in valuesStr)
+ if (!string.IsNullOrEmpty(valueStr))
+ if (attribute.ProductAttributeValues.Any(x => x.Id == valueStr))
{
- if (attribute.ProductAttributeValues.Any(x => x.Id == valueStr))
- {
- var value = attribute.ProductAttributeValues.FirstOrDefault(x => x.Id == valueStr);
- if (value != null)
- {
- values.Add(value);
- }
- }
+ var value = attribute.ProductAttributeValues.FirstOrDefault(x => x.Id == valueStr);
+ if (value != null) values.Add(value);
}
- }
- }
- return values;
}
- /// <summary>
- /// Gets selected product attribute values
- /// </summary>
- /// <param name="customAttributes">Attributes </param>
- /// <param name="productAttributeMappingId">Product attribute mapping identifier</param>
- /// <returns>Product attribute values</returns>
- public static IList<string> ParseValues(IList<CustomAttribute> customAttributes, string productAttributeMappingId)
- {
- var selectedValues = new List<string>();
- if (customAttributes == null || !customAttributes.Any())
- return selectedValues;
+ return values;
+ }
- return customAttributes.Where(x => x.Key == productAttributeMappingId).Select(x => x.Value).ToList();
+ /// <summary>
+ /// Gets selected product attribute values
+ /// </summary>
+ /// <param name="customAttributes">Attributes </param>
+ /// <param name="productAttributeMappingId">Product attribute mapping identifier</param>
+ /// <returns>Product attribute values</returns>
+ public static IList<string> ParseValues(IList<CustomAttribute> customAttributes, string productAttributeMappingId)
+ {
+ var selectedValues = new List<string>();
+ if (customAttributes == null || !customAttributes.Any())
+ return selectedValues;
- }
+ return customAttributes.Where(x => x.Key == productAttributeMappingId).Select(x => x.Value).ToList();
+ }
- /// <summary>
- /// Adds an attribute
- /// </summary>
- /// <param name="customAttributes"></param>
- /// <param name="productAttributeMapping">Product attribute mapping</param>
- /// <param name="value">Value</param>
- /// <returns>Attributes</returns>
- public static IList<CustomAttribute> AddProductAttribute(IList<CustomAttribute> customAttributes, ProductAttributeMapping productAttributeMapping, string value)
- {
- customAttributes ??= new List<CustomAttribute>();
- customAttributes.Add(new CustomAttribute { Key = productAttributeMapping.Id, Value = value });
+ /// <summary>
+ /// Adds an attribute
+ /// </summary>
+ /// <param name="customAttributes"></param>
+ /// <param name="productAttributeMapping">Product attribute mapping</param>
+ /// <param name="value">Value</param>
+ /// <returns>Attributes</returns>
+ public static IList<CustomAttribute> AddProductAttribute(IList<CustomAttribute> customAttributes,
+ ProductAttributeMapping productAttributeMapping, string value)
+ {
+ customAttributes ??= new List<CustomAttribute>();
+ customAttributes.Add(new CustomAttribute { Key = productAttributeMapping.Id, Value = value });
- return customAttributes;
- }
+ return customAttributes;
+ }
- /// <summary>
- /// Remove an attribute
- /// </summary>
- /// <param name="customAttributes"></param>
- /// <param name="productAttributeMapping">Product attribute mapping</param>
- /// <returns>Updated result (XML format)</returns>
- public static IList<CustomAttribute> RemoveProductAttribute(IList<CustomAttribute> customAttributes, ProductAttributeMapping productAttributeMapping)
- {
- return customAttributes.Where(x => x.Key != productAttributeMapping.Id).ToList();
- }
+ /// <summary>
+ /// Remove an attribute
+ /// </summary>
+ /// <param name="customAttributes"></param>
+ /// <param name="productAttributeMapping">Product attribute mapping</param>
+ /// <returns>Updated result (XML format)</returns>
+ public static IList<CustomAttribute> RemoveProductAttribute(IList<CustomAttribute> customAttributes,
+ ProductAttributeMapping productAttributeMapping)
+ {
+ return customAttributes.Where(x => x.Key != productAttributeMapping.Id).ToList();
+ }
- /// <summary>
- /// Are attributes equal
- /// </summary>
- /// <param name="product"></param>
- /// <param name="customAttributes1">The attributes of the first product</param>
- /// <param name="customAttributes2">The attributes of the second product</param>
- /// <param name="ignoreNonCombinableAttributes">A value indicating whether we should ignore non-combinable attributes</param>
- /// <returns>Result</returns>
- public static bool AreProductAttributesEqual(Product product, IList<CustomAttribute> customAttributes1, IList<CustomAttribute> customAttributes2, bool ignoreNonCombinableAttributes)
- {
- var attributes1 = ParseProductAttributeMappings(product, customAttributes1);
- if (ignoreNonCombinableAttributes)
- {
- attributes1 = attributes1.Where(x => !x.IsNonCombinable()).ToList();
- }
- var attributes2 = ParseProductAttributeMappings(product, customAttributes2);
- //TO DO - Where(x=>x.IsRequired).ToList()
+ /// <summary>
+ /// Are attributes equal
+ /// </summary>
+ /// <param name="product"></param>
+ /// <param name="customAttributes1">The attributes of the first product</param>
+ /// <param name="customAttributes2">The attributes of the second product</param>
+ /// <param name="ignoreNonCombinableAttributes">A value indicating whether we should ignore non-combinable attributes</param>
+ /// <returns>Result</returns>
+ public static bool AreProductAttributesEqual(Product product, IList<CustomAttribute> customAttributes1,
+ IList<CustomAttribute> customAttributes2, bool ignoreNonCombinableAttributes)
+ {
+ var attributes1 = ParseProductAttributeMappings(product, customAttributes1);
+ if (ignoreNonCombinableAttributes) attributes1 = attributes1.Where(x => !x.IsNonCombinable()).ToList();
+ var attributes2 = ParseProductAttributeMappings(product, customAttributes2);
+ //TO DO - Where(x=>x.IsRequired).ToList()
- if (ignoreNonCombinableAttributes)
- {
- attributes2 = attributes2.Where(x => !x.IsNonCombinable()).ToList();
- }
- if (attributes1.Count != attributes2.Count)
- return false;
+ if (ignoreNonCombinableAttributes) attributes2 = attributes2.Where(x => !x.IsNonCombinable()).ToList();
+ if (attributes1.Count != attributes2.Count)
+ return false;
- var attributesEqual = true;
- foreach (var a1 in attributes1)
- {
- var hasAttribute = false;
- foreach (var a2 in attributes2)
+ var attributesEqual = true;
+ foreach (var a1 in attributes1)
+ {
+ var hasAttribute = false;
+ foreach (var a2 in attributes2)
+ if (a1.Id == a2.Id)
{
- if (a1.Id == a2.Id)
+ hasAttribute = true;
+ var values1Str = ParseValues(customAttributes1, a1.Id);
+ var values2Str = ParseValues(customAttributes2, a2.Id);
+ if (values1Str.Count == values2Str.Count)
{
- hasAttribute = true;
- var values1Str = ParseValues(customAttributes1, a1.Id);
- var values2Str = ParseValues(customAttributes2, a2.Id);
- if (values1Str.Count == values2Str.Count)
+ foreach (var str1 in values1Str)
{
- foreach (var str1 in values1Str)
- {
- var hasValue = false;
- foreach (var str2 in values2Str)
- {
- //case insensitive?
- if (str1.Trim() == str2.Trim())
- {
- hasValue = true;
- break;
- }
- }
-
- if (!hasValue)
+ var hasValue = false;
+ foreach (var str2 in values2Str)
+ //case insensitive?
+ if (str1.Trim() == str2.Trim())
{
- attributesEqual = false;
+ hasValue = true;
break;
}
+
+ if (!hasValue)
+ {
+ attributesEqual = false;
+ break;
}
}
- else
- {
- attributesEqual = false;
- break;
- }
+ }
+ else
+ {
+ attributesEqual = false;
+ break;
}
}
- if (hasAttribute == false)
- {
- attributesEqual = false;
- break;
- }
+ if (hasAttribute == false)
+ {
+ attributesEqual = false;
+ break;
}
-
- return attributesEqual;
}
- /// <summary>
- /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified
- /// </summary>
- /// <param name="product"></param>
- /// <param name="pam">Product attribute</param>
- /// <param name="selectedAttributes">Selected attributes</param>
- /// <returns>Result</returns>
- public static bool? IsConditionMet(this Product product, ProductAttributeMapping pam, IList<CustomAttribute> selectedAttributes)
- {
- ArgumentNullException.ThrowIfNull(pam);
-
- selectedAttributes ??= new List<CustomAttribute>();
-
- var conditionAttribute = pam.ConditionAttribute;
- if (!conditionAttribute.Any())
- //no condition
- return null;
-
- //load an attribute this one depends on
- var dependOnAttribute = ParseProductAttributeMappings(product, conditionAttribute).FirstOrDefault();
- if (dependOnAttribute == null)
- return true;
-
- var valuesThatShouldBeSelected = ParseValues(conditionAttribute, dependOnAttribute.Id)
- .Where(x => !string.IsNullOrEmpty(x))
- .ToList();
- var selectedValues = ParseValues(selectedAttributes, dependOnAttribute.Id);
- if (valuesThatShouldBeSelected.Count != selectedValues.Count)
- return false;
-
- //compare values
- var allFound = true;
- foreach (var t1 in valuesThatShouldBeSelected)
- {
- var found = false;
- foreach (var t2 in selectedValues)
- if (t1 == t2)
- found = true;
- if (!found)
- allFound = false;
- }
+ return attributesEqual;
+ }
- return allFound;
- }
+ /// <summary>
+ /// Check whether condition of some attribute is met (if specified). Return "null" if not condition is specified
+ /// </summary>
+ /// <param name="product"></param>
+ /// <param name="pam">Product attribute</param>
+ /// <param name="selectedAttributes">Selected attributes</param>
+ /// <returns>Result</returns>
+ public static bool? IsConditionMet(this Product product, ProductAttributeMapping pam,
+ IList<CustomAttribute> selectedAttributes)
+ {
+ ArgumentNullException.ThrowIfNull(pam);
+
+ selectedAttributes ??= new List<CustomAttribute>();
+
+ var conditionAttribute = pam.ConditionAttribute;
+ if (!conditionAttribute.Any())
+ //no condition
+ return null;
+
+ //load an attribute this one depends on
+ var dependOnAttribute = ParseProductAttributeMappings(product, conditionAttribute).FirstOrDefault();
+ if (dependOnAttribute == null)
+ return true;
- /// <summary>
- /// Generate all combinations
- /// </summary>
- /// <param name="product">Product</param>
- /// <returns>Attribute combinations</returns>
- public static IList<IEnumerable<CustomAttribute>> GenerateAllCombinations(this Product product)
+ var valuesThatShouldBeSelected = ParseValues(conditionAttribute, dependOnAttribute.Id)
+ .Where(x => !string.IsNullOrEmpty(x))
+ .ToList();
+ var selectedValues = ParseValues(selectedAttributes, dependOnAttribute.Id);
+ if (valuesThatShouldBeSelected.Count != selectedValues.Count)
+ return false;
+
+ //compare values
+ var allFound = true;
+ foreach (var t1 in valuesThatShouldBeSelected)
{
- ArgumentNullException.ThrowIfNull(product);
+ var found = false;
+ foreach (var t2 in selectedValues)
+ if (t1 == t2)
+ found = true;
+ if (!found)
+ allFound = false;
+ }
- var allProductAttributMappings = product.ProductAttributeMappings.Where(x => !x.IsNonCombinable()).ToList();
+ return allFound;
+ }
- if (allProductAttributMappings.Count == 0)
- return null;
+ /// <summary>
+ /// Generate all combinations
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <returns>Attribute combinations</returns>
+ public static IList<IEnumerable<CustomAttribute>> GenerateAllCombinations(this Product product)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- var query = allProductAttributMappings.Select(o1 => o1.ProductAttributeValues.Select(o2 =>
- new CustomAttribute {
- Key = o1.Id,
- Value = o2.Id
- }
- )).SelectMany(x => x).ToList();
+ var allProductAttributMappings = product.ProductAttributeMappings.Where(x => !x.IsNonCombinable()).ToList();
- var result = query.GroupBy(t => t.Key).CartesianProduct().ToList();
+ if (allProductAttributMappings.Count == 0)
+ return null;
- return result;
- }
+ var query = allProductAttributMappings.Select(o1 => o1.ProductAttributeValues.Select(o2 =>
+ new CustomAttribute {
+ Key = o1.Id,
+ Value = o2.Id
+ }
+ )).SelectMany(x => x).ToList();
- /// <summary>
- /// SKU
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="attributes">Attributes</param>
- /// <returns>SKU</returns>
- public static string FormatSku(this Product product, IList<CustomAttribute> attributes = null)
- {
- ArgumentNullException.ThrowIfNull(product);
+ var result = query.GroupBy(t => t.Key).CartesianProduct().ToList();
- product.GetSkuMpnGtin(attributes, out var sku, out _, out _);
+ return result;
+ }
- return sku;
- }
+ /// <summary>
+ /// SKU
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="attributes">Attributes</param>
+ /// <returns>SKU</returns>
+ public static string FormatSku(this Product product, IList<CustomAttribute> attributes = null)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- /// <summary>
- /// MPN
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="attributes">Attributes</param>
- /// <returns>Collection part number</returns>
- public static string FormatMpn(this Product product, IList<CustomAttribute> attributes = null)
- {
- ArgumentNullException.ThrowIfNull(product);
+ product.GetSkuMpnGtin(attributes, out var sku, out _, out _);
- product.GetSkuMpnGtin(attributes, out _, out var Mpn, out _);
+ return sku;
+ }
- return Mpn;
- }
+ /// <summary>
+ /// MPN
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="attributes">Attributes</param>
+ /// <returns>Collection part number</returns>
+ public static string FormatMpn(this Product product, IList<CustomAttribute> attributes = null)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- /// <summary>
- /// GTIN
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="attributes">Attributes</param>
- /// <returns>GTIN</returns>
- public static string FormatGtin(this Product product, IList<CustomAttribute> attributes = null)
- {
- ArgumentNullException.ThrowIfNull(product);
+ product.GetSkuMpnGtin(attributes, out _, out var Mpn, out _);
- product.GetSkuMpnGtin(attributes, out _, out _, out var gtin);
+ return Mpn;
+ }
- return gtin;
- }
+ /// <summary>
+ /// GTIN
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="attributes">Attributes</param>
+ /// <returns>GTIN</returns>
+ public static string FormatGtin(this Product product, IList<CustomAttribute> attributes = null)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- /// <summary>
- /// Parse "required product Ids" property
- /// </summary>
- /// <param name="product">Product</param>
- /// <returns>A list of required product IDs</returns>
- public static string[] ParseRequiredProductIds(this Product product)
- {
- ArgumentNullException.ThrowIfNull(product);
+ product.GetSkuMpnGtin(attributes, out _, out _, out var gtin);
+
+ return gtin;
+ }
+
+ /// <summary>
+ /// Parse "required product Ids" property
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <returns>A list of required product IDs</returns>
+ public static string[] ParseRequiredProductIds(this Product product)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- if (string.IsNullOrEmpty(product.RequiredProductIds))
- return Array.Empty<string>();
+ if (string.IsNullOrEmpty(product.RequiredProductIds))
+ return Array.Empty<string>();
- var ids = new List<string>();
+ var ids = new List<string>();
- foreach (var idStr in product.RequiredProductIds
- .Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)
- .Select(x => x.Trim()))
- {
- ids.Add(idStr);
- }
+ foreach (var idStr in product.RequiredProductIds
+ .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
+ .Select(x => x.Trim()))
+ ids.Add(idStr);
- return ids.ToArray();
- }
+ return ids.ToArray();
+ }
- /// <summary>
- /// Get a value indicating whether a product is available now (availability dates)
- /// </summary>
- /// <param name="product">Product</param>
- /// <returns>Result</returns>
- public static bool IsAvailable(this Product product)
- {
- return IsAvailable(product, DateTime.UtcNow);
- }
+ /// <summary>
+ /// Get a value indicating whether a product is available now (availability dates)
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <returns>Result</returns>
+ public static bool IsAvailable(this Product product)
+ {
+ return IsAvailable(product, DateTime.UtcNow);
+ }
- /// <summary>
- /// Get a value indicating whether a product is available now (availability dates)
- /// </summary>
- /// <param name="product">Product</param>
- /// <param name="dateTime">Datetime to check</param>
- /// <returns>Result</returns>
- public static bool IsAvailable(this Product product, DateTime dateTime)
- {
- ArgumentNullException.ThrowIfNull(product);
+ /// <summary>
+ /// Get a value indicating whether a product is available now (availability dates)
+ /// </summary>
+ /// <param name="product">Product</param>
+ /// <param name="dateTime">Datetime to check</param>
+ /// <returns>Result</returns>
+ public static bool IsAvailable(this Product product, DateTime dateTime)
+ {
+ ArgumentNullException.ThrowIfNull(product);
- if (product.AvailableStartDateTimeUtc.HasValue && product.AvailableStartDateTimeUtc.Value > dateTime)
- {
- return false;
- }
+ if (product.AvailableStartDateTimeUtc.HasValue && product.AvailableStartDateTimeUtc.Value > dateTime)
+ return false;
- if (product.AvailableEndDateTimeUtc.HasValue && product.AvailableEndDateTimeUtc.Value < dateTime)
- {
- return false;
- }
+ if (product.AvailableEndDateTimeUtc.HasValue && product.AvailableEndDateTimeUtc.Value < dateTime) return false;
- return true;
- }
+ return true;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductLayout.cs b/src/Core/Grand.Domain/Catalog/ProductLayout.cs
index 3b4e63cc3..6272aa959 100644
--- a/src/Core/Grand.Domain/Catalog/ProductLayout.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductLayout.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product layout
+/// </summary>
+public class ProductLayout : BaseEntity
{
/// <summary>
- /// Represents a product layout
+ /// Gets or sets the layout name
/// </summary>
- public class ProductLayout : BaseEntity
- {
- /// <summary>
- /// Gets or sets the layout name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the view path
- /// </summary>
- public string ViewPath { get; set; }
+ /// <summary>
+ /// Gets or sets the view path
+ /// </summary>
+ public string ViewPath { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductPicture.cs b/src/Core/Grand.Domain/Catalog/ProductPicture.cs
index 513e7f85b..2628d4272 100644
--- a/src/Core/Grand.Domain/Catalog/ProductPicture.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductPicture.cs
@@ -1,20 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product picture mapping
+/// </summary>
+public class ProductPicture : SubBaseEntity
{
/// <summary>
- /// Represents a product picture mapping
+ /// Gets or sets the picture identifier
/// </summary>
- public class ProductPicture : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- }
+ public string PictureId { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductPrice.cs b/src/Core/Grand.Domain/Catalog/ProductPrice.cs
index 208e09a18..86fed1ca4 100644
--- a/src/Core/Grand.Domain/Catalog/ProductPrice.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductPrice.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public class ProductPrice : SubBaseEntity
{
- public class ProductPrice : SubBaseEntity
- {
- public string ProductId { get; set; }
- public string CurrencyCode { get; set; }
- public double Price { get; set; }
- }
-}
+ public string ProductId { get; set; }
+ public string CurrencyCode { get; set; }
+ public double Price { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductReservation.cs b/src/Core/Grand.Domain/Catalog/ProductReservation.cs
index c8ed41835..c6fe0a203 100644
--- a/src/Core/Grand.Domain/Catalog/ProductReservation.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductReservation.cs
@@ -1,33 +1,37 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product reservation
+/// </summary>
+public class ProductReservation : BaseEntity
{
/// <summary>
- /// Represents a product reservation
+ /// Gets or sets the product identifier
/// </summary>
- public class ProductReservation : BaseEntity
- {
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
- /// <summary>
- /// Gets or sets the reservation date
- /// </summary>
- public DateTime Date { get; set; }
- /// <summary>
- /// Gets or sets the order id
- /// </summary>
- public string OrderId { get; set; }
- /// <summary>
- /// Gets or sets resource name
- /// </summary>
- public string Resource { get; set; }
- /// <summary>
- /// Gets or sets parameter name
- /// </summary>
- public string Parameter { get; set; }
- /// <summary>
- /// Gets or sets duration
- /// </summary>
- public string Duration { get; set; }
- }
-}
+ public string ProductId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the reservation date
+ /// </summary>
+ public DateTime Date { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order id
+ /// </summary>
+ public string OrderId { get; set; }
+
+ /// <summary>
+ /// Gets or sets resource name
+ /// </summary>
+ public string Resource { get; set; }
+
+ /// <summary>
+ /// Gets or sets parameter name
+ /// </summary>
+ public string Parameter { get; set; }
+
+ /// <summary>
+ /// Gets or sets duration
+ /// </summary>
+ public string Duration { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductReview.cs b/src/Core/Grand.Domain/Catalog/ProductReview.cs
index a58a9b027..34b94f6ea 100644
--- a/src/Core/Grand.Domain/Catalog/ProductReview.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductReview.cs
@@ -1,78 +1,77 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product review
+/// </summary>
+public class ProductReview : BaseEntity
{
+ private ICollection<ProductReviewHelpfulness> _productReviewHelpfulnessEntries;
+
/// <summary>
- /// Represents a product review
+ /// Gets or sets the customer identifier
/// </summary>
- public class ProductReview : BaseEntity
- {
- private ICollection<ProductReviewHelpfulness> _productReviewHelpfulnessEntries;
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
+ /// <summary>
+ /// Gets or sets the product identifier
+ /// </summary>
+ public string ProductId { get; set; }
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the content is approved
- /// </summary>
- public bool IsApproved { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the content is approved
+ /// </summary>
+ public bool IsApproved { get; set; }
- /// <summary>
- /// Gets or sets the title
- /// </summary>
- public string Title { get; set; }
+ /// <summary>
+ /// Gets or sets the title
+ /// </summary>
+ public string Title { get; set; }
- /// <summary>
- /// Gets or sets the review text
- /// </summary>
- public string ReviewText { get; set; }
+ /// <summary>
+ /// Gets or sets the review text
+ /// </summary>
+ public string ReviewText { get; set; }
- /// <summary>
- /// Gets or sets the reply text
- /// </summary>
- public string ReplyText { get; set; }
+ /// <summary>
+ /// Gets or sets the reply text
+ /// </summary>
+ public string ReplyText { get; set; }
- /// <summary>
- /// Gets or sets the Signature (for response text)
- /// </summary>
- public string Signature { get; set; }
+ /// <summary>
+ /// Gets or sets the Signature (for response text)
+ /// </summary>
+ public string Signature { get; set; }
- /// <summary>
- /// Gets or sets the review was confirmed by purchased
- /// </summary>
- public bool ConfirmedPurchase { get; set; }
+ /// <summary>
+ /// Gets or sets the review was confirmed by purchased
+ /// </summary>
+ public bool ConfirmedPurchase { get; set; }
- /// <summary>
- /// Review rating
- /// </summary>
- public int Rating { get; set; }
+ /// <summary>
+ /// Review rating
+ /// </summary>
+ public int Rating { get; set; }
- /// <summary>
- /// Review helpful votes total
- /// </summary>
- public int HelpfulYesTotal { get; set; }
+ /// <summary>
+ /// Review helpful votes total
+ /// </summary>
+ public int HelpfulYesTotal { get; set; }
+
+ /// <summary>
+ /// Review not helpful votes total
+ /// </summary>
+ public int HelpfulNoTotal { get; set; }
- /// <summary>
- /// Review not helpful votes total
- /// </summary>
- public int HelpfulNoTotal { get; set; }
-
- /// <summary>
- /// Gets the entries of product review helpfulness
- /// </summary>
- public virtual ICollection<ProductReviewHelpfulness> ProductReviewHelpfulnessEntries
- {
- get => _productReviewHelpfulnessEntries ??= new List<ProductReviewHelpfulness>();
- protected set => _productReviewHelpfulnessEntries = value;
- }
+ /// <summary>
+ /// Gets the entries of product review helpfulness
+ /// </summary>
+ public virtual ICollection<ProductReviewHelpfulness> ProductReviewHelpfulnessEntries {
+ get => _productReviewHelpfulnessEntries ??= new List<ProductReviewHelpfulness>();
+ protected set => _productReviewHelpfulnessEntries = value;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductReviewHelpfulness.cs b/src/Core/Grand.Domain/Catalog/ProductReviewHelpfulness.cs
index eee786dc0..39ca4330a 100644
--- a/src/Core/Grand.Domain/Catalog/ProductReviewHelpfulness.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductReviewHelpfulness.cs
@@ -1,24 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product review helpfulness
+/// </summary>
+public class ProductReviewHelpfulness : SubBaseEntity
{
/// <summary>
- /// Represents a product review helpfulness
+ /// Gets or sets the product review identifier
/// </summary>
- public class ProductReviewHelpfulness : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the product review identifier
- /// </summary>
- public string ProductReviewId { get; set; }
-
- /// <summary>
- /// A value indicating whether a review a helpful
- /// </summary>
- public bool WasHelpful { get; set; }
+ public string ProductReviewId { get; set; }
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
+ /// <summary>
+ /// A value indicating whether a review a helpful
+ /// </summary>
+ public bool WasHelpful { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductSortingEnum.cs b/src/Core/Grand.Domain/Catalog/ProductSortingEnum.cs
index 732fc4748..63dea89c2 100644
--- a/src/Core/Grand.Domain/Catalog/ProductSortingEnum.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductSortingEnum.cs
@@ -1,49 +1,57 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents the product sorting
+/// </summary>
+public enum ProductSortingEnum
{
/// <summary>
- /// Represents the product sorting
- /// </summary>
- public enum ProductSortingEnum
- {
- /// <summary>
- /// Position (display order)
- /// </summary>
- Position = 0,
- /// <summary>
- /// Name: A to Z
- /// </summary>
- NameAsc = 5,
- /// <summary>
- /// Name: Z to A
- /// </summary>
- NameDesc = 6,
- /// <summary>
- /// Price: Low to High
- /// </summary>
- PriceAsc = 10,
- /// <summary>
- /// Price: High to Low
- /// </summary>
- PriceDesc = 11,
- /// <summary>
- /// Product creation date
- /// </summary>
- CreatedOn = 15,
- /// <summary>
- /// Product sold
- /// </summary>
- BestSellers = 20,
- /// <summary>
- /// Product most viewed
- /// </summary>
- MostViewed = 25,
- /// <summary>
- /// Product most on-sale
- /// </summary>
- OnSale = 30,
- /// <summary>
- /// Product rating
- /// </summary>
- Rating = 40
- }
+ /// Position (display order)
+ /// </summary>
+ Position = 0,
+
+ /// <summary>
+ /// Name: A to Z
+ /// </summary>
+ NameAsc = 5,
+
+ /// <summary>
+ /// Name: Z to A
+ /// </summary>
+ NameDesc = 6,
+
+ /// <summary>
+ /// Price: Low to High
+ /// </summary>
+ PriceAsc = 10,
+
+ /// <summary>
+ /// Price: High to Low
+ /// </summary>
+ PriceDesc = 11,
+
+ /// <summary>
+ /// Product creation date
+ /// </summary>
+ CreatedOn = 15,
+
+ /// <summary>
+ /// Product sold
+ /// </summary>
+ BestSellers = 20,
+
+ /// <summary>
+ /// Product most viewed
+ /// </summary>
+ MostViewed = 25,
+
+ /// <summary>
+ /// Product most on-sale
+ /// </summary>
+ OnSale = 30,
+
+ /// <summary>
+ /// Product rating
+ /// </summary>
+ Rating = 40
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductSpecificationAttribute.cs b/src/Core/Grand.Domain/Catalog/ProductSpecificationAttribute.cs
index 555ac4910..48fd273b6 100644
--- a/src/Core/Grand.Domain/Catalog/ProductSpecificationAttribute.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductSpecificationAttribute.cs
@@ -1,50 +1,47 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product specification attribute
+/// </summary>
+public class ProductSpecificationAttribute : SubBaseEntity
{
/// <summary>
- /// Represents a product specification attribute
- /// </summary>
- public class ProductSpecificationAttribute : SubBaseEntity
- {
-
- /// <summary>
- /// Gets or sets the attribute type ID
- /// </summary>
- public SpecificationAttributeType AttributeTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute Id
- /// </summary>
- public string SpecificationAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute identifier
- /// </summary>
- public string SpecificationAttributeOptionId { get; set; }
-
- /// <summary>
- /// Gets or sets the custom name
- /// </summary>
- public string CustomName { get; set; }
-
- /// <summary>
- /// Gets or sets the custom value
- /// </summary>
- public string CustomValue { get; set; }
-
- /// <summary>
- /// Gets or sets whether the attribute can be filtered by
- /// </summary>
- public bool AllowFiltering { get; set; }
-
- /// <summary>
- /// Gets or sets whether the attribute will be shown on the product page
- /// </summary>
- public bool ShowOnProductPage { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- }
-}
+ /// Gets or sets the attribute type ID
+ /// </summary>
+ public SpecificationAttributeType AttributeTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute Id
+ /// </summary>
+ public string SpecificationAttributeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute identifier
+ /// </summary>
+ public string SpecificationAttributeOptionId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom name
+ /// </summary>
+ public string CustomName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom value
+ /// </summary>
+ public string CustomValue { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether the attribute can be filtered by
+ /// </summary>
+ public bool AllowFiltering { get; set; }
+
+ /// <summary>
+ /// Gets or sets whether the attribute will be shown on the product page
+ /// </summary>
+ public bool ShowOnProductPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductTag.cs b/src/Core/Grand.Domain/Catalog/ProductTag.cs
index 2bf3a0193..291f1057a 100644
--- a/src/Core/Grand.Domain/Catalog/ProductTag.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductTag.cs
@@ -1,30 +1,29 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product tag
+/// </summary>
+public class ProductTag : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a product tag
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sename
/// </summary>
- public class ProductTag : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string SeName { get; set; }
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
+ /// <summary>
+ /// Gets or sets the count
+ /// </summary>
+ public int Count { get; set; }
- /// <summary>
- /// Gets or sets the count
- /// </summary>
- public int Count { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductType.cs b/src/Core/Grand.Domain/Catalog/ProductType.cs
index 8ee3813b2..d97525b15 100644
--- a/src/Core/Grand.Domain/Catalog/ProductType.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductType.cs
@@ -1,32 +1,32 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a product type
+/// </summary>
+public enum ProductType
{
/// <summary>
- /// Represents a product type
+ /// Simple
/// </summary>
- public enum ProductType
- {
- /// <summary>
- /// Simple
- /// </summary>
- SimpleProduct = 0,
- /// <summary>
- /// Grouped product
- /// </summary>
- GroupedProduct = 10,
+ SimpleProduct = 0,
- /// <summary>
- /// Reservation product
- /// </summary>
- Reservation = 20,
+ /// <summary>
+ /// Grouped product
+ /// </summary>
+ GroupedProduct = 10,
+
+ /// <summary>
+ /// Reservation product
+ /// </summary>
+ Reservation = 20,
- /// <summary>
- /// Bundled product
- /// </summary>
- BundledProduct = 30,
+ /// <summary>
+ /// Bundled product
+ /// </summary>
+ BundledProduct = 30,
- /// <summary>
- /// Auction product
- /// </summary>
- Auction = 40
- }
-}
+ /// <summary>
+ /// Auction product
+ /// </summary>
+ Auction = 40
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/ProductWarehouseInventory.cs b/src/Core/Grand.Domain/Catalog/ProductWarehouseInventory.cs
index 2ae28b151..42873db5f 100644
--- a/src/Core/Grand.Domain/Catalog/ProductWarehouseInventory.cs
+++ b/src/Core/Grand.Domain/Catalog/ProductWarehouseInventory.cs
@@ -1,24 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Manage product inventory per warehouse
+/// </summary>
+public class ProductWarehouseInventory : SubBaseEntity
{
/// <summary>
- /// Manage product inventory per warehouse
+ /// Gets or sets the warehouse identifier
/// </summary>
- public class ProductWarehouseInventory : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
-
- /// <summary>
- /// Gets or sets the stock quantity
- /// </summary>
- public int StockQuantity { get; set; }
+ public string WarehouseId { get; set; }
- /// <summary>
- /// Gets or sets the reserved quantity (ordered but not shipped yet)
- /// </summary>
- public int ReservedQuantity { get; set; }
+ /// <summary>
+ /// Gets or sets the stock quantity
+ /// </summary>
+ public int StockQuantity { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the reserved quantity (ordered but not shipped yet)
+ /// </summary>
+ public int ReservedQuantity { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/RecentlyViewedProduct.cs b/src/Core/Grand.Domain/Catalog/RecentlyViewedProduct.cs
index 332dd24a9..db1bf0e3e 100644
--- a/src/Core/Grand.Domain/Catalog/RecentlyViewedProduct.cs
+++ b/src/Core/Grand.Domain/Catalog/RecentlyViewedProduct.cs
@@ -1,8 +1,7 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public class RecentlyViewedProduct : BaseEntity
{
- public class RecentlyViewedProduct: BaseEntity
- {
- public string CustomerId { get; set; }
- public string ProductId { get; set; }
- }
-}
+ public string CustomerId { get; set; }
+ public string ProductId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/RecurringCyclePeriod.cs b/src/Core/Grand.Domain/Catalog/RecurringCyclePeriod.cs
index bcef08548..7c4524118 100644
--- a/src/Core/Grand.Domain/Catalog/RecurringCyclePeriod.cs
+++ b/src/Core/Grand.Domain/Catalog/RecurringCyclePeriod.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a recurring product cycle period
+/// </summary>
+public enum RecurringCyclePeriod
{
/// <summary>
- /// Represents a recurring product cycle period
+ /// Days
/// </summary>
- public enum RecurringCyclePeriod
- {
- /// <summary>
- /// Days
- /// </summary>
- Days = 0,
- /// <summary>
- /// Weeks
- /// </summary>
- Weeks = 10,
- /// <summary>
- /// Months
- /// </summary>
- Months = 20,
- /// <summary>
- /// Years
- /// </summary>
- Years = 30
- }
-}
+ Days = 0,
+
+ /// <summary>
+ /// Weeks
+ /// </summary>
+ Weeks = 10,
+
+ /// <summary>
+ /// Months
+ /// </summary>
+ Months = 20,
+
+ /// <summary>
+ /// Years
+ /// </summary>
+ Years = 30
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/RelatedProduct.cs b/src/Core/Grand.Domain/Catalog/RelatedProduct.cs
index c63de35ce..8e8dbf68f 100644
--- a/src/Core/Grand.Domain/Catalog/RelatedProduct.cs
+++ b/src/Core/Grand.Domain/Catalog/RelatedProduct.cs
@@ -1,18 +1,17 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a related product
+/// </summary>
+public class RelatedProduct : SubBaseEntity
{
/// <summary>
- /// Represents a related product
+ /// Gets or sets the second product identifier
/// </summary>
- public class RelatedProduct : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the second product identifier
- /// </summary>
- public string ProductId2 { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
+ public string ProductId2 { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/SimilarProduct.cs b/src/Core/Grand.Domain/Catalog/SimilarProduct.cs
index 9cc889ee8..492662342 100644
--- a/src/Core/Grand.Domain/Catalog/SimilarProduct.cs
+++ b/src/Core/Grand.Domain/Catalog/SimilarProduct.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a similar product
+/// </summary>
+public class SimilarProduct : SubBaseEntity
{
/// <summary>
- /// Represents a similar product
+ /// Gets or sets the first product identifier
/// </summary>
- public class SimilarProduct : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the first product identifier
- /// </summary>
- public string ProductId1 { get; set; }
+ public string ProductId1 { get; set; }
- /// <summary>
- /// Gets or sets the second product identifier
- /// </summary>
- public string ProductId2 { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the second product identifier
+ /// </summary>
+ public string ProductId2 { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/SpecificationAttribute.cs b/src/Core/Grand.Domain/Catalog/SpecificationAttribute.cs
index fc133f8a2..fb5b46e23 100644
--- a/src/Core/Grand.Domain/Catalog/SpecificationAttribute.cs
+++ b/src/Core/Grand.Domain/Catalog/SpecificationAttribute.cs
@@ -1,48 +1,47 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a specification attribute
+/// </summary>
+public class SpecificationAttribute : BaseEntity, IStoreLinkEntity, ITranslationEntity
{
+ private ICollection<SpecificationAttributeOption> _specificationAttributeOptions;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
/// <summary>
- /// Represents a specification attribute
+ /// Gets or sets the specification attribute options
/// </summary>
- public class SpecificationAttribute : BaseEntity, IStoreLinkEntity, ITranslationEntity
- {
- private ICollection<SpecificationAttributeOption> _specificationAttributeOptions;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the specification attribute options
- /// </summary>
- public virtual ICollection<SpecificationAttributeOption> SpecificationAttributeOptions
- {
- get => _specificationAttributeOptions ??= new List<SpecificationAttributeOption>();
- protected set => _specificationAttributeOptions = value;
- }
+ public virtual ICollection<SpecificationAttributeOption> SpecificationAttributeOptions {
+ get => _specificationAttributeOptions ??= new List<SpecificationAttributeOption>();
+ protected set => _specificationAttributeOptions = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/SpecificationAttributeOption.cs b/src/Core/Grand.Domain/Catalog/SpecificationAttributeOption.cs
index 6262760b5..736d1b77e 100644
--- a/src/Core/Grand.Domain/Catalog/SpecificationAttributeOption.cs
+++ b/src/Core/Grand.Domain/Catalog/SpecificationAttributeOption.cs
@@ -1,35 +1,34 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a specification attribute option
+/// </summary>
+public class SpecificationAttributeOption : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a specification attribute option
+ /// Gets or sets the name
/// </summary>
- public class SpecificationAttributeOption : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color RGB value (used when you want to display "Color squares" instead of text)
+ /// </summary>
+ public string ColorSquaresRgb { get; set; }
- /// <summary>
- /// Gets or sets the color RGB value (used when you want to display "Color squares" instead of text)
- /// </summary>
- public string ColorSquaresRgb { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/SpecificationAttributeOptionFilter.cs b/src/Core/Grand.Domain/Catalog/SpecificationAttributeOptionFilter.cs
index ffdc4c9fd..31523d25f 100644
--- a/src/Core/Grand.Domain/Catalog/SpecificationAttributeOptionFilter.cs
+++ b/src/Core/Grand.Domain/Catalog/SpecificationAttributeOptionFilter.cs
@@ -1,53 +1,52 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a specification attribute option filter
+/// </summary>
+public class SpecificationAttributeOptionFilter
{
/// <summary>
- /// Represents a specification attribute option filter
- /// </summary>
- public class SpecificationAttributeOptionFilter
- {
- /// <summary>
- /// Gets or sets the specification attribute identifier
- /// </summary>
- public string SpecificationAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute name
- /// </summary>
- public string SpecificationAttributeName { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute sename
- /// </summary>
- public string SpecificationAttributeSeName { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute option color (RGB)
- /// </summary>
- public string SpecificationAttributeOptionColorRgb { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute display order
- /// </summary>
- public int SpecificationAttributeDisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute option identifier
- /// </summary>
- public string SpecificationAttributeOptionId { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute option name
- /// </summary>
- public string SpecificationAttributeOptionName { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute option sename
- /// </summary>
- public string SpecificationAttributeOptionSeName { get; set; }
-
- /// <summary>
- /// Gets or sets the specification attribute option display order
- /// </summary>
- public int SpecificationAttributeOptionDisplayOrder { get; set; }
- }
-}
+ /// Gets or sets the specification attribute identifier
+ /// </summary>
+ public string SpecificationAttributeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute name
+ /// </summary>
+ public string SpecificationAttributeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute sename
+ /// </summary>
+ public string SpecificationAttributeSeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute option color (RGB)
+ /// </summary>
+ public string SpecificationAttributeOptionColorRgb { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute display order
+ /// </summary>
+ public int SpecificationAttributeDisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute option identifier
+ /// </summary>
+ public string SpecificationAttributeOptionId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute option name
+ /// </summary>
+ public string SpecificationAttributeOptionName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute option sename
+ /// </summary>
+ public string SpecificationAttributeOptionSeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the specification attribute option display order
+ /// </summary>
+ public int SpecificationAttributeOptionDisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/SpecificationAttributeType.cs b/src/Core/Grand.Domain/Catalog/SpecificationAttributeType.cs
index fb39597da..db582e8d4 100644
--- a/src/Core/Grand.Domain/Catalog/SpecificationAttributeType.cs
+++ b/src/Core/Grand.Domain/Catalog/SpecificationAttributeType.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a specification attribute type
+/// </summary>
+public enum SpecificationAttributeType
{
/// <summary>
- /// Represents a specification attribute type
+ /// Option
/// </summary>
- public enum SpecificationAttributeType
- {
- /// <summary>
- /// Option
- /// </summary>
- Option = 0,
- /// <summary>
- /// Custom text
- /// </summary>
- CustomText = 10,
- /// <summary>
- /// Custom HTML text
- /// </summary>
- CustomHtmlText = 20,
- /// <summary>
- /// Hyperlink
- /// </summary>
- Hyperlink = 30
- }
+ Option = 0,
+
+ /// <summary>
+ /// Custom text
+ /// </summary>
+ CustomText = 10,
+
+ /// <summary>
+ /// Custom HTML text
+ /// </summary>
+ CustomHtmlText = 20,
+
+ /// <summary>
+ /// Hyperlink
+ /// </summary>
+ Hyperlink = 30
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/TierPrice.cs b/src/Core/Grand.Domain/Catalog/TierPrice.cs
index ea529d79a..4dde02807 100644
--- a/src/Core/Grand.Domain/Catalog/TierPrice.cs
+++ b/src/Core/Grand.Domain/Catalog/TierPrice.cs
@@ -1,43 +1,42 @@
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+/// <summary>
+/// Represents a tier price
+/// </summary>
+public class TierPrice : SubBaseEntity
{
/// <summary>
- /// Represents a tier price
+ /// Gets or sets the store identifier (0 - all stores)
/// </summary>
- public class TierPrice : SubBaseEntity
- {
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the store identifier (0 - all stores)
- /// </summary>
- public string StoreId { get; set; }
+ /// <summary>
+ /// Gets or sets the customer group identifier
+ /// </summary>
+ public string CustomerGroupId { get; set; }
- /// <summary>
- /// Gets or sets the customer group identifier
- /// </summary>
- public string CustomerGroupId { get; set; }
+ /// <summary>
+ /// Gets or sets the currency code
+ /// </summary>
+ public string CurrencyCode { get; set; }
- /// <summary>
- /// Gets or sets the currency code
- /// </summary>
- public string CurrencyCode { get; set; }
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
+ /// <summary>
+ /// Gets or sets the price
+ /// </summary>
+ public double Price { get; set; }
- /// <summary>
- /// Gets or sets the price
- /// </summary>
- public double Price { get; set; }
- /// <summary>
- /// Gets or sets the start date and time of the special price
- /// </summary>
- public DateTime? StartDateTimeUtc { get; set; }
- /// <summary>
- /// Gets or sets the end date and time of the special price
- /// </summary>
- public DateTime? EndDateTimeUtc { get; set; }
+ /// <summary>
+ /// Gets or sets the start date and time of the special price
+ /// </summary>
+ public DateTime? StartDateTimeUtc { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the end date and time of the special price
+ /// </summary>
+ public DateTime? EndDateTimeUtc { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Catalog/TierPriceExtensions.cs b/src/Core/Grand.Domain/Catalog/TierPriceExtensions.cs
index d718bc15a..31a7b531a 100644
--- a/src/Core/Grand.Domain/Catalog/TierPriceExtensions.cs
+++ b/src/Core/Grand.Domain/Catalog/TierPriceExtensions.cs
@@ -1,80 +1,80 @@
using Grand.Domain.Customers;
-namespace Grand.Domain.Catalog
+namespace Grand.Domain.Catalog;
+
+public static class TierPriceExtensions
{
- public static class TierPriceExtensions
+ /// <summary>
+ /// Filter tier prices by date range
+ /// </summary>
+ /// <param name="source">Tier prices</param>
+ /// <param name="date">Date in UTC; use null to filter by current</param>
+ /// <returns>Tier prices</returns>
+ public static IEnumerable<TierPrice> FilterByDate(this IEnumerable<TierPrice> source, DateTime? date = null)
{
- /// <summary>
- /// Filter tier prices by date range
- /// </summary>
- /// <param name="source">Tier prices</param>
- /// <param name="date">Date in UTC; use null to filter by current</param>
- /// <returns>Tier prices</returns>
- public static IEnumerable<TierPrice> FilterByDate(this IEnumerable<TierPrice> source, DateTime? date = null)
- {
- ArgumentNullException.ThrowIfNull(source);
-
- date ??= DateTime.UtcNow;
+ ArgumentNullException.ThrowIfNull(source);
- return source.Where(tierPrice =>
- (!tierPrice.StartDateTimeUtc.HasValue || tierPrice.StartDateTimeUtc.Value < date.Value) &&
- (!tierPrice.EndDateTimeUtc.HasValue || tierPrice.EndDateTimeUtc.Value > date.Value));
- }
- /// <summary>
- /// Filter tier prices by specified store
- /// </summary>
- /// <param name="source">Tier prices</param>
- /// <param name="storeId">Store id</param>
- /// <returns>Tier prices</returns>
- public static IEnumerable<TierPrice> FilterByStore(this IEnumerable<TierPrice> source, string storeId)
- {
- ArgumentNullException.ThrowIfNull(source);
+ date ??= DateTime.UtcNow;
- return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.StoreId) || tierPrice.StoreId == storeId);
- }
+ return source.Where(tierPrice =>
+ (!tierPrice.StartDateTimeUtc.HasValue || tierPrice.StartDateTimeUtc.Value < date.Value) &&
+ (!tierPrice.EndDateTimeUtc.HasValue || tierPrice.EndDateTimeUtc.Value > date.Value));
+ }
- /// <summary>
- /// Filter tier prices for specified customer
- /// </summary>
- /// <param name="source">Tier prices</param>
- /// <param name="customer">Customer</param>
- /// <returns>Tier prices</returns>
- public static IEnumerable<TierPrice> FilterForCustomer(this IEnumerable<TierPrice> source, Customer customer)
- {
- ArgumentNullException.ThrowIfNull(source);
+ /// <summary>
+ /// Filter tier prices by specified store
+ /// </summary>
+ /// <param name="source">Tier prices</param>
+ /// <param name="storeId">Store id</param>
+ /// <returns>Tier prices</returns>
+ public static IEnumerable<TierPrice> FilterByStore(this IEnumerable<TierPrice> source, string storeId)
+ {
+ ArgumentNullException.ThrowIfNull(source);
- if (customer == null)
- return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.CustomerGroupId));
+ return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.StoreId) || tierPrice.StoreId == storeId);
+ }
- return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.CustomerGroupId) ||
- customer.Groups.Contains(tierPrice.CustomerGroupId));
- }
+ /// <summary>
+ /// Filter tier prices for specified customer
+ /// </summary>
+ /// <param name="source">Tier prices</param>
+ /// <param name="customer">Customer</param>
+ /// <returns>Tier prices</returns>
+ public static IEnumerable<TierPrice> FilterForCustomer(this IEnumerable<TierPrice> source, Customer customer)
+ {
+ ArgumentNullException.ThrowIfNull(source);
- /// <summary>
- /// Filter tier prices by specified currency
- /// </summary>
- /// <param name="source">Tier prices</param>
- /// <param name="currencyCode">currencyCode</param>
- /// <returns>Tier prices</returns>
- public static IEnumerable<TierPrice> FilterByCurrency(this IEnumerable<TierPrice> source, string currencyCode)
- {
- ArgumentNullException.ThrowIfNull(source);
+ if (customer == null)
+ return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.CustomerGroupId));
- return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.CurrencyCode) || tierPrice.CurrencyCode == currencyCode);
- }
+ return source.Where(tierPrice => string.IsNullOrEmpty(tierPrice.CustomerGroupId) ||
+ customer.Groups.Contains(tierPrice.CustomerGroupId));
+ }
- /// <summary>
- /// Remove duplicated quantities if exists
- /// </summary>
- /// <param name="source">Tier prices</param>
- /// <returns>Tier prices</returns>
- public static IEnumerable<TierPrice> RemoveDuplicatedQuantities(this IEnumerable<TierPrice> source)
- {
- ArgumentNullException.ThrowIfNull(source);
- var result = source.OrderBy(x => x.Price).GroupBy(x => x.Quantity).Select(x => x.First()).OrderBy(x => x.Quantity).ToList();
- return result;
- }
+ /// <summary>
+ /// Filter tier prices by specified currency
+ /// </summary>
+ /// <param name="source">Tier prices</param>
+ /// <param name="currencyCode">currencyCode</param>
+ /// <returns>Tier prices</returns>
+ public static IEnumerable<TierPrice> FilterByCurrency(this IEnumerable<TierPrice> source, string currencyCode)
+ {
+ ArgumentNullException.ThrowIfNull(source);
+ return source.Where(tierPrice =>
+ string.IsNullOrEmpty(tierPrice.CurrencyCode) || tierPrice.CurrencyCode == currencyCode);
+ }
+ /// <summary>
+ /// Remove duplicated quantities if exists
+ /// </summary>
+ /// <param name="source">Tier prices</param>
+ /// <returns>Tier prices</returns>
+ public static IEnumerable<TierPrice> RemoveDuplicatedQuantities(this IEnumerable<TierPrice> source)
+ {
+ ArgumentNullException.ThrowIfNull(source);
+ var result = source.OrderBy(x => x.Price).GroupBy(x => x.Quantity).Select(x => x.First())
+ .OrderBy(x => x.Quantity).ToList();
+ return result;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Cms/WidgetSettings.cs b/src/Core/Grand.Domain/Cms/WidgetSettings.cs
index c05cb46a3..eb9fc52ef 100644
--- a/src/Core/Grand.Domain/Cms/WidgetSettings.cs
+++ b/src/Core/Grand.Domain/Cms/WidgetSettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Cms
+namespace Grand.Domain.Cms;
+
+public class WidgetSettings : ISettings
{
- public class WidgetSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a system names of active widgets
- /// </summary>
- public List<string> ActiveWidgetSystemNames { get; set; } = new();
- }
+ /// <summary>
+ /// Gets or sets a system names of active widgets
+ /// </summary>
+ public List<string> ActiveWidgetSystemNames { get; set; } = new();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/Address.cs b/src/Core/Grand.Domain/Common/Address.cs
index e9031da17..585288d1f 100644
--- a/src/Core/Grand.Domain/Common/Address.cs
+++ b/src/Core/Grand.Domain/Common/Address.cs
@@ -1,91 +1,89 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class Address : SubBaseEntity
{
- public class Address : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the name of address
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the first name
- /// </summary>
- public string FirstName { get; set; }
-
- /// <summary>
- /// Gets or sets the last name
- /// </summary>
- public string LastName { get; set; }
-
- /// <summary>
- /// Gets or sets the email
- /// </summary>
- public string Email { get; set; }
-
- /// <summary>
- /// Gets or sets the company
- /// </summary>
- public string Company { get; set; }
-
- /// <summary>
- /// Gets or sets the vat numer
- /// </summary>
- public string VatNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the country identifier
- /// </summary>
- public string CountryId { get; set; }
-
- /// <summary>
- /// Gets or sets the state/province identifier
- /// </summary>
- public string StateProvinceId { get; set; }
-
- /// <summary>
- /// Gets or sets the city
- /// </summary>
- public string City { get; set; }
-
- /// <summary>
- /// Gets or sets the address 1
- /// </summary>
- public string Address1 { get; set; }
-
- /// <summary>
- /// Gets or sets the address 2
- /// </summary>
- public string Address2 { get; set; }
-
- /// <summary>
- /// Gets or sets the zip/postal code
- /// </summary>
- public string ZipPostalCode { get; set; }
-
- /// <summary>
- /// Gets or sets the phone number
- /// </summary>
- public string PhoneNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the fax number
- /// </summary>
- public string FaxNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the note
- /// </summary>
- public string Note { get; set; }
-
- /// <summary>
- /// Gets or sets the custom attributes (see "AddressAttribute" entity for more info)
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets the address type
- /// </summary>
- public AddressType AddressType { get; set; }
-
- }
-}
+ /// <summary>
+ /// Gets or sets the name of address
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the first name
+ /// </summary>
+ public string FirstName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the last name
+ /// </summary>
+ public string LastName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the email
+ /// </summary>
+ public string Email { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company
+ /// </summary>
+ public string Company { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vat numer
+ /// </summary>
+ public string VatNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the country identifier
+ /// </summary>
+ public string CountryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the state/province identifier
+ /// </summary>
+ public string StateProvinceId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the city
+ /// </summary>
+ public string City { get; set; }
+
+ /// <summary>
+ /// Gets or sets the address 1
+ /// </summary>
+ public string Address1 { get; set; }
+
+ /// <summary>
+ /// Gets or sets the address 2
+ /// </summary>
+ public string Address2 { get; set; }
+
+ /// <summary>
+ /// Gets or sets the zip/postal code
+ /// </summary>
+ public string ZipPostalCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the phone number
+ /// </summary>
+ public string PhoneNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the fax number
+ /// </summary>
+ public string FaxNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the note
+ /// </summary>
+ public string Note { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom attributes (see "AddressAttribute" entity for more info)
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets or sets the address type
+ /// </summary>
+ public AddressType AddressType { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AddressAttribute.cs b/src/Core/Grand.Domain/Common/AddressAttribute.cs
index 2f493d8b6..dddafe4e8 100644
--- a/src/Core/Grand.Domain/Common/AddressAttribute.cs
+++ b/src/Core/Grand.Domain/Common/AddressAttribute.cs
@@ -1,57 +1,54 @@
using Grand.Domain.Catalog;
using Grand.Domain.Localization;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+/// <summary>
+/// Represents an address attribute
+/// </summary>
+public class AddressAttribute : BaseEntity, ITranslationEntity
{
+ private ICollection<AddressAttributeValue> _addressAttributeValues;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the attribute is required
+ /// </summary>
+ public bool IsRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attribute control type identifier
+ /// </summary>
+ public int AttributeControlTypeId { get; set; }
+
/// <summary>
- /// Represents an address attribute
+ /// Gets or sets the display order
/// </summary>
- public class AddressAttribute : BaseEntity, ITranslationEntity
- {
- private ICollection<AddressAttributeValue> _addressAttributeValues;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the attribute is required
- /// </summary>
- public bool IsRequired { get; set; }
-
- /// <summary>
- /// Gets or sets the attribute control type identifier
- /// </summary>
- public int AttributeControlTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets the attribute control type
- /// </summary>
- public AttributeControlType AttributeControlType
- {
- get => (AttributeControlType)AttributeControlTypeId;
- set => AttributeControlTypeId = (int)value;
- }
- /// <summary>
- /// Gets the address attribute values
- /// </summary>
- public virtual ICollection<AddressAttributeValue> AddressAttributeValues
- {
- get => _addressAttributeValues ??= new List<AddressAttributeValue>();
- protected set => _addressAttributeValues = value;
- }
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets the attribute control type
+ /// </summary>
+ public AttributeControlType AttributeControlType {
+ get => (AttributeControlType)AttributeControlTypeId;
+ set => AttributeControlTypeId = (int)value;
+ }
+
+ /// <summary>
+ /// Gets the address attribute values
+ /// </summary>
+ public virtual ICollection<AddressAttributeValue> AddressAttributeValues {
+ get => _addressAttributeValues ??= new List<AddressAttributeValue>();
+ protected set => _addressAttributeValues = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AddressAttributeExtensions.cs b/src/Core/Grand.Domain/Common/AddressAttributeExtensions.cs
index 203b1b275..1df608f96 100644
--- a/src/Core/Grand.Domain/Common/AddressAttributeExtensions.cs
+++ b/src/Core/Grand.Domain/Common/AddressAttributeExtensions.cs
@@ -1,30 +1,29 @@
using Grand.Domain.Catalog;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+/// <summary>
+/// Extensions
+/// </summary>
+public static class AddressAttributeExtensions
{
/// <summary>
- /// Extensions
+ /// A value indicating whether this address attribute should have values
/// </summary>
- public static class AddressAttributeExtensions
+ /// <param name="addressAttribute">Address attribute</param>
+ /// <returns>Result</returns>
+ public static bool ShouldHaveValues(this AddressAttribute addressAttribute)
{
- /// <summary>
- /// A value indicating whether this address attribute should have values
- /// </summary>
- /// <param name="addressAttribute">Address attribute</param>
- /// <returns>Result</returns>
- public static bool ShouldHaveValues(this AddressAttribute addressAttribute)
- {
- if (addressAttribute == null)
- return false;
+ if (addressAttribute == null)
+ return false;
- if (addressAttribute.AttributeControlType == AttributeControlType.TextBox ||
- addressAttribute.AttributeControlType == AttributeControlType.MultilineTextbox ||
- addressAttribute.AttributeControlType == AttributeControlType.Datepicker ||
- addressAttribute.AttributeControlType == AttributeControlType.FileUpload)
- return false;
+ if (addressAttribute.AttributeControlType == AttributeControlType.TextBox ||
+ addressAttribute.AttributeControlType == AttributeControlType.MultilineTextbox ||
+ addressAttribute.AttributeControlType == AttributeControlType.Datepicker ||
+ addressAttribute.AttributeControlType == AttributeControlType.FileUpload)
+ return false;
- //other attribute controle types support values
- return true;
- }
+ //other attribute controle types support values
+ return true;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AddressAttributeValue.cs b/src/Core/Grand.Domain/Common/AddressAttributeValue.cs
index 35846098d..228485eb2 100644
--- a/src/Core/Grand.Domain/Common/AddressAttributeValue.cs
+++ b/src/Core/Grand.Domain/Common/AddressAttributeValue.cs
@@ -1,37 +1,35 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+/// <summary>
+/// Represents an address attribute value
+/// </summary>
+public class AddressAttributeValue : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents an address attribute value
+ /// Gets or sets the address attribute identifier
/// </summary>
- public class AddressAttributeValue : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the address attribute identifier
- /// </summary>
- public string AddressAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets the checkout attribute name
- /// </summary>
- public string Name { get; set; }
+ public string AddressAttributeId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the value is pre-selected
- /// </summary>
- public bool IsPreSelected { get; set; }
+ /// <summary>
+ /// Gets or sets the checkout attribute name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the value is pre-selected
+ /// </summary>
+ public bool IsPreSelected { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AddressExtensions.cs b/src/Core/Grand.Domain/Common/AddressExtensions.cs
index e8b0fcf94..0d0093d35 100644
--- a/src/Core/Grand.Domain/Common/AddressExtensions.cs
+++ b/src/Core/Grand.Domain/Common/AddressExtensions.cs
@@ -1,43 +1,45 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public static class AddressExtensions
{
- public static class AddressExtensions
+ /// <summary>
+ /// Find an address
+ /// </summary>
+ /// <param name="source">Source</param>
+ /// <param name="firstName">First name</param>
+ /// <param name="lastName">Last name</param>
+ /// <param name="phoneNumber">Phone number</param>
+ /// <param name="email">Email</param>
+ /// <param name="faxNumber">Fax number</param>
+ /// <param name="company">Company</param>
+ /// <param name="address1">Address 1</param>
+ /// <param name="address2">Address 2</param>
+ /// <param name="city">City</param>
+ /// <param name="stateProvinceId">State/province identifier</param>
+ /// <param name="zipPostalCode">Zip postal code</param>
+ /// <param name="countryId">Country identifier</param>
+ /// <returns>Address</returns>
+ public static Address FindAddress(this List<Address> source,
+ string firstName, string lastName, string phoneNumber,
+ string email, string faxNumber, string company, string address1,
+ string address2, string city, string stateProvinceId,
+ string zipPostalCode, string countryId)
{
- /// <summary>
- /// Find an address
- /// </summary>
- /// <param name="source">Source</param>
- /// <param name="firstName">First name</param>
- /// <param name="lastName">Last name</param>
- /// <param name="phoneNumber">Phone number</param>
- /// <param name="email">Email</param>
- /// <param name="faxNumber">Fax number</param>
- /// <param name="company">Company</param>
- /// <param name="address1">Address 1</param>
- /// <param name="address2">Address 2</param>
- /// <param name="city">City</param>
- /// <param name="stateProvinceId">State/province identifier</param>
- /// <param name="zipPostalCode">Zip postal code</param>
- /// <param name="countryId">Country identifier</param>
- /// <returns>Address</returns>
- public static Address FindAddress(this List<Address> source,
- string firstName, string lastName, string phoneNumber,
- string email, string faxNumber, string company, string address1,
- string address2, string city, string stateProvinceId,
- string zipPostalCode, string countryId)
- {
- return source.Find(a => ((string.IsNullOrEmpty(a.FirstName) && string.IsNullOrEmpty(firstName)) || a.FirstName == firstName) &&
- ((string.IsNullOrEmpty(a.LastName) && string.IsNullOrEmpty(lastName)) || a.LastName == lastName) &&
- ((string.IsNullOrEmpty(a.PhoneNumber) && string.IsNullOrEmpty(phoneNumber)) || a.PhoneNumber == phoneNumber) &&
- ((string.IsNullOrEmpty(a.Email) && string.IsNullOrEmpty(email)) || a.Email == email) &&
- ((string.IsNullOrEmpty(a.FaxNumber) && string.IsNullOrEmpty(faxNumber)) || a.FaxNumber == faxNumber) &&
- ((string.IsNullOrEmpty(a.Company) && string.IsNullOrEmpty(company)) || a.Company == company) &&
- ((string.IsNullOrEmpty(a.Address1) && string.IsNullOrEmpty(address1)) || a.Address1 == address1) &&
- ((string.IsNullOrEmpty(a.Address2) && string.IsNullOrEmpty(address2)) || a.Address2 == address2) &&
- ((string.IsNullOrEmpty(a.City) && string.IsNullOrEmpty(city)) || a.City == city) &&
- ((string.IsNullOrEmpty(a.StateProvinceId) && string.IsNullOrEmpty(stateProvinceId)) || a.StateProvinceId == stateProvinceId) &&
- ((string.IsNullOrEmpty(a.ZipPostalCode) && string.IsNullOrEmpty(zipPostalCode)) || a.ZipPostalCode == zipPostalCode) &&
- ((string.IsNullOrEmpty(a.CountryId) && string.IsNullOrEmpty(countryId)) || a.CountryId == countryId));
- }
-
+ return source.Find(a =>
+ ((string.IsNullOrEmpty(a.FirstName) && string.IsNullOrEmpty(firstName)) || a.FirstName == firstName) &&
+ ((string.IsNullOrEmpty(a.LastName) && string.IsNullOrEmpty(lastName)) || a.LastName == lastName) &&
+ ((string.IsNullOrEmpty(a.PhoneNumber) && string.IsNullOrEmpty(phoneNumber)) ||
+ a.PhoneNumber == phoneNumber) &&
+ ((string.IsNullOrEmpty(a.Email) && string.IsNullOrEmpty(email)) || a.Email == email) &&
+ ((string.IsNullOrEmpty(a.FaxNumber) && string.IsNullOrEmpty(faxNumber)) || a.FaxNumber == faxNumber) &&
+ ((string.IsNullOrEmpty(a.Company) && string.IsNullOrEmpty(company)) || a.Company == company) &&
+ ((string.IsNullOrEmpty(a.Address1) && string.IsNullOrEmpty(address1)) || a.Address1 == address1) &&
+ ((string.IsNullOrEmpty(a.Address2) && string.IsNullOrEmpty(address2)) || a.Address2 == address2) &&
+ ((string.IsNullOrEmpty(a.City) && string.IsNullOrEmpty(city)) || a.City == city) &&
+ ((string.IsNullOrEmpty(a.StateProvinceId) && string.IsNullOrEmpty(stateProvinceId)) ||
+ a.StateProvinceId == stateProvinceId) &&
+ ((string.IsNullOrEmpty(a.ZipPostalCode) && string.IsNullOrEmpty(zipPostalCode)) ||
+ a.ZipPostalCode == zipPostalCode) &&
+ ((string.IsNullOrEmpty(a.CountryId) && string.IsNullOrEmpty(countryId)) || a.CountryId == countryId));
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AddressSettings.cs b/src/Core/Grand.Domain/Common/AddressSettings.cs
index 93580d960..bcbf9254b 100644
--- a/src/Core/Grand.Domain/Common/AddressSettings.cs
+++ b/src/Core/Grand.Domain/Common/AddressSettings.cs
@@ -1,108 +1,116 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class AddressSettings : ISettings
{
- public class AddressSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether 'Name' is enabled
- /// </summary>
- public bool NameEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Company' is enabled
- /// </summary>
- public bool CompanyEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Company' is required
- /// </summary>
- public bool CompanyRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Vat number' is enabled
- /// </summary>
- public bool VatNumberEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Vat number' is required
- /// </summary>
- public bool VatNumberRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address' is enabled
- /// </summary>
- public bool StreetAddressEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address' is required
- /// </summary>
- public bool StreetAddressRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address 2' is enabled
- /// </summary>
- public bool StreetAddress2Enabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address 2' is required
- /// </summary>
- public bool StreetAddress2Required { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Zip / postal code' is enabled
- /// </summary>
- public bool ZipPostalCodeEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Zip / postal code' is required
- /// </summary>
- public bool ZipPostalCodeRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'City' is enabled
- /// </summary>
- public bool CityEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'City' is required
- /// </summary>
- public bool CityRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Country' is enabled
- /// </summary>
- public bool CountryEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'State / province' is enabled
- /// </summary>
- public bool StateProvinceEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Phone number' is enabled
- /// </summary>
- public bool PhoneEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Phone number' is required
- /// </summary>
- public bool PhoneRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Fax number' is enabled
- /// </summary>
- public bool FaxEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Fax number' is required
- /// </summary>
- public bool FaxRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Note' is enabled
- /// </summary>
- public bool NoteEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'AddressType' is enabled
- /// </summary>
- public bool AddressTypeEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether users are allowed to change their email on the address
- /// </summary>
- public bool DisallowUsersToChangeEmail { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Name' is enabled
+ /// </summary>
+ public bool NameEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Company' is enabled
+ /// </summary>
+ public bool CompanyEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Company' is required
+ /// </summary>
+ public bool CompanyRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Vat number' is enabled
+ /// </summary>
+ public bool VatNumberEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Vat number' is required
+ /// </summary>
+ public bool VatNumberRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address' is enabled
+ /// </summary>
+ public bool StreetAddressEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address' is required
+ /// </summary>
+ public bool StreetAddressRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address 2' is enabled
+ /// </summary>
+ public bool StreetAddress2Enabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address 2' is required
+ /// </summary>
+ public bool StreetAddress2Required { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Zip / postal code' is enabled
+ /// </summary>
+ public bool ZipPostalCodeEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Zip / postal code' is required
+ /// </summary>
+ public bool ZipPostalCodeRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'City' is enabled
+ /// </summary>
+ public bool CityEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'City' is required
+ /// </summary>
+ public bool CityRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Country' is enabled
+ /// </summary>
+ public bool CountryEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'State / province' is enabled
+ /// </summary>
+ public bool StateProvinceEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Phone number' is enabled
+ /// </summary>
+ public bool PhoneEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Phone number' is required
+ /// </summary>
+ public bool PhoneRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Fax number' is enabled
+ /// </summary>
+ public bool FaxEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Fax number' is required
+ /// </summary>
+ public bool FaxRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Note' is enabled
+ /// </summary>
+ public bool NoteEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'AddressType' is enabled
+ /// </summary>
+ public bool AddressTypeEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users are allowed to change their email on the address
+ /// </summary>
+ public bool DisallowUsersToChangeEmail { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AddressType.cs b/src/Core/Grand.Domain/Common/AddressType.cs
index da08d224b..69c315d7e 100644
--- a/src/Core/Grand.Domain/Common/AddressType.cs
+++ b/src/Core/Grand.Domain/Common/AddressType.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public enum AddressType
{
- public enum AddressType
- {
- Any = 0,
- Billing = 1,
- Shipping = 2
- }
-}
+ Any = 0,
+ Billing = 1,
+ Shipping = 2
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/AdminAreaSettings.cs b/src/Core/Grand.Domain/Common/AdminAreaSettings.cs
index 6d2943844..eadd4d528 100644
--- a/src/Core/Grand.Domain/Common/AdminAreaSettings.cs
+++ b/src/Core/Grand.Domain/Common/AdminAreaSettings.cs
@@ -1,26 +1,27 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class AdminAreaSettings : ISettings
{
- public class AdminAreaSettings : ISettings
- {
- /// <summary>
- /// Default grid page size
- /// </summary>
- public int DefaultGridPageSize { get; set; }
- /// <summary>
- /// A comma-separated list of available grid page sizes
- /// </summary>
- public string GridPageSizes { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to use IsoDateTimeConverter in Json results (used for avoiding issue with dates in KendoUI grids)
- /// </summary>
- public bool UseIsoDateTimeConverterInJson { get; set; }
+ /// <summary>
+ /// Default grid page size
+ /// </summary>
+ public int DefaultGridPageSize { get; set; }
+
+ /// <summary>
+ /// A comma-separated list of available grid page sizes
+ /// </summary>
+ public string GridPageSizes { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to hide column Store in a grid list
- /// </summary>
- public bool HideStoreColumn { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to use IsoDateTimeConverter in Json results (used for avoiding issue with
+ /// dates in KendoUI grids)
+ /// </summary>
+ public bool UseIsoDateTimeConverterInJson { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide column Store in a grid list
+ /// </summary>
+ public bool HideStoreColumn { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/CommonSettings.cs b/src/Core/Grand.Domain/Common/CommonSettings.cs
index a0286b386..1ba09927e 100644
--- a/src/Core/Grand.Domain/Common/CommonSettings.cs
+++ b/src/Core/Grand.Domain/Common/CommonSettings.cs
@@ -1,49 +1,47 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class CommonSettings : ISettings
{
- public class CommonSettings : ISettings
- {
- public bool StoreInDatabaseContactUsForm { get; set; }
- public bool SubjectFieldOnContactUsForm { get; set; }
- public bool UseSystemEmailForContactUsForm { get; set; }
-
- public bool SitemapEnabled { get; set; }
- public bool SitemapIncludeCategories { get; set; }
- public bool SitemapIncludeBrands { get; set; }
- public bool SitemapIncludeProducts { get; set; }
- public bool SitemapIncludeImage { get; set; }
-
- /// <summary>
- /// A list of custom URLs to be added to sitemap.xml (include page names only)
- /// </summary>
- public List<string> SitemapCustomUrls { get; set; } = new();
-
- /// <summary>
- /// Gets or sets a ignore words (phrases) to be ignored when logging errors/messages
- /// </summary>
- public List<string> IgnoreLogWordlist { get; set; } = new();
-
- /// <summary>
- /// Gets or sets a value indicating whether "accept terms of service" links should be open in popup window. If disabled, then they'll be open on a new page.
- /// </summary>
- public bool PopupForTermsOfServiceLinks { get; set; }
-
- /// <summary>
- /// Gets or sets to allow user to select store
- /// </summary>
- public bool AllowToSelectStore { get; set; }
-
- /// <summary>
- /// Gets or sets to edit product where auction ended
- /// </summary>
- public bool AllowEditProductEndedAuction { get; set; }
-
- /// <summary>
- /// Gets or sets - allow user to read "let's encrypted file"
- /// </summary>
- public bool AllowToReadLetsEncryptFile { get; set; }
-
-
- }
+ public bool StoreInDatabaseContactUsForm { get; set; }
+ public bool SubjectFieldOnContactUsForm { get; set; }
+ public bool UseSystemEmailForContactUsForm { get; set; }
+
+ public bool SitemapEnabled { get; set; }
+ public bool SitemapIncludeCategories { get; set; }
+ public bool SitemapIncludeBrands { get; set; }
+ public bool SitemapIncludeProducts { get; set; }
+ public bool SitemapIncludeImage { get; set; }
+
+ /// <summary>
+ /// A list of custom URLs to be added to sitemap.xml (include page names only)
+ /// </summary>
+ public List<string> SitemapCustomUrls { get; set; } = new();
+
+ /// <summary>
+ /// Gets or sets a ignore words (phrases) to be ignored when logging errors/messages
+ /// </summary>
+ public List<string> IgnoreLogWordlist { get; set; } = new();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "accept terms of service" links should be open in popup window. If
+ /// disabled, then they'll be open on a new page.
+ /// </summary>
+ public bool PopupForTermsOfServiceLinks { get; set; }
+
+ /// <summary>
+ /// Gets or sets to allow user to select store
+ /// </summary>
+ public bool AllowToSelectStore { get; set; }
+
+ /// <summary>
+ /// Gets or sets to edit product where auction ended
+ /// </summary>
+ public bool AllowEditProductEndedAuction { get; set; }
+
+ /// <summary>
+ /// Gets or sets - allow user to read "let's encrypted file"
+ /// </summary>
+ public bool AllowToReadLetsEncryptFile { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/CustomAttribute.cs b/src/Core/Grand.Domain/Common/CustomAttribute.cs
index c99bf0094..82a0adda2 100644
--- a/src/Core/Grand.Domain/Common/CustomAttribute.cs
+++ b/src/Core/Grand.Domain/Common/CustomAttribute.cs
@@ -1,8 +1,7 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class CustomAttribute
{
- public class CustomAttribute
- {
- public string Key { get; set; }
- public string Value { get; set; }
- }
-}
+ public string Key { get; set; }
+ public string Value { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/DisplayOrderHomePage.cs b/src/Core/Grand.Domain/Common/DisplayOrderHomePage.cs
index 7f19c31a4..3ad96aaec 100644
--- a/src/Core/Grand.Domain/Common/DisplayOrderHomePage.cs
+++ b/src/Core/Grand.Domain/Common/DisplayOrderHomePage.cs
@@ -1,132 +1,130 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class DisplayOrderHomePage : ISettings
{
- public class DisplayOrderHomePage : ISettings
- {
- //Home page categories
- public int HomePageCategories { get; set; }
- public int Pc_Xl { get; set; } = 4; //default 4
- public int Pc_Lg { get; set; } = 4; //default 4
- public int Pc_Md { get; set; } = 6; //default 6
- public int Pc_Sm { get; set; } = 6; //default 6
- public int Pc_Col { get; set; } = 12; //default 12
-
- //Personalized products
- public int PersonalizedProducts { get; set; }
- public int Pp_Xl { get; set; } = 3; //default 3
- public int Pp_Lg { get; set; } = 4; //default 4
- public int Pp_Md { get; set; } = 4; //default 4
- public int Pp_Sm { get; set; } = 6; //default 6
- public int Pp_Col { get; set; } = 6; //default 6
-
- //Recommended products
- public int RecommendedProducts { get; set; }
- public int Rp_Xl { get; set; } = 3; //default 3
- public int Rp_Lg { get; set; } = 4; //default 4
- public int Rp_Md { get; set; } = 4; //default 4
- public int Rp_Sm { get; set; } = 6; //default 6
- public int Rp_Col { get; set; } = 6; //default 6
-
- //Suggested products
- public int SuggestedProducts { get; set; }
- public int Sp_Xl { get; set; } = 3; //default 3
- public int Sp_Lg { get; set; } = 4; //default 4
- public int Sp_Md { get; set; } = 4; //default 4
- public int Sp_Sm { get; set; } = 6; //default 6
- public int Sp_Col { get; set; } = 6; //default 6
-
- //Home page products
- public int HomePageProducts { get; set; }
- public int Hp_Xl { get; set; } = 3; //default 3
- public int Hp_Lg { get; set; } = 4; //default 4
- public int Hp_Md { get; set; } = 4; //default 4
- public int Hp_Sm { get; set; } = 6; //default 6
- public int Hp_Col { get; set; } = 6; //default 6
-
- //Home page new products
- public int HomePageNewProducts { get; set; }
- public int Np_Xl { get; set; } = 3; //default 3
- public int Np_Lg { get; set; } = 4; //default 4
- public int Np_Md { get; set; } = 4; //default 4
- public int Np_Sm { get; set; } = 6; //default 6
- public int Np_Col { get; set; } = 6; //default 6
-
- //Category featured products
- public int CategoryFeaturedProducts { get; set; }
- public int CF_c_Xl { get; set; } = 4; //default 4
- public int CF_c_Lg { get; set; } = 4; //default 4
- public int CF_c_Md { get; set; } = 6; //default 6
- public int CF_c_Sm { get; set; } = 6; //default 6
- public int CF_c_Col { get; set; } = 6; //default 6
- public int CF_p_Xl { get; set; } = 8; //default 8
- public int CF_p_Lg { get; set; } = 8; //default 8
- public int CF_p_Md { get; set; } = 12; //default 12
- public int CF_p_Sm { get; set; } = 12; //default 12
- public int CF_p_Col { get; set; } = 12; //default 12
- public int CF_pp_Xl { get; set; } = 6; //default 6
- public int CF_pp_Lg { get; set; } = 6; //default 6
- public int CF_pp_Md { get; set; } = 6; //default 12
- public int CF_pp_Sm { get; set; } = 6; //default 12
- public int CF_pp_Col { get; set; } = 12; //default 12
-
- //Home page best sellers
- public int HomePageBestSellers { get; set; }
- public int Bs_Xl { get; set; } = 3; //default 3
- public int Bs_Lg { get; set; } = 4; //default 4
- public int Bs_Md { get; set; } = 4; //default 4
- public int Bs_Sm { get; set; } = 6; //default 6
- public int Bs_Col { get; set; } = 6; //default 6
-
- //Home page brands
- public int HomePageBrands { get; set; }
- public int Bm_Xl { get; set; } = 4; //default 4
- public int Bm_Lg { get; set; } = 4; //default 4
- public int Bm_Md { get; set; } = 6; //default 6
- public int Bm_Sm { get; set; } = 6; //default 6
- public int Bm_Col { get; set; } = 12; //default 12
-
- //Home page collections
- public int HomePageCollections { get; set; }
- public int Pm_Xl { get; set; } = 4; //default 4
- public int Pm_Lg { get; set; } = 4; //default 4
- public int Pm_Md { get; set; } = 6; //default 6
- public int Pm_Sm { get; set; } = 6; //default 6
- public int Pm_Col { get; set; } = 12; //default 12
-
- public int CollectionFeaturedProducts { get; set; }
- public int MF_m_Xl { get; set; } = 4; //default 4
- public int MF_m_Lg { get; set; } = 4; //default 4
- public int MF_m_Md { get; set; } = 6; //default 6
- public int MF_m_Sm { get; set; } = 6; //default 6
- public int MF_m_Col { get; set; } = 6; //default 6
- public int MF_p_Xl { get; set; } = 8; //default 8
- public int MF_p_Lg { get; set; } = 8; //default 8
- public int MF_p_Md { get; set; } = 12; //default 12
- public int MF_p_Sm { get; set; } = 12; //default 12
- public int MF_p_Col { get; set; } = 12; //default 12
- public int MF_pp_Xl { get; set; } = 6; //default 6
- public int MF_pp_Lg { get; set; } = 6; //default 6
- public int MF_pp_Md { get; set; } = 6; //default 6
- public int MF_pp_Sm { get; set; } = 6; //default 6
- public int MF_pp_Col { get; set; } = 12; //default 12
-
-
- //Home page news
- public int HomePageNews { get; set; }
- public int Pn_Xl { get; set; } = 4; //default 4
- public int Pn_Lg { get; set; } = 4; //default 4
- public int Pn_Md { get; set; } = 6; //default 6
- public int Pn_Sm { get; set; } = 6; //default 6
- public int Pn_Col { get; set; } = 12; //default 12
-
-
- public int HomePageBlog { get; set; }
- public int Pb_Xl { get; set; } = 6; //default 6
- public int Pb_Lg { get; set; } = 6; //default 6
- public int Pb_Md { get; set; } = 6; //default 6
- public int Pb_Sm { get; set; } = 6; //default 6
- public int Pb_Col { get; set; } = 12; //default 12
-
- }
-}
+ //Home page categories
+ public int HomePageCategories { get; set; }
+ public int Pc_Xl { get; set; } = 4; //default 4
+ public int Pc_Lg { get; set; } = 4; //default 4
+ public int Pc_Md { get; set; } = 6; //default 6
+ public int Pc_Sm { get; set; } = 6; //default 6
+ public int Pc_Col { get; set; } = 12; //default 12
+
+ //Personalized products
+ public int PersonalizedProducts { get; set; }
+ public int Pp_Xl { get; set; } = 3; //default 3
+ public int Pp_Lg { get; set; } = 4; //default 4
+ public int Pp_Md { get; set; } = 4; //default 4
+ public int Pp_Sm { get; set; } = 6; //default 6
+ public int Pp_Col { get; set; } = 6; //default 6
+
+ //Recommended products
+ public int RecommendedProducts { get; set; }
+ public int Rp_Xl { get; set; } = 3; //default 3
+ public int Rp_Lg { get; set; } = 4; //default 4
+ public int Rp_Md { get; set; } = 4; //default 4
+ public int Rp_Sm { get; set; } = 6; //default 6
+ public int Rp_Col { get; set; } = 6; //default 6
+
+ //Suggested products
+ public int SuggestedProducts { get; set; }
+ public int Sp_Xl { get; set; } = 3; //default 3
+ public int Sp_Lg { get; set; } = 4; //default 4
+ public int Sp_Md { get; set; } = 4; //default 4
+ public int Sp_Sm { get; set; } = 6; //default 6
+ public int Sp_Col { get; set; } = 6; //default 6
+
+ //Home page products
+ public int HomePageProducts { get; set; }
+ public int Hp_Xl { get; set; } = 3; //default 3
+ public int Hp_Lg { get; set; } = 4; //default 4
+ public int Hp_Md { get; set; } = 4; //default 4
+ public int Hp_Sm { get; set; } = 6; //default 6
+ public int Hp_Col { get; set; } = 6; //default 6
+
+ //Home page new products
+ public int HomePageNewProducts { get; set; }
+ public int Np_Xl { get; set; } = 3; //default 3
+ public int Np_Lg { get; set; } = 4; //default 4
+ public int Np_Md { get; set; } = 4; //default 4
+ public int Np_Sm { get; set; } = 6; //default 6
+ public int Np_Col { get; set; } = 6; //default 6
+
+ //Category featured products
+ public int CategoryFeaturedProducts { get; set; }
+ public int CF_c_Xl { get; set; } = 4; //default 4
+ public int CF_c_Lg { get; set; } = 4; //default 4
+ public int CF_c_Md { get; set; } = 6; //default 6
+ public int CF_c_Sm { get; set; } = 6; //default 6
+ public int CF_c_Col { get; set; } = 6; //default 6
+ public int CF_p_Xl { get; set; } = 8; //default 8
+ public int CF_p_Lg { get; set; } = 8; //default 8
+ public int CF_p_Md { get; set; } = 12; //default 12
+ public int CF_p_Sm { get; set; } = 12; //default 12
+ public int CF_p_Col { get; set; } = 12; //default 12
+ public int CF_pp_Xl { get; set; } = 6; //default 6
+ public int CF_pp_Lg { get; set; } = 6; //default 6
+ public int CF_pp_Md { get; set; } = 6; //default 12
+ public int CF_pp_Sm { get; set; } = 6; //default 12
+ public int CF_pp_Col { get; set; } = 12; //default 12
+
+ //Home page best sellers
+ public int HomePageBestSellers { get; set; }
+ public int Bs_Xl { get; set; } = 3; //default 3
+ public int Bs_Lg { get; set; } = 4; //default 4
+ public int Bs_Md { get; set; } = 4; //default 4
+ public int Bs_Sm { get; set; } = 6; //default 6
+ public int Bs_Col { get; set; } = 6; //default 6
+
+ //Home page brands
+ public int HomePageBrands { get; set; }
+ public int Bm_Xl { get; set; } = 4; //default 4
+ public int Bm_Lg { get; set; } = 4; //default 4
+ public int Bm_Md { get; set; } = 6; //default 6
+ public int Bm_Sm { get; set; } = 6; //default 6
+ public int Bm_Col { get; set; } = 12; //default 12
+
+ //Home page collections
+ public int HomePageCollections { get; set; }
+ public int Pm_Xl { get; set; } = 4; //default 4
+ public int Pm_Lg { get; set; } = 4; //default 4
+ public int Pm_Md { get; set; } = 6; //default 6
+ public int Pm_Sm { get; set; } = 6; //default 6
+ public int Pm_Col { get; set; } = 12; //default 12
+
+ public int CollectionFeaturedProducts { get; set; }
+ public int MF_m_Xl { get; set; } = 4; //default 4
+ public int MF_m_Lg { get; set; } = 4; //default 4
+ public int MF_m_Md { get; set; } = 6; //default 6
+ public int MF_m_Sm { get; set; } = 6; //default 6
+ public int MF_m_Col { get; set; } = 6; //default 6
+ public int MF_p_Xl { get; set; } = 8; //default 8
+ public int MF_p_Lg { get; set; } = 8; //default 8
+ public int MF_p_Md { get; set; } = 12; //default 12
+ public int MF_p_Sm { get; set; } = 12; //default 12
+ public int MF_p_Col { get; set; } = 12; //default 12
+ public int MF_pp_Xl { get; set; } = 6; //default 6
+ public int MF_pp_Lg { get; set; } = 6; //default 6
+ public int MF_pp_Md { get; set; } = 6; //default 6
+ public int MF_pp_Sm { get; set; } = 6; //default 6
+ public int MF_pp_Col { get; set; } = 12; //default 12
+
+
+ //Home page news
+ public int HomePageNews { get; set; }
+ public int Pn_Xl { get; set; } = 4; //default 4
+ public int Pn_Lg { get; set; } = 4; //default 4
+ public int Pn_Md { get; set; } = 6; //default 6
+ public int Pn_Sm { get; set; } = 6; //default 6
+ public int Pn_Col { get; set; } = 12; //default 12
+
+
+ public int HomePageBlog { get; set; }
+ public int Pb_Xl { get; set; } = 6; //default 6
+ public int Pb_Lg { get; set; } = 6; //default 6
+ public int Pb_Md { get; set; } = 6; //default 6
+ public int Pb_Sm { get; set; } = 6; //default 6
+ public int Pb_Col { get; set; } = 12; //default 12
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/GeoCoordinates.cs b/src/Core/Grand.Domain/Common/GeoCoordinates.cs
index f5f521e50..c978edb3a 100644
--- a/src/Core/Grand.Domain/Common/GeoCoordinates.cs
+++ b/src/Core/Grand.Domain/Common/GeoCoordinates.cs
@@ -1,21 +1,20 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class GeoCoordinates
{
- public class GeoCoordinates
+ public GeoCoordinates(double x, double y)
{
- public GeoCoordinates(double x, double y)
- {
- X = x;
- Y = y;
- }
+ X = x;
+ Y = y;
+ }
- /// <summary>
- /// Gets the X coordinate.
- /// </summary>
- public double X { get; }
+ /// <summary>
+ /// Gets the X coordinate.
+ /// </summary>
+ public double X { get; }
- /// <summary>
- /// Gets the Y coordinate.
- /// </summary>
- public double Y { get; }
- }
-}
+ /// <summary>
+ /// Gets the Y coordinate.
+ /// </summary>
+ public double Y { get; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/GrandNodeVersion.cs b/src/Core/Grand.Domain/Common/GrandNodeVersion.cs
index c6e0d613a..3dff524ad 100644
--- a/src/Core/Grand.Domain/Common/GrandNodeVersion.cs
+++ b/src/Core/Grand.Domain/Common/GrandNodeVersion.cs
@@ -1,7 +1,6 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class GrandNodeVersion : BaseEntity
{
- public class GrandNodeVersion: BaseEntity
- {
- public string DataBaseVersion { get; set; }
- }
-}
+ public string DataBaseVersion { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/MenuItemSettings.cs b/src/Core/Grand.Domain/Common/MenuItemSettings.cs
index 48d34d5e3..9c76c4876 100644
--- a/src/Core/Grand.Domain/Common/MenuItemSettings.cs
+++ b/src/Core/Grand.Domain/Common/MenuItemSettings.cs
@@ -1,19 +1,18 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class MenuItemSettings : ISettings
{
- public class MenuItemSettings: ISettings
- {
- public bool DisplayHomePageMenu { get; set; }
+ public bool DisplayHomePageMenu { get; set; }
- public bool DisplayNewProductsMenu { get; set; }
+ public bool DisplayNewProductsMenu { get; set; }
- public bool DisplaySearchMenu { get; set; }
+ public bool DisplaySearchMenu { get; set; }
- public bool DisplayCustomerMenu { get; set; }
+ public bool DisplayCustomerMenu { get; set; }
- public bool DisplayBlogMenu { get; set; }
+ public bool DisplayBlogMenu { get; set; }
- public bool DisplayContactUsMenu { get; set; }
- }
-}
+ public bool DisplayContactUsMenu { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/PdfSettings.cs b/src/Core/Grand.Domain/Common/PdfSettings.cs
index 53ee50545..dca3fb645 100644
--- a/src/Core/Grand.Domain/Common/PdfSettings.cs
+++ b/src/Core/Grand.Domain/Common/PdfSettings.cs
@@ -1,27 +1,26 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class PdfSettings : ISettings
{
- public class PdfSettings : ISettings
- {
- /// <summary>
- /// PDF logo picture identifier
- /// </summary>
- public string LogoPictureId { get; set; }
+ /// <summary>
+ /// PDF logo picture identifier
+ /// </summary>
+ public string LogoPictureId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to disallow customers to print PDF invoices for pedning orders
- /// </summary>
- public bool DisablePdfInvoicesForPendingOrders { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to disallow customers to print PDF invoices for pedning orders
+ /// </summary>
+ public bool DisablePdfInvoicesForPendingOrders { get; set; }
- /// <summary>
- /// Gets or sets the text that will appear at the top of invoices
- /// </summary>
- public string InvoiceHeaderText { get; set; }
+ /// <summary>
+ /// Gets or sets the text that will appear at the top of invoices
+ /// </summary>
+ public string InvoiceHeaderText { get; set; }
- /// <summary>
- /// Gets or sets the text that will appear at the bottom of invoices
- /// </summary>
- public string InvoiceFooterText { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the text that will appear at the bottom of invoices
+ /// </summary>
+ public string InvoiceFooterText { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/RobotsTxt.cs b/src/Core/Grand.Domain/Common/RobotsTxt.cs
index ba5da8dad..0805e78a8 100644
--- a/src/Core/Grand.Domain/Common/RobotsTxt.cs
+++ b/src/Core/Grand.Domain/Common/RobotsTxt.cs
@@ -1,22 +1,19 @@
-namespace Grand.Domain.Common
-{
- public class RobotsTxt : BaseEntity
- {
-
- /// <summary>
- /// Gets or sets the name of robots.txt
- /// </summary>
- public string Name { get; set; }
+namespace Grand.Domain.Common;
- /// <summary>
- /// Gets or sets the text of robots.txt
- /// </summary>
- public string Text { get; set; }
+public class RobotsTxt : BaseEntity
+{
+ /// <summary>
+ /// Gets or sets the name of robots.txt
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets a value store ident
- /// </summary>
- public string StoreId { get; set; }
+ /// <summary>
+ /// Gets or sets the text of robots.txt
+ /// </summary>
+ public string Text { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets a value store ident
+ /// </summary>
+ public string StoreId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/SearchTerm.cs b/src/Core/Grand.Domain/Common/SearchTerm.cs
index 9d3bad2d4..ef6c0eb83 100644
--- a/src/Core/Grand.Domain/Common/SearchTerm.cs
+++ b/src/Core/Grand.Domain/Common/SearchTerm.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+/// <summary>
+/// Search term (only for statistics)
+/// </summary>
+public class SearchTerm : BaseEntity
{
/// <summary>
- /// Search term (only for statistics)
+ /// Gets or sets the keyword
/// </summary>
- public class SearchTerm : BaseEntity
- {
- /// <summary>
- /// Gets or sets the keyword
- /// </summary>
- public string Keyword { get; set; }
+ public string Keyword { get; set; }
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets search count
- /// </summary>
- public int Count { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets search count
+ /// </summary>
+ public int Count { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/SystemSettings.cs b/src/Core/Grand.Domain/Common/SystemSettings.cs
index 125662680..0ac8c60c5 100644
--- a/src/Core/Grand.Domain/Common/SystemSettings.cs
+++ b/src/Core/Grand.Domain/Common/SystemSettings.cs
@@ -1,18 +1,16 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Common
-{
- public class SystemSettings : ISettings
- {
- /// <summary>
- /// Gets or sets interval (in minutes) with which the Delete Guest Task runs
- /// </summary>
- public int DeleteGuestTaskOlderThanMinutes { get; set; } = 1440;
+namespace Grand.Domain.Common;
- /// <summary>
- /// Gets or sets Number of Days after which order would automatically Canceled - if not paid and has pending status
- /// </summary>
- public int? DaysToCancelUnpaidOrder { get; set; }
+public class SystemSettings : ISettings
+{
+ /// <summary>
+ /// Gets or sets interval (in minutes) with which the Delete Guest Task runs
+ /// </summary>
+ public int DeleteGuestTaskOlderThanMinutes { get; set; } = 1440;
- }
-}
+ /// <summary>
+ /// Gets or sets Number of Days after which order would automatically Canceled - if not paid and has pending status
+ /// </summary>
+ public int? DaysToCancelUnpaidOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/UserField.cs b/src/Core/Grand.Domain/Common/UserField.cs
index 17aa13997..eb13387bb 100644
--- a/src/Core/Grand.Domain/Common/UserField.cs
+++ b/src/Core/Grand.Domain/Common/UserField.cs
@@ -1,24 +1,22 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+/// <summary>
+/// Represents a user field
+/// </summary>
+public class UserField
{
/// <summary>
- /// Represents a user field
+ /// Gets or sets the key
/// </summary>
- public class UserField
- {
- /// <summary>
- /// Gets or sets the key
- /// </summary>
- public string Key { get; set; }
+ public string Key { get; set; }
- /// <summary>
- /// Gets or sets the value
- /// </summary>
- public string Value { get; set; }
+ /// <summary>
+ /// Gets or sets the value
+ /// </summary>
+ public string Value { get; set; }
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- }
-}
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/UserFieldBaseEntity.cs b/src/Core/Grand.Domain/Common/UserFieldBaseEntity.cs
index 72a0022da..dfa13ba36 100644
--- a/src/Core/Grand.Domain/Common/UserFieldBaseEntity.cs
+++ b/src/Core/Grand.Domain/Common/UserFieldBaseEntity.cs
@@ -1,6 +1,5 @@
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public class UserFieldBaseEntity : BaseEntity
{
- public class UserFieldBaseEntity : BaseEntity
- {
- }
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Common/UserFieldExtensions.cs b/src/Core/Grand.Domain/Common/UserFieldExtensions.cs
index 0e75acaf5..7b2fd20f6 100644
--- a/src/Core/Grand.Domain/Common/UserFieldExtensions.cs
+++ b/src/Core/Grand.Domain/Common/UserFieldExtensions.cs
@@ -1,36 +1,34 @@
using Grand.SharedKernel.Extensions;
-namespace Grand.Domain.Common
+namespace Grand.Domain.Common;
+
+public static class UserFieldExtensions
{
- public static class UserFieldExtensions
+ /// <summary>
+ /// Get an attribute of an entity
+ /// </summary>
+ /// <typeparam name="TPropType">Property type</typeparam>
+ /// <param name="entity">Entity</param>
+ /// <param name="key">Key</param>
+ /// <param name="storeId">Load a value specific for a certain store; pass 0 to load a value shared for all stores</param>
+ /// <returns>Attribute</returns>
+ public static TPropType GetUserFieldFromEntity<TPropType>(this BaseEntity entity, string key, string storeId = "")
{
- /// <summary>
- /// Get an attribute of an entity
- /// </summary>
- /// <typeparam name="TPropType">Property type</typeparam>
- /// <param name="entity">Entity</param>
- /// <param name="key">Key</param>
- /// <param name="storeId">Load a value specific for a certain store; pass 0 to load a value shared for all stores</param>
- /// <returns>Attribute</returns>
- public static TPropType GetUserFieldFromEntity<TPropType>(this BaseEntity entity, string key, string storeId = "")
- {
- ArgumentNullException.ThrowIfNull(entity);
-
- var props = entity.UserFields;
- if (props == null)
- return default(TPropType);
- props = props.Where(x => x.StoreId == storeId).ToList();
- if (!props.Any())
- return default(TPropType);
+ ArgumentNullException.ThrowIfNull(entity);
- var prop = props.FirstOrDefault(ga =>
- ga.Key.Equals(key, StringComparison.InvariantCultureIgnoreCase));
+ var props = entity.UserFields;
+ if (props == null)
+ return default;
+ props = props.Where(x => x.StoreId == storeId).ToList();
+ if (!props.Any())
+ return default;
- if (prop == null || string.IsNullOrEmpty(prop.Value))
- return default(TPropType);
+ var prop = props.FirstOrDefault(ga =>
+ ga.Key.Equals(key, StringComparison.InvariantCultureIgnoreCase));
- return CommonHelper.To<TPropType>(prop.Value);
- }
+ if (prop == null || string.IsNullOrEmpty(prop.Value))
+ return default;
+ return CommonHelper.To<TPropType>(prop.Value);
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Configuration/ISettings.cs b/src/Core/Grand.Domain/Configuration/ISettings.cs
index 0ace9e651..3993c9eaf 100644
--- a/src/Core/Grand.Domain/Configuration/ISettings.cs
+++ b/src/Core/Grand.Domain/Configuration/ISettings.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Configuration
+namespace Grand.Domain.Configuration;
+
+/// <summary>
+/// Setting interface
+/// </summary>
+public interface ISettings
{
- /// <summary>
- /// Setting interface
- /// </summary>
- public interface ISettings
- {
- }
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Configuration/Setting.cs b/src/Core/Grand.Domain/Configuration/Setting.cs
index 60c4cd5af..698595186 100644
--- a/src/Core/Grand.Domain/Configuration/Setting.cs
+++ b/src/Core/Grand.Domain/Configuration/Setting.cs
@@ -1,30 +1,22 @@
+namespace Grand.Domain.Configuration;
-namespace Grand.Domain.Configuration
+/// <summary>
+/// Represents a setting
+/// </summary>
+public class Setting : BaseEntity
{
/// <summary>
- /// Represents a setting
+ /// Gets or sets the name
/// </summary>
- public class Setting : BaseEntity
- {
- public Setting()
- {
+ public string Name { get; set; }
- }
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the store for which this setting is valid. 0 is set when the setting is for all stores
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the metadata settings
- /// </summary>
- public string Metadata { get; set; }
+ /// <summary>
+ /// Gets or sets the store for which this setting is valid. 0 is set when the setting is for all stores
+ /// </summary>
+ public string StoreId { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the metadata settings
+ /// </summary>
+ public string Metadata { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Courses/Course.cs b/src/Core/Grand.Domain/Courses/Course.cs
index 96e97e75f..0c3362169 100644
--- a/src/Core/Grand.Domain/Courses/Course.cs
+++ b/src/Core/Grand.Domain/Courses/Course.cs
@@ -3,85 +3,86 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Courses
+namespace Grand.Domain.Courses;
+
+public class Course : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
{
- public class Course : BaseEntity, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string ShortDescription { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the picture
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the product ident
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the level ident
- /// </summary>
- public string LevelId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string ShortDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the product ident
+ /// </summary>
+ public string ProductId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the level ident
+ /// </summary>
+ public string LevelId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Courses/CourseAction.cs b/src/Core/Grand.Domain/Courses/CourseAction.cs
index 42e1ade4a..b13ca3709 100644
--- a/src/Core/Grand.Domain/Courses/CourseAction.cs
+++ b/src/Core/Grand.Domain/Courses/CourseAction.cs
@@ -1,26 +1,24 @@
-namespace Grand.Domain.Courses
-{
- public class CourseAction : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer ident
- /// </summary>
- public string CustomerId { get; set; }
+namespace Grand.Domain.Courses;
- /// <summary>
- /// Gets or sets the course ident
- /// </summary>
- public string CourseId { get; set; }
+public class CourseAction : BaseEntity
+{
+ /// <summary>
+ /// Gets or sets the customer ident
+ /// </summary>
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the lesson ident
- /// </summary>
- public string LessonId { get; set; }
+ /// <summary>
+ /// Gets or sets the course ident
+ /// </summary>
+ public string CourseId { get; set; }
- /// <summary>
- /// Gets or sets the finished
- /// </summary>
- public bool Finished { get; set; }
+ /// <summary>
+ /// Gets or sets the lesson ident
+ /// </summary>
+ public string LessonId { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the finished
+ /// </summary>
+ public bool Finished { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Courses/CourseLesson.cs b/src/Core/Grand.Domain/Courses/CourseLesson.cs
index 8b7a8f140..17bc14c87 100644
--- a/src/Core/Grand.Domain/Courses/CourseLesson.cs
+++ b/src/Core/Grand.Domain/Courses/CourseLesson.cs
@@ -1,56 +1,54 @@
-namespace Grand.Domain.Courses
+namespace Grand.Domain.Courses;
+
+public class CourseLesson : BaseEntity
{
- public class CourseLesson : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the short description
- /// </summary>
- public string ShortDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the course ident
- /// </summary>
- public string CourseId { get; set; }
-
- /// <summary>
- /// Gets or sets the subject ident
- /// </summary>
- public string SubjectId { get; set; }
-
- /// <summary>
- /// Gets or sets the video file
- /// </summary>
- public string VideoFile { get; set; }
-
- /// <summary>
- /// Gets or sets the attachment ident
- /// </summary>
- public string AttachmentId { get; set; }
-
- /// <summary>
- /// Gets or sets the picture
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- }
-}
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the short description
+ /// </summary>
+ public string ShortDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the course ident
+ /// </summary>
+ public string CourseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subject ident
+ /// </summary>
+ public string SubjectId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the video file
+ /// </summary>
+ public string VideoFile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attachment ident
+ /// </summary>
+ public string AttachmentId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Courses/CourseLevel.cs b/src/Core/Grand.Domain/Courses/CourseLevel.cs
index 30cb9b566..874a41e47 100644
--- a/src/Core/Grand.Domain/Courses/CourseLevel.cs
+++ b/src/Core/Grand.Domain/Courses/CourseLevel.cs
@@ -1,15 +1,14 @@
-namespace Grand.Domain.Courses
+namespace Grand.Domain.Courses;
+
+public class CourseLevel : BaseEntity
{
- public class CourseLevel : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Courses/CourseSettings.cs b/src/Core/Grand.Domain/Courses/CourseSettings.cs
index 3a4470be0..ecd39a6dd 100644
--- a/src/Core/Grand.Domain/Courses/CourseSettings.cs
+++ b/src/Core/Grand.Domain/Courses/CourseSettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Courses
+namespace Grand.Domain.Courses;
+
+public class CourseSettings : ISettings
{
- public class CourseSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether guests are allowed to access to the course
- /// </summary>
- public bool AllowGuestsToAccessCourse { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets a value indicating whether guests are allowed to access to the course
+ /// </summary>
+ public bool AllowGuestsToAccessCourse { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Courses/CourseSubject.cs b/src/Core/Grand.Domain/Courses/CourseSubject.cs
index 1d3aab48d..d1e41744b 100644
--- a/src/Core/Grand.Domain/Courses/CourseSubject.cs
+++ b/src/Core/Grand.Domain/Courses/CourseSubject.cs
@@ -1,21 +1,19 @@
-namespace Grand.Domain.Courses
-{
- public class CourseSubject : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+namespace Grand.Domain.Courses;
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+public class CourseSubject : BaseEntity
+{
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the course ident
- /// </summary>
- public string CourseId { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the course ident
+ /// </summary>
+ public string CourseId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/Customer.cs b/src/Core/Grand.Domain/Customers/Customer.cs
index e5379e7f9..7dba6def2 100644
--- a/src/Core/Grand.Domain/Customers/Customer.cs
+++ b/src/Core/Grand.Domain/Customers/Customer.cs
@@ -1,227 +1,226 @@
using Grand.Domain.Common;
using Grand.Domain.Orders;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a customer
+/// </summary>
+public class Customer : BaseEntity
{
+ private ICollection<Address> _addresses;
+ private ICollection<string> _customerTags;
+ private ICollection<string> _groups;
+ private ICollection<ShoppingCartItem> _shoppingCartItems;
+
/// <summary>
- /// Represents a customer
+ /// Ctor
/// </summary>
- public class Customer : BaseEntity
+ public Customer()
{
- private ICollection<ShoppingCartItem> _shoppingCartItems;
- private ICollection<Address> _addresses;
- private ICollection<string> _groups;
- private ICollection<string> _customerTags;
-
- /// <summary>
- /// Ctor
- /// </summary>
- public Customer()
- {
- CustomerGuid = Guid.NewGuid();
- PasswordFormatId = PasswordFormat.Clear;
- Attributes = new List<CustomAttribute>();
- }
-
- /// <summary>
- /// Gets or sets the customer Guid
- /// </summary>
- public Guid CustomerGuid { get; set; }
-
- /// <summary>
- /// Gets or sets the username
- /// </summary>
- public string Username { get; set; }
- /// <summary>
- /// Gets or sets the email
- /// </summary>
- public string Email { get; set; }
- /// <summary>
- /// Gets or sets the password
- /// </summary>
- public string Password { get; set; }
-
- /// <summary>
- /// Gets or sets the password format
- /// </summary>
- public PasswordFormat PasswordFormatId { get; set; }
-
- /// <summary>
- /// Gets or sets the password salt
- /// </summary>
- public string PasswordSalt { get; set; }
-
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer is tax exempt
- /// </summary>
- public bool IsTaxExempt { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer has a free shipping to the next a order
- /// </summary>
- public bool FreeShipping { get; set; }
-
- /// <summary>
- /// Gets or sets the affiliate identifier
- /// </summary>
- public string AffiliateId { get; set; }
-
- /// <summary>
- /// Gets or sets the vendor identifier with which this customer is associated (manager)
- /// </summary>
- public string VendorId { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the staff store identifier
- /// </summary>
- public string StaffStoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the owner identifier
- /// </summary>
- public string OwnerId { get; set; }
-
- /// <summary>
- /// Gets or sets the sales employee identifier
- /// </summary>
- public string SeId { get; set; }
-
- /// <summary>
- /// Gets or sets the custom attributes (see "CustomerAttribute" entity for more info)
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer is active
- /// </summary>
- public bool Active { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer has been deleted
- /// </summary>
- public bool Deleted { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer account is system
- /// </summary>
- public bool IsSystemAccount { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer is active by adding comments etc...
- /// </summary>
- public bool HasContributions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating number of failed login attempts (wrong password)
- /// </summary>
- public int FailedLoginAttempts { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time until which a customer cannot login (locked out)
- /// </summary>
- public DateTime? CannotLoginUntilDateUtc { get; set; }
- /// <summary>
- /// Gets or sets the customer system name
- /// </summary>
- public string SystemName { get; set; }
-
- /// <summary>
- /// Gets or sets the last IP address
- /// </summary>
- public string LastIpAddress { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of last login
- /// </summary>
- public DateTime? LastLoginDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of last activity
- /// </summary>
- public DateTime LastActivityDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of last purchase
- /// </summary>
- public DateTime? LastPurchaseDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of last update cart
- /// </summary>
- public DateTime? LastUpdateCartDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of last update wishlist
- /// </summary>
- public DateTime? LastUpdateWishListDateUtc { get; set; }
-
- /// <summary>
- /// Last date to change password
- /// </summary>
- public DateTime? PasswordChangeDateUtc { get; set; }
-
- #region Navigation properties
-
- /// <summary>
- /// Gets or sets the customer groups
- /// </summary>
- public virtual ICollection<string> Groups
- {
- get => _groups ??= new List<string>();
- protected set => _groups = value;
- }
-
- /// <summary>
- /// Gets or sets shopping cart items
- /// </summary>
- public virtual ICollection<ShoppingCartItem> ShoppingCartItems
- {
- get => _shoppingCartItems ??= new List<ShoppingCartItem>();
- protected set => _shoppingCartItems = value;
- }
-
- /// <summary>
- /// Default billing address
- /// </summary>
- public virtual Address BillingAddress { get; set; }
-
- /// <summary>
- /// Default shipping address
- /// </summary>
- public virtual Address ShippingAddress { get; set; }
-
- /// <summary>
- /// Gets or sets the coordinates
- /// </summary>
- public GeoCoordinates Coordinates { get; set; }
-
- /// <summary>
- /// Gets or sets customer addresses
- /// </summary>
- public virtual ICollection<Address> Addresses
- {
- get => _addresses ??= new List<Address>();
- protected set => _addresses = value;
- }
-
- /// <summary>
- /// Gets or sets the customer tags
- /// </summary>
- public virtual ICollection<string> CustomerTags
- {
- get => _customerTags ??= new List<string>();
- protected set => _customerTags = value;
- }
- #endregion
+ CustomerGuid = Guid.NewGuid();
+ PasswordFormatId = PasswordFormat.Clear;
+ Attributes = new List<CustomAttribute>();
}
+
+ /// <summary>
+ /// Gets or sets the customer Guid
+ /// </summary>
+ public Guid CustomerGuid { get; set; }
+
+ /// <summary>
+ /// Gets or sets the username
+ /// </summary>
+ public string Username { get; set; }
+
+ /// <summary>
+ /// Gets or sets the email
+ /// </summary>
+ public string Email { get; set; }
+
+ /// <summary>
+ /// Gets or sets the password
+ /// </summary>
+ public string Password { get; set; }
+
+ /// <summary>
+ /// Gets or sets the password format
+ /// </summary>
+ public PasswordFormat PasswordFormatId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the password salt
+ /// </summary>
+ public string PasswordSalt { get; set; }
+
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer is tax exempt
+ /// </summary>
+ public bool IsTaxExempt { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer has a free shipping to the next a order
+ /// </summary>
+ public bool FreeShipping { get; set; }
+
+ /// <summary>
+ /// Gets or sets the affiliate identifier
+ /// </summary>
+ public string AffiliateId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vendor identifier with which this customer is associated (manager)
+ /// </summary>
+ public string VendorId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the staff store identifier
+ /// </summary>
+ public string StaffStoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the owner identifier
+ /// </summary>
+ public string OwnerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sales employee identifier
+ /// </summary>
+ public string SeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom attributes (see "CustomerAttribute" entity for more info)
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer is active
+ /// </summary>
+ public bool Active { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer has been deleted
+ /// </summary>
+ public bool Deleted { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer account is system
+ /// </summary>
+ public bool IsSystemAccount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer is active by adding comments etc...
+ /// </summary>
+ public bool HasContributions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating number of failed login attempts (wrong password)
+ /// </summary>
+ public int FailedLoginAttempts { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time until which a customer cannot login (locked out)
+ /// </summary>
+ public DateTime? CannotLoginUntilDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer system name
+ /// </summary>
+ public string SystemName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the last IP address
+ /// </summary>
+ public string LastIpAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of last login
+ /// </summary>
+ public DateTime? LastLoginDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of last activity
+ /// </summary>
+ public DateTime LastActivityDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of last purchase
+ /// </summary>
+ public DateTime? LastPurchaseDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of last update cart
+ /// </summary>
+ public DateTime? LastUpdateCartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of last update wishlist
+ /// </summary>
+ public DateTime? LastUpdateWishListDateUtc { get; set; }
+
+ /// <summary>
+ /// Last date to change password
+ /// </summary>
+ public DateTime? PasswordChangeDateUtc { get; set; }
+
+ #region Navigation properties
+
+ /// <summary>
+ /// Gets or sets the customer groups
+ /// </summary>
+ public virtual ICollection<string> Groups {
+ get => _groups ??= new List<string>();
+ protected set => _groups = value;
+ }
+
+ /// <summary>
+ /// Gets or sets shopping cart items
+ /// </summary>
+ public virtual ICollection<ShoppingCartItem> ShoppingCartItems {
+ get => _shoppingCartItems ??= new List<ShoppingCartItem>();
+ protected set => _shoppingCartItems = value;
+ }
+
+ /// <summary>
+ /// Default billing address
+ /// </summary>
+ public virtual Address BillingAddress { get; set; }
+
+ /// <summary>
+ /// Default shipping address
+ /// </summary>
+ public virtual Address ShippingAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the coordinates
+ /// </summary>
+ public GeoCoordinates Coordinates { get; set; }
+
+ /// <summary>
+ /// Gets or sets customer addresses
+ /// </summary>
+ public virtual ICollection<Address> Addresses {
+ get => _addresses ??= new List<Address>();
+ protected set => _addresses = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the customer tags
+ /// </summary>
+ public virtual ICollection<string> CustomerTags {
+ get => _customerTags ??= new List<string>();
+ protected set => _customerTags = value;
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerAttribute.cs b/src/Core/Grand.Domain/Customers/CustomerAttribute.cs
index 5497206af..4965ab966 100644
--- a/src/Core/Grand.Domain/Customers/CustomerAttribute.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerAttribute.cs
@@ -1,53 +1,50 @@
using Grand.Domain.Catalog;
using Grand.Domain.Localization;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a customer attribute
+/// </summary>
+public class CustomerAttribute : BaseEntity, ITranslationEntity
{
+ private ICollection<CustomerAttributeValue> _customerAttributeValues;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
/// <summary>
- /// Represents a customer attribute
+ /// Gets or sets a value indicating whether the attribute is required
/// </summary>
- public class CustomerAttribute : BaseEntity, ITranslationEntity
- {
- private ICollection<CustomerAttributeValue> _customerAttributeValues;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the attribute is required
- /// </summary>
- public bool IsRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the attribute is read only
- /// </summary>
- public bool IsReadOnly { get; set; }
-
- /// <summary>
- /// Gets or sets the attribute control type identifier
- /// </summary>
- public AttributeControlType AttributeControlTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets the customer attribute values
- /// </summary>
- public virtual ICollection<CustomerAttributeValue> CustomerAttributeValues
- {
- get => _customerAttributeValues ??= new List<CustomerAttributeValue>();
- protected set => _customerAttributeValues = value;
- }
+ public bool IsRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the attribute is read only
+ /// </summary>
+ public bool IsReadOnly { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attribute control type identifier
+ /// </summary>
+ public AttributeControlType AttributeControlTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets the customer attribute values
+ /// </summary>
+ public virtual ICollection<CustomerAttributeValue> CustomerAttributeValues {
+ get => _customerAttributeValues ??= new List<CustomerAttributeValue>();
+ protected set => _customerAttributeValues = value;
}
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerAttributeExtensions.cs b/src/Core/Grand.Domain/Customers/CustomerAttributeExtensions.cs
index 732bde6cd..3cbb7c1bb 100644
--- a/src/Core/Grand.Domain/Customers/CustomerAttributeExtensions.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerAttributeExtensions.cs
@@ -1,30 +1,29 @@
using Grand.Domain.Catalog;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Extensions
+/// </summary>
+public static class CustomerAttributeExtensions
{
/// <summary>
- /// Extensions
+ /// A value indicating whether this customer attribute should have values
/// </summary>
- public static class CustomerAttributeExtensions
+ /// <param name="customerAttribute">Customer attribute</param>
+ /// <returns>Result</returns>
+ public static bool ShouldHaveValues(this CustomerAttribute customerAttribute)
{
- /// <summary>
- /// A value indicating whether this customer attribute should have values
- /// </summary>
- /// <param name="customerAttribute">Customer attribute</param>
- /// <returns>Result</returns>
- public static bool ShouldHaveValues(this CustomerAttribute customerAttribute)
- {
- if (customerAttribute == null)
- return false;
+ if (customerAttribute == null)
+ return false;
- if (customerAttribute.AttributeControlTypeId == AttributeControlType.TextBox ||
- customerAttribute.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
- customerAttribute.AttributeControlTypeId == AttributeControlType.Datepicker ||
- customerAttribute.AttributeControlTypeId == AttributeControlType.FileUpload)
- return false;
+ if (customerAttribute.AttributeControlTypeId == AttributeControlType.TextBox ||
+ customerAttribute.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
+ customerAttribute.AttributeControlTypeId == AttributeControlType.Datepicker ||
+ customerAttribute.AttributeControlTypeId == AttributeControlType.FileUpload)
+ return false;
- //other attribute controle types support values
- return true;
- }
+ //other attribute controle types support values
+ return true;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerAttributeValue.cs b/src/Core/Grand.Domain/Customers/CustomerAttributeValue.cs
index df6d712c0..fcbcb0f23 100644
--- a/src/Core/Grand.Domain/Customers/CustomerAttributeValue.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerAttributeValue.cs
@@ -1,36 +1,34 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a customer attribute value
+/// </summary>
+public class CustomerAttributeValue : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a customer attribute value
+ /// Gets or sets the customer attribute identifier
/// </summary>
- public class CustomerAttributeValue : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the customer attribute identifier
- /// </summary>
- public string CustomerAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets the checkout attribute name
- /// </summary>
- public string Name { get; set; }
+ public string CustomerAttributeId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the value is pre-selected
- /// </summary>
- public bool IsPreSelected { get; set; }
+ /// <summary>
+ /// Gets or sets the checkout attribute name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the value is pre-selected
+ /// </summary>
+ public bool IsPreSelected { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerExtensions.cs b/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
index dec44651f..b49a329b2 100644
--- a/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerExtensions.cs
@@ -1,243 +1,244 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public static class CustomerExtensions
{
- public static class CustomerExtensions
+ #region Addresses
+
+ public static void RemoveAddress(this Customer customer, Address address)
{
- #region Customer
-
- /// <summary>
- /// Gets a value indicating whether customer a anonymous
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <returns>Result</returns>
- public static bool IsSystemAccount(this Customer customer)
+ if (customer.Addresses.Contains(address))
{
- ArgumentNullException.ThrowIfNull(customer);
+ if (customer.BillingAddress == address) customer.BillingAddress = null;
+ if (customer.ShippingAddress == address) customer.ShippingAddress = null;
- return customer.IsSystemAccount && !string.IsNullOrEmpty(customer.SystemName);
+ customer.Addresses.Remove(address);
}
+ }
-
- /// <summary>
- /// Gets a value indicating whether customer a search engine
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <returns>Result</returns>
- public static bool IsSearchEngineAccount(this Customer customer)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ #endregion
- if (!customer.IsSystemAccount || string.IsNullOrEmpty(customer.SystemName))
- return false;
+ #region Customer
- var result = customer.SystemName.Equals(SystemCustomerNames.SearchEngine, StringComparison.OrdinalIgnoreCase);
- return result;
- }
+ /// <summary>
+ /// Gets a value indicating whether customer a anonymous
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <returns>Result</returns>
+ public static bool IsSystemAccount(this Customer customer)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- #endregion
+ return customer.IsSystemAccount && !string.IsNullOrEmpty(customer.SystemName);
+ }
- #region Addresses
- public static void RemoveAddress(this Customer customer, Address address)
- {
- if (customer.Addresses.Contains(address))
- {
- if (customer.BillingAddress == address) customer.BillingAddress = null;
- if (customer.ShippingAddress == address) customer.ShippingAddress = null;
+ /// <summary>
+ /// Gets a value indicating whether customer a search engine
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <returns>Result</returns>
+ public static bool IsSearchEngineAccount(this Customer customer)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- customer.Addresses.Remove(address);
- }
- }
+ if (!customer.IsSystemAccount || string.IsNullOrEmpty(customer.SystemName))
+ return false;
- #endregion
+ var result = customer.SystemName.Equals(SystemCustomerNames.SearchEngine, StringComparison.OrdinalIgnoreCase);
+ return result;
+ }
+
+ #endregion
- #region Customer
+ #region Customer
- public static string CouponSeparator => ";";
+ public static string CouponSeparator => ";";
- /// <summary>
- /// Get full name
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <returns>Customer full name</returns>
- public static string GetFullName(this Customer customer)
+ /// <summary>
+ /// Get full name
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <returns>Customer full name</returns>
+ public static string GetFullName(this Customer customer)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
+ var firstName = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName);
+ var lastName = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastName);
+
+ var fullName = "";
+ if (!string.IsNullOrWhiteSpace(firstName) && !string.IsNullOrWhiteSpace(lastName))
{
- ArgumentNullException.ThrowIfNull(customer);
- var firstName = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName);
- var lastName = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.LastName);
-
- var fullName = "";
- if (!string.IsNullOrWhiteSpace(firstName) && !string.IsNullOrWhiteSpace(lastName))
- fullName = $"{firstName} {lastName}";
- else
- {
- if (!string.IsNullOrWhiteSpace(firstName))
- fullName = firstName;
-
- if (!string.IsNullOrWhiteSpace(lastName))
- fullName = lastName;
- }
- return fullName;
+ fullName = $"{firstName} {lastName}";
}
-
- /// <summary>
- /// Formats the customer name
- /// </summary>
- /// <param name="customer">Source</param>
- /// <param name="customerNameFormat"></param>
- /// <returns>Formatted text</returns>
- public static string FormatUserName(this Customer customer, CustomerNameFormat customerNameFormat)
+ else
{
- if (customer == null)
- return string.Empty;
-
- if (string.IsNullOrEmpty(customer.Email))
- {
- return "Customer.Guest";
- }
-
- var result = string.Empty;
- switch (customerNameFormat)
- {
- case CustomerNameFormat.Emails:
- result = customer.Email;
- break;
- case CustomerNameFormat.Usernames:
- result = customer.Username;
- break;
- case CustomerNameFormat.FullNames:
- result = customer.GetFullName();
- break;
- case CustomerNameFormat.FirstName:
- result = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName);
- break;
- }
-
- return result;
+ if (!string.IsNullOrWhiteSpace(firstName))
+ fullName = firstName;
+
+ if (!string.IsNullOrWhiteSpace(lastName))
+ fullName = lastName;
}
- /// <summary>
- /// Gets coupon codes
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <param name="key">key</param>
- /// <returns>Coupon codes</returns>
- public static string[] ParseAppliedCouponCodes(this Customer customer, string key)
+ return fullName;
+ }
+
+ /// <summary>
+ /// Formats the customer name
+ /// </summary>
+ /// <param name="customer">Source</param>
+ /// <param name="customerNameFormat"></param>
+ /// <returns>Formatted text</returns>
+ public static string FormatUserName(this Customer customer, CustomerNameFormat customerNameFormat)
+ {
+ if (customer == null)
+ return string.Empty;
+
+ if (string.IsNullOrEmpty(customer.Email)) return "Customer.Guest";
+
+ var result = string.Empty;
+ switch (customerNameFormat)
{
- ArgumentNullException.ThrowIfNull(customer);
+ case CustomerNameFormat.Emails:
+ result = customer.Email;
+ break;
+ case CustomerNameFormat.Usernames:
+ result = customer.Username;
+ break;
+ case CustomerNameFormat.FullNames:
+ result = customer.GetFullName();
+ break;
+ case CustomerNameFormat.FirstName:
+ result = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.FirstName);
+ break;
+ }
- var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
+ return result;
+ }
- var couponCodes = new List<string>();
- if (string.IsNullOrEmpty(existingCouponCodes))
- return couponCodes.ToArray();
+ /// <summary>
+ /// Gets coupon codes
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <param name="key">key</param>
+ /// <returns>Coupon codes</returns>
+ public static string[] ParseAppliedCouponCodes(this Customer customer, string key)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- return existingCouponCodes.Split(CouponSeparator);
+ var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
- }
+ var couponCodes = new List<string>();
+ if (string.IsNullOrEmpty(existingCouponCodes))
+ return couponCodes.ToArray();
- /// <summary>
- /// Adds a coupon code
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <param name="key"></param>
- /// <param name="couponCode">Coupon code</param>
- /// <returns>New coupon codes document</returns>
- public static string ApplyCouponCode(this Customer customer, string key, string couponCode)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ return existingCouponCodes.Split(CouponSeparator);
+ }
- var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
- return string.IsNullOrEmpty(existingCouponCodes) ? couponCode : string.Join(CouponSeparator, existingCouponCodes.Split(CouponSeparator).Append(couponCode).Distinct());
- }
+ /// <summary>
+ /// Adds a coupon code
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <param name="key"></param>
+ /// <param name="couponCode">Coupon code</param>
+ /// <returns>New coupon codes document</returns>
+ public static string ApplyCouponCode(this Customer customer, string key, string couponCode)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- /// <summary>
- /// Adds a coupon codes
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <param name="key">key</param>
- /// <param name="couponCodes">Coupon code</param>
- /// <returns>New coupon codes document</returns>
- public static string ApplyCouponCode(this Customer customer, string key, string[] couponCodes)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
+ return string.IsNullOrEmpty(existingCouponCodes)
+ ? couponCode
+ : string.Join(CouponSeparator, existingCouponCodes.Split(CouponSeparator).Append(couponCode).Distinct());
+ }
- var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
- if (string.IsNullOrEmpty(existingCouponCodes))
- {
- return string.Join(CouponSeparator, couponCodes);
- }
+ /// <summary>
+ /// Adds a coupon codes
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <param name="key">key</param>
+ /// <param name="couponCodes">Coupon code</param>
+ /// <returns>New coupon codes document</returns>
+ public static string ApplyCouponCode(this Customer customer, string key, string[] couponCodes)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- var coupons = existingCouponCodes.Split(CouponSeparator).ToList();
- coupons.AddRange(couponCodes.ToList());
- return string.Join(CouponSeparator, coupons.Distinct());
- }
+ var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
+ if (string.IsNullOrEmpty(existingCouponCodes)) return string.Join(CouponSeparator, couponCodes);
- /// <summary>
- /// Adds a coupon code
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <param name="key"></param>
- /// <param name="couponCode">Coupon code</param>
- /// <returns>New coupon codes document</returns>
- public static string RemoveCouponCode(this Customer customer, string key, string couponCode)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ var coupons = existingCouponCodes.Split(CouponSeparator).ToList();
+ coupons.AddRange(couponCodes.ToList());
+ return string.Join(CouponSeparator, coupons.Distinct());
+ }
- var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
- return string.IsNullOrEmpty(existingCouponCodes) ? "" : string.Join(CouponSeparator, existingCouponCodes.Split(CouponSeparator).Except(new List<string> { couponCode }).Distinct());
- }
+ /// <summary>
+ /// Adds a coupon code
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <param name="key"></param>
+ /// <param name="couponCode">Coupon code</param>
+ /// <returns>New coupon codes document</returns>
+ public static string RemoveCouponCode(this Customer customer, string key, string couponCode)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- /// <summary>
- /// Check whether password recovery token is valid
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <param name="token">Token to validate</param>
- /// <returns>Result</returns>
- public static bool IsPasswordRecoveryTokenValid(this Customer customer, string token)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ var existingCouponCodes = customer.GetUserFieldFromEntity<string>(key);
+ return string.IsNullOrEmpty(existingCouponCodes)
+ ? ""
+ : string.Join(CouponSeparator,
+ existingCouponCodes.Split(CouponSeparator).Except(new List<string> { couponCode }).Distinct());
+ }
- var cPrt = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.PasswordRecoveryToken);
- return !string.IsNullOrEmpty(cPrt) && cPrt.Equals(token, StringComparison.OrdinalIgnoreCase);
- }
+ /// <summary>
+ /// Check whether password recovery token is valid
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <param name="token">Token to validate</param>
+ /// <returns>Result</returns>
+ public static bool IsPasswordRecoveryTokenValid(this Customer customer, string token)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- /// <summary>
- /// Check whether password recovery link is expired
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <param name="customerSettings">Customer settings</param>
- /// <returns>Result</returns>
- public static bool IsPasswordRecoveryLinkExpired(this Customer customer, CustomerSettings customerSettings)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ var cPrt = customer.GetUserFieldFromEntity<string>(SystemCustomerFieldNames.PasswordRecoveryToken);
+ return !string.IsNullOrEmpty(cPrt) && cPrt.Equals(token, StringComparison.OrdinalIgnoreCase);
+ }
- ArgumentNullException.ThrowIfNull(customerSettings);
+ /// <summary>
+ /// Check whether password recovery link is expired
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <param name="customerSettings">Customer settings</param>
+ /// <returns>Result</returns>
+ public static bool IsPasswordRecoveryLinkExpired(this Customer customer, CustomerSettings customerSettings)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- if (customerSettings.PasswordRecoveryLinkDaysValid == 0)
- return false;
+ ArgumentNullException.ThrowIfNull(customerSettings);
- var geneatedDate = customer.GetUserFieldFromEntity<DateTime?>(SystemCustomerFieldNames.PasswordRecoveryTokenDateGenerated);
- if (!geneatedDate.HasValue)
- return false;
+ if (customerSettings.PasswordRecoveryLinkDaysValid == 0)
+ return false;
- var daysPassed = (DateTime.UtcNow - geneatedDate.Value).TotalDays;
- return daysPassed > customerSettings.PasswordRecoveryLinkDaysValid;
- }
+ var geneatedDate =
+ customer.GetUserFieldFromEntity<DateTime?>(SystemCustomerFieldNames.PasswordRecoveryTokenDateGenerated);
+ if (!geneatedDate.HasValue)
+ return false;
- /// <summary>
- /// Get customer group identifiers
- /// </summary>
- /// <param name="customer">Customer</param>
- /// <returns>Customer group identifiers</returns>
- public static string[] GetCustomerGroupIds(this Customer customer)
- {
- ArgumentNullException.ThrowIfNull(customer);
+ var daysPassed = (DateTime.UtcNow - geneatedDate.Value).TotalDays;
+ return daysPassed > customerSettings.PasswordRecoveryLinkDaysValid;
+ }
- return customer.Groups.ToArray();
- }
+ /// <summary>
+ /// Get customer group identifiers
+ /// </summary>
+ /// <param name="customer">Customer</param>
+ /// <returns>Customer group identifiers</returns>
+ public static string[] GetCustomerGroupIds(this Customer customer)
+ {
+ ArgumentNullException.ThrowIfNull(customer);
- #endregion
+ return customer.Groups.ToArray();
}
-}
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerGroup.cs b/src/Core/Grand.Domain/Customers/CustomerGroup.cs
index 2c11eff71..1d6c1e4eb 100644
--- a/src/Core/Grand.Domain/Customers/CustomerGroup.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerGroup.cs
@@ -1,60 +1,57 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a customer group
+/// </summary>
+public class CustomerGroup : BaseEntity
{
/// <summary>
- /// Represents a customer group
- /// </summary>
- public class CustomerGroup : BaseEntity
- {
-
- /// <summary>
- /// Gets or sets the customer group name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer group is marked as free shiping
- /// </summary>
- public bool FreeShipping { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer group is marked as tax exempt
- /// </summary>
- public bool TaxExempt { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer group is active
- /// </summary>
- public bool Active { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customer group is system
- /// </summary>
- public bool IsSystem { get; set; }
-
- /// <summary>
- /// Gets or sets the customer group display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the customer group system name
- /// </summary>
- public string SystemName { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the customers must change passwords after a specified time
- /// </summary>
- public bool EnablePasswordLifetime { get; set; }
-
- /// <summary>
- /// Gets or sets a minimum order total amount
- /// </summary>
- public double? MinOrderAmount { get; set; }
-
- /// <summary>
- /// Gets or sets a maximum order total amount
- /// </summary>
- public double? MaxOrderAmount { get; set; }
- }
+ /// Gets or sets the customer group name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer group is marked as free shiping
+ /// </summary>
+ public bool FreeShipping { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer group is marked as tax exempt
+ /// </summary>
+ public bool TaxExempt { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer group is active
+ /// </summary>
+ public bool Active { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customer group is system
+ /// </summary>
+ public bool IsSystem { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer group display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer group system name
+ /// </summary>
+ public string SystemName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the customers must change passwords after a specified time
+ /// </summary>
+ public bool EnablePasswordLifetime { get; set; }
+ /// <summary>
+ /// Gets or sets a minimum order total amount
+ /// </summary>
+ public double? MinOrderAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a maximum order total amount
+ /// </summary>
+ public double? MaxOrderAmount { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerGroupProduct.cs b/src/Core/Grand.Domain/Customers/CustomerGroupProduct.cs
index 9bf2233a5..ebab17b02 100644
--- a/src/Core/Grand.Domain/Customers/CustomerGroupProduct.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerGroupProduct.cs
@@ -1,27 +1,22 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a customer group products
+/// </summary>
+public class CustomerGroupProduct : BaseEntity
{
/// <summary>
- /// Represents a customer group products
+ /// Gets or sets the customer group id
/// </summary>
- public class CustomerGroupProduct : BaseEntity
- {
-
- /// <summary>
- /// Gets or sets the customer group id
- /// </summary>
- public string CustomerGroupId { get; set; }
-
- /// <summary>
- /// Gets or sets the product Id
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ public string CustomerGroupId { get; set; }
- }
-
+ /// <summary>
+ /// Gets or sets the product Id
+ /// </summary>
+ public string ProductId { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerHistoryPassword.cs b/src/Core/Grand.Domain/Customers/CustomerHistoryPassword.cs
index 0570b7172..b87f2ec96 100644
--- a/src/Core/Grand.Domain/Customers/CustomerHistoryPassword.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerHistoryPassword.cs
@@ -1,29 +1,27 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a Customer History Password
+/// </summary>
+public class CustomerHistoryPassword : BaseEntity
{
/// <summary>
- /// Represents a Customer History Password
+ /// Gets or sets the customer identifier
/// </summary>
- public class CustomerHistoryPassword : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the password
- /// </summary>
- public string Password { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the password format identifier
- /// </summary>
- public PasswordFormat PasswordFormatId { get; set; } = PasswordFormat.Clear;
+ /// <summary>
+ /// Gets or sets the password
+ /// </summary>
+ public string Password { get; set; }
- /// <summary>
- /// Gets or sets the password salt
- /// </summary>
- public string PasswordSalt { get; set; }
+ /// <summary>
+ /// Gets or sets the password format identifier
+ /// </summary>
+ public PasswordFormat PasswordFormatId { get; set; } = PasswordFormat.Clear;
- }
-}
+ /// <summary>
+ /// Gets or sets the password salt
+ /// </summary>
+ public string PasswordSalt { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerLoginResults.cs b/src/Core/Grand.Domain/Customers/CustomerLoginResults.cs
index 3674add2a..0da942742 100644
--- a/src/Core/Grand.Domain/Customers/CustomerLoginResults.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerLoginResults.cs
@@ -1,41 +1,47 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents the customer login result enumeration
+/// </summary>
+public enum CustomerLoginResults
{
/// <summary>
- /// Represents the customer login result enumeration
- /// </summary>
- public enum CustomerLoginResults
- {
- /// <summary>
- /// Login successful
- /// </summary>
- Successful = 1,
- /// <summary>
- /// Customer dies not exist (email or username)
- /// </summary>
- CustomerNotExist = 2,
- /// <summary>
- /// Wrong password
- /// </summary>
- WrongPassword = 3,
- /// <summary>
- /// Account have not been activated
- /// </summary>
- NotActive = 4,
- /// <summary>
- /// Customer has been deleted
- /// </summary>
- Deleted = 5,
- /// <summary>
- /// Customer not registered
- /// </summary>
- NotRegistered = 6,
- /// <summary>
- /// Locked out
- /// </summary>
- LockedOut = 7,
- /// <summary>
- /// Requires 2fa
- /// </summary>
- RequiresTwoFactor = 8
- }
-}
+ /// Login successful
+ /// </summary>
+ Successful = 1,
+
+ /// <summary>
+ /// Customer dies not exist (email or username)
+ /// </summary>
+ CustomerNotExist = 2,
+
+ /// <summary>
+ /// Wrong password
+ /// </summary>
+ WrongPassword = 3,
+
+ /// <summary>
+ /// Account have not been activated
+ /// </summary>
+ NotActive = 4,
+
+ /// <summary>
+ /// Customer has been deleted
+ /// </summary>
+ Deleted = 5,
+
+ /// <summary>
+ /// Customer not registered
+ /// </summary>
+ NotRegistered = 6,
+
+ /// <summary>
+ /// Locked out
+ /// </summary>
+ LockedOut = 7,
+
+ /// <summary>
+ /// Requires 2fa
+ /// </summary>
+ RequiresTwoFactor = 8
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerNameFormat.cs b/src/Core/Grand.Domain/Customers/CustomerNameFormat.cs
index bebd610cc..9aa62d632 100644
--- a/src/Core/Grand.Domain/Customers/CustomerNameFormat.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerNameFormat.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents the customer name fortatting enumeration
+/// </summary>
+public enum CustomerNameFormat
{
/// <summary>
- /// Represents the customer name fortatting enumeration
+ /// Show emails
/// </summary>
- public enum CustomerNameFormat
- {
- /// <summary>
- /// Show emails
- /// </summary>
- Emails = 1,
- /// <summary>
- /// Show usernames
- /// </summary>
- Usernames = 2,
- /// <summary>
- /// Show full names
- /// </summary>
- FullNames = 3,
- /// <summary>
- /// Show first name
- /// </summary>
- FirstName = 10
- }
-}
+ Emails = 1,
+
+ /// <summary>
+ /// Show usernames
+ /// </summary>
+ Usernames = 2,
+
+ /// <summary>
+ /// Show full names
+ /// </summary>
+ FullNames = 3,
+
+ /// <summary>
+ /// Show first name
+ /// </summary>
+ FirstName = 10
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerNote.cs b/src/Core/Grand.Domain/Customers/CustomerNote.cs
index dfff7bd43..675b313ab 100644
--- a/src/Core/Grand.Domain/Customers/CustomerNote.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerNote.cs
@@ -1,34 +1,32 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents an customer note
+/// </summary>
+public class CustomerNote : BaseEntity
{
/// <summary>
- /// Represents an customer note
+ /// Gets or sets the customer identifier
/// </summary>
- public class CustomerNote : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the title
- /// </summary>
- public string Title { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the note
- /// </summary>
- public string Note { get; set; }
+ /// <summary>
+ /// Gets or sets the title
+ /// </summary>
+ public string Title { get; set; }
- /// <summary>
- /// Gets or sets the attached file (download) identifier
- /// </summary>
- public string DownloadId { get; set; }
+ /// <summary>
+ /// Gets or sets the note
+ /// </summary>
+ public string Note { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether a customer can see a note
- /// </summary>
- public bool DisplayToCustomer { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the attached file (download) identifier
+ /// </summary>
+ public string DownloadId { get; set; }
-}
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer can see a note
+ /// </summary>
+ public bool DisplayToCustomer { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerProduct.cs b/src/Core/Grand.Domain/Customers/CustomerProduct.cs
index 0d983d48b..6fde63bf8 100644
--- a/src/Core/Grand.Domain/Customers/CustomerProduct.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerProduct.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public class CustomerProduct : BaseEntity
{
- public class CustomerProduct: BaseEntity
- {
- public string CustomerId { get; set; }
- public string ProductId { get; set; }
- public int DisplayOrder { get; set; }
- }
-}
+ public string CustomerId { get; set; }
+ public string ProductId { get; set; }
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerProductPrice.cs b/src/Core/Grand.Domain/Customers/CustomerProductPrice.cs
index 3dde07bed..751a1b1b0 100644
--- a/src/Core/Grand.Domain/Customers/CustomerProductPrice.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerProductPrice.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public class CustomerProductPrice : BaseEntity
{
- public class CustomerProductPrice: BaseEntity
- {
- public string CustomerId { get; set; }
- public string ProductId { get; set; }
- public double Price { get; set; }
- }
-}
+ public string CustomerId { get; set; }
+ public string ProductId { get; set; }
+ public double Price { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerSettings.cs b/src/Core/Grand.Domain/Customers/CustomerSettings.cs
index f5704af34..78175f36a 100644
--- a/src/Core/Grand.Domain/Customers/CustomerSettings.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerSettings.cs
@@ -1,306 +1,316 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public class CustomerSettings : ISettings
{
- public class CustomerSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether usernames are used instead of emails
- /// </summary>
- public bool UsernamesEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether users can check the availability of usernames (when registering or changing in 'My Account')
- /// </summary>
- public bool CheckUsernameAvailabilityEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether users are allowed to change their usernames
- /// </summary>
- public bool AllowUsersToChangeUsernames { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether users are allowed to change their email
- /// </summary>
- public bool AllowUsersToChangeEmail { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether first and last name are required
- /// </summary>
- public bool FirstLastNameRequired { get; set; }
-
- /// <summary>
- /// Default password format for customers
- /// </summary>
- public PasswordFormat DefaultPasswordFormat { get; set; }
-
- /// <summary>
- /// Gets or sets a customer password format (SHA1, MD5) when passwords are hashed
- /// </summary>
- public HashedPasswordFormat HashedPasswordFormat { get; set; }
-
- /// <summary>
- /// Gets or sets a regular expression for password validation
- /// </summary>
- public string PasswordRegularExpression { get; set; }
-
- /// <summary>
- /// Gets or sets a number of passwords that should not be the same as the previous one; 0 if the customer can use the same password time after time
- /// </summary>
- public int UnduplicatedPasswordsNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a number of days for password recovery link. Set to 0 if it doesn't expire.
- /// </summary>
- public int PasswordRecoveryLinkDaysValid { get; set; }
-
- /// <summary>
- /// User registration type
- /// </summary>
- public UserRegistrationType UserRegistrationType { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'New customer' notification message should be sent to a store owner
- /// </summary>
- public bool NotifyNewCustomerRegistration { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Downloable products' tab on 'My account' page
- /// </summary>
- public bool HideDownloadableProductsTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Out of stock subscriptions' tab on 'My account' page
- /// </summary>
- public bool HideOutOfStockSubscriptionsTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'My auctions' tab on 'My account' page
- /// </summary>
- public bool HideAuctionsTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Notes' tab on 'My account' page
- /// </summary>
- public bool HideNotesTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Documents' tab on 'My account' page
- /// </summary>
- public bool HideDocumentsTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Subaccounts' tab on 'My account' page
- /// </summary>
- public bool HideSubAccountsTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to validate user when downloading products
- /// </summary>
- public bool DownloadableProductsValidateUser { get; set; }
-
- /// <summary>
- /// Customer name formatting
- /// </summary>
- public CustomerNameFormat CustomerNameFormat { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Newsletter' form field is enabled
- /// </summary>
- public bool NewsletterEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Newsletter' checkbox is ticked by default on the registration page
- /// </summary>
- public bool NewsletterTickedByDefault { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide newsletter box
- /// </summary>
- public bool HideNewsletterBlock { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether newsletter block should allow to unsubsribe
- /// </summary>
- public bool NewsletterBlockAllowToUnsubscribe { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the number of minutes for 'online customers' module
- /// </summary>
- public int OnlineCustomerMinutes { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the number of minutes for 'online shopping cart' module
- /// </summary>
- public int OnlineShoppingCartMinutes { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating we should store last visited page URL for each customer
- /// </summary>
- public bool StoreLastVisitedPage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether during registration the customer has a free shipping to the next a order
- /// </summary>
- public bool RegistrationFreeShipping { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether users are allowed to delete account
- /// </summary>
- public bool AllowUsersToDeleteAccount { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether users are allowed to export account
- /// </summary>
- public bool AllowUsersToExportData { get; set; }
-
- /// <summary>
- /// Gets or sets maximum login failures to lockout account. Set 0 to disable this feature
- /// </summary>
- public int FailedPasswordAllowedAttempts { get; set; }
-
- /// <summary>
- ///
- /// </summary>
- public int FailedPasswordLockoutMinutes { get; set; }
-
- /// <summary>
- /// Gets or sets a number of days for password expiration
- /// </summary>
- public int PasswordLifetime { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Reviews' tab on 'My account' page
- /// </summary>
- public bool HideReviewsTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide 'Courses' tab on 'My account' page
- /// </summary>
- public bool HideCoursesTab { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Two factor authentication' is enabled
- /// </summary>
- public bool TwoFactorAuthenticationEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value for two factor authentication type
- /// </summary>
- public TwoFactorAuthenticationType TwoFactorAuthenticationType { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether geo-location is enabled
- /// </summary>
- public bool GeoEnabled { get; set; }
-
- #region Form fields
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Gender' is enabled
- /// </summary>
- public bool GenderEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Date of Birth' is enabled
- /// </summary>
- public bool DateOfBirthEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Date of Birth' is required
- /// </summary>
- public bool DateOfBirthRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a minimum age. Null if ignored
- /// </summary>
- public int? DateOfBirthMinimumAge { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Company' is enabled
- /// </summary>
- public bool CompanyEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Company' is required
- /// </summary>
- public bool CompanyRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address' is enabled
- /// </summary>
- public bool StreetAddressEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address' is required
- /// </summary>
- public bool StreetAddressRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address 2' is enabled
- /// </summary>
- public bool StreetAddress2Enabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address 2' is required
- /// </summary>
- public bool StreetAddress2Required { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Zip / postal code' is enabled
- /// </summary>
- public bool ZipPostalCodeEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Zip / postal code' is required
- /// </summary>
- public bool ZipPostalCodeRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'City' is enabled
- /// </summary>
- public bool CityEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'City' is required
- /// </summary>
- public bool CityRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Country' is enabled
- /// </summary>
- public bool CountryEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Country' is required
- /// </summary>
- public bool CountryRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'State / province' is enabled
- /// </summary>
- public bool StateProvinceEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'State / province' is required
- /// </summary>
- public bool StateProvinceRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Phone number' is enabled
- /// </summary>
- public bool PhoneEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Phone number' is required
- /// </summary>
- public bool PhoneRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Fax number' is enabled
- /// </summary>
- public bool FaxEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Fax number' is required
- /// </summary>
- public bool FaxRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether privacy policy should accepted during registration
- /// </summary>
- public bool AcceptPrivacyPolicyEnabled { get; set; }
-
- #endregion
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether usernames are used instead of emails
+ /// </summary>
+ public bool UsernamesEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users can check the availability of usernames (when registering or changing
+ /// in 'My Account')
+ /// </summary>
+ public bool CheckUsernameAvailabilityEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users are allowed to change their usernames
+ /// </summary>
+ public bool AllowUsersToChangeUsernames { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users are allowed to change their email
+ /// </summary>
+ public bool AllowUsersToChangeEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether first and last name are required
+ /// </summary>
+ public bool FirstLastNameRequired { get; set; }
+
+ /// <summary>
+ /// Default password format for customers
+ /// </summary>
+ public PasswordFormat DefaultPasswordFormat { get; set; }
+
+ /// <summary>
+ /// Gets or sets a customer password format (SHA1, MD5) when passwords are hashed
+ /// </summary>
+ public HashedPasswordFormat HashedPasswordFormat { get; set; }
+
+ /// <summary>
+ /// Gets or sets a regular expression for password validation
+ /// </summary>
+ public string PasswordRegularExpression { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of passwords that should not be the same as the previous one; 0 if the customer can use the
+ /// same password time after time
+ /// </summary>
+ public int UnduplicatedPasswordsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of days for password recovery link. Set to 0 if it doesn't expire.
+ /// </summary>
+ public int PasswordRecoveryLinkDaysValid { get; set; }
+
+ /// <summary>
+ /// User registration type
+ /// </summary>
+ public UserRegistrationType UserRegistrationType { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'New customer' notification message should be sent to a store owner
+ /// </summary>
+ public bool NotifyNewCustomerRegistration { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Downloable products' tab on 'My account' page
+ /// </summary>
+ public bool HideDownloadableProductsTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Out of stock subscriptions' tab on 'My account' page
+ /// </summary>
+ public bool HideOutOfStockSubscriptionsTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'My auctions' tab on 'My account' page
+ /// </summary>
+ public bool HideAuctionsTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Notes' tab on 'My account' page
+ /// </summary>
+ public bool HideNotesTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Documents' tab on 'My account' page
+ /// </summary>
+ public bool HideDocumentsTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Subaccounts' tab on 'My account' page
+ /// </summary>
+ public bool HideSubAccountsTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to validate user when downloading products
+ /// </summary>
+ public bool DownloadableProductsValidateUser { get; set; }
+
+ /// <summary>
+ /// Customer name formatting
+ /// </summary>
+ public CustomerNameFormat CustomerNameFormat { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Newsletter' form field is enabled
+ /// </summary>
+ public bool NewsletterEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Newsletter' checkbox is ticked by default on the registration page
+ /// </summary>
+ public bool NewsletterTickedByDefault { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide newsletter box
+ /// </summary>
+ public bool HideNewsletterBlock { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether newsletter block should allow to unsubsribe
+ /// </summary>
+ public bool NewsletterBlockAllowToUnsubscribe { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the number of minutes for 'online customers' module
+ /// </summary>
+ public int OnlineCustomerMinutes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the number of minutes for 'online shopping cart' module
+ /// </summary>
+ public int OnlineShoppingCartMinutes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating we should store last visited page URL for each customer
+ /// </summary>
+ public bool StoreLastVisitedPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether during registration the customer has a free shipping to the next a order
+ /// </summary>
+ public bool RegistrationFreeShipping { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users are allowed to delete account
+ /// </summary>
+ public bool AllowUsersToDeleteAccount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users are allowed to export account
+ /// </summary>
+ public bool AllowUsersToExportData { get; set; }
+
+ /// <summary>
+ /// Gets or sets maximum login failures to lockout account. Set 0 to disable this feature
+ /// </summary>
+ public int FailedPasswordAllowedAttempts { get; set; }
+
+ /// <summary>
+ /// </summary>
+ public int FailedPasswordLockoutMinutes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of days for password expiration
+ /// </summary>
+ public int PasswordLifetime { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Reviews' tab on 'My account' page
+ /// </summary>
+ public bool HideReviewsTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide 'Courses' tab on 'My account' page
+ /// </summary>
+ public bool HideCoursesTab { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Two factor authentication' is enabled
+ /// </summary>
+ public bool TwoFactorAuthenticationEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value for two factor authentication type
+ /// </summary>
+ public TwoFactorAuthenticationType TwoFactorAuthenticationType { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether geo-location is enabled
+ /// </summary>
+ public bool GeoEnabled { get; set; }
+
+ #region Form fields
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Gender' is enabled
+ /// </summary>
+ public bool GenderEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Date of Birth' is enabled
+ /// </summary>
+ public bool DateOfBirthEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Date of Birth' is required
+ /// </summary>
+ public bool DateOfBirthRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a minimum age. Null if ignored
+ /// </summary>
+ public int? DateOfBirthMinimumAge { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Company' is enabled
+ /// </summary>
+ public bool CompanyEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Company' is required
+ /// </summary>
+ public bool CompanyRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address' is enabled
+ /// </summary>
+ public bool StreetAddressEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address' is required
+ /// </summary>
+ public bool StreetAddressRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address 2' is enabled
+ /// </summary>
+ public bool StreetAddress2Enabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address 2' is required
+ /// </summary>
+ public bool StreetAddress2Required { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Zip / postal code' is enabled
+ /// </summary>
+ public bool ZipPostalCodeEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Zip / postal code' is required
+ /// </summary>
+ public bool ZipPostalCodeRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'City' is enabled
+ /// </summary>
+ public bool CityEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'City' is required
+ /// </summary>
+ public bool CityRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Country' is enabled
+ /// </summary>
+ public bool CountryEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Country' is required
+ /// </summary>
+ public bool CountryRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'State / province' is enabled
+ /// </summary>
+ public bool StateProvinceEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'State / province' is required
+ /// </summary>
+ public bool StateProvinceRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Phone number' is enabled
+ /// </summary>
+ public bool PhoneEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Phone number' is required
+ /// </summary>
+ public bool PhoneRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Fax number' is enabled
+ /// </summary>
+ public bool FaxEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Fax number' is required
+ /// </summary>
+ public bool FaxRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether privacy policy should accepted during registration
+ /// </summary>
+ public bool AcceptPrivacyPolicyEnabled { get; set; }
+
+ #endregion
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerTag.cs b/src/Core/Grand.Domain/Customers/CustomerTag.cs
index 76f234abe..f04e48605 100644
--- a/src/Core/Grand.Domain/Customers/CustomerTag.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerTag.cs
@@ -1,13 +1,12 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents a product tag
+/// </summary>
+public class CustomerTag : BaseEntity
{
/// <summary>
- /// Represents a product tag
+ /// Gets or sets the name
/// </summary>
- public class CustomerTag : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
- }
-}
+ public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/CustomerTagProduct.cs b/src/Core/Grand.Domain/Customers/CustomerTagProduct.cs
index ea7103c76..35b5d2e2b 100644
--- a/src/Core/Grand.Domain/Customers/CustomerTagProduct.cs
+++ b/src/Core/Grand.Domain/Customers/CustomerTagProduct.cs
@@ -1,27 +1,22 @@
-namespace Grand.Domain.Customers
-{
+namespace Grand.Domain.Customers;
+/// <summary>
+/// Represents a customer tag product
+/// </summary>
+public class CustomerTagProduct : BaseEntity
+{
/// <summary>
- /// Represents a customer tag product
+ /// Gets or sets the customer tag id
/// </summary>
- public class CustomerTagProduct : BaseEntity
- {
-
- /// <summary>
- /// Gets or sets the customer tag id
- /// </summary>
- public string CustomerTagId { get; set; }
-
- /// <summary>
- /// Gets or sets the product Id
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ public string CustomerTagId { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the product Id
+ /// </summary>
+ public string ProductId { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/ExternalAuthentication.cs b/src/Core/Grand.Domain/Customers/ExternalAuthentication.cs
index 3d2c221f1..df4f865da 100644
--- a/src/Core/Grand.Domain/Customers/ExternalAuthentication.cs
+++ b/src/Core/Grand.Domain/Customers/ExternalAuthentication.cs
@@ -1,41 +1,37 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents an external authentication
+/// </summary>
+public class ExternalAuthentication : BaseEntity
{
/// <summary>
- /// Represents an external authentication
+ /// Gets or sets the customer identifier
/// </summary>
- public class ExternalAuthentication : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the external email
- /// </summary>
- public string Email { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the external identifier
- /// </summary>
- public string ExternalIdentifier { get; set; }
+ /// <summary>
+ /// Gets or sets the external email
+ /// </summary>
+ public string Email { get; set; }
- /// <summary>
- /// Gets or sets the external display identifier
- /// </summary>
- public string ExternalDisplayIdentifier { get; set; }
+ /// <summary>
+ /// Gets or sets the external identifier
+ /// </summary>
+ public string ExternalIdentifier { get; set; }
- /// <summary>
- /// Gets or sets the OAuthAccessToken
- /// </summary>
- public string OAuthAccessToken { get; set; }
+ /// <summary>
+ /// Gets or sets the external display identifier
+ /// </summary>
+ public string ExternalDisplayIdentifier { get; set; }
- /// <summary>
- /// Gets or sets the provider
- /// </summary>
- public string ProviderSystemName { get; set; }
-
-
- }
+ /// <summary>
+ /// Gets or sets the OAuthAccessToken
+ /// </summary>
+ public string OAuthAccessToken { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the provider
+ /// </summary>
+ public string ProviderSystemName { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/ExternalAuthenticationSettings.cs b/src/Core/Grand.Domain/Customers/ExternalAuthenticationSettings.cs
index 5a3ed1f75..a9d8513b8 100644
--- a/src/Core/Grand.Domain/Customers/ExternalAuthenticationSettings.cs
+++ b/src/Core/Grand.Domain/Customers/ExternalAuthenticationSettings.cs
@@ -1,23 +1,22 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// External authentication settings
+/// </summary>
+public class ExternalAuthenticationSettings : ISettings
{
/// <summary>
- /// External authentication settings
+ /// Constructor
/// </summary>
- public class ExternalAuthenticationSettings : ISettings
+ public ExternalAuthenticationSettings()
{
- /// <summary>
- /// Constructor
- /// </summary>
- public ExternalAuthenticationSettings()
- {
- ActiveAuthenticationMethodSystemNames = new List<string>();
- }
-
- /// <summary>
- /// Gets or sets system names of active payment methods
- /// </summary>
- public List<string> ActiveAuthenticationMethodSystemNames { get; set; }
+ ActiveAuthenticationMethodSystemNames = new List<string>();
}
+
+ /// <summary>
+ /// Gets or sets system names of active payment methods
+ /// </summary>
+ public List<string> ActiveAuthenticationMethodSystemNames { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/HashedPasswordFormat.cs b/src/Core/Grand.Domain/Customers/HashedPasswordFormat.cs
index 86c2df71d..ee0345844 100644
--- a/src/Core/Grand.Domain/Customers/HashedPasswordFormat.cs
+++ b/src/Core/Grand.Domain/Customers/HashedPasswordFormat.cs
@@ -1,10 +1,9 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public enum HashedPasswordFormat
{
- public enum HashedPasswordFormat
- {
- SHA1,
- SHA256,
- SHA384,
- SHA512
- }
-}
+ SHA1,
+ SHA256,
+ SHA384,
+ SHA512
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/PasswordFormat.cs b/src/Core/Grand.Domain/Customers/PasswordFormat.cs
index 23ae4cf15..7f8a1865e 100644
--- a/src/Core/Grand.Domain/Customers/PasswordFormat.cs
+++ b/src/Core/Grand.Domain/Customers/PasswordFormat.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public enum PasswordFormat
{
- public enum PasswordFormat
- {
- Clear = 0,
- Hashed = 1,
- Encrypted = 2
- }
-}
+ Clear = 0,
+ Hashed = 1,
+ Encrypted = 2
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/SalesEmployee.cs b/src/Core/Grand.Domain/Customers/SalesEmployee.cs
index c1577bf6c..1dd2a1aa9 100644
--- a/src/Core/Grand.Domain/Customers/SalesEmployee.cs
+++ b/src/Core/Grand.Domain/Customers/SalesEmployee.cs
@@ -1,35 +1,34 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public class SalesEmployee : BaseEntity
{
- public class SalesEmployee : BaseEntity
- {
- /// <summary>
- /// Gets or sets the sales employee name
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the sales employee name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the sales employee email
- /// </summary>
- public string Email { get; set; }
+ /// <summary>
+ /// Gets or sets the sales employee email
+ /// </summary>
+ public string Email { get; set; }
- /// <summary>
- /// Gets or sets the sales employee phone
- /// </summary>
- public string Phone { get; set; }
+ /// <summary>
+ /// Gets or sets the sales employee phone
+ /// </summary>
+ public string Phone { get; set; }
- /// <summary>
- /// Gets or sets the sales employee active
- /// </summary>
- public bool Active { get; set; }
+ /// <summary>
+ /// Gets or sets the sales employee active
+ /// </summary>
+ public bool Active { get; set; }
- /// <summary>
- /// Gets or sets the commission rate
- /// </summary>
- public double? Commission { get; set; }
+ /// <summary>
+ /// Gets or sets the commission rate
+ /// </summary>
+ public double? Commission { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs b/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs
index 10a603590..e6576b35e 100644
--- a/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs
+++ b/src/Core/Grand.Domain/Customers/SystemCustomerFieldNames.cs
@@ -1,60 +1,59 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public static class SystemCustomerFieldNames
{
- public static class SystemCustomerFieldNames
- {
- //Form fields
- public static string FirstName => "FirstName";
- public static string LastName => "LastName";
- public static string Gender => "Gender";
- public static string DateOfBirth => "DateOfBirth";
- public static string Company => "Company";
- public static string StreetAddress => "StreetAddress";
- public static string StreetAddress2 => "StreetAddress2";
- public static string ZipPostalCode => "ZipPostalCode";
- public static string City => "City";
- public static string CountryId => "CountryId";
- public static string StateProvinceId => "StateProvinceId";
- public static string Phone => "Phone";
- public static string Fax => "Fax";
- public static string VatNumber => "VatNumber";
- public static string VatNumberStatusId => "VatNumberStatusId";
- public static string PasswordToken => "PasswordToken";
+ //Form fields
+ public static string FirstName => "FirstName";
+ public static string LastName => "LastName";
+ public static string Gender => "Gender";
+ public static string DateOfBirth => "DateOfBirth";
+ public static string Company => "Company";
+ public static string StreetAddress => "StreetAddress";
+ public static string StreetAddress2 => "StreetAddress2";
+ public static string ZipPostalCode => "ZipPostalCode";
+ public static string City => "City";
+ public static string CountryId => "CountryId";
+ public static string StateProvinceId => "StateProvinceId";
+ public static string Phone => "Phone";
+ public static string Fax => "Fax";
+ public static string VatNumber => "VatNumber";
+ public static string VatNumberStatusId => "VatNumberStatusId";
+ public static string PasswordToken => "PasswordToken";
- //Other attributes
- public static string DiscountCoupons => "DiscountCoupons";
- public static string GiftVoucherCoupons => "GiftVoucherCoupons";
- public static string UrlReferrer => "UrlReferrer";
- public static string PasswordRecoveryToken => "PasswordRecoveryToken";
- public static string PasswordRecoveryTokenDateGenerated => "PasswordRecoveryTokenDateGenerated";
- public static string AccountActivationToken => "AccountActivationToken";
- public static string LastVisitedPage => "LastVisitedPage";
- public static string LastUrlReferrer => "LastUrlReferrer";
- public static string ImpersonatedCustomerId => "ImpersonatedCustomerId";
- public static string AdminAreaStoreScopeConfiguration => "AdminAreaStoreScopeConfiguration";
- public static string TwoFactorEnabled => "TwoFactorEnabled";
- public static string TwoFactorSecretKey => "TwoFactorSecretKey";
- public static string TwoFactorValidCode => "TwoFactorValidCode";
- public static string TwoFactorCodeValidUntil => "TwoFactorValidCodeUntil";
+ //Other attributes
+ public static string DiscountCoupons => "DiscountCoupons";
+ public static string GiftVoucherCoupons => "GiftVoucherCoupons";
+ public static string UrlReferrer => "UrlReferrer";
+ public static string PasswordRecoveryToken => "PasswordRecoveryToken";
+ public static string PasswordRecoveryTokenDateGenerated => "PasswordRecoveryTokenDateGenerated";
+ public static string AccountActivationToken => "AccountActivationToken";
+ public static string LastVisitedPage => "LastVisitedPage";
+ public static string LastUrlReferrer => "LastUrlReferrer";
+ public static string ImpersonatedCustomerId => "ImpersonatedCustomerId";
+ public static string AdminAreaStoreScopeConfiguration => "AdminAreaStoreScopeConfiguration";
+ public static string TwoFactorEnabled => "TwoFactorEnabled";
+ public static string TwoFactorSecretKey => "TwoFactorSecretKey";
+ public static string TwoFactorValidCode => "TwoFactorValidCode";
+ public static string TwoFactorCodeValidUntil => "TwoFactorValidCodeUntil";
- public static string CurrencyId => "CurrencyId";
- public static string LanguageId => "LanguageId";
- public static string SelectedPaymentMethod => "SelectedPaymentMethod";
- public static string PaymentTransaction => "PaymentTransaction";
- public static string PaymentOptionAttribute => "PaymentOptionAttribute";
+ public static string CurrencyId => "CurrencyId";
+ public static string LanguageId => "LanguageId";
+ public static string SelectedPaymentMethod => "SelectedPaymentMethod";
+ public static string PaymentTransaction => "PaymentTransaction";
+ public static string PaymentOptionAttribute => "PaymentOptionAttribute";
- public static string SelectedShippingOption => "SelectedShippingOption";
+ public static string SelectedShippingOption => "SelectedShippingOption";
- //value customer chose "pick up in store" option
- public static string SelectedPickupPoint => "SelectedPickupPoint";
- public static string CheckoutAttributes => "CheckoutAttributes";
- public static string OfferedShippingOptions => "OfferedShippingOptions";
- public static string ShippingOptionAttributeDescription => "ShippingOptionAttributeDescription";
- public static string ShippingOptionAttribute => "ShippingOptionAttribute";
- public static string LastContinueShoppingPage => "LastContinueShoppingPage";
- public static string TaxDisplayTypeId => "TaxDisplayTypeId";
- public static string UseLoyaltyPointsDuringCheckout => "UseLoyaltyPointsDuringCheckout";
- public static string CookieAccepted => "Cookie.Accepted";
- public static string ConsentCookies => "ConsentCookies";
- public static string RefreshToken => "RefreshToken";
- }
+ //value customer chose "pick up in store" option
+ public static string SelectedPickupPoint => "SelectedPickupPoint";
+ public static string CheckoutAttributes => "CheckoutAttributes";
+ public static string OfferedShippingOptions => "OfferedShippingOptions";
+ public static string ShippingOptionAttributeDescription => "ShippingOptionAttributeDescription";
+ public static string ShippingOptionAttribute => "ShippingOptionAttribute";
+ public static string LastContinueShoppingPage => "LastContinueShoppingPage";
+ public static string TaxDisplayTypeId => "TaxDisplayTypeId";
+ public static string UseLoyaltyPointsDuringCheckout => "UseLoyaltyPointsDuringCheckout";
+ public static string CookieAccepted => "Cookie.Accepted";
+ public static string ConsentCookies => "ConsentCookies";
+ public static string RefreshToken => "RefreshToken";
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs b/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs
index 12ec67261..c2dd3ca56 100644
--- a/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs
+++ b/src/Core/Grand.Domain/Customers/SystemCustomerGroupNames.cs
@@ -1,17 +1,16 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public static class SystemCustomerGroupNames
{
- public static class SystemCustomerGroupNames
- {
- public const string Administrators = "Administrators";
+ public const string Administrators = "Administrators";
- public const string Registered = "Registered";
+ public const string Registered = "Registered";
- public const string Guests = "Guests";
+ public const string Guests = "Guests";
- public const string Vendors = "Vendors";
+ public const string Vendors = "Vendors";
- public const string Staff = "Staff";
+ public const string Staff = "Staff";
- public const string SalesManager = "SalesManager";
- }
+ public const string SalesManager = "SalesManager";
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/SystemCustomerNames.cs b/src/Core/Grand.Domain/Customers/SystemCustomerNames.cs
index 52d0c5f5f..8cf7ae664 100644
--- a/src/Core/Grand.Domain/Customers/SystemCustomerNames.cs
+++ b/src/Core/Grand.Domain/Customers/SystemCustomerNames.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public static class SystemCustomerNames
{
- public static class SystemCustomerNames
- {
- public static string Anonymous => "Anonymous";
- public static string SearchEngine => "SearchEngine";
- public static string BackgroundTask => "BackgroundTask";
- }
+ public static string Anonymous => "Anonymous";
+ public static string SearchEngine => "SearchEngine";
+ public static string BackgroundTask => "BackgroundTask";
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/TwoFactorAuthenticationType.cs b/src/Core/Grand.Domain/Customers/TwoFactorAuthenticationType.cs
index 4bed2b797..2b403c864 100644
--- a/src/Core/Grand.Domain/Customers/TwoFactorAuthenticationType.cs
+++ b/src/Core/Grand.Domain/Customers/TwoFactorAuthenticationType.cs
@@ -1,18 +1,19 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public enum TwoFactorAuthenticationType
{
- public enum TwoFactorAuthenticationType
- {
- /// <summary>
- /// Google/MS authenticator
- /// </summary>
- AppVerification = 0,
- /// <summary>
- /// Email verification
- /// </summary>
- EmailVerification = 1,
- /// <summary>
- /// SMS verification
- /// </summary>
- SMSVerification = 2
- }
-}
+ /// <summary>
+ /// Google/MS authenticator
+ /// </summary>
+ AppVerification = 0,
+
+ /// <summary>
+ /// Email verification
+ /// </summary>
+ EmailVerification = 1,
+
+ /// <summary>
+ /// SMS verification
+ /// </summary>
+ SMSVerification = 2
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/UserApi.cs b/src/Core/Grand.Domain/Customers/UserApi.cs
index a8d1c82c0..ee8cc3a9b 100644
--- a/src/Core/Grand.Domain/Customers/UserApi.cs
+++ b/src/Core/Grand.Domain/Customers/UserApi.cs
@@ -1,11 +1,10 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+public class UserApi : BaseEntity
{
- public class UserApi : BaseEntity
- {
- public string Email { get; set; }
- public string Password { get; set; }
- public string PrivateKey { get; set; }
- public bool IsActive { get; set; }
- public string Token { get; set; }
- }
-}
+ public string Email { get; set; }
+ public string Password { get; set; }
+ public string PrivateKey { get; set; }
+ public bool IsActive { get; set; }
+ public string Token { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Customers/UserRegistrationType.cs b/src/Core/Grand.Domain/Customers/UserRegistrationType.cs
index e0dc2c186..6ab272828 100644
--- a/src/Core/Grand.Domain/Customers/UserRegistrationType.cs
+++ b/src/Core/Grand.Domain/Customers/UserRegistrationType.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Customers
+namespace Grand.Domain.Customers;
+
+/// <summary>
+/// Represents the customer registration type fortatting enumeration
+/// </summary>
+public enum UserRegistrationType
{
/// <summary>
- /// Represents the customer registration type fortatting enumeration
+ /// Standard account creation
/// </summary>
- public enum UserRegistrationType
- {
- /// <summary>
- /// Standard account creation
- /// </summary>
- Standard = 1,
- /// <summary>
- /// Email validation is required after registration
- /// </summary>
- EmailValidation = 2,
- /// <summary>
- /// A customer should be approved by administrator
- /// </summary>
- AdminApproval = 3,
- /// <summary>
- /// Registration is disabled
- /// </summary>
- Disabled = 4
- }
-}
+ Standard = 1,
+
+ /// <summary>
+ /// Email validation is required after registration
+ /// </summary>
+ EmailValidation = 2,
+
+ /// <summary>
+ /// A customer should be approved by administrator
+ /// </summary>
+ AdminApproval = 3,
+
+ /// <summary>
+ /// Registration is disabled
+ /// </summary>
+ Disabled = 4
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/Country.cs b/src/Core/Grand.Domain/Directory/Country.cs
index 96bd5e206..9aa57c3df 100644
--- a/src/Core/Grand.Domain/Directory/Country.cs
+++ b/src/Core/Grand.Domain/Directory/Country.cs
@@ -1,80 +1,77 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents a country
+/// </summary>
+public class Country : BaseEntity, ITranslationEntity, IStoreLinkEntity
{
+ private ICollection<StateProvince> _stateProvinces;
+
/// <summary>
- /// Represents a country
+ /// Gets or sets the name
/// </summary>
- public class Country : BaseEntity, ITranslationEntity, IStoreLinkEntity
- {
- private ICollection<StateProvince> _stateProvinces;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether billing is allowed to this country
- /// </summary>
- public bool AllowsBilling { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether shipping is allowed to this country
- /// </summary>
- public bool AllowsShipping { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether billing is allowed to this country
+ /// </summary>
+ public bool AllowsBilling { get; set; }
- /// <summary>
- /// Gets or sets the two letter ISO code
- /// </summary>
- public string TwoLetterIsoCode { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether shipping is allowed to this country
+ /// </summary>
+ public bool AllowsShipping { get; set; }
- /// <summary>
- /// Gets or sets the three letter ISO code
- /// </summary>
- public string ThreeLetterIsoCode { get; set; }
+ /// <summary>
+ /// Gets or sets the two letter ISO code
+ /// </summary>
+ public string TwoLetterIsoCode { get; set; }
- /// <summary>
- /// Gets or sets the numeric ISO code
- /// </summary>
- public int NumericIsoCode { get; set; }
+ /// <summary>
+ /// Gets or sets the three letter ISO code
+ /// </summary>
+ public string ThreeLetterIsoCode { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether customers in this country must be charged EU VAT
- /// </summary>
- public bool SubjectToVat { get; set; }
+ /// <summary>
+ /// Gets or sets the numeric ISO code
+ /// </summary>
+ public int NumericIsoCode { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether customers in this country must be charged EU VAT
+ /// </summary>
+ public bool SubjectToVat { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+ /// <summary>
+ /// Gets or sets the state/provinces
+ /// </summary>
+ public virtual ICollection<StateProvince> StateProvinces {
+ get => _stateProvinces ??= new List<StateProvince>();
+ protected set => _stateProvinces = value;
+ }
- /// <summary>
- /// Gets or sets the state/provinces
- /// </summary>
- public virtual ICollection<StateProvince> StateProvinces
- {
- get => _stateProvinces ??= new List<StateProvince>();
- protected set => _stateProvinces = value;
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
- }
+ public IList<string> Stores { get; set; } = new List<string>();
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/Currency.cs b/src/Core/Grand.Domain/Directory/Currency.cs
index efc0d2764..72fa003d5 100644
--- a/src/Core/Grand.Domain/Directory/Currency.cs
+++ b/src/Core/Grand.Domain/Directory/Currency.cs
@@ -1,73 +1,72 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents a currency
+/// </summary>
+public class Currency : BaseEntity, ITranslationEntity, IStoreLinkEntity
{
/// <summary>
- /// Represents a currency
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the currency code
/// </summary>
- public class Currency : BaseEntity, ITranslationEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string CurrencyCode { get; set; }
- /// <summary>
- /// Gets or sets the currency code
- /// </summary>
- public string CurrencyCode { get; set; }
+ /// <summary>
+ /// Gets or sets the rate
+ /// </summary>
+ public double Rate { get; set; }
- /// <summary>
- /// Gets or sets the rate
- /// </summary>
- public double Rate { get; set; }
+ /// <summary>
+ /// Gets or sets the display locale
+ /// </summary>
+ public string DisplayLocale { get; set; }
- /// <summary>
- /// Gets or sets the display locale
- /// </summary>
- public string DisplayLocale { get; set; }
+ /// <summary>
+ /// Gets or sets the custom formatting
+ /// </summary>
+ public string CustomFormatting { get; set; }
- /// <summary>
- /// Gets or sets the custom formatting
- /// </summary>
- public string CustomFormatting { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
+ /// <summary>
+ /// Gets or sets the rounding type identifier
+ /// </summary>
+ public RoundingType RoundingTypeId { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets the Midpoint rounding identifier
+ /// </summary>
+ public MidpointRounding MidpointRoundId { get; set; }
- /// <summary>
- /// Gets or sets the rounding type identifier
- /// </summary>
- public RoundingType RoundingTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the Midpoint rounding identifier
- /// </summary>
- public MidpointRounding MidpointRoundId { get; set; }
+ /// <summary>
+ /// Gets or sets the number of double places (for RoundPrice)
+ /// </summary>
+ public int NumberDecimal { get; set; } = 2;
- /// <summary>
- /// Gets or sets the number of double places (for RoundPrice)
- /// </summary>
- public int NumberDecimal { get; set; } = 2;
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
+ public IList<string> Stores { get; set; } = new List<string>();
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/CurrencySettings.cs b/src/Core/Grand.Domain/Directory/CurrencySettings.cs
index c8678f9f8..1fb7a205b 100644
--- a/src/Core/Grand.Domain/Directory/CurrencySettings.cs
+++ b/src/Core/Grand.Domain/Directory/CurrencySettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+public class CurrencySettings : ISettings
{
- public class CurrencySettings : ISettings
- {
- public string PrimaryStoreCurrencyId { get; set; }
- public string PrimaryExchangeRateCurrencyId { get; set; }
- public string ActiveExchangeRateProviderSystemName { get; set; }
- public bool AutoUpdateEnabled { get; set; }
- }
+ public string PrimaryStoreCurrencyId { get; set; }
+ public string PrimaryExchangeRateCurrencyId { get; set; }
+ public string ActiveExchangeRateProviderSystemName { get; set; }
+ public bool AutoUpdateEnabled { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/DateTimeSettings.cs b/src/Core/Grand.Domain/Directory/DateTimeSettings.cs
index 8574e69aa..526065cce 100644
--- a/src/Core/Grand.Domain/Directory/DateTimeSettings.cs
+++ b/src/Core/Grand.Domain/Directory/DateTimeSettings.cs
@@ -1,13 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Directory
-{
- public class DateTimeSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a default store time zone ident
- /// </summary>
- public string DefaultStoreTimeZoneId { get; set; }
+namespace Grand.Domain.Directory;
- }
+public class DateTimeSettings : ISettings
+{
+ /// <summary>
+ /// Gets or sets a default store time zone ident
+ /// </summary>
+ public string DefaultStoreTimeZoneId { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/ExchangeRate.cs b/src/Core/Grand.Domain/Directory/ExchangeRate.cs
index 43b373d1b..9258b61b8 100644
--- a/src/Core/Grand.Domain/Directory/ExchangeRate.cs
+++ b/src/Core/Grand.Domain/Directory/ExchangeRate.cs
@@ -1,43 +1,41 @@
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents an exchange rate
+/// </summary>
+public class ExchangeRate
{
/// <summary>
- /// Represents an exchange rate
+ /// Creates a new instance of the ExchangeRate class
/// </summary>
- public class ExchangeRate
+ public ExchangeRate()
{
- /// <summary>
- /// Creates a new instance of the ExchangeRate class
- /// </summary>
- public ExchangeRate()
- {
- CurrencyCode = string.Empty;
- Rate = 1.0;
- }
-
- /// <summary>
- /// The three letter ISO code for the Exchange Rate, e.g. USD
- /// </summary>
- public string CurrencyCode { get; set; }
+ CurrencyCode = string.Empty;
+ Rate = 1.0;
+ }
- /// <summary>
- /// The conversion rate of this currency from the base currency
- /// </summary>
- public double Rate { get; set; }
+ /// <summary>
+ /// The three letter ISO code for the Exchange Rate, e.g. USD
+ /// </summary>
+ public string CurrencyCode { get; set; }
- /// <summary>
- /// When was this exchange rate updated from the data source (the internet data xml feed)
- /// </summary>
- public DateTime UpdatedOn { get; set; }
+ /// <summary>
+ /// The conversion rate of this currency from the base currency
+ /// </summary>
+ public double Rate { get; set; }
-
- /// <summary>
- /// Format the rate into a string with the currency code, e.g. "USD 0.72543"
- /// </summary>
- /// <returns></returns>
- public override string ToString()
- {
- return $"{CurrencyCode} {Rate}";
- }
- }
+ /// <summary>
+ /// When was this exchange rate updated from the data source (the internet data xml feed)
+ /// </summary>
+ public DateTime UpdatedOn { get; set; }
-}
+
+ /// <summary>
+ /// Format the rate into a string with the currency code, e.g. "USD 0.72543"
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ return $"{CurrencyCode} {Rate}";
+ }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/MeasureDimension.cs b/src/Core/Grand.Domain/Directory/MeasureDimension.cs
index 33228cbaf..5e4530c68 100644
--- a/src/Core/Grand.Domain/Directory/MeasureDimension.cs
+++ b/src/Core/Grand.Domain/Directory/MeasureDimension.cs
@@ -1,28 +1,27 @@
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents a measure dimension
+/// </summary>
+public class MeasureDimension : BaseEntity
{
/// <summary>
- /// Represents a measure dimension
+ /// Gets or sets the name
/// </summary>
- public class MeasureDimension : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the system keyword
- /// </summary>
- public string SystemKeyword { get; set; }
+ /// <summary>
+ /// Gets or sets the system keyword
+ /// </summary>
+ public string SystemKeyword { get; set; }
- /// <summary>
- /// Gets or sets the ratio
- /// </summary>
- public double Ratio { get; set; }
+ /// <summary>
+ /// Gets or sets the ratio
+ /// </summary>
+ public double Ratio { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/MeasureSettings.cs b/src/Core/Grand.Domain/Directory/MeasureSettings.cs
index 3848e9b15..1e2553dd6 100644
--- a/src/Core/Grand.Domain/Directory/MeasureSettings.cs
+++ b/src/Core/Grand.Domain/Directory/MeasureSettings.cs
@@ -1,10 +1,9 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+public class MeasureSettings : ISettings
{
- public class MeasureSettings : ISettings
- {
- public string BaseDimensionId { get; set; }
- public string BaseWeightId { get; set; }
- }
+ public string BaseDimensionId { get; set; }
+ public string BaseWeightId { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/MeasureUnit.cs b/src/Core/Grand.Domain/Directory/MeasureUnit.cs
index ac232b196..f0a4fb1cd 100644
--- a/src/Core/Grand.Domain/Directory/MeasureUnit.cs
+++ b/src/Core/Grand.Domain/Directory/MeasureUnit.cs
@@ -1,18 +1,17 @@
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents a measure weight
+/// </summary>
+public class MeasureUnit : BaseEntity
{
/// <summary>
- /// Represents a measure weight
+ /// Gets or sets the name
/// </summary>
- public class MeasureUnit : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/MeasureWeight.cs b/src/Core/Grand.Domain/Directory/MeasureWeight.cs
index 82c7b28a4..4473490d3 100644
--- a/src/Core/Grand.Domain/Directory/MeasureWeight.cs
+++ b/src/Core/Grand.Domain/Directory/MeasureWeight.cs
@@ -1,28 +1,27 @@
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents a measure weight
+/// </summary>
+public class MeasureWeight : BaseEntity
{
/// <summary>
- /// Represents a measure weight
+ /// Gets or sets the name
/// </summary>
- public class MeasureWeight : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the system keyword
- /// </summary>
- public string SystemKeyword { get; set; }
+ /// <summary>
+ /// Gets or sets the system keyword
+ /// </summary>
+ public string SystemKeyword { get; set; }
- /// <summary>
- /// Gets or sets the ratio
- /// </summary>
- public double Ratio { get; set; }
+ /// <summary>
+ /// Gets or sets the ratio
+ /// </summary>
+ public double Ratio { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/RoundingType.cs b/src/Core/Grand.Domain/Directory/RoundingType.cs
index fd7f46c8b..04b64445b 100644
--- a/src/Core/Grand.Domain/Directory/RoundingType.cs
+++ b/src/Core/Grand.Domain/Directory/RoundingType.cs
@@ -1,43 +1,50 @@
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+public enum RoundingType
{
- public enum RoundingType
- {
- /// <summary>
- /// Default rounding (Match.Round(num, 2))
- /// </summary>
- Rounding001 = 0,
- /// <summary>
- /// Prices are rounded up to the nearest multiple of 5 cents for sales ending in: 3¢ & 4¢ round to 5¢; and, 8¢ & 9¢ round to 10¢
- /// </summary>
- Rounding005Up = 10,
- /// <summary>
- /// Prices are rounded down to the nearest multiple of 5 cents for sales ending in: 1¢ & 2¢ to 0¢; and, 6¢ & 7¢ to 5¢
- /// </summary>
- Rounding005Down = 20,
- /// <summary>
- /// Round up to the nearest 10 cent value for sales ending in 5¢
- /// </summary>
- Rounding01Up = 30,
- /// <summary>
- /// Round down to the nearest 10 cent value for sales ending in 5¢
- /// </summary>
- Rounding01Down = 40,
- /// <summary>
- /// Sales ending in 1–24 cents round down to 0¢
- /// Sales ending in 25–49 cents round up to 50¢
- /// Sales ending in 51–74 cents round down to 50¢
- /// Sales ending in 75–99 cents round up to the next whole dollar
- /// </summary>
- Rounding05 = 50,
- /// <summary>
- /// Sales ending in 1–49 cents round down to 0
- /// Sales ending in 50–99 cents round up to the next whole dollar
- /// For example, Swedish Krona
- /// </summary>
- Rounding1 = 60,
- /// <summary>
- /// Sales ending in 1–99 cents round up to the next whole dollar
- /// </summary>
- Rounding1Up = 70
- }
-}
+ /// <summary>
+ /// Default rounding (Match.Round(num, 2))
+ /// </summary>
+ Rounding001 = 0,
+
+ /// <summary>
+ /// Prices are rounded up to the nearest multiple of 5 cents for sales ending in: 3¢ & 4¢ round to 5¢; and, 8¢ & 9¢
+ /// round to 10¢
+ /// </summary>
+ Rounding005Up = 10,
+
+ /// <summary>
+ /// Prices are rounded down to the nearest multiple of 5 cents for sales ending in: 1¢ & 2¢ to 0¢; and, 6¢ & 7¢ to 5¢
+ /// </summary>
+ Rounding005Down = 20,
+
+ /// <summary>
+ /// Round up to the nearest 10 cent value for sales ending in 5¢
+ /// </summary>
+ Rounding01Up = 30,
+
+ /// <summary>
+ /// Round down to the nearest 10 cent value for sales ending in 5¢
+ /// </summary>
+ Rounding01Down = 40,
+
+ /// <summary>
+ /// Sales ending in 1–24 cents round down to 0¢
+ /// Sales ending in 25–49 cents round up to 50¢
+ /// Sales ending in 51–74 cents round down to 50¢
+ /// Sales ending in 75–99 cents round up to the next whole dollar
+ /// </summary>
+ Rounding05 = 50,
+
+ /// <summary>
+ /// Sales ending in 1–49 cents round down to 0
+ /// Sales ending in 50–99 cents round up to the next whole dollar
+ /// For example, Swedish Krona
+ /// </summary>
+ Rounding1 = 60,
+
+ /// <summary>
+ /// Sales ending in 1–99 cents round up to the next whole dollar
+ /// </summary>
+ Rounding1Up = 70
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Directory/StateProvince.cs b/src/Core/Grand.Domain/Directory/StateProvince.cs
index 71251a45d..952d580f3 100644
--- a/src/Core/Grand.Domain/Directory/StateProvince.cs
+++ b/src/Core/Grand.Domain/Directory/StateProvince.cs
@@ -1,36 +1,34 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Directory
+namespace Grand.Domain.Directory;
+
+/// <summary>
+/// Represents a state/province
+/// </summary>
+public class StateProvince : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a state/province
+ /// Gets or sets the name
/// </summary>
- public class StateProvince : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the abbreviation
- /// </summary>
- public string Abbreviation { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
+ /// <summary>
+ /// Gets or sets the abbreviation
+ /// </summary>
+ public string Abbreviation { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Discounts/Discount.cs b/src/Core/Grand.Domain/Discounts/Discount.cs
index 066f37719..47bb33fab 100644
--- a/src/Core/Grand.Domain/Discounts/Discount.cs
+++ b/src/Core/Grand.Domain/Discounts/Discount.cs
@@ -1,120 +1,119 @@
using Grand.Domain.Stores;
-namespace Grand.Domain.Discounts
+namespace Grand.Domain.Discounts;
+
+/// <summary>
+/// Represents a discount
+/// </summary>
+public class Discount : BaseEntity, IStoreLinkEntity
{
+ private ICollection<DiscountRule> _discountRules;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount type identifier
+ /// </summary>
+ public DiscountType DiscountTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to use percentage
+ /// </summary>
+ public bool UsePercentage { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount percentage
+ /// </summary>
+ public double DiscountPercentage { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount amount
+ /// </summary>
+ public double DiscountAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount currency
+ /// </summary>
+ public string CurrencyCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to calculate by plugin
+ /// </summary>
+ public bool CalculateByPlugin { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to calculate by plugin
+ /// </summary>
+ public string DiscountPluginName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the maximum discount amount (used with "UsePercentage")
+ /// </summary>
+ public double? MaximumDiscountAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount start date and time
+ /// </summary>
+ public DateTime? StartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount end date and time
+ /// </summary>
+ public DateTime? EndDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether discount requires coupon code
+ /// </summary>
+ public bool RequiresCouponCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether coupon code can be reused
+ /// </summary>
+ public bool Reused { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether discount can be used simultaneously with other discounts (with the same
+ /// discount type)
+ /// </summary>
+ public bool IsCumulative { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount limitation identifier
+ /// </summary>
+ public DiscountLimitationType DiscountLimitationId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount limitation times (used when Limitation is set to "N Times Only" or "N Times Per
+ /// Customer")
+ /// </summary>
+ public int LimitationTimes { get; set; }
+
/// <summary>
- /// Represents a discount
- /// </summary>
- public class Discount : BaseEntity, IStoreLinkEntity
- {
- private ICollection<DiscountRule> _discountRules;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the discount type identifier
- /// </summary>
- public DiscountType DiscountTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to use percentage
- /// </summary>
- public bool UsePercentage { get; set; }
-
- /// <summary>
- /// Gets or sets the discount percentage
- /// </summary>
- public double DiscountPercentage { get; set; }
-
- /// <summary>
- /// Gets or sets the discount amount
- /// </summary>
- public double DiscountAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the discount currency
- /// </summary>
- public string CurrencyCode { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to calculate by plugin
- /// </summary>
- public bool CalculateByPlugin { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to calculate by plugin
- /// </summary>
- public string DiscountPluginName { get; set; }
-
- /// <summary>
- /// Gets or sets the maximum discount amount (used with "UsePercentage")
- /// </summary>
- public double? MaximumDiscountAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the discount start date and time
- /// </summary>
- public DateTime? StartDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the discount end date and time
- /// </summary>
- public DateTime? EndDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether discount requires coupon code
- /// </summary>
- public bool RequiresCouponCode { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether coupon code can be reused
- /// </summary>
- public bool Reused { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether discount can be used simultaneously with other discounts (with the same discount type)
- /// </summary>
- public bool IsCumulative { get; set; }
-
- /// <summary>
- /// Gets or sets the discount limitation identifier
- /// </summary>
- public DiscountLimitationType DiscountLimitationId { get; set; }
-
- /// <summary>
- /// Gets or sets the discount limitation times (used when Limitation is set to "N Times Only" or "N Times Per Customer")
- /// </summary>
- public int LimitationTimes { get; set; }
-
- /// <summary>
- /// Gets or sets the maximum product quantity which could be discounted
- /// Used with "Assigned to products" or "Assigned to categories" type
- /// </summary>
- public int? MaximumDiscountedQuantity { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether discount is enabled
- /// </summary>
- public bool IsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
-
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the discount requirement
- /// </summary>
- public virtual ICollection<DiscountRule> DiscountRules
- {
- get => _discountRules ??= new List<DiscountRule>();
- protected set => _discountRules = value;
- }
+ /// Gets or sets the maximum product quantity which could be discounted
+ /// Used with "Assigned to products" or "Assigned to categories" type
+ /// </summary>
+ public int? MaximumDiscountedQuantity { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether discount is enabled
+ /// </summary>
+ public bool IsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount requirement
+ /// </summary>
+ public virtual ICollection<DiscountRule> DiscountRules {
+ get => _discountRules ??= new List<DiscountRule>();
+ protected set => _discountRules = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Discounts/DiscountCoupon.cs b/src/Core/Grand.Domain/Discounts/DiscountCoupon.cs
index 19a5dc0f3..62e456f72 100644
--- a/src/Core/Grand.Domain/Discounts/DiscountCoupon.cs
+++ b/src/Core/Grand.Domain/Discounts/DiscountCoupon.cs
@@ -1,25 +1,24 @@
-namespace Grand.Domain.Discounts
+namespace Grand.Domain.Discounts;
+
+public class DiscountCoupon : BaseEntity
{
- public class DiscountCoupon : BaseEntity
- {
- /// <summary>
- /// Gets or sets the coupon code
- /// </summary>
- public string CouponCode { get; set; }
+ /// <summary>
+ /// Gets or sets the coupon code
+ /// </summary>
+ public string CouponCode { get; set; }
- /// <summary>
- /// Gets or sets the discount id
- /// </summary>
- public string DiscountId { get; set; }
+ /// <summary>
+ /// Gets or sets the discount id
+ /// </summary>
+ public string DiscountId { get; set; }
- /// <summary>
- /// Gets or sets discount used
- /// </summary>
- public bool Used { get; set; }
+ /// <summary>
+ /// Gets or sets discount used
+ /// </summary>
+ public bool Used { get; set; }
- /// <summary>
- /// How many times was used
- /// </summary>
- public int Qty { get; set; }
- }
-}
+ /// <summary>
+ /// How many times was used
+ /// </summary>
+ public int Qty { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Discounts/DiscountLimitationType.cs b/src/Core/Grand.Domain/Discounts/DiscountLimitationType.cs
index 103e1bcb9..a436a354f 100644
--- a/src/Core/Grand.Domain/Discounts/DiscountLimitationType.cs
+++ b/src/Core/Grand.Domain/Discounts/DiscountLimitationType.cs
@@ -1,21 +1,22 @@
-namespace Grand.Domain.Discounts
+namespace Grand.Domain.Discounts;
+
+/// <summary>
+/// Represents a discount limitation type
+/// </summary>
+public enum DiscountLimitationType
{
/// <summary>
- /// Represents a discount limitation type
+ /// None
/// </summary>
- public enum DiscountLimitationType
- {
- /// <summary>
- /// None
- /// </summary>
- Nolimits = 0,
- /// <summary>
- /// N Times Only
- /// </summary>
- NTimes = 1,
- /// <summary>
- /// N Times Per user
- /// </summary>
- NTimesPerUser = 2
- }
-}
+ Nolimits = 0,
+
+ /// <summary>
+ /// N Times Only
+ /// </summary>
+ NTimes = 1,
+
+ /// <summary>
+ /// N Times Per user
+ /// </summary>
+ NTimesPerUser = 2
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Discounts/DiscountRule.cs b/src/Core/Grand.Domain/Discounts/DiscountRule.cs
index 43ae4f68b..286d252ec 100644
--- a/src/Core/Grand.Domain/Discounts/DiscountRule.cs
+++ b/src/Core/Grand.Domain/Discounts/DiscountRule.cs
@@ -1,19 +1,17 @@
-namespace Grand.Domain.Discounts
+namespace Grand.Domain.Discounts;
+
+/// <summary>
+/// Represents a discount requirement
+/// </summary>
+public class DiscountRule : SubBaseEntity
{
/// <summary>
- /// Represents a discount requirement
+ /// Gets or sets the discount requirement rule system name
/// </summary>
- public class DiscountRule : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the discount requirement rule system name
- /// </summary>
- public string DiscountRequirementRuleSystemName { get; set; }
-
- /// <summary>
- /// Gets or sets the metadata
- /// </summary>
- public string Metadata { get; set; }
+ public string DiscountRequirementRuleSystemName { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the metadata
+ /// </summary>
+ public string Metadata { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Discounts/DiscountType.cs b/src/Core/Grand.Domain/Discounts/DiscountType.cs
index 5dcf2e723..226e232d2 100644
--- a/src/Core/Grand.Domain/Discounts/DiscountType.cs
+++ b/src/Core/Grand.Domain/Discounts/DiscountType.cs
@@ -1,45 +1,52 @@
-namespace Grand.Domain.Discounts
+namespace Grand.Domain.Discounts;
+
+/// <summary>
+/// Represents a discount type
+/// </summary>
+public enum DiscountType
{
/// <summary>
- /// Represents a discount type
- /// </summary>
- public enum DiscountType
- {
- /// <summary>
- /// Assigned to order total
- /// </summary>
- AssignedToOrderTotal = 1,
- /// <summary>
- /// Assigned to products (SKUs)
- /// </summary>
- AssignedToSkus = 2,
- /// <summary>
- /// Assigned to categories (all products in a category)
- /// </summary>
- AssignedToCategories = 5,
- /// <summary>
- /// Assigned to brands (all products of a brand)
- /// </summary>
- AssignedToBrands = 6,
- /// <summary>
- /// Assigned to collections (all products of a collection)
- /// </summary>
- AssignedToCollections = 7,
- /// <summary>
- /// Assigned to vendors (all products of a vendor)
- /// </summary>
- AssignedToVendors = 8,
- /// <summary>
- /// Assigned to shipping
- /// </summary>
- AssignedToShipping = 10,
- /// <summary>
- /// Assigned to order subtotal
- /// </summary>
- AssignedToOrderSubTotal = 20,
- /// <summary>
- /// Assigned to all product
- /// </summary>
- AssignedToAllProducts = 30
- }
-}
+ /// Assigned to order total
+ /// </summary>
+ AssignedToOrderTotal = 1,
+
+ /// <summary>
+ /// Assigned to products (SKUs)
+ /// </summary>
+ AssignedToSkus = 2,
+
+ /// <summary>
+ /// Assigned to categories (all products in a category)
+ /// </summary>
+ AssignedToCategories = 5,
+
+ /// <summary>
+ /// Assigned to brands (all products of a brand)
+ /// </summary>
+ AssignedToBrands = 6,
+
+ /// <summary>
+ /// Assigned to collections (all products of a collection)
+ /// </summary>
+ AssignedToCollections = 7,
+
+ /// <summary>
+ /// Assigned to vendors (all products of a vendor)
+ /// </summary>
+ AssignedToVendors = 8,
+
+ /// <summary>
+ /// Assigned to shipping
+ /// </summary>
+ AssignedToShipping = 10,
+
+ /// <summary>
+ /// Assigned to order subtotal
+ /// </summary>
+ AssignedToOrderSubTotal = 20,
+
+ /// <summary>
+ /// Assigned to all product
+ /// </summary>
+ AssignedToAllProducts = 30
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Discounts/DiscountUsageHistory.cs b/src/Core/Grand.Domain/Discounts/DiscountUsageHistory.cs
index 1de1f5432..a0d2e166a 100644
--- a/src/Core/Grand.Domain/Discounts/DiscountUsageHistory.cs
+++ b/src/Core/Grand.Domain/Discounts/DiscountUsageHistory.cs
@@ -1,34 +1,32 @@
-namespace Grand.Domain.Discounts
+namespace Grand.Domain.Discounts;
+
+/// <summary>
+/// Represents a discount usage history entry
+/// </summary>
+public class DiscountUsageHistory : BaseEntity
{
/// <summary>
- /// Represents a discount usage history entry
+ /// Gets or sets the discount identifier
/// </summary>
- public class DiscountUsageHistory : BaseEntity
- {
- /// <summary>
- /// Gets or sets the discount identifier
- /// </summary>
- public string DiscountId { get; set; }
-
- /// <summary>
- /// Gets or sets the discount coupon code
- /// </summary>
- public string CouponCode { get; set; }
+ public string DiscountId { get; set; }
- /// <summary>
- /// Gets or sets the order identifier
- /// </summary>
- public string OrderId { get; set; }
+ /// <summary>
+ /// Gets or sets the discount coupon code
+ /// </summary>
+ public string CouponCode { get; set; }
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
+ /// <summary>
+ /// Gets or sets the order identifier
+ /// </summary>
+ public string OrderId { get; set; }
- /// <summary>
- /// Gets or sets the canceled identifier
- /// </summary>
- public bool Canceled { get; set; }
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the canceled identifier
+ /// </summary>
+ public bool Canceled { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Documents/Document.cs b/src/Core/Grand.Domain/Documents/Document.cs
index 6f5ef5f68..3580a5cd9 100644
--- a/src/Core/Grand.Domain/Documents/Document.cs
+++ b/src/Core/Grand.Domain/Documents/Document.cs
@@ -2,144 +2,144 @@
using Grand.Domain.Permissions;
using Grand.Domain.Stores;
-namespace Grand.Domain.Documents
+namespace Grand.Domain.Documents;
+
+/// <summary>
+/// Represents a document
+/// </summary>
+public class Document : BaseEntity, IGroupLinkEntity, IStoreLinkEntity
{
/// <summary>
- /// Represents a document
- /// </summary>
- public class Document : BaseEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets the document number
- /// </summary>
- public string Number { get; set; }
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sales employee identifier
- /// </summary>
- public string SeId { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the parent document identifier
- /// </summary>
- public string ParentDocumentId { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the download identifier
- /// </summary>
- public string DownloadId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the flag
- /// </summary>
- public string Flag { get; set; }
-
- /// <summary>
- /// Gets or sets the lik
- /// </summary>
- public string Link { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets an document status identifier
- /// </summary>
- public DocumentStatus StatusId { get; set; }
-
- /// <summary>
- /// Gets or sets an document reference identifier
- /// </summary>
- public Reference ReferenceId { get; set; }
-
- /// <summary>
- /// Gets or sets an object reference identifier
- /// </summary>
- public string ObjectId { get; set; }
-
- /// <summary>
- /// Gets or sets an document type identifier (DocumentType)
- /// </summary>
- public string DocumentTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the customer email
- /// </summary>
- public string CustomerEmail { get; set; }
-
- /// <summary>
- /// Gets or sets the user name
- /// </summary>
- public string Username { get; set; }
-
- /// <summary>
- /// Gets or sets the currency code
- /// </summary>
- public string CurrencyCode { get; set; }
-
- /// <summary>
- /// Gets or sets the total amount
- /// </summary>
- public double TotalAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the outstand amount
- /// </summary>
- public double OutstandAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of document date
- /// </summary>
- public DateTime? DocDate { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of document due date
- /// </summary>
- public DateTime? DueDate { get; set; }
-
- }
-}
+ /// Gets or sets the document number
+ /// </summary>
+ public string Number { get; set; }
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sales employee identifier
+ /// </summary>
+ public string SeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the parent document identifier
+ /// </summary>
+ public string ParentDocumentId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the download identifier
+ /// </summary>
+ public string DownloadId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the flag
+ /// </summary>
+ public string Flag { get; set; }
+
+ /// <summary>
+ /// Gets or sets the lik
+ /// </summary>
+ public string Link { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets an document status identifier
+ /// </summary>
+ public DocumentStatus StatusId { get; set; }
+
+ /// <summary>
+ /// Gets or sets an document reference identifier
+ /// </summary>
+ public Reference ReferenceId { get; set; }
+
+ /// <summary>
+ /// Gets or sets an object reference identifier
+ /// </summary>
+ public string ObjectId { get; set; }
+
+ /// <summary>
+ /// Gets or sets an document type identifier (DocumentType)
+ /// </summary>
+ public string DocumentTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer email
+ /// </summary>
+ public string CustomerEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets the user name
+ /// </summary>
+ public string Username { get; set; }
+
+ /// <summary>
+ /// Gets or sets the currency code
+ /// </summary>
+ public string CurrencyCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total amount
+ /// </summary>
+ public double TotalAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the outstand amount
+ /// </summary>
+ public double OutstandAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of document date
+ /// </summary>
+ public DateTime? DocDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of document due date
+ /// </summary>
+ public DateTime? DueDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Documents/DocumentSettings.cs b/src/Core/Grand.Domain/Documents/DocumentSettings.cs
index 68e2322f8..5b4520da4 100644
--- a/src/Core/Grand.Domain/Documents/DocumentSettings.cs
+++ b/src/Core/Grand.Domain/Documents/DocumentSettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Documents
+namespace Grand.Domain.Documents;
+
+public class DocumentSettings : ISettings
{
- public class DocumentSettings : ISettings
- {
- /// <summary>
- /// Gets or sets the page size for documents
- /// </summary>
- public int PageSize { get; set; } = 10;
- }
-}
+ /// <summary>
+ /// Gets or sets the page size for documents
+ /// </summary>
+ public int PageSize { get; set; } = 10;
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Documents/DocumentStatus.cs b/src/Core/Grand.Domain/Documents/DocumentStatus.cs
index 55cd308ed..4fdcd8224 100644
--- a/src/Core/Grand.Domain/Documents/DocumentStatus.cs
+++ b/src/Core/Grand.Domain/Documents/DocumentStatus.cs
@@ -1,26 +1,29 @@
-namespace Grand.Domain.Documents
+namespace Grand.Domain.Documents;
+
+public enum DocumentStatus
{
- public enum DocumentStatus
- {
- /// <summary>
- /// Open
- /// </summary>
- Open = 0,
- /// <summary>
- /// Processing
- /// </summary>
- Processing = 10,
- /// <summary>
- /// Approved
- /// </summary>
- Approved = 20,
- /// <summary>
- /// Closed
- /// </summary>
- Closed = 30,
- /// <summary>
- /// Canceled
- /// </summary>
- Cancelled = 40
- }
-}
+ /// <summary>
+ /// Open
+ /// </summary>
+ Open = 0,
+
+ /// <summary>
+ /// Processing
+ /// </summary>
+ Processing = 10,
+
+ /// <summary>
+ /// Approved
+ /// </summary>
+ Approved = 20,
+
+ /// <summary>
+ /// Closed
+ /// </summary>
+ Closed = 30,
+
+ /// <summary>
+ /// Canceled
+ /// </summary>
+ Cancelled = 40
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Documents/DocumentType.cs b/src/Core/Grand.Domain/Documents/DocumentType.cs
index a5ac9e84b..4b716bb17 100644
--- a/src/Core/Grand.Domain/Documents/DocumentType.cs
+++ b/src/Core/Grand.Domain/Documents/DocumentType.cs
@@ -1,12 +1,11 @@
-namespace Grand.Domain.Documents
+namespace Grand.Domain.Documents;
+
+/// <summary>
+/// Represents a document type
+/// </summary>
+public class DocumentType : BaseEntity
{
- /// <summary>
- /// Represents a document type
- /// </summary>
- public class DocumentType : BaseEntity
- {
- public string Name { get; set; }
- public string Description { get; set; }
- public int DisplayOrder { get; set; }
- }
-}
+ public string Name { get; set; }
+ public string Description { get; set; }
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/History/HistoryObject.cs b/src/Core/Grand.Domain/History/HistoryObject.cs
index 2740329fa..1bf5d17b5 100644
--- a/src/Core/Grand.Domain/History/HistoryObject.cs
+++ b/src/Core/Grand.Domain/History/HistoryObject.cs
@@ -1,7 +1,6 @@
-namespace Grand.Domain.History
+namespace Grand.Domain.History;
+
+public class HistoryObject : BaseEntity
{
- public class HistoryObject: BaseEntity
- {
- public BaseEntity Object { get; set; }
- }
-}
+ public BaseEntity Object { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/History/IHistory.cs b/src/Core/Grand.Domain/History/IHistory.cs
index 1f3ef29b1..dada08272 100644
--- a/src/Core/Grand.Domain/History/IHistory.cs
+++ b/src/Core/Grand.Domain/History/IHistory.cs
@@ -1,10 +1,8 @@
-namespace Grand.Domain.History
+namespace Grand.Domain.History;
+
+/// <summary>
+/// Interface for History of changes object
+/// </summary>
+public interface IHistory
{
- /// <summary>
- /// Interface for History of changes object
- /// </summary>
- public interface IHistory
- {
-
- }
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/IPagedList.cs b/src/Core/Grand.Domain/IPagedList.cs
index 2472468c8..f930d3ee4 100644
--- a/src/Core/Grand.Domain/IPagedList.cs
+++ b/src/Core/Grand.Domain/IPagedList.cs
@@ -1,15 +1,14 @@
-namespace Grand.Domain
+namespace Grand.Domain;
+
+/// <summary>
+/// Paged list interface
+/// </summary>
+public interface IPagedList<T> : IList<T>
{
- /// <summary>
- /// Paged list interface
- /// </summary>
- public interface IPagedList<T> : IList<T>
- {
- int PageIndex { get; }
- int PageSize { get; }
- int TotalCount { get; }
- int TotalPages { get; }
- bool HasPreviousPage { get; }
- bool HasNextPage { get; }
- }
-}
+ int PageIndex { get; }
+ int PageSize { get; }
+ int TotalCount { get; }
+ int TotalPages { get; }
+ bool HasPreviousPage { get; }
+ bool HasNextPage { get; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Knowledgebase/ITreeNode.cs b/src/Core/Grand.Domain/Knowledgebase/ITreeNode.cs
index d3b50373f..80914e477 100644
--- a/src/Core/Grand.Domain/Knowledgebase/ITreeNode.cs
+++ b/src/Core/Grand.Domain/Knowledgebase/ITreeNode.cs
@@ -1,22 +1,21 @@
-namespace Grand.Domain.Knowledgebase
+namespace Grand.Domain.Knowledgebase;
+
+public interface ITreeNode
{
- public interface ITreeNode
- {
- string Id { get; set; }
+ string Id { get; set; }
- string Name { get; set; }
+ string Name { get; set; }
- string ParentCategoryId { get; set; }
- }
+ string ParentCategoryId { get; set; }
+}
- public class TreeNode
- {
- public string text { get; set; }
+public class TreeNode
+{
+ public string text { get; set; }
- public string id { get; set; }
+ public string id { get; set; }
- public List<TreeNode> nodes { get; set; }
+ public List<TreeNode> nodes { get; set; }
- public bool isCategory { get; set; }
- }
-}
+ public bool isCategory { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticle.cs b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticle.cs
index a89f8df59..d94c6f79e 100644
--- a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticle.cs
+++ b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticle.cs
@@ -3,85 +3,87 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Knowledgebase
+namespace Grand.Domain.Knowledgebase;
+
+public class KnowledgebaseArticle : BaseEntity, ITreeNode, ITranslationEntity, ISlugEntity, IGroupLinkEntity,
+ IStoreLinkEntity
{
- public class KnowledgebaseArticle : BaseEntity, ITreeNode, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets title of the article
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets content of the article
- /// </summary>
- public string Content { get; set; }
-
- /// <summary>
- /// Gets or sets parent category Id
- /// </summary>
- public string ParentCategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets value indicating whether to show article on knowledgebase homepage
- /// </summary>
- public bool ShowOnHomepage { get; set; }
-
- /// <summary>
- /// Gets or sets list of related articles ids
- /// </summary>
- public IList<string> RelatedArticles { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the comments are allowed
- /// </summary>
- public bool AllowComments { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
- }
-}
+ /// <summary>
+ /// Gets or sets content of the article
+ /// </summary>
+ public string Content { get; set; }
+
+ /// <summary>
+ /// Gets or sets display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets value indicating whether to show article on knowledgebase homepage
+ /// </summary>
+ public bool ShowOnHomepage { get; set; }
+
+ /// <summary>
+ /// Gets or sets list of related articles ids
+ /// </summary>
+ public IList<string> RelatedArticles { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the comments are allowed
+ /// </summary>
+ public bool AllowComments { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+
+ /// <summary>
+ /// Gets or sets title of the article
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets parent category Id
+ /// </summary>
+ public string ParentCategoryId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticleComment.cs b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticleComment.cs
index 6decd394c..2ba337c4c 100644
--- a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticleComment.cs
+++ b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseArticleComment.cs
@@ -1,26 +1,24 @@
-namespace Grand.Domain.Knowledgebase
-{
- public class KnowledgebaseArticleComment : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
+namespace Grand.Domain.Knowledgebase;
- /// <summary>
- /// Gets or sets the comment text
- /// </summary>
- public string CommentText { get; set; }
+public class KnowledgebaseArticleComment : BaseEntity
+{
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the blog post title
- /// </summary>
- public string ArticleTitle { get; set; }
+ /// <summary>
+ /// Gets or sets the comment text
+ /// </summary>
+ public string CommentText { get; set; }
- /// <summary>
- /// Gets or sets the blog post identifier
- /// </summary>
- public string ArticleId { get; set; }
+ /// <summary>
+ /// Gets or sets the blog post title
+ /// </summary>
+ public string ArticleTitle { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the blog post identifier
+ /// </summary>
+ public string ArticleId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseCategory.cs b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseCategory.cs
index 43fee9ad3..8f1da6331 100644
--- a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseCategory.cs
+++ b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseCategory.cs
@@ -3,70 +3,72 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Knowledgebase
+namespace Grand.Domain.Knowledgebase;
+
+public class KnowledgebaseCategory : BaseEntity, ITreeNode, ITranslationEntity, ISlugEntity, IGroupLinkEntity,
+ IStoreLinkEntity
{
- public class KnowledgebaseCategory : BaseEntity, ITreeNode, ITranslationEntity, ISlugEntity, IGroupLinkEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets name of the category
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets published
+ /// </summary>
+ public bool Published { get; set; }
- /// <summary>
- /// Gets or sets parent category Id
- /// </summary>
- public string ParentCategoryId { get; set; }
+ /// <summary>
+ /// Gets or sets meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
- /// <summary>
- /// Gets or sets display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
- /// <summary>
- /// Gets or sets description
- /// </summary>
- public string Description { get; set; }
+ /// <summary>
+ /// Gets or sets meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
- /// <summary>
- /// Gets or sets published
- /// </summary>
- public bool Published { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string SeName { get; set; }
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string SeName { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
- /// <summary>
- /// Gets or sets meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
+ public IList<string> Stores { get; set; } = new List<string>();
- /// <summary>
- /// Gets or sets meta description
- /// </summary>
- public string MetaDescription { get; set; }
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- /// <summary>
- /// Gets or sets meta title
- /// </summary>
- public string MetaTitle { get; set; }
+ /// <summary>
+ /// Gets or sets name of the category
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
- }
-}
+ /// <summary>
+ /// Gets or sets parent category Id
+ /// </summary>
+ public string ParentCategoryId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseSettings.cs b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseSettings.cs
index 64432689e..287c37cc3 100644
--- a/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseSettings.cs
+++ b/src/Core/Grand.Domain/Knowledgebase/KnowledgebaseSettings.cs
@@ -1,22 +1,21 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Knowledgebase
+namespace Grand.Domain.Knowledgebase;
+
+public class KnowledgebaseSettings : ISettings
{
- public class KnowledgebaseSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether knowledgebase is enabled
- /// </summary>
- public bool Enabled { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether knowledgebase is enabled
+ /// </summary>
+ public bool Enabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether not registered user can leave comments
- /// </summary>
- public bool AllowNotRegisteredUsersToLeaveComments { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether not registered user can leave comments
+ /// </summary>
+ public bool AllowNotRegisteredUsersToLeaveComments { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to notify about new article comments
- /// </summary>
- public bool NotifyAboutNewArticleComments { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets a value indicating whether to notify about new article comments
+ /// </summary>
+ public bool NotifyAboutNewArticleComments { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Localization/ITranslationEntity.cs b/src/Core/Grand.Domain/Localization/ITranslationEntity.cs
index 2e920d9b3..ef44cac3f 100644
--- a/src/Core/Grand.Domain/Localization/ITranslationEntity.cs
+++ b/src/Core/Grand.Domain/Localization/ITranslationEntity.cs
@@ -1,10 +1,9 @@
-namespace Grand.Domain.Localization
+namespace Grand.Domain.Localization;
+
+/// <summary>
+/// Represents a translation entity
+/// </summary>
+public interface ITranslationEntity
{
- /// <summary>
- /// Represents a translation entity
- /// </summary>
- public interface ITranslationEntity
- {
- IList<TranslationEntity> Locales { get; set; }
- }
-}
+ IList<TranslationEntity> Locales { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Localization/Language.cs b/src/Core/Grand.Domain/Localization/Language.cs
index a8000e880..a9767ca82 100644
--- a/src/Core/Grand.Domain/Localization/Language.cs
+++ b/src/Core/Grand.Domain/Localization/Language.cs
@@ -1,57 +1,57 @@
using Grand.Domain.Stores;
-namespace Grand.Domain.Localization
+namespace Grand.Domain.Localization;
+
+/// <summary>
+/// Represents a language
+/// </summary>
+public class Language : BaseEntity, IStoreLinkEntity
{
/// <summary>
- /// Represents a language
- /// </summary>
- public class Language : BaseEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the language culture
- /// </summary>
- public string LanguageCulture { get; set; }
-
- /// <summary>
- /// Gets or sets the unique SEO code
- /// </summary>
- public string UniqueSeoCode { get; set; }
-
- /// <summary>
- /// Gets or sets the flag image file name
- /// </summary>
- public string FlagImageFileName { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the language supports "Right-to-left"
- /// </summary>
- public bool Rtl { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the identifier of the default currency for this language; 0 is set when we use the default currency display order
- /// </summary>
- public string DefaultCurrencyId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the language is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- }
-}
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the language culture
+ /// </summary>
+ public string LanguageCulture { get; set; }
+
+ /// <summary>
+ /// Gets or sets the unique SEO code
+ /// </summary>
+ public string UniqueSeoCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the flag image file name
+ /// </summary>
+ public string FlagImageFileName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the language supports "Right-to-left"
+ /// </summary>
+ public bool Rtl { get; set; }
+
+ /// <summary>
+ /// Gets or sets the identifier of the default currency for this language; 0 is set when we use the default currency
+ /// display order
+ /// </summary>
+ public string DefaultCurrencyId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the language is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Localization/LanguageSettings.cs b/src/Core/Grand.Domain/Localization/LanguageSettings.cs
index 682fc72cf..781f43dec 100644
--- a/src/Core/Grand.Domain/Localization/LanguageSettings.cs
+++ b/src/Core/Grand.Domain/Localization/LanguageSettings.cs
@@ -1,22 +1,21 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Localization
+namespace Grand.Domain.Localization;
+
+public class LanguageSettings : ISettings
{
- public class LanguageSettings : ISettings
- {
- /// <summary>
- /// Default admin area language identifier
- /// </summary>
- public string DefaultAdminLanguageId { get; set; }
+ /// <summary>
+ /// Default admin area language identifier
+ /// </summary>
+ public string DefaultAdminLanguageId { get; set; }
+
+ /// <summary>
+ /// A value indicating whether we should detect the current language by a customer region (browser settings)
+ /// </summary>
+ public bool AutomaticallyDetectLanguage { get; set; }
- /// <summary>
- /// A value indicating whether we should detect the current language by a customer region (browser settings)
- /// </summary>
- public bool AutomaticallyDetectLanguage { get; set; }
-
- /// <summary>
- /// A value indicating whether to we should ignore RTL language property for admin area
- /// </summary>
- public bool IgnoreRtlPropertyForAdminArea { get; set; }
- }
+ /// <summary>
+ /// A value indicating whether to we should ignore RTL language property for admin area
+ /// </summary>
+ public bool IgnoreRtlPropertyForAdminArea { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Localization/TranslationEntity.cs b/src/Core/Grand.Domain/Localization/TranslationEntity.cs
index a9806878f..12cd555bf 100644
--- a/src/Core/Grand.Domain/Localization/TranslationEntity.cs
+++ b/src/Core/Grand.Domain/Localization/TranslationEntity.cs
@@ -1,24 +1,22 @@
-namespace Grand.Domain.Localization
+namespace Grand.Domain.Localization;
+
+/// <summary>
+/// Represents a translation property
+/// </summary>
+public class TranslationEntity : SubBaseEntity
{
/// <summary>
- /// Represents a translation property
+ /// Gets or sets the language identifier
/// </summary>
- public class TranslationEntity : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the language identifier
- /// </summary>
- public string LanguageId { get; set; }
+ public string LanguageId { get; set; }
- /// <summary>
- /// Gets or sets the locale key
- /// </summary>
- public string LocaleKey { get; set; }
+ /// <summary>
+ /// Gets or sets the locale key
+ /// </summary>
+ public string LocaleKey { get; set; }
- /// <summary>
- /// Gets or sets the locale value
- /// </summary>
- public string LocaleValue { get; set; }
-
- }
-}
+ /// <summary>
+ /// Gets or sets the locale value
+ /// </summary>
+ public string LocaleValue { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Localization/TranslationResource.cs b/src/Core/Grand.Domain/Localization/TranslationResource.cs
index 3c52ed9bc..976d7804d 100644
--- a/src/Core/Grand.Domain/Localization/TranslationResource.cs
+++ b/src/Core/Grand.Domain/Localization/TranslationResource.cs
@@ -1,30 +1,27 @@
-namespace Grand.Domain.Localization
+namespace Grand.Domain.Localization;
+
+/// <summary>
+/// Represents a locale string resource
+/// </summary>
+public class TranslationResource : BaseEntity
{
/// <summary>
- /// Represents a locale string resource
+ /// Gets or sets the language identifier
/// </summary>
- public class TranslationResource : BaseEntity
- {
- /// <summary>
- /// Gets or sets the language identifier
- /// </summary>
- public string LanguageId { get; set; }
-
- /// <summary>
- /// Gets or sets the translation name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the translation value
- /// </summary>
- public string Value { get; set; }
+ public string LanguageId { get; set; }
- /// <summary>
- /// Gets or sets the translation area
- /// </summary>
- public TranslationResourceArea Area { get; set; }
+ /// <summary>
+ /// Gets or sets the translation name
+ /// </summary>
+ public string Name { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the translation value
+ /// </summary>
+ public string Value { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the translation area
+ /// </summary>
+ public TranslationResourceArea Area { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Localization/TranslationResourceArea.cs b/src/Core/Grand.Domain/Localization/TranslationResourceArea.cs
index 580b26027..b0f64d20e 100644
--- a/src/Core/Grand.Domain/Localization/TranslationResourceArea.cs
+++ b/src/Core/Grand.Domain/Localization/TranslationResourceArea.cs
@@ -1,12 +1,11 @@
-namespace Grand.Domain.Localization
+namespace Grand.Domain.Localization;
+
+public enum TranslationResourceArea
{
- public enum TranslationResourceArea
- {
- Common = 0,
- Admin = 1,
- Front = 2,
- Plugin = 3,
- Other = 4,
- Vendor = 5
- }
-}
+ Common = 0,
+ Admin = 1,
+ Front = 2,
+ Plugin = 3,
+ Other = 4,
+ Vendor = 5
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Media/Download.cs b/src/Core/Grand.Domain/Media/Download.cs
index 53c36c237..9f4b54e16 100644
--- a/src/Core/Grand.Domain/Media/Download.cs
+++ b/src/Core/Grand.Domain/Media/Download.cs
@@ -1,64 +1,62 @@
-namespace Grand.Domain.Media
+namespace Grand.Domain.Media;
+
+/// <summary>
+/// Represents a download
+/// </summary>
+public class Download : BaseEntity
{
/// <summary>
- /// Represents a download
+ /// Gets or sets a customer identifier
/// </summary>
- public class Download : BaseEntity
- {
- /// <summary>
- /// Gets or sets a customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets a GUID
- /// </summary>
- public Guid DownloadGuid { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether DownloadUrl property should be used
- /// </summary>
- public bool UseDownloadUrl { get; set; }
+ /// <summary>
+ /// Gets or sets a GUID
+ /// </summary>
+ public Guid DownloadGuid { get; set; }
- /// <summary>
- /// Gets or sets a download URL
- /// </summary>
- public string DownloadUrl { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether DownloadUrl property should be used
+ /// </summary>
+ public bool UseDownloadUrl { get; set; }
- /// <summary>
- /// Gets or sets the download binary
- /// </summary>
- public byte[] DownloadBinary { get; set; }
+ /// <summary>
+ /// Gets or sets a download URL
+ /// </summary>
+ public string DownloadUrl { get; set; }
- /// <summary>
- /// Gets or sets the download binary
- /// </summary>
- public string DownloadObjectId { get; set; }
+ /// <summary>
+ /// Gets or sets the download binary
+ /// </summary>
+ public byte[] DownloadBinary { get; set; }
- /// <summary>
- /// The mime-type of the download
- /// </summary>
- public string ContentType { get; set; }
+ /// <summary>
+ /// Gets or sets the download binary
+ /// </summary>
+ public string DownloadObjectId { get; set; }
- /// <summary>
- /// The filename of the download
- /// </summary>
- public string Filename { get; set; }
+ /// <summary>
+ /// The mime-type of the download
+ /// </summary>
+ public string ContentType { get; set; }
- /// <summary>
- /// Gets or sets the extension
- /// </summary>
- public string Extension { get; set; }
+ /// <summary>
+ /// The filename of the download
+ /// </summary>
+ public string Filename { get; set; }
- /// <summary>
- /// Gets or sets an download type
- /// </summary>
- public DownloadType DownloadType { get; set; }
+ /// <summary>
+ /// Gets or sets the extension
+ /// </summary>
+ public string Extension { get; set; }
- /// <summary>
- /// Gets or sets an object reference identifier
- /// </summary>
- public string ReferenceId { get; set; }
- }
+ /// <summary>
+ /// Gets or sets an download type
+ /// </summary>
+ public DownloadType DownloadType { get; set; }
-}
+ /// <summary>
+ /// Gets or sets an object reference identifier
+ /// </summary>
+ public string ReferenceId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Media/DownloadType.cs b/src/Core/Grand.Domain/Media/DownloadType.cs
index abdb4c368..b17fd7b56 100644
--- a/src/Core/Grand.Domain/Media/DownloadType.cs
+++ b/src/Core/Grand.Domain/Media/DownloadType.cs
@@ -3,55 +3,67 @@
public enum DownloadType
{
/// <summary>
- /// None
+ /// None
/// </summary>
None = 0,
+
/// <summary>
- /// Product
+ /// Product
/// </summary>
Product = 10,
+
/// <summary>
- /// Customer
+ /// Customer
/// </summary>
Customer = 20,
+
/// <summary>
- /// Order
+ /// Order
/// </summary>
Order = 30,
+
/// <summary>
- /// Shipment
+ /// Shipment
/// </summary>
Shipment = 40,
+
/// <summary>
- /// Shipment
+ /// Shipment
/// </summary>
MerchandiseReturn = 50,
+
/// <summary>
- /// Document
+ /// Document
/// </summary>
Document = 60,
+
/// <summary>
- /// Course
+ /// Course
/// </summary>
Course = 70,
+
/// <summary>
- /// Product attribute
+ /// Product attribute
/// </summary>
ProductAttribute = 80,
+
/// <summary>
- /// Checkout attribute
+ /// Checkout attribute
/// </summary>
CheckoutAttribute = 81,
+
/// <summary>
- /// Contact attribute
+ /// Contact attribute
/// </summary>
ContactAttribute = 82,
+
/// <summary>
- /// Message template
+ /// Message template
/// </summary>
MessageTemplate = 90,
+
/// <summary>
- /// Queued email
+ /// Queued email
/// </summary>
QueuedEmail = 91
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Media/MediaSettings.cs b/src/Core/Grand.Domain/Media/MediaSettings.cs
index f50220537..015ff76f7 100644
--- a/src/Core/Grand.Domain/Media/MediaSettings.cs
+++ b/src/Core/Grand.Domain/Media/MediaSettings.cs
@@ -1,40 +1,39 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Media
-{
- public class MediaSettings : ISettings
- {
- public string DefaultImageName { get; set; } = "no-image.png";
- public int BlogThumbPictureSize { get; set; }
- public int NewsThumbPictureSize { get; set; }
- public int NewsListThumbPictureSize { get; set; }
- public int ProductThumbPictureSize { get; set; }
- public int ProductDetailsPictureSize { get; set; }
- public int ProductBundlePictureSize { get; set; }
- public int ProductThumbPictureSizeOnProductDetailsPage { get; set; }
- public int AssociatedProductPictureSize { get; set; }
- public int CategoryThumbPictureSize { get; set; }
- public int BrandThumbPictureSize { get; set; }
- public int CollectionThumbPictureSize { get; set; }
- public int VendorThumbPictureSize { get; set; }
- public int CourseThumbPictureSize { get; set; }
- public int LessonThumbPictureSize { get; set; }
- public int CartThumbPictureSize { get; set; }
- public int MiniCartThumbPictureSize { get; set; }
- public int AddToCartThumbPictureSize { get; set; }
- public int AutoCompleteSearchThumbPictureSize { get; set; }
- public int ImageSquarePictureSize { get; set; }
- public bool DefaultPictureZoomEnabled { get; set; }
+namespace Grand.Domain.Media;
- public int MaximumImageSize { get; set; }
+public class MediaSettings : ISettings
+{
+ public string DefaultImageName { get; set; } = "no-image.png";
+ public int BlogThumbPictureSize { get; set; }
+ public int NewsThumbPictureSize { get; set; }
+ public int NewsListThumbPictureSize { get; set; }
+ public int ProductThumbPictureSize { get; set; }
+ public int ProductDetailsPictureSize { get; set; }
+ public int ProductBundlePictureSize { get; set; }
+ public int ProductThumbPictureSizeOnProductDetailsPage { get; set; }
+ public int AssociatedProductPictureSize { get; set; }
+ public int CategoryThumbPictureSize { get; set; }
+ public int BrandThumbPictureSize { get; set; }
+ public int CollectionThumbPictureSize { get; set; }
+ public int VendorThumbPictureSize { get; set; }
+ public int CourseThumbPictureSize { get; set; }
+ public int LessonThumbPictureSize { get; set; }
+ public int CartThumbPictureSize { get; set; }
+ public int MiniCartThumbPictureSize { get; set; }
+ public int AddToCartThumbPictureSize { get; set; }
+ public int AutoCompleteSearchThumbPictureSize { get; set; }
+ public int ImageSquarePictureSize { get; set; }
+ public bool DefaultPictureZoomEnabled { get; set; }
- public int ImageQuality { get; set; } = 100;
+ public int MaximumImageSize { get; set; }
- public string AllowedFileTypes { get; set; }
+ public int ImageQuality { get; set; } = 100;
- public string FileManagerEnabledCommands { get; set; } = "abort,open,file,mkdir,mkfile,parents,tmb,dim,paste,duplicate,get,rm,ls,put,size,rename,tree,resize,search,upload";
+ public string AllowedFileTypes { get; set; }
- public string FileManagerDisabledUICommands { get; set; } = "ping,hide,archive,extract,netmount,netunmount,zipdl";
+ public string FileManagerEnabledCommands { get; set; } =
+ "abort,open,file,mkdir,mkfile,parents,tmb,dim,paste,duplicate,get,rm,ls,put,size,rename,tree,resize,search,upload";
- }
+ public string FileManagerDisabledUICommands { get; set; } = "ping,hide,archive,extract,netmount,netunmount,zipdl";
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Media/Picture.cs b/src/Core/Grand.Domain/Media/Picture.cs
index fe5d5e1c2..fc0654a9a 100644
--- a/src/Core/Grand.Domain/Media/Picture.cs
+++ b/src/Core/Grand.Domain/Media/Picture.cs
@@ -1,66 +1,67 @@
using Grand.Domain.Common;
using Grand.Domain.Localization;
-namespace Grand.Domain.Media
+namespace Grand.Domain.Media;
+
+/// <summary>
+/// Represents a picture
+/// </summary>
+public class Picture : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a picture
+ /// Gets or sets the picture binary
/// </summary>
- public class Picture : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the picture binary
- /// </summary>
- public byte[] PictureBinary { get; set; }
+ public byte[] PictureBinary { get; set; }
- /// <summary>
- /// Gets or sets an reference identifier
- /// </summary>
- public Reference Reference { get; set; }
+ /// <summary>
+ /// Gets or sets an reference identifier
+ /// </summary>
+ public Reference Reference { get; set; }
- /// <summary>
- /// Gets or sets an object reference identifier
- /// </summary>
- public string ObjectId { get; set; }
+ /// <summary>
+ /// Gets or sets an object reference identifier
+ /// </summary>
+ public string ObjectId { get; set; }
- /// <summary>
- /// Gets or sets the picture mime type
- /// </summary>
- public string MimeType { get; set; }
+ /// <summary>
+ /// Gets or sets the picture mime type
+ /// </summary>
+ public string MimeType { get; set; }
- /// <summary>
- /// Gets or sets the SEO friednly filename of the picture
- /// </summary>
- public string SeoFilename { get; set; }
+ /// <summary>
+ /// Gets or sets the SEO friednly filename of the picture
+ /// </summary>
+ public string SeoFilename { get; set; }
- /// <summary>
- /// Gets or sets the "alt" attribute for "img" HTML element. If empty, then a default rule will be used (e.g. product name)
- /// </summary>
- public string AltAttribute { get; set; }
+ /// <summary>
+ /// Gets or sets the "alt" attribute for "img" HTML element. If empty, then a default rule will be used (e.g. product
+ /// name)
+ /// </summary>
+ public string AltAttribute { get; set; }
- /// <summary>
- /// Gets or sets the "title" attribute for "img" HTML element. If empty, then a default rule will be used (e.g. product name)
- /// </summary>
- public string TitleAttribute { get; set; }
+ /// <summary>
+ /// Gets or sets the "title" attribute for "img" HTML element. If empty, then a default rule will be used (e.g. product
+ /// name)
+ /// </summary>
+ public string TitleAttribute { get; set; }
- /// <summary>
- /// Gets or sets the "Style" attribute for "img" HTML element.
- /// </summary>
- public string Style { get; set; }
+ /// <summary>
+ /// Gets or sets the "Style" attribute for "img" HTML element.
+ /// </summary>
+ public string Style { get; set; }
- /// <summary>
- /// Gets or sets the "extra field"
- /// </summary>
- public string ExtraField { get; set; }
+ /// <summary>
+ /// Gets or sets the "extra field"
+ /// </summary>
+ public string ExtraField { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the picture is new
- /// </summary>
- public bool IsNew { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the picture is new
+ /// </summary>
+ public bool IsNew { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Media/StorageSettings.cs b/src/Core/Grand.Domain/Media/StorageSettings.cs
index fed2a11de..da3839ff9 100644
--- a/src/Core/Grand.Domain/Media/StorageSettings.cs
+++ b/src/Core/Grand.Domain/Media/StorageSettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Media
+namespace Grand.Domain.Media;
+
+public class StorageSettings : ISettings
{
- public class StorageSettings : ISettings
- {
- /// <summary>
- /// Gets a value indicating whether the images should be stored in data base.
- /// </summary>
- public bool PictureStoreInDb { get; set; } = true;
- }
+ /// <summary>
+ /// Gets a value indicating whether the images should be stored in data base.
+ /// </summary>
+ public bool PictureStoreInDb { get; set; } = true;
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/Campaign.cs b/src/Core/Grand.Domain/Messages/Campaign.cs
index 0d9e9428c..d1f59d4df 100644
--- a/src/Core/Grand.Domain/Messages/Campaign.cs
+++ b/src/Core/Grand.Domain/Messages/Campaign.cs
@@ -1,78 +1,76 @@
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents a campaign
+/// </summary>
+public class Campaign : BaseEntity
{
+ private ICollection<string> _customerGroups;
+ private ICollection<string> _customerTags;
+ private ICollection<string> _newsletterCategories;
+
/// <summary>
- /// Represents a campaign
+ /// Gets or sets the name
/// </summary>
- public class Campaign : BaseEntity
- {
- private ICollection<string> _customerTags;
- private ICollection<string> _customerGroups;
- private ICollection<string> _newsletterCategories;
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets the subject
+ /// </summary>
+ public string Subject { get; set; }
- /// <summary>
- /// Gets or sets the subject
- /// </summary>
- public string Subject { get; set; }
+ /// <summary>
+ /// Gets or sets the body
+ /// </summary>
+ public string Body { get; set; }
- /// <summary>
- /// Gets or sets the body
- /// </summary>
- public string Body { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
+ /// <summary>
+ /// Gets or sets the lang identifier
+ /// </summary>
+ public string LanguageId { get; set; }
- /// <summary>
- /// Gets or sets the lang identifier
- /// </summary>
- public string LanguageId { get; set; }
+ public DateTime? CustomerCreatedDateFrom { get; set; }
+ public DateTime? CustomerCreatedDateTo { get; set; }
+ public DateTime? CustomerLastActivityDateFrom { get; set; }
+ public DateTime? CustomerLastActivityDateTo { get; set; }
+ public DateTime? CustomerLastPurchaseDateFrom { get; set; }
+ public DateTime? CustomerLastPurchaseDateTo { get; set; }
- public DateTime? CustomerCreatedDateFrom { get; set; }
- public DateTime? CustomerCreatedDateTo { get; set; }
- public DateTime? CustomerLastActivityDateFrom { get; set; }
- public DateTime? CustomerLastActivityDateTo { get; set; }
- public DateTime? CustomerLastPurchaseDateFrom { get; set; }
- public DateTime? CustomerLastPurchaseDateTo { get; set; }
+ public CampaignCondition CustomerHasOrders { get; set; }
- public CampaignCondition CustomerHasOrders { get; set; }
-
- public CampaignCondition CustomerHasShoppingCart { get; set; }
-
- /// <summary>
- /// Gets or sets the used email account identifier
- /// </summary>
- public string EmailAccountId { get; set; }
- /// <summary>
- /// Gets or sets the customer tags
- /// </summary>
- public virtual ICollection<string> CustomerTags
- {
- get => _customerTags ??= new List<string>();
- protected set => _customerTags = value;
- }
- /// <summary>
- /// Gets or sets the customer groups
- /// </summary>
- public virtual ICollection<string> CustomerGroups
- {
- get => _customerGroups ??= new List<string>();
- protected set => _customerGroups = value;
- }
- /// <summary>
- /// Gets or sets the newsletter categories
- /// </summary>
- public virtual ICollection<string> NewsletterCategories
- {
- get => _newsletterCategories ??= new List<string>();
- protected set => _newsletterCategories = value;
- }
+ public CampaignCondition CustomerHasShoppingCart { get; set; }
+ /// <summary>
+ /// Gets or sets the used email account identifier
+ /// </summary>
+ public string EmailAccountId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer tags
+ /// </summary>
+ public virtual ICollection<string> CustomerTags {
+ get => _customerTags ??= new List<string>();
+ protected set => _customerTags = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the customer groups
+ /// </summary>
+ public virtual ICollection<string> CustomerGroups {
+ get => _customerGroups ??= new List<string>();
+ protected set => _customerGroups = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the newsletter categories
+ /// </summary>
+ public virtual ICollection<string> NewsletterCategories {
+ get => _newsletterCategories ??= new List<string>();
+ protected set => _newsletterCategories = value;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/CampaignCondition.cs b/src/Core/Grand.Domain/Messages/CampaignCondition.cs
index 06b886748..dfeea53a8 100644
--- a/src/Core/Grand.Domain/Messages/CampaignCondition.cs
+++ b/src/Core/Grand.Domain/Messages/CampaignCondition.cs
@@ -1,10 +1,8 @@
-namespace Grand.Domain.Messages
-{
- public enum CampaignCondition
- {
- All = 0,
- False = 1,
- True = 2
- }
+namespace Grand.Domain.Messages;
-}
+public enum CampaignCondition
+{
+ All = 0,
+ False = 1,
+ True = 2
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/CampaignCustomerSubscription.cs b/src/Core/Grand.Domain/Messages/CampaignCustomerSubscription.cs
index 42de5d39e..a339d7c2a 100644
--- a/src/Core/Grand.Domain/Messages/CampaignCustomerSubscription.cs
+++ b/src/Core/Grand.Domain/Messages/CampaignCustomerSubscription.cs
@@ -1,8 +1,7 @@
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+public class CampaignCustomerSubscription
{
- public class CampaignCustomerSubscription
- {
- public string CustomerId { get; set; }
- public string Email { get; set; }
- }
-}
+ public string CustomerId { get; set; }
+ public string Email { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/CampaignHistory.cs b/src/Core/Grand.Domain/Messages/CampaignHistory.cs
index a37355aae..e338573bd 100644
--- a/src/Core/Grand.Domain/Messages/CampaignHistory.cs
+++ b/src/Core/Grand.Domain/Messages/CampaignHistory.cs
@@ -1,20 +1,17 @@
-namespace Grand.Domain.Messages
-{
- /// <summary>
- /// Represents a campaign history
- /// </summary>
- public class CampaignHistory : BaseEntity
- {
-
- public string CampaignId { get; set; }
+namespace Grand.Domain.Messages;
- public string Email { get; set; }
+/// <summary>
+/// Represents a campaign history
+/// </summary>
+public class CampaignHistory : BaseEntity
+{
+ public string CampaignId { get; set; }
- public string CustomerId { get; set; }
+ public string Email { get; set; }
- public string StoreId { get; set; }
+ public string CustomerId { get; set; }
- public DateTime CreatedDateUtc { get; set; }
+ public string StoreId { get; set; }
- }
-}
+ public DateTime CreatedDateUtc { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/ContactAttribute.cs b/src/Core/Grand.Domain/Messages/ContactAttribute.cs
index a11deefcb..931cf143c 100644
--- a/src/Core/Grand.Domain/Messages/ContactAttribute.cs
+++ b/src/Core/Grand.Domain/Messages/ContactAttribute.cs
@@ -4,105 +4,104 @@ using Grand.Domain.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Stores;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents a contact attribute
+/// </summary>
+public class ContactAttribute : BaseEntity, ITranslationEntity, IStoreLinkEntity, IGroupLinkEntity
{
+ private ICollection<ContactAttributeValue> _contactAttributeValues;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the text prompt
+ /// </summary>
+ public string TextPrompt { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is required
+ /// </summary>
+ public bool IsRequired { get; set; }
+
+
+ /// <summary>
+ /// Gets or sets the attribute control type identifier
+ /// </summary>
+ public int AttributeControlTypeId { get; set; }
+
/// <summary>
- /// Represents a contact attribute
+ /// Gets or sets the display order
/// </summary>
- public class ContactAttribute : BaseEntity, ITranslationEntity, IStoreLinkEntity, IGroupLinkEntity
- {
- private ICollection<ContactAttributeValue> _contactAttributeValues;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the text prompt
- /// </summary>
- public string TextPrompt { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is required
- /// </summary>
- public bool IsRequired { get; set; }
-
-
- /// <summary>
- /// Gets or sets the attribute control type identifier
- /// </summary>
- public int AttributeControlTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- //validation fields
-
- /// <summary>
- /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox)
- /// </summary>
- public int? ValidationMinLength { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox)
- /// </summary>
- public int? ValidationMaxLength { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for file allowed extensions (for file upload)
- /// </summary>
- public string ValidationFileAllowedExtensions { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload)
- /// </summary>
- public int? ValidationFileMaximumSize { get; set; }
-
- /// <summary>
- /// Gets or sets the default value (for textbox and multiline textbox)
- /// </summary>
- public string DefaultValue { get; set; }
-
- public IList<CustomAttribute> ConditionAttribute { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
-
- /// <summary>
- /// Gets the attribute control type
- /// </summary>
- public AttributeControlType AttributeControlType
- {
- get => (AttributeControlType)AttributeControlTypeId;
- set => AttributeControlTypeId = (int)value;
- }
- /// <summary>
- /// Gets the checkout attribute values
- /// </summary>
- public virtual ICollection<ContactAttributeValue> ContactAttributeValues
- {
- get => _contactAttributeValues ??= new List<ContactAttributeValue>();
- protected set => _contactAttributeValues = value;
- }
+ public int DisplayOrder { get; set; }
+
+ //validation fields
+
+ /// <summary>
+ /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox)
+ /// </summary>
+ public int? ValidationMinLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox)
+ /// </summary>
+ public int? ValidationMaxLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for file allowed extensions (for file upload)
+ /// </summary>
+ public string ValidationFileAllowedExtensions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload)
+ /// </summary>
+ public int? ValidationFileMaximumSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value (for textbox and multiline textbox)
+ /// </summary>
+ public string DefaultValue { get; set; }
+
+ public IList<CustomAttribute> ConditionAttribute { get; set; } = new List<CustomAttribute>();
+
+
+ /// <summary>
+ /// Gets the attribute control type
+ /// </summary>
+ public AttributeControlType AttributeControlType {
+ get => (AttributeControlType)AttributeControlTypeId;
+ set => AttributeControlTypeId = (int)value;
}
-}
+ /// <summary>
+ /// Gets the checkout attribute values
+ /// </summary>
+ public virtual ICollection<ContactAttributeValue> ContactAttributeValues {
+ get => _contactAttributeValues ??= new List<ContactAttributeValue>();
+ protected set => _contactAttributeValues = value;
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/ContactAttributeExtensions.cs b/src/Core/Grand.Domain/Messages/ContactAttributeExtensions.cs
index 6bc0c5963..fcc617fe7 100644
--- a/src/Core/Grand.Domain/Messages/ContactAttributeExtensions.cs
+++ b/src/Core/Grand.Domain/Messages/ContactAttributeExtensions.cs
@@ -1,51 +1,50 @@
using Grand.Domain.Catalog;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Extensions
+/// </summary>
+public static class ContactAttributeExtensions
{
/// <summary>
- /// Extensions
+ /// Gets a value indicating whether this contact attribute should have values
/// </summary>
- public static class ContactAttributeExtensions
+ /// <param name="contactAttribute">Contact attribute</param>
+ /// <returns>Result</returns>
+ public static bool ShouldHaveValues(this ContactAttribute contactAttribute)
{
- /// <summary>
- /// Gets a value indicating whether this contact attribute should have values
- /// </summary>
- /// <param name="contactAttribute">Contact attribute</param>
- /// <returns>Result</returns>
- public static bool ShouldHaveValues(this ContactAttribute contactAttribute)
- {
- if (contactAttribute == null)
- return false;
+ if (contactAttribute == null)
+ return false;
- if (contactAttribute.AttributeControlType == AttributeControlType.TextBox ||
- contactAttribute.AttributeControlType == AttributeControlType.MultilineTextbox ||
- contactAttribute.AttributeControlType == AttributeControlType.Datepicker ||
- contactAttribute.AttributeControlType == AttributeControlType.FileUpload)
- return false;
+ if (contactAttribute.AttributeControlType == AttributeControlType.TextBox ||
+ contactAttribute.AttributeControlType == AttributeControlType.MultilineTextbox ||
+ contactAttribute.AttributeControlType == AttributeControlType.Datepicker ||
+ contactAttribute.AttributeControlType == AttributeControlType.FileUpload)
+ return false;
- //other attribute controle types support values
- return true;
- }
+ //other attribute controle types support values
+ return true;
+ }
- /// <summary>
- /// A value indicating whether this contact attribute can be used as condition for some other attribute
- /// </summary>
- /// <param name="contactAttribute">Contact attribute</param>
- /// <returns>Result</returns>
- public static bool CanBeUsedAsCondition(this ContactAttribute contactAttribute)
- {
- if (contactAttribute == null)
- return false;
+ /// <summary>
+ /// A value indicating whether this contact attribute can be used as condition for some other attribute
+ /// </summary>
+ /// <param name="contactAttribute">Contact attribute</param>
+ /// <returns>Result</returns>
+ public static bool CanBeUsedAsCondition(this ContactAttribute contactAttribute)
+ {
+ if (contactAttribute == null)
+ return false;
- if (contactAttribute.AttributeControlType == AttributeControlType.ReadonlyCheckboxes ||
- contactAttribute.AttributeControlType == AttributeControlType.TextBox ||
- contactAttribute.AttributeControlType == AttributeControlType.MultilineTextbox ||
- contactAttribute.AttributeControlType == AttributeControlType.Datepicker ||
- contactAttribute.AttributeControlType == AttributeControlType.FileUpload)
- return false;
+ if (contactAttribute.AttributeControlType == AttributeControlType.ReadonlyCheckboxes ||
+ contactAttribute.AttributeControlType == AttributeControlType.TextBox ||
+ contactAttribute.AttributeControlType == AttributeControlType.MultilineTextbox ||
+ contactAttribute.AttributeControlType == AttributeControlType.Datepicker ||
+ contactAttribute.AttributeControlType == AttributeControlType.FileUpload)
+ return false;
- //other attribute controle types support it
- return true;
- }
+ //other attribute controle types support it
+ return true;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/ContactAttributeValue.cs b/src/Core/Grand.Domain/Messages/ContactAttributeValue.cs
index 0765c2b31..b39fbb49d 100644
--- a/src/Core/Grand.Domain/Messages/ContactAttributeValue.cs
+++ b/src/Core/Grand.Domain/Messages/ContactAttributeValue.cs
@@ -1,41 +1,39 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents a contact attribute value
+/// </summary>
+public class ContactAttributeValue : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a contact attribute value
+ /// Gets or sets the checkout attribute mapping identifier
/// </summary>
- public class ContactAttributeValue : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the checkout attribute mapping identifier
- /// </summary>
- public string ContactAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets the checkout attribute name
- /// </summary>
- public string Name { get; set; }
+ public string ContactAttributeId { get; set; }
- /// <summary>
- /// Gets or sets the color RGB value (used with "Color squares" attribute type)
- /// </summary>
- public string ColorSquaresRgb { get; set; }
+ /// <summary>
+ /// Gets or sets the checkout attribute name
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the value is pre-selected
- /// </summary>
- public bool IsPreSelected { get; set; }
+ /// <summary>
+ /// Gets or sets the color RGB value (used with "Color squares" attribute type)
+ /// </summary>
+ public string ColorSquaresRgb { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the value is pre-selected
+ /// </summary>
+ public bool IsPreSelected { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/ContactUs.cs b/src/Core/Grand.Domain/Messages/ContactUs.cs
index 40a4057fa..97c820a60 100644
--- a/src/Core/Grand.Domain/Messages/ContactUs.cs
+++ b/src/Core/Grand.Domain/Messages/ContactUs.cs
@@ -1,67 +1,64 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Search term record (for statistics)
+/// </summary>
+public class ContactUs : BaseEntity
{
/// <summary>
- /// Search term record (for statistics)
+ /// Gets or sets the customer identifier
/// </summary>
- public class ContactUs : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the IP address
- /// </summary>
- public string IpAddress { get; set; }
-
- /// <summary>
- /// Gets or sets the email
- /// </summary>
- public string Email { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets full name
- /// </summary>
- public string FullName { get; set; }
+ /// <summary>
+ /// Gets or sets the IP address
+ /// </summary>
+ public string IpAddress { get; set; }
- /// <summary>
- /// Gets or sets the subject
- /// </summary>
- public string Subject { get; set; }
+ /// <summary>
+ /// Gets or sets the email
+ /// </summary>
+ public string Email { get; set; }
- /// <summary>
- /// Gets or sets enquiry
- /// </summary>
- public string Enquiry { get; set; }
+ /// <summary>
+ /// Gets or sets full name
+ /// </summary>
+ public string FullName { get; set; }
- /// <summary>
- /// Gets or sets the email account identifier
- /// </summary>
- public string EmailAccountId { get; set; }
+ /// <summary>
+ /// Gets or sets the subject
+ /// </summary>
+ public string Subject { get; set; }
- /// <summary>
- /// Gets or sets the vendor identifier
- /// </summary>
- public string VendorId { get; set; }
+ /// <summary>
+ /// Gets or sets enquiry
+ /// </summary>
+ public string Enquiry { get; set; }
- /// <summary>
- /// Gets or sets the contact attribute description
- /// </summary>
- public string ContactAttributeDescription { get; set; }
+ /// <summary>
+ /// Gets or sets the email account identifier
+ /// </summary>
+ public string EmailAccountId { get; set; }
- /// <summary>
- /// Gets or sets the custom attributes (see "AddressAttribute" entity for more info)
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+ /// <summary>
+ /// Gets or sets the vendor identifier
+ /// </summary>
+ public string VendorId { get; set; }
+ /// <summary>
+ /// Gets or sets the contact attribute description
+ /// </summary>
+ public string ContactAttributeDescription { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the custom attributes (see "AddressAttribute" entity for more info)
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/EmailAccount.cs b/src/Core/Grand.Domain/Messages/EmailAccount.cs
index 11e4501ec..dfbe59f38 100644
--- a/src/Core/Grand.Domain/Messages/EmailAccount.cs
+++ b/src/Core/Grand.Domain/Messages/EmailAccount.cs
@@ -1,51 +1,48 @@
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents an email account
+/// </summary>
+public class EmailAccount : BaseEntity
{
/// <summary>
- /// Represents an email account
- /// </summary>
- public class EmailAccount : BaseEntity
- {
- /// <summary>
- /// Gets or sets an email address
- /// </summary>
- public string Email { get; set; }
-
- /// <summary>
- /// Gets or sets an email display name
- /// </summary>
- public string DisplayName { get; set; }
-
- /// <summary>
- /// Gets or sets an email host
- /// </summary>
- public string Host { get; set; }
-
- /// <summary>
- /// Gets or sets an email port
- /// </summary>
- public int Port { get; set; }
-
- /// <summary>
- /// Gets or sets an email user name
- /// </summary>
- public string Username { get; set; }
-
- /// <summary>
- /// Gets or sets an email password
- /// </summary>
- public string Password { get; set; }
-
- /// <summary>
- /// Gets or sets a value that the remote certificate is invalid according to the validation procedure.
- /// https://github.com/jstedfast/MailKit/blob/master/FAQ.md#InvalidSslCertificate
- /// </summary>
- public bool UseServerCertificateValidation { get; set; }
-
- /// <summary>
- /// Provides a way of specifying the SSL and/or TLS encryption that should be used for a connection
- /// </summary>
- public int SecureSocketOptionsId { get; set; }
-
-
- }
-}
+ /// Gets or sets an email address
+ /// </summary>
+ public string Email { get; set; }
+
+ /// <summary>
+ /// Gets or sets an email display name
+ /// </summary>
+ public string DisplayName { get; set; }
+
+ /// <summary>
+ /// Gets or sets an email host
+ /// </summary>
+ public string Host { get; set; }
+
+ /// <summary>
+ /// Gets or sets an email port
+ /// </summary>
+ public int Port { get; set; }
+
+ /// <summary>
+ /// Gets or sets an email user name
+ /// </summary>
+ public string Username { get; set; }
+
+ /// <summary>
+ /// Gets or sets an email password
+ /// </summary>
+ public string Password { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value that the remote certificate is invalid according to the validation procedure.
+ /// https://github.com/jstedfast/MailKit/blob/master/FAQ.md#InvalidSslCertificate
+ /// </summary>
+ public bool UseServerCertificateValidation { get; set; }
+
+ /// <summary>
+ /// Provides a way of specifying the SSL and/or TLS encryption that should be used for a connection
+ /// </summary>
+ public int SecureSocketOptionsId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/EmailAccountSettings.cs b/src/Core/Grand.Domain/Messages/EmailAccountSettings.cs
index ac9d64c1f..586153efe 100644
--- a/src/Core/Grand.Domain/Messages/EmailAccountSettings.cs
+++ b/src/Core/Grand.Domain/Messages/EmailAccountSettings.cs
@@ -1,14 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Messages
-{
- public class EmailAccountSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a store default email account identifier
- /// </summary>
- public string DefaultEmailAccountId { get; set; }
-
- }
+namespace Grand.Domain.Messages;
-}
+public class EmailAccountSettings : ISettings
+{
+ /// <summary>
+ /// Gets or sets a store default email account identifier
+ /// </summary>
+ public string DefaultEmailAccountId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/LiquidObject.cs b/src/Core/Grand.Domain/Messages/LiquidObject.cs
index 346f46d98..ae82f8dc6 100644
--- a/src/Core/Grand.Domain/Messages/LiquidObject.cs
+++ b/src/Core/Grand.Domain/Messages/LiquidObject.cs
@@ -1,60 +1,59 @@
using DotLiquid;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// An object that acumulates all DotLiquid Drops
+/// </summary>
+public class LiquidObject
{
- /// <summary>
- /// An object that acumulates all DotLiquid Drops
- /// </summary>
- public class LiquidObject
- {
- public Drop AttributeCombination { get; set; }
+ public Drop AttributeCombination { get; set; }
- public Drop Auctions { get; set; }
+ public Drop Auctions { get; set; }
- public Drop OutOfStockSubscription { get; set; }
+ public Drop OutOfStockSubscription { get; set; }
- public Drop BlogComment { get; set; }
+ public Drop BlogComment { get; set; }
- public Drop Customer { get; set; }
+ public Drop Customer { get; set; }
- public Drop GiftVoucher { get; set; }
+ public Drop GiftVoucher { get; set; }
- public Drop Knowledgebase { get; set; }
+ public Drop Knowledgebase { get; set; }
- public Drop NewsComment { get; set; }
+ public Drop NewsComment { get; set; }
- public Drop NewsLetterSubscription { get; set; }
+ public Drop NewsLetterSubscription { get; set; }
- public Drop Order { get; set; }
+ public Drop Order { get; set; }
- public Drop Product { get; set; }
+ public Drop Product { get; set; }
- public Drop ProductReview { get; set; }
+ public Drop ProductReview { get; set; }
- public Drop RecurringPayment { get; set; }
+ public Drop RecurringPayment { get; set; }
- public Drop MerchandiseReturn { get; set; }
+ public Drop MerchandiseReturn { get; set; }
- public Drop Shipment { get; set; }
+ public Drop Shipment { get; set; }
- public Drop ShoppingCart { get; set; }
+ public Drop ShoppingCart { get; set; }
- public Drop Store { get; set; }
+ public Drop Store { get; set; }
- public Drop Vendor { get; set; }
+ public Drop Vendor { get; set; }
- public Drop VendorReview { get; set; }
+ public Drop VendorReview { get; set; }
- public Drop EmailAFriend { get; set; }
+ public Drop EmailAFriend { get; set; }
- public Drop AskQuestion { get; set; }
+ public Drop AskQuestion { get; set; }
- public Drop VatValidationResult { get; set; }
+ public Drop VatValidationResult { get; set; }
- public Drop ContactUs { get; set; }
+ public Drop ContactUs { get; set; }
- public Drop Email { get; set; }
+ public Drop Email { get; set; }
- public IDictionary<string, string> AdditionalTokens { get; set; } = new Dictionary<string, string>();
- }
+ public IDictionary<string, string> AdditionalTokens { get; set; } = new Dictionary<string, string>();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/MessageDelayPeriod.cs b/src/Core/Grand.Domain/Messages/MessageDelayPeriod.cs
index 9b8d7cb3a..7cd5e395c 100644
--- a/src/Core/Grand.Domain/Messages/MessageDelayPeriod.cs
+++ b/src/Core/Grand.Domain/Messages/MessageDelayPeriod.cs
@@ -1,39 +1,39 @@
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+public enum MessageDelayPeriod
{
- public enum MessageDelayPeriod
- {
- /// <summary>
- /// Hours
- /// </summary>
- Hours = 0,
- /// <summary>
- /// Days
- /// </summary>
- Days = 1
- }
+ /// <summary>
+ /// Hours
+ /// </summary>
+ Hours = 0,
/// <summary>
- /// MessageDelayPeriod Extensions
+ /// Days
/// </summary>
- public static class MessageDelayPeriodExtensions
+ Days = 1
+}
+
+/// <summary>
+/// MessageDelayPeriod Extensions
+/// </summary>
+public static class MessageDelayPeriodExtensions
+{
+ /// <summary>
+ /// Returns message delay in hours
+ /// </summary>
+ /// <param name="period">Message delay period</param>
+ /// <param name="value">Value of delay send</param>
+ /// <returns>Value of message delay in hours</returns>
+ public static int ToHours(this MessageDelayPeriod period, int value)
{
- /// <summary>
- /// Returns message delay in hours
- /// </summary>
- /// <param name="period">Message delay period</param>
- /// <param name="value">Value of delay send</param>
- /// <returns>Value of message delay in hours</returns>
- public static int ToHours(this MessageDelayPeriod period, int value)
+ switch (period)
{
- switch (period)
- {
- case MessageDelayPeriod.Hours:
- return value;
- case MessageDelayPeriod.Days:
- return value * 24;
- default:
- throw new ArgumentOutOfRangeException("MessageDelayPeriod");
- }
+ case MessageDelayPeriod.Hours:
+ return value;
+ case MessageDelayPeriod.Days:
+ return value * 24;
+ default:
+ throw new ArgumentOutOfRangeException("MessageDelayPeriod");
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/MessageTemplate.cs b/src/Core/Grand.Domain/Messages/MessageTemplate.cs
index 6ee0e1ce6..494783c91 100644
--- a/src/Core/Grand.Domain/Messages/MessageTemplate.cs
+++ b/src/Core/Grand.Domain/Messages/MessageTemplate.cs
@@ -1,68 +1,68 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents a message template
+/// </summary>
+public class MessageTemplate : BaseEntity, ITranslationEntity, IStoreLinkEntity
{
/// <summary>
- /// Represents a message template
+ /// Gets or sets the name
/// </summary>
- public class MessageTemplate : BaseEntity, ITranslationEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the BCC Email addresses
- /// </summary>
- public string BccEmailAddresses { get; set; }
+ /// <summary>
+ /// Gets or sets the BCC Email addresses
+ /// </summary>
+ public string BccEmailAddresses { get; set; }
- /// <summary>
- /// Gets or sets the subject
- /// </summary>
- public string Subject { get; set; }
+ /// <summary>
+ /// Gets or sets the subject
+ /// </summary>
+ public string Subject { get; set; }
- /// <summary>
- /// Gets or sets the body
- /// </summary>
- public string Body { get; set; }
+ /// <summary>
+ /// Gets or sets the body
+ /// </summary>
+ public string Body { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the template is active
- /// </summary>
- public bool IsActive { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the template is active
+ /// </summary>
+ public bool IsActive { get; set; }
+
+ /// <summary>
+ /// Gets or sets the delay before sending message
+ /// </summary>
+ public int? DelayBeforeSend { get; set; }
- /// <summary>
- /// Gets or sets the delay before sending message
- /// </summary>
- public int? DelayBeforeSend { get; set; }
+ /// <summary>
+ /// Gets or sets the period of message delay
+ /// </summary>
+ public MessageDelayPeriod DelayPeriodId { get; set; }
- /// <summary>
- /// Gets or sets the period of message delay
- /// </summary>
- public MessageDelayPeriod DelayPeriodId { get; set; }
+ /// <summary>
+ /// Gets or sets the download identifier of attached file
+ /// </summary>
+ public string AttachedDownloadId { get; set; }
- /// <summary>
- /// Gets or sets the download identifier of attached file
- /// </summary>
- public string AttachedDownloadId { get; set; }
+ /// <summary>
+ /// Gets or sets the used email account identifier
+ /// </summary>
+ public string EmailAccountId { get; set; }
- /// <summary>
- /// Gets or sets the used email account identifier
- /// </summary>
- public string EmailAccountId { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
+ public IList<string> Stores { get; set; } = new List<string>();
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/NewsLetterSubscription.cs b/src/Core/Grand.Domain/Messages/NewsLetterSubscription.cs
index 30041531c..682f8fc8e 100644
--- a/src/Core/Grand.Domain/Messages/NewsLetterSubscription.cs
+++ b/src/Core/Grand.Domain/Messages/NewsLetterSubscription.cs
@@ -1,46 +1,44 @@
using Grand.Domain.History;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents NewsLetterSubscription entity
+/// </summary>
+public class NewsLetterSubscription : BaseEntity, IHistory
{
+ private ICollection<string> _categories;
+
+ /// <summary>
+ /// Gets or sets the newsletter subscription GUID
+ /// </summary>
+ public Guid NewsLetterSubscriptionGuid { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subcriber email
+ /// </summary>
+ public string Email { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether subscription is active
+ /// </summary>
+ public bool Active { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier in which a customer has subscribed to newsletter
+ /// </summary>
+ public string StoreId { get; set; }
+
/// <summary>
- /// Represents NewsLetterSubscription entity
+ /// Gets or sets the categories
/// </summary>
- public class NewsLetterSubscription : BaseEntity, IHistory
- {
- private ICollection<string> _categories;
-
- /// <summary>
- /// Gets or sets the newsletter subscription GUID
- /// </summary>
- public Guid NewsLetterSubscriptionGuid { get; set; }
-
- /// <summary>
- /// Gets or sets the Customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the subcriber email
- /// </summary>
- public string Email { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether subscription is active
- /// </summary>
- public bool Active { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier in which a customer has subscribed to newsletter
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the categories
- /// </summary>
- public virtual ICollection<string> Categories
- {
- get => _categories ??= new List<string>();
- protected set => _categories = value;
- }
+ public virtual ICollection<string> Categories {
+ get => _categories ??= new List<string>();
+ protected set => _categories = value;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/NewsletterCategory.cs b/src/Core/Grand.Domain/Messages/NewsletterCategory.cs
index c34649ecf..8278bf457 100644
--- a/src/Core/Grand.Domain/Messages/NewsletterCategory.cs
+++ b/src/Core/Grand.Domain/Messages/NewsletterCategory.cs
@@ -1,33 +1,33 @@
using Grand.Domain.Localization;
using Grand.Domain.Stores;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+public class NewsletterCategory : BaseEntity, ITranslationEntity, IStoreLinkEntity
{
- public class NewsletterCategory : BaseEntity, ITranslationEntity, IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the selected
- /// </summary>
- public bool Selected { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- public int DisplayOrder { get; set; }
-
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the selected
+ /// </summary>
+ public bool Selected { get; set; }
+
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/QueuedEmail.cs b/src/Core/Grand.Domain/Messages/QueuedEmail.cs
index 8f982f66a..011eef4d8 100644
--- a/src/Core/Grand.Domain/Messages/QueuedEmail.cs
+++ b/src/Core/Grand.Domain/Messages/QueuedEmail.cs
@@ -1,115 +1,115 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents an email item
+/// </summary>
+public class QueuedEmail : BaseEntity
{
/// <summary>
- /// Represents an email item
- /// </summary>
- public class QueuedEmail : BaseEntity
- {
- /// <summary>
- /// Gets or sets the priority
- /// </summary>
- public QueuedEmailPriority PriorityId { get; set; }
-
- /// <summary>
- /// Gets or sets the From property
- /// </summary>
- public string From { get; set; }
-
- /// <summary>
- /// Gets or sets the FromName property
- /// </summary>
- public string FromName { get; set; }
-
- /// <summary>
- /// Gets or sets the To property
- /// </summary>
- public string To { get; set; }
-
- /// <summary>
- /// Gets or sets the ToName property
- /// </summary>
- public string ToName { get; set; }
-
- /// <summary>
- /// Gets or sets the ReplyTo property
- /// </summary>
- public string ReplyTo { get; set; }
-
- /// <summary>
- /// Gets or sets the ReplyToName property
- /// </summary>
- public string ReplyToName { get; set; }
-
- /// <summary>
- /// Gets or sets the CC
- /// </summary>
- public string CC { get; set; }
-
- /// <summary>
- /// Gets or sets the Bcc
- /// </summary>
- public string Bcc { get; set; }
-
- /// <summary>
- /// Gets or sets the subject
- /// </summary>
- public string Subject { get; set; }
-
- /// <summary>
- /// Gets or sets the body
- /// </summary>
- public string Body { get; set; }
-
- /// <summary>
- /// Gets or sets the attachment file path (full file path)
- /// </summary>
- public string AttachmentFilePath { get; set; }
-
- /// <summary>
- /// Gets or sets the attachment file name. If specified, then this file name will be sent to a recipient. Otherwise, "AttachmentFilePath" name will be used.
- /// </summary>
- public string AttachmentFileName { get; set; }
-
- /// <summary>
- /// Gets or sets the download identifiers of attached file
- /// </summary>
- public IList<string> AttachedDownloads { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the date and time in UTC before which this email should not be sent
- /// </summary>
- public DateTime? DontSendBeforeDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the send tries
- /// </summary>
- public int SentTries { get; set; }
-
- /// <summary>
- /// Gets or sets the sent date and time
- /// </summary>
- public DateTime? SentOnUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the read date and time
- /// </summary>
- public DateTime? ReadOnUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the used email account identifier
- /// </summary>
- public string EmailAccountId { get; set; }
-
- /// <summary>
- /// Gets or sets an reference identifier
- /// </summary>
- public Reference Reference { get; set; }
-
- /// <summary>
- /// Gets or sets an object reference identifier
- /// </summary>
- public string ObjectId { get; set; }
- }
-}
+ /// Gets or sets the priority
+ /// </summary>
+ public QueuedEmailPriority PriorityId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the From property
+ /// </summary>
+ public string From { get; set; }
+
+ /// <summary>
+ /// Gets or sets the FromName property
+ /// </summary>
+ public string FromName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the To property
+ /// </summary>
+ public string To { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ToName property
+ /// </summary>
+ public string ToName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ReplyTo property
+ /// </summary>
+ public string ReplyTo { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ReplyToName property
+ /// </summary>
+ public string ReplyToName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the CC
+ /// </summary>
+ public string CC { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Bcc
+ /// </summary>
+ public string Bcc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the subject
+ /// </summary>
+ public string Subject { get; set; }
+
+ /// <summary>
+ /// Gets or sets the body
+ /// </summary>
+ public string Body { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attachment file path (full file path)
+ /// </summary>
+ public string AttachmentFilePath { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attachment file name. If specified, then this file name will be sent to a recipient. Otherwise,
+ /// "AttachmentFilePath" name will be used.
+ /// </summary>
+ public string AttachmentFileName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the download identifiers of attached file
+ /// </summary>
+ public IList<string> AttachedDownloads { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the date and time in UTC before which this email should not be sent
+ /// </summary>
+ public DateTime? DontSendBeforeDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the send tries
+ /// </summary>
+ public int SentTries { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sent date and time
+ /// </summary>
+ public DateTime? SentOnUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the read date and time
+ /// </summary>
+ public DateTime? ReadOnUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the used email account identifier
+ /// </summary>
+ public string EmailAccountId { get; set; }
+
+ /// <summary>
+ /// Gets or sets an reference identifier
+ /// </summary>
+ public Reference Reference { get; set; }
+
+ /// <summary>
+ /// Gets or sets an object reference identifier
+ /// </summary>
+ public string ObjectId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Messages/QueuedEmailPriority.cs b/src/Core/Grand.Domain/Messages/QueuedEmailPriority.cs
index 961a815b9..769c6f05a 100644
--- a/src/Core/Grand.Domain/Messages/QueuedEmailPriority.cs
+++ b/src/Core/Grand.Domain/Messages/QueuedEmailPriority.cs
@@ -1,17 +1,17 @@
-namespace Grand.Domain.Messages
+namespace Grand.Domain.Messages;
+
+/// <summary>
+/// Represents priority of queued email
+/// </summary>
+public enum QueuedEmailPriority
{
/// <summary>
- /// Represents priority of queued email
+ /// Low
/// </summary>
- public enum QueuedEmailPriority
- {
- /// <summary>
- /// Low
- /// </summary>
- Low = 0,
- /// <summary>
- /// High
- /// </summary>
- High = 5
- }
-}
+ Low = 0,
+
+ /// <summary>
+ /// High
+ /// </summary>
+ High = 5
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/MigrationDb.cs b/src/Core/Grand.Domain/MigrationDb.cs
index b35253734..0f3c4886d 100644
--- a/src/Core/Grand.Domain/MigrationDb.cs
+++ b/src/Core/Grand.Domain/MigrationDb.cs
@@ -1,25 +1,24 @@
-namespace Grand.Domain
+namespace Grand.Domain;
+
+public class MigrationDb : BaseEntity
{
- public class MigrationDb : BaseEntity
- {
- /// <summary>
- /// The unique identity of migration.
- /// </summary>
- public Guid Identity { get; set; }
+ /// <summary>
+ /// The unique identity of migration.
+ /// </summary>
+ public Guid Identity { get; set; }
- /// <summary>
- /// Name of migration.
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Name of migration.
+ /// </summary>
+ public string Name { get; set; }
- /// <summary>
- /// Db Version
- /// </summary>
- public string Version { get; set; }
+ /// <summary>
+ /// Db Version
+ /// </summary>
+ public string Version { get; set; }
- /// <summary>
- /// Gets or sets the migration creation from installation
- /// </summary>
- public bool InstallApp { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the migration creation from installation
+ /// </summary>
+ public bool InstallApp { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/News/NewsComment.cs b/src/Core/Grand.Domain/News/NewsComment.cs
index c90b139c4..282b45773 100644
--- a/src/Core/Grand.Domain/News/NewsComment.cs
+++ b/src/Core/Grand.Domain/News/NewsComment.cs
@@ -1,36 +1,37 @@
-namespace Grand.Domain.News
+namespace Grand.Domain.News;
+
+/// <summary>
+/// Represents a news comment
+/// </summary>
+public class NewsComment : SubBaseEntity
{
/// <summary>
- /// Represents a news comment
+ /// Gets or sets the comment title
/// </summary>
- public class NewsComment : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the comment title
- /// </summary>
- public string CommentTitle { get; set; }
+ public string CommentTitle { get; set; }
- /// <summary>
- /// Gets or sets the comment text
- /// </summary>
- public string CommentText { get; set; }
+ /// <summary>
+ /// Gets or sets the comment text
+ /// </summary>
+ public string CommentText { get; set; }
- /// <summary>
- /// Gets or sets the news item identifier
- /// </summary>
- public string NewsItemId { get; set; }
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the date and time of instance creation
- /// </summary>
- public DateTime CreatedOnUtc { get; set; }
+ /// <summary>
+ /// Gets or sets the news item identifier
+ /// </summary>
+ public string NewsItemId { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of instance creation
+ /// </summary>
+ public DateTime CreatedOnUtc { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/News/NewsItem.cs b/src/Core/Grand.Domain/News/NewsItem.cs
index 24b7e4e6a..083bac2fd 100644
--- a/src/Core/Grand.Domain/News/NewsItem.cs
+++ b/src/Core/Grand.Domain/News/NewsItem.cs
@@ -3,108 +3,107 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.News
+namespace Grand.Domain.News;
+
+/// <summary>
+/// Represents a news item
+/// </summary>
+public class NewsItem : BaseEntity, ISlugEntity, IStoreLinkEntity, ITranslationEntity, IGroupLinkEntity
{
+ private ICollection<NewsComment> _newsComments;
+
+ /// <summary>
+ /// Gets or sets the news title
+ /// </summary>
+ public string Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the short text
+ /// </summary>
+ public string Short { get; set; }
+
+ /// <summary>
+ /// Gets or sets the full text
+ /// </summary>
+ public string Full { get; set; }
+
/// <summary>
- /// Represents a news item
- /// </summary>
- public class NewsItem : BaseEntity, ISlugEntity, IStoreLinkEntity, ITranslationEntity, IGroupLinkEntity
- {
- private ICollection<NewsComment> _newsComments;
-
- /// <summary>
- /// Gets or sets the news title
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the short text
- /// </summary>
- public string Short { get; set; }
-
- /// <summary>
- /// Gets or sets the full text
- /// </summary>
- public string Full { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the news item is published
- /// </summary>
- public bool Published { get; set; }
-
- /// <summary>
- /// Gets or sets the news item start date and time
- /// </summary>
- public DateTime? StartDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the news item end date and time
- /// </summary>
- public DateTime? EndDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the news post comments are allowed
- /// </summary>
- public bool AllowComments { get; set; }
-
- /// <summary>
- /// Gets or sets the total number of comments
- /// <remarks>
- /// We use this property for performance optimization (no SQL command executed)
- /// </remarks>
- /// </summary>
- public int CommentCount { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the news comments
- /// </summary>
- public virtual ICollection<NewsComment> NewsComments
- {
- get => _newsComments ??= new List<NewsComment>();
- protected set => _newsComments = value;
- }
-
+ /// Gets or sets a value indicating whether the news item is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets the news item start date and time
+ /// </summary>
+ public DateTime? StartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the news item end date and time
+ /// </summary>
+ public DateTime? EndDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the news post comments are allowed
+ /// </summary>
+ public bool AllowComments { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total number of comments
+ /// <remarks>
+ /// We use this property for performance optimization (no SQL command executed)
+ /// </remarks>
+ /// </summary>
+ public int CommentCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the news comments
+ /// </summary>
+ public virtual ICollection<NewsComment> NewsComments {
+ get => _newsComments ??= new List<NewsComment>();
+ protected set => _newsComments = value;
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/News/NewsSettings.cs b/src/Core/Grand.Domain/News/NewsSettings.cs
index 9a8b96bef..9c75ab564 100644
--- a/src/Core/Grand.Domain/News/NewsSettings.cs
+++ b/src/Core/Grand.Domain/News/NewsSettings.cs
@@ -1,38 +1,36 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.News
-{
- public class NewsSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether news are enabled
- /// </summary>
- public bool Enabled { get; set; }
+namespace Grand.Domain.News;
- /// <summary>
- /// Gets or sets a value indicating whether not registered user can leave comments
- /// </summary>
- public bool AllowNotRegisteredUsersToLeaveComments { get; set; }
+public class NewsSettings : ISettings
+{
+ /// <summary>
+ /// Gets or sets a value indicating whether news are enabled
+ /// </summary>
+ public bool Enabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to notify about new news comments
- /// </summary>
- public bool NotifyAboutNewNewsComments { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether not registered user can leave comments
+ /// </summary>
+ public bool AllowNotRegisteredUsersToLeaveComments { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to show news on the main page
- /// </summary>
- public bool ShowNewsOnMainPage { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to notify about new news comments
+ /// </summary>
+ public bool NotifyAboutNewNewsComments { get; set; }
- /// <summary>
- /// Gets or sets a value indicating news count displayed on the main page
- /// </summary>
- public int MainPageNewsCount { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to show news on the main page
+ /// </summary>
+ public bool ShowNewsOnMainPage { get; set; }
- /// <summary>
- /// Gets or sets the page size for news archive
- /// </summary>
- public int NewsArchivePageSize { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating news count displayed on the main page
+ /// </summary>
+ public int MainPageNewsCount { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the page size for news archive
+ /// </summary>
+ public int NewsArchivePageSize { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/CheckoutAttribute.cs b/src/Core/Grand.Domain/Orders/CheckoutAttribute.cs
index 70b95947c..a601eca13 100644
--- a/src/Core/Grand.Domain/Orders/CheckoutAttribute.cs
+++ b/src/Core/Grand.Domain/Orders/CheckoutAttribute.cs
@@ -4,113 +4,112 @@ using Grand.Domain.Localization;
using Grand.Domain.Permissions;
using Grand.Domain.Stores;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a checkout attribute
+/// </summary>
+public class CheckoutAttribute : BaseEntity, ITranslationEntity, IStoreLinkEntity, IGroupLinkEntity
{
+ private ICollection<CheckoutAttributeValue> _checkoutAttributeValues;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the text prompt
+ /// </summary>
+ public string TextPrompt { get; set; }
+
/// <summary>
- /// Represents a checkout attribute
- /// </summary>
- public class CheckoutAttribute : BaseEntity, ITranslationEntity, IStoreLinkEntity, IGroupLinkEntity
- {
- private ICollection<CheckoutAttributeValue> _checkoutAttributeValues;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the text prompt
- /// </summary>
- public string TextPrompt { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is required
- /// </summary>
- public bool IsRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether shippable products are required in order to display this attribute
- /// </summary>
- public bool ShippableProductRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the attribute is marked as tax exempt
- /// </summary>
- public bool IsTaxExempt { get; set; }
-
- /// <summary>
- /// Gets or sets the tax category identifier
- /// </summary>
- public string TaxCategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets the attribute control type identifier
- /// </summary>
- public AttributeControlType AttributeControlTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- //validation fields
-
- /// <summary>
- /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox)
- /// </summary>
- public int? ValidationMinLength { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox)
- /// </summary>
- public int? ValidationMaxLength { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for file allowed extensions (for file upload)
- /// </summary>
- public string ValidationFileAllowedExtensions { get; set; }
-
- /// <summary>
- /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload)
- /// </summary>
- public int? ValidationFileMaximumSize { get; set; }
-
- /// <summary>
- /// Gets or sets the default value (for textbox and multiline textbox)
- /// </summary>
- public string DefaultValue { get; set; }
-
- /// <summary>
- /// Gets or sets a condition (depending on other attribute) when this attribute should be enabled (visible).
- /// </summary>
- public IList<CustomAttribute> ConditionAttribute { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets the checkout attribute values
- /// </summary>
- public virtual ICollection<CheckoutAttributeValue> CheckoutAttributeValues
- {
- get => _checkoutAttributeValues ??= new List<CheckoutAttributeValue>();
- protected set => _checkoutAttributeValues = value;
- }
+ /// Gets or sets a value indicating whether the entity is required
+ /// </summary>
+ public bool IsRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether shippable products are required in order to display this attribute
+ /// </summary>
+ public bool ShippableProductRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the attribute is marked as tax exempt
+ /// </summary>
+ public bool IsTaxExempt { get; set; }
+
+ /// <summary>
+ /// Gets or sets the tax category identifier
+ /// </summary>
+ public string TaxCategoryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attribute control type identifier
+ /// </summary>
+ public AttributeControlType AttributeControlTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ //validation fields
+
+ /// <summary>
+ /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox)
+ /// </summary>
+ public int? ValidationMinLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox)
+ /// </summary>
+ public int? ValidationMaxLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for file allowed extensions (for file upload)
+ /// </summary>
+ public string ValidationFileAllowedExtensions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload)
+ /// </summary>
+ public int? ValidationFileMaximumSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the default value (for textbox and multiline textbox)
+ /// </summary>
+ public string DefaultValue { get; set; }
+
+ /// <summary>
+ /// Gets or sets a condition (depending on other attribute) when this attribute should be enabled (visible).
+ /// </summary>
+ public IList<CustomAttribute> ConditionAttribute { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets the checkout attribute values
+ /// </summary>
+ public virtual ICollection<CheckoutAttributeValue> CheckoutAttributeValues {
+ get => _checkoutAttributeValues ??= new List<CheckoutAttributeValue>();
+ protected set => _checkoutAttributeValues = value;
}
-}
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/CheckoutAttributeExtensions.cs b/src/Core/Grand.Domain/Orders/CheckoutAttributeExtensions.cs
index ddecb6e98..4acc0dcc8 100644
--- a/src/Core/Grand.Domain/Orders/CheckoutAttributeExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/CheckoutAttributeExtensions.cs
@@ -1,49 +1,48 @@
using Grand.Domain.Catalog;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Extensions
+/// </summary>
+public static class CheckoutAttributeExtensions
{
/// <summary>
- /// Extensions
+ /// Gets a value indicating whether - checkout attribute should have values
/// </summary>
- public static class CheckoutAttributeExtensions
+ /// <param name="checkoutAttribute">Checkout attribute</param>
+ /// <returns>Result</returns>
+ public static bool ShouldHaveValues(this CheckoutAttribute checkoutAttribute)
{
- /// <summary>
- /// Gets a value indicating whether - checkout attribute should have values
- /// </summary>
- /// <param name="checkoutAttribute">Checkout attribute</param>
- /// <returns>Result</returns>
- public static bool ShouldHaveValues(this CheckoutAttribute checkoutAttribute)
- {
- if (checkoutAttribute == null)
- return false;
+ if (checkoutAttribute == null)
+ return false;
- if (checkoutAttribute.AttributeControlTypeId == AttributeControlType.TextBox ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.Datepicker ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.FileUpload)
- return false;
+ if (checkoutAttribute.AttributeControlTypeId == AttributeControlType.TextBox ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.Datepicker ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.FileUpload)
+ return false;
- return true;
- }
+ return true;
+ }
- /// <summary>
- /// A value indicating whether this checkout attribute can be used
- /// </summary>
- /// <param name="checkoutAttribute">Checkout attribute</param>
- /// <returns>Result</returns>
- public static bool CanBeUsedAsCondition(this CheckoutAttribute checkoutAttribute)
- {
- if (checkoutAttribute == null)
- return false;
+ /// <summary>
+ /// A value indicating whether this checkout attribute can be used
+ /// </summary>
+ /// <param name="checkoutAttribute">Checkout attribute</param>
+ /// <returns>Result</returns>
+ public static bool CanBeUsedAsCondition(this CheckoutAttribute checkoutAttribute)
+ {
+ if (checkoutAttribute == null)
+ return false;
- if (checkoutAttribute.AttributeControlTypeId == AttributeControlType.ReadonlyCheckboxes ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.TextBox ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.Datepicker ||
- checkoutAttribute.AttributeControlTypeId == AttributeControlType.FileUpload)
- return false;
+ if (checkoutAttribute.AttributeControlTypeId == AttributeControlType.ReadonlyCheckboxes ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.TextBox ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.MultilineTextbox ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.Datepicker ||
+ checkoutAttribute.AttributeControlTypeId == AttributeControlType.FileUpload)
+ return false;
- return true;
- }
+ return true;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/CheckoutAttributeValue.cs b/src/Core/Grand.Domain/Orders/CheckoutAttributeValue.cs
index 540c619cf..eac7bf62f 100644
--- a/src/Core/Grand.Domain/Orders/CheckoutAttributeValue.cs
+++ b/src/Core/Grand.Domain/Orders/CheckoutAttributeValue.cs
@@ -1,51 +1,49 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a checkout attribute value
+/// </summary>
+public class CheckoutAttributeValue : SubBaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a checkout attribute value
- /// </summary>
- public class CheckoutAttributeValue : SubBaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the checkout attribute mapping identifier
- /// </summary>
- public string CheckoutAttributeId { get; set; }
-
- /// <summary>
- /// Gets or sets the checkout attribute name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the color RGB value (used with "Color squares" attribute type)
- /// </summary>
- public string ColorSquaresRgb { get; set; }
-
- /// <summary>
- /// Gets or sets the price adjustment
- /// </summary>
- public double PriceAdjustment { get; set; }
-
- /// <summary>
- /// Gets or sets the weight adjustment
- /// </summary>
- public double WeightAdjustment { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the value is pre-selected
- /// </summary>
- public bool IsPreSelected { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-
-}
+ /// Gets or sets the checkout attribute mapping identifier
+ /// </summary>
+ public string CheckoutAttributeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the checkout attribute name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color RGB value (used with "Color squares" attribute type)
+ /// </summary>
+ public string ColorSquaresRgb { get; set; }
+
+ /// <summary>
+ /// Gets or sets the price adjustment
+ /// </summary>
+ public double PriceAdjustment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the weight adjustment
+ /// </summary>
+ public double WeightAdjustment { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the value is pre-selected
+ /// </summary>
+ public bool IsPreSelected { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/GiftVoucher.cs b/src/Core/Grand.Domain/Orders/GiftVoucher.cs
index 2c493d2bc..aa3c0a976 100644
--- a/src/Core/Grand.Domain/Orders/GiftVoucher.cs
+++ b/src/Core/Grand.Domain/Orders/GiftVoucher.cs
@@ -1,91 +1,89 @@
using Grand.Domain.Catalog;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a gift voucher
+/// </summary>
+public class GiftVoucher : BaseEntity
{
+ private ICollection<GiftVoucherUsageHistory> _giftVoucherUsageHistory;
+
+ /// <summary>
+ /// Gets or sets the gift voucher type identifier
+ /// </summary>
+ public GiftVoucherType GiftVoucherTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the amount
+ /// </summary>
+ public double Amount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the currency code
+ /// </summary>
+ public string CurrencyCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether gift voucher is activated
+ /// </summary>
+ public bool IsGiftVoucherActivated { get; set; }
+
+ /// <summary>
+ /// Gets or sets a gift voucher coupon code
+ /// </summary>
+ public string Code { get; set; }
+
+ /// <summary>
+ /// Gets or sets a recipient name
+ /// </summary>
+ public string RecipientName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a recipient email
+ /// </summary>
+ public string RecipientEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets a sender name
+ /// </summary>
+ public string SenderName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a sender email
+ /// </summary>
+ public string SenderEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets a message
+ /// </summary>
+ public string Message { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether recipient is notified
+ /// </summary>
+ public bool IsRecipientNotified { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
/// <summary>
- /// Represents a gift voucher
+ /// Gets or sets the date and time of instance creation
/// </summary>
- public class GiftVoucher : BaseEntity
- {
- private ICollection<GiftVoucherUsageHistory> _giftVoucherUsageHistory;
-
- /// <summary>
- /// Gets or sets the gift voucher type identifier
- /// </summary>
- public GiftVoucherType GiftVoucherTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the amount
- /// </summary>
- public double Amount { get; set; }
-
- /// <summary>
- /// Gets or sets the currency code
- /// </summary>
- public string CurrencyCode { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether gift voucher is activated
- /// </summary>
- public bool IsGiftVoucherActivated { get; set; }
-
- /// <summary>
- /// Gets or sets a gift voucher coupon code
- /// </summary>
- public string Code { get; set; }
-
- /// <summary>
- /// Gets or sets a recipient name
- /// </summary>
- public string RecipientName { get; set; }
-
- /// <summary>
- /// Gets or sets a recipient email
- /// </summary>
- public string RecipientEmail { get; set; }
-
- /// <summary>
- /// Gets or sets a sender name
- /// </summary>
- public string SenderName { get; set; }
-
- /// <summary>
- /// Gets or sets a sender email
- /// </summary>
- public string SenderEmail { get; set; }
-
- /// <summary>
- /// Gets or sets a message
- /// </summary>
- public string Message { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether recipient is notified
- /// </summary>
- public bool IsRecipientNotified { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of instance creation
- /// </summary>
- public DateTime? ValidTo { get; set; }
-
- /// <summary>
- /// Gets or sets the gift voucher usage history
- /// </summary>
- public virtual ICollection<GiftVoucherUsageHistory> GiftVoucherUsageHistory
- {
- get => _giftVoucherUsageHistory ??= new List<GiftVoucherUsageHistory>();
- protected set => _giftVoucherUsageHistory = value;
- }
-
- /// <summary>
- /// Gets or sets the associated order item
- /// </summary>
- public virtual OrderItem PurchasedWithOrderItem { get; set; }
+ public DateTime? ValidTo { get; set; }
+
+ /// <summary>
+ /// Gets or sets the gift voucher usage history
+ /// </summary>
+ public virtual ICollection<GiftVoucherUsageHistory> GiftVoucherUsageHistory {
+ get => _giftVoucherUsageHistory ??= new List<GiftVoucherUsageHistory>();
+ protected set => _giftVoucherUsageHistory = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets the associated order item
+ /// </summary>
+ public virtual OrderItem PurchasedWithOrderItem { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs b/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs
index 4e98d1ef8..20c07d24b 100644
--- a/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/GiftVoucherExtensions.cs
@@ -2,105 +2,104 @@ using Grand.Domain.Common;
using Grand.Domain.Directory;
using Grand.Domain.Stores;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Extensions
+/// </summary>
+public static class GiftVoucherExtensions
{
/// <summary>
- /// Extensions
+ /// Add gift voucher attrbibutes
+ /// </summary>
+ /// <param name="customAttributes">Attributes</param>
+ /// <param name="recipientName">Recipient name</param>
+ /// <param name="recipientEmail">Recipient email</param>
+ /// <param name="senderName">Sender name</param>
+ /// <param name="senderEmail">Sender email</param>
+ /// <param name="giftVoucherMessage">Message</param>
+ /// <returns>Attributes</returns>
+ public static IList<CustomAttribute> AddGiftVoucherAttribute(IList<CustomAttribute> customAttributes,
+ string recipientName,
+ string recipientEmail, string senderName, string senderEmail, string giftVoucherMessage)
+ {
+ if (customAttributes == null)
+ customAttributes = new List<CustomAttribute>();
+
+ customAttributes.Add(new CustomAttribute { Key = "RecipientName", Value = recipientName });
+ customAttributes.Add(new CustomAttribute { Key = "RecipientEmail", Value = recipientEmail });
+ customAttributes.Add(new CustomAttribute { Key = "SenderName", Value = senderName });
+ customAttributes.Add(new CustomAttribute { Key = "SenderEmail", Value = senderEmail });
+ customAttributes.Add(new CustomAttribute { Key = "Message", Value = giftVoucherMessage });
+
+ return customAttributes;
+ }
+
+ /// <summary>
+ /// Get gift voucher attrbibutes
+ /// </summary>
+ /// <param name="customAttributes">Attributes</param>
+ /// <param name="recipientName">Recipient name</param>
+ /// <param name="recipientEmail">Recipient email</param>
+ /// <param name="senderName">Sender name</param>
+ /// <param name="senderEmail">Sender email</param>
+ /// <param name="giftVoucherMessage">Message</param>
+ public static void GetGiftVoucherAttribute(IList<CustomAttribute> customAttributes, out string recipientName,
+ out string recipientEmail, out string senderName,
+ out string senderEmail, out string giftVoucherMessage)
+ {
+ if (customAttributes == null)
+ customAttributes = new List<CustomAttribute>();
+
+ recipientName = customAttributes.FirstOrDefault(x => x.Key == "RecipientName")?.Value;
+ recipientEmail = customAttributes.FirstOrDefault(x => x.Key == "RecipientEmail")?.Value;
+ senderName = customAttributes.FirstOrDefault(x => x.Key == "SenderName")?.Value;
+ senderEmail = customAttributes.FirstOrDefault(x => x.Key == "SenderEmail")?.Value;
+ giftVoucherMessage = customAttributes.FirstOrDefault(x => x.Key == "Message")?.Value;
+ }
+
+ /// <summary>
+ /// Gets a gift voucher remaining amount
+ /// </summary>
+ /// <returns>Gift voucher remaining amount</returns>
+ public static double GetGiftVoucherRemainingAmount(this GiftVoucher giftVoucher)
+ {
+ var result = giftVoucher.Amount;
+
+ foreach (var gcuh in giftVoucher.GiftVoucherUsageHistory)
+ result -= gcuh.UsedValue;
+
+ if (result < 0)
+ result = 0;
+
+ return result;
+ }
+
+ /// <summary>
+ /// Is gift voucher valid
/// </summary>
- public static class GiftVoucherExtensions
+ /// <param name="giftVoucher">Gift voucher</param>
+ /// <param name="currency">Currency</param>
+ /// <param name="store">Store</param>
+ /// <returns>Result</returns>
+ public static bool IsGiftVoucherValid(this GiftVoucher giftVoucher, Currency currency, Store store)
{
- /// <summary>
- /// Add gift voucher attrbibutes
- /// </summary>
- /// <param name="customAttributes">Attributes</param>
- /// <param name="recipientName">Recipient name</param>
- /// <param name="recipientEmail">Recipient email</param>
- /// <param name="senderName">Sender name</param>
- /// <param name="senderEmail">Sender email</param>
- /// <param name="giftVoucherMessage">Message</param>
- /// <returns>Attributes</returns>
- public static IList<CustomAttribute> AddGiftVoucherAttribute(IList<CustomAttribute> customAttributes, string recipientName,
- string recipientEmail, string senderName, string senderEmail, string giftVoucherMessage)
- {
- if (customAttributes == null)
- customAttributes = new List<CustomAttribute>();
-
- customAttributes.Add(new CustomAttribute { Key = "RecipientName", Value = recipientName });
- customAttributes.Add(new CustomAttribute { Key = "RecipientEmail", Value = recipientEmail });
- customAttributes.Add(new CustomAttribute { Key = "SenderName", Value = senderName });
- customAttributes.Add(new CustomAttribute { Key = "SenderEmail", Value = senderEmail });
- customAttributes.Add(new CustomAttribute { Key = "Message", Value = giftVoucherMessage });
-
- return customAttributes;
- }
-
- /// <summary>
- /// Get gift voucher attrbibutes
- /// </summary>
- /// <param name="customAttributes">Attributes</param>
- /// <param name="recipientName">Recipient name</param>
- /// <param name="recipientEmail">Recipient email</param>
- /// <param name="senderName">Sender name</param>
- /// <param name="senderEmail">Sender email</param>
- /// <param name="giftVoucherMessage">Message</param>
- public static void GetGiftVoucherAttribute(IList<CustomAttribute> customAttributes, out string recipientName,
- out string recipientEmail, out string senderName,
- out string senderEmail, out string giftVoucherMessage)
- {
- if (customAttributes == null)
- customAttributes = new List<CustomAttribute>();
-
- recipientName = customAttributes.FirstOrDefault(x => x.Key == "RecipientName")?.Value;
- recipientEmail = customAttributes.FirstOrDefault(x => x.Key == "RecipientEmail")?.Value;
- senderName = customAttributes.FirstOrDefault(x => x.Key == "SenderName")?.Value;
- senderEmail = customAttributes.FirstOrDefault(x => x.Key == "SenderEmail")?.Value;
- giftVoucherMessage = customAttributes.FirstOrDefault(x => x.Key == "Message")?.Value;
-
- }
-
- /// <summary>
- /// Gets a gift voucher remaining amount
- /// </summary>
- /// <returns>Gift voucher remaining amount</returns>
- public static double GetGiftVoucherRemainingAmount(this GiftVoucher giftVoucher)
- {
- var result = giftVoucher.Amount;
-
- foreach (var gcuh in giftVoucher.GiftVoucherUsageHistory)
- result -= gcuh.UsedValue;
-
- if (result < 0)
- result = 0;
-
- return result;
- }
-
- /// <summary>
- /// Is gift voucher valid
- /// </summary>
- /// <param name="giftVoucher">Gift voucher</param>
- /// <param name="currency">Currency</param>
- /// <param name="store">Store</param>
- /// <returns>Result</returns>
- public static bool IsGiftVoucherValid(this GiftVoucher giftVoucher, Currency currency, Store store)
- {
- if (!giftVoucher.IsGiftVoucherActivated)
- return false;
-
- if (giftVoucher.CurrencyCode != currency.CurrencyCode)
- return false;
-
- if(giftVoucher.ValidTo.HasValue && giftVoucher.ValidTo.Value <= System.DateTime.UtcNow)
- return false;
-
- if(!string.IsNullOrEmpty(giftVoucher.StoreId) && giftVoucher.StoreId!=store.Id)
- return false;
-
- var remainingAmount = giftVoucher.GetGiftVoucherRemainingAmount();
- if (remainingAmount > 0)
- return true;
+ if (!giftVoucher.IsGiftVoucherActivated)
+ return false;
+
+ if (giftVoucher.CurrencyCode != currency.CurrencyCode)
+ return false;
+ if (giftVoucher.ValidTo.HasValue && giftVoucher.ValidTo.Value <= DateTime.UtcNow)
return false;
- }
+
+ if (!string.IsNullOrEmpty(giftVoucher.StoreId) && giftVoucher.StoreId != store.Id)
+ return false;
+
+ var remainingAmount = giftVoucher.GetGiftVoucherRemainingAmount();
+ if (remainingAmount > 0)
+ return true;
+
+ return false;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/GiftVoucherUsageHistory.cs b/src/Core/Grand.Domain/Orders/GiftVoucherUsageHistory.cs
index eeec11d65..be296f6ca 100644
--- a/src/Core/Grand.Domain/Orders/GiftVoucherUsageHistory.cs
+++ b/src/Core/Grand.Domain/Orders/GiftVoucherUsageHistory.cs
@@ -1,29 +1,27 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a gift voucher usage history entry
+/// </summary>
+public class GiftVoucherUsageHistory : SubBaseEntity
{
/// <summary>
- /// Represents a gift voucher usage history entry
+ /// Gets or sets the gift voucher identifier
/// </summary>
- public class GiftVoucherUsageHistory : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the gift voucher identifier
- /// </summary>
- public string GiftVoucherId { get; set; }
+ public string GiftVoucherId { get; set; }
- /// <summary>
- /// Gets or sets the order identifier
- /// </summary>
- public string UsedWithOrderId { get; set; }
+ /// <summary>
+ /// Gets or sets the order identifier
+ /// </summary>
+ public string UsedWithOrderId { get; set; }
- /// <summary>
- /// Gets or sets the used value (amount)
- /// </summary>
- public double UsedValue { get; set; }
+ /// <summary>
+ /// Gets or sets the used value (amount)
+ /// </summary>
+ public double UsedValue { get; set; }
- /// <summary>
- /// Gets or sets the date and time of instance creation
- /// </summary>
- public DateTime CreatedOnUtc { get; set; }
-
- }
-}
+ /// <summary>
+ /// Gets or sets the date and time of instance creation
+ /// </summary>
+ public DateTime CreatedOnUtc { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/LoyaltyPointsHistory.cs b/src/Core/Grand.Domain/Orders/LoyaltyPointsHistory.cs
index b2715bd25..9bb0e068b 100644
--- a/src/Core/Grand.Domain/Orders/LoyaltyPointsHistory.cs
+++ b/src/Core/Grand.Domain/Orders/LoyaltyPointsHistory.cs
@@ -1,40 +1,39 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a loyalty point history entry
+/// </summary>
+public class LoyaltyPointsHistory : BaseEntity
{
/// <summary>
- /// Represents a loyalty point history entry
+ /// Gets or sets the customer identifier
/// </summary>
- public class LoyaltyPointsHistory : BaseEntity
- {
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the store identifier in which these loyalty points were awarded or redeemed
- /// </summary>
- public string StoreId { get; set; }
+ public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets the points redeemed/added
- /// </summary>
- public int Points { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier in which these loyalty points were awarded or redeemed
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the points balance
- /// </summary>
- public int PointsBalance { get; set; }
+ /// <summary>
+ /// Gets or sets the points redeemed/added
+ /// </summary>
+ public int Points { get; set; }
- /// <summary>
- /// Gets or sets the used amount
- /// </summary>
- public double UsedAmount { get; set; }
+ /// <summary>
+ /// Gets or sets the points balance
+ /// </summary>
+ public int PointsBalance { get; set; }
+
+ /// <summary>
+ /// Gets or sets the used amount
+ /// </summary>
+ public double UsedAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the message
+ /// </summary>
+ public string Message { get; set; }
- /// <summary>
- /// Gets or sets the message
- /// </summary>
- public string Message { get; set; }
-
- public string UsedWithOrderId { get; set; }
-
- }
-}
+ public string UsedWithOrderId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/LoyaltyPointsSettings.cs b/src/Core/Grand.Domain/Orders/LoyaltyPointsSettings.cs
index ba35ae38f..40158dc81 100644
--- a/src/Core/Grand.Domain/Orders/LoyaltyPointsSettings.cs
+++ b/src/Core/Grand.Domain/Orders/LoyaltyPointsSettings.cs
@@ -1,57 +1,57 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public class LoyaltyPointsSettings : ISettings
{
- public class LoyaltyPointsSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether Loyalty Points Program is enabled
- /// </summary>
- public bool Enabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value of Loyalty Points exchange rate
- /// </summary>
- public double ExchangeRate { get; set; }
-
- /// <summary>
- /// Gets or sets the minimum loyalty points to use
- /// </summary>
- public int MinimumLoyaltyPointsToUse { get; set; }
-
- /// <summary>
- /// Gets or sets a number of points awarded for registration
- /// </summary>
- public int PointsForRegistration { get; set; }
-
- /// <summary>
- /// Gets or sets a number of points awarded for purchases (amount in primary store currency)
- /// </summary>
- public double PointsForPurchases_Amount { get; set; }
-
- /// <summary>
- /// Gets or sets a number of points awarded for purchases
- /// </summary>
- public int PointsForPurchases_Points { get; set; }
-
- /// <summary>
- /// Points are awarded when the order status is
- /// </summary>
- public int PointsForPurchases_Awarded { get; set; }
-
- /// <summary>
- /// Loyalty points are canceled when the order is canceled
- /// </summary>
- public bool ReduceLoyaltyPointsAfterCancelOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "You will earn" message should be displayed
- /// </summary>
- public bool DisplayHowMuchWillBeEarned { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether all loyalty points are accumulated in one balance for all stores and they can be used in any store. Otherwise, each store has its own loyalty points and they can only be used in that store.
- /// </summary>
- public bool PointsAccumulatedForAllStores { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether Loyalty Points Program is enabled
+ /// </summary>
+ public bool Enabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of Loyalty Points exchange rate
+ /// </summary>
+ public double ExchangeRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the minimum loyalty points to use
+ /// </summary>
+ public int MinimumLoyaltyPointsToUse { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of points awarded for registration
+ /// </summary>
+ public int PointsForRegistration { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of points awarded for purchases (amount in primary store currency)
+ /// </summary>
+ public double PointsForPurchases_Amount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of points awarded for purchases
+ /// </summary>
+ public int PointsForPurchases_Points { get; set; }
+
+ /// <summary>
+ /// Points are awarded when the order status is
+ /// </summary>
+ public int PointsForPurchases_Awarded { get; set; }
+
+ /// <summary>
+ /// Loyalty points are canceled when the order is canceled
+ /// </summary>
+ public bool ReduceLoyaltyPointsAfterCancelOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "You will earn" message should be displayed
+ /// </summary>
+ public bool DisplayHowMuchWillBeEarned { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether all loyalty points are accumulated in one balance for all stores and they
+ /// can be used in any store. Otherwise, each store has its own loyalty points and they can only be used in that store.
+ /// </summary>
+ public bool PointsAccumulatedForAllStores { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/MerchandiseReturn.cs b/src/Core/Grand.Domain/Orders/MerchandiseReturn.cs
index 10069c8b7..36142f877 100644
--- a/src/Core/Grand.Domain/Orders/MerchandiseReturn.cs
+++ b/src/Core/Grand.Domain/Orders/MerchandiseReturn.cs
@@ -1,91 +1,89 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a merchandise return
+/// </summary>
+public class MerchandiseReturn : BaseEntity
{
+ public int ReturnNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ExternalId
+ /// </summary>
+ public string ExternalId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order item identifier
+ /// </summary>
+ public string OrderId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the owner item identifier
+ /// </summary>
+ public string OwnerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sales employee identifier
+ /// </summary>
+ public string SeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the merchandise return items
+ /// </summary>
+ public IList<MerchandiseReturnItem> MerchandiseReturnItems { get; set; } = new List<MerchandiseReturnItem>();
+
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vendor item identifier
+ /// </summary>
+ public string VendorId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer comments
+ /// </summary>
+ public string CustomerComments { get; set; }
+
+ /// <summary>
+ /// Gets or sets the staff notes
+ /// </summary>
+ public string StaffNotes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the return status identifier
+ /// </summary>
+ public int MerchandiseReturnStatusId { get; set; }
+
/// <summary>
- /// Represents a merchandise return
+ /// Gets or sets the return status
/// </summary>
- public class MerchandiseReturn : BaseEntity
- {
- public int ReturnNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the ExternalId
- /// </summary>
- public string ExternalId { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the order item identifier
- /// </summary>
- public string OrderId { get; set; }
-
- /// <summary>
- /// Gets or sets the owner item identifier
- /// </summary>
- public string OwnerId { get; set; }
-
- /// <summary>
- /// Gets or sets the sales employee identifier
- /// </summary>
- public string SeId { get; set; }
-
- /// <summary>
- /// Gets or sets the merchandise return items
- /// </summary>
- public IList<MerchandiseReturnItem> MerchandiseReturnItems { get; set; } = new List<MerchandiseReturnItem>();
-
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the vendor item identifier
- /// </summary>
- public string VendorId { get; set; }
-
- /// <summary>
- /// Gets or sets the customer comments
- /// </summary>
- public string CustomerComments { get; set; }
-
- /// <summary>
- /// Gets or sets the staff notes
- /// </summary>
- public string StaffNotes { get; set; }
-
- /// <summary>
- /// Gets or sets the return status identifier
- /// </summary>
- public int MerchandiseReturnStatusId { get; set; }
-
- /// <summary>
- /// Gets or sets the return status
- /// </summary>
- public MerchandiseReturnStatus MerchandiseReturnStatus
- {
- get => (MerchandiseReturnStatus)MerchandiseReturnStatusId;
- set => MerchandiseReturnStatusId = (int)value;
- }
-
- /// <summary>
- /// Gets or sets the pickup date
- /// </summary>
- public DateTime PickupDate { get; set; }
-
- /// <summary>
- /// Gets or sets the pickup address
- /// </summary>
- public Address PickupAddress { get; set; }
-
- /// <summary>
- /// Get or sets notify customer
- /// </summary>
- public bool NotifyCustomer { get; set; }
+ public MerchandiseReturnStatus MerchandiseReturnStatus {
+ get => (MerchandiseReturnStatus)MerchandiseReturnStatusId;
+ set => MerchandiseReturnStatusId = (int)value;
}
-}
+
+ /// <summary>
+ /// Gets or sets the pickup date
+ /// </summary>
+ public DateTime PickupDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pickup address
+ /// </summary>
+ public Address PickupAddress { get; set; }
+
+ /// <summary>
+ /// Get or sets notify customer
+ /// </summary>
+ public bool NotifyCustomer { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/MerchandiseReturnAction.cs b/src/Core/Grand.Domain/Orders/MerchandiseReturnAction.cs
index 36458aeba..e3fcc132b 100644
--- a/src/Core/Grand.Domain/Orders/MerchandiseReturnAction.cs
+++ b/src/Core/Grand.Domain/Orders/MerchandiseReturnAction.cs
@@ -1,24 +1,24 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a merchandise return action
+/// </summary>
+public class MerchandiseReturnAction : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a merchandise return action
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
/// </summary>
- public class MerchandiseReturnAction : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/MerchandiseReturnItem.cs b/src/Core/Grand.Domain/Orders/MerchandiseReturnItem.cs
index 18b5fef0c..6444a7644 100644
--- a/src/Core/Grand.Domain/Orders/MerchandiseReturnItem.cs
+++ b/src/Core/Grand.Domain/Orders/MerchandiseReturnItem.cs
@@ -1,25 +1,24 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public class MerchandiseReturnItem : BaseEntity
{
- public class MerchandiseReturnItem : BaseEntity
- {
- /// <summary>
- /// Gets or sets the order item identifier
- /// </summary>
- public string OrderItemId { get; set; }
+ /// <summary>
+ /// Gets or sets the order item identifier
+ /// </summary>
+ public string OrderItemId { get; set; }
- /// <summary>
- /// Gets or sets the reason for return
- /// </summary>
- public string ReasonForReturn { get; set; }
+ /// <summary>
+ /// Gets or sets the reason for return
+ /// </summary>
+ public string ReasonForReturn { get; set; }
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
- /// <summary>
- /// Gets or sets the requested action
- /// </summary>
- public string RequestedAction { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the requested action
+ /// </summary>
+ public string RequestedAction { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/MerchandiseReturnNote.cs b/src/Core/Grand.Domain/Orders/MerchandiseReturnNote.cs
index 72de10e4e..e2b98ea56 100644
--- a/src/Core/Grand.Domain/Orders/MerchandiseReturnNote.cs
+++ b/src/Core/Grand.Domain/Orders/MerchandiseReturnNote.cs
@@ -1,38 +1,37 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a merchandise return note
+/// </summary>
+public class MerchandiseReturnNote : BaseEntity
{
/// <summary>
- /// Represents a merchandise return note
+ /// Gets or sets the merchandise return identifier
/// </summary>
- public class MerchandiseReturnNote : BaseEntity
- {
- /// <summary>
- /// Gets or sets the merchandise return identifier
- /// </summary>
- public string MerchandiseReturnId { get; set; }
+ public string MerchandiseReturnId { get; set; }
- /// <summary>
- /// Gets or sets the title
- /// </summary>
- public string Title { get; set; }
+ /// <summary>
+ /// Gets or sets the title
+ /// </summary>
+ public string Title { get; set; }
- /// <summary>
- /// Gets or sets the note
- /// </summary>
- public string Note { get; set; }
+ /// <summary>
+ /// Gets or sets the note
+ /// </summary>
+ public string Note { get; set; }
- /// <summary>
- /// Gets or sets the attached file (download) identifier
- /// </summary>
- public string DownloadId { get; set; }
+ /// <summary>
+ /// Gets or sets the attached file (download) identifier
+ /// </summary>
+ public string DownloadId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether a customer can see a note
- /// </summary>
- public bool DisplayToCustomer { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer can see a note
+ /// </summary>
+ public bool DisplayToCustomer { get; set; }
- /// <summary>
- /// Gets or sets value indicating whether this merchandise return note was create by customer
- /// </summary>
- public bool CreatedByCustomer { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets value indicating whether this merchandise return note was create by customer
+ /// </summary>
+ public bool CreatedByCustomer { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/MerchandiseReturnReason.cs b/src/Core/Grand.Domain/Orders/MerchandiseReturnReason.cs
index eb05a4d36..3374141c2 100644
--- a/src/Core/Grand.Domain/Orders/MerchandiseReturnReason.cs
+++ b/src/Core/Grand.Domain/Orders/MerchandiseReturnReason.cs
@@ -1,25 +1,24 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a merchandise return reason
+/// </summary>
+public class MerchandiseReturnReason : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a merchandise return reason
+ /// Gets or sets the name
/// </summary>
- public class MerchandiseReturnReason : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/MerchandiseReturnStatus.cs b/src/Core/Grand.Domain/Orders/MerchandiseReturnStatus.cs
index 6beeb1c6e..5d058a054 100644
--- a/src/Core/Grand.Domain/Orders/MerchandiseReturnStatus.cs
+++ b/src/Core/Grand.Domain/Orders/MerchandiseReturnStatus.cs
@@ -1,29 +1,32 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a return status
+/// </summary>
+public enum MerchandiseReturnStatus
{
/// <summary>
- /// Represents a return status
+ /// Pending
/// </summary>
- public enum MerchandiseReturnStatus
- {
- /// <summary>
- /// Pending
- /// </summary>
- Pending = 0,
- /// <summary>
- /// Accepted
- /// </summary>
- Accepted = 10,
- /// <summary>
- /// Rejected
- /// </summary>
- Rejected = 20,
- /// <summary>
- /// Cancelled
- /// </summary>
- Cancelled = 30,
- /// <summary>
- /// Completed
- /// </summary>
- Completed = 40
- }
-}
+ Pending = 0,
+
+ /// <summary>
+ /// Accepted
+ /// </summary>
+ Accepted = 10,
+
+ /// <summary>
+ /// Rejected
+ /// </summary>
+ Rejected = 20,
+
+ /// <summary>
+ /// Cancelled
+ /// </summary>
+ Cancelled = 30,
+
+ /// <summary>
+ /// Completed
+ /// </summary>
+ Completed = 40
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/Order.cs b/src/Core/Grand.Domain/Orders/Order.cs
index 2141b4a2c..c4d611d9b 100644
--- a/src/Core/Grand.Domain/Orders/Order.cs
+++ b/src/Core/Grand.Domain/Orders/Order.cs
@@ -4,340 +4,342 @@ using Grand.Domain.Payments;
using Grand.Domain.Shipping;
using Grand.Domain.Tax;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents an order
+/// </summary>
+public class Order : BaseEntity
{
+ private ICollection<OrderItem> _orderItems;
+ private ICollection<string> _orderTags;
+ private ICollection<OrderTax> _orderTaxes;
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the order identifier
+ /// </summary>
+ public Guid OrderGuid { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order identifier
+ /// </summary>
+ public int OrderNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order code
+ /// </summary>
+ public string Code { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the owner identifier
+ /// </summary>
+ public string OwnerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sales employee identifier
+ /// </summary>
+ public string SeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer chose "pick up in store" shipping option
+ /// </summary>
+ public bool PickUpInStore { get; set; }
+
+ /// <summary>
+ /// Gets or sets an order status identifier
+ /// </summary>
+ public int OrderStatusId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the shipping status identifier
+ /// </summary>
+ public ShippingStatus ShippingStatusId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the payment status identifier
+ /// </summary>
+ public PaymentStatus PaymentStatusId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the payment method system name
+ /// </summary>
+ public string PaymentMethodSystemName { get; set; }
+
+ public string PaymentOptionAttribute { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer currency code (at the moment of order placing)
+ /// </summary>
+ public string CustomerCurrencyCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the primary currency code (at the moment of order placing)
+ /// </summary>
+ public string PrimaryCurrencyCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets the currency rate
+ /// </summary>
+ public double CurrencyRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the currency rate
+ /// </summary>
+ public double Rate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the customer tax display type identifier
+ /// </summary>
+ public TaxDisplayType CustomerTaxDisplayTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the VAT number
+ /// </summary>
+ public string VatNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the VAT number status id
+ /// </summary>
+ public int VatNumberStatusId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Company name
+ /// </summary>
+ public string CompanyName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the CustomerEmail
+ /// </summary>
+ public string CustomerEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets the FirstName
+ /// </summary>
+ public string FirstName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the LastName
+ /// </summary>
+ public string LastName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order subtotal (incl tax)
+ /// </summary>
+ public double OrderSubtotalInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order subtotal (excl tax)
+ /// </summary>
+ public double OrderSubtotalExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order subtotal discount (incl tax)
+ /// </summary>
+ public double OrderSubTotalDiscountInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order subtotal discount (excl tax)
+ /// </summary>
+ public double OrderSubTotalDiscountExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order shipping (incl tax)
+ /// </summary>
+ public double OrderShippingInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order shipping (excl tax)
+ /// </summary>
+ public double OrderShippingExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the payment method additional fee (incl tax)
+ /// </summary>
+ public double PaymentMethodAdditionalFeeInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the payment method additional fee (excl tax)
+ /// </summary>
+ public double PaymentMethodAdditionalFeeExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order tax
+ /// </summary>
+ public double OrderTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order discount (applied to order total)
+ /// </summary>
+ public double OrderDiscount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the order total
+ /// </summary>
+ public double OrderTotal { get; set; }
+
+ /// <summary>
+ /// Gets or sets the paid amount
+ /// </summary>
+ public double PaidAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the paid date and time
+ /// </summary>
+ public DateTime? PaidDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the refunded amount
+ /// </summary>
+ public double RefundedAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether loyalty points were earned for this order
+ /// </summary>
+ public bool LoyaltyPointsWereAdded { get; set; }
+
+ public int RedeemedLoyaltyPoints { get; set; }
+
+ public double RedeemedLoyaltyPointsAmount { get; set; }
+
+ /// Gets or sets the value indicating for calculated loyalty points
+ public int CalcLoyaltyPoints { get; set; }
+
+ /// <summary>
+ /// Gets or sets the checkout attribute description
+ /// </summary>
+ public string CheckoutAttributeDescription { get; set; }
+
+ public IList<CustomAttribute> CheckoutAttributes { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets or sets the customer language identifier
+ /// </summary>
+ public string CustomerLanguageId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the affiliate identifier
+ /// </summary>
+ public string AffiliateId { get; set; }
+
/// <summary>
- /// Represents an order
- /// </summary>
- public class Order : BaseEntity
- {
- private ICollection<OrderItem> _orderItems;
- private ICollection<OrderTax> _orderTaxes;
- private ICollection<string> _orderTags;
-
- #region Properties
-
- /// <summary>
- /// Gets or sets the order identifier
- /// </summary>
- public Guid OrderGuid { get; set; }
-
- /// <summary>
- /// Gets or sets the order identifier
- /// </summary>
- public int OrderNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the order code
- /// </summary>
- public string Code { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the owner identifier
- /// </summary>
- public string OwnerId { get; set; }
-
- /// <summary>
- /// Gets or sets the sales employee identifier
- /// </summary>
- public string SeId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a customer chose "pick up in store" shipping option
- /// </summary>
- public bool PickUpInStore { get; set; }
-
- /// <summary>
- /// Gets or sets an order status identifier
- /// </summary>
- public int OrderStatusId { get; set; }
-
- /// <summary>
- /// Gets or sets the shipping status identifier
- /// </summary>
- public ShippingStatus ShippingStatusId { get; set; }
-
- /// <summary>
- /// Gets or sets the payment status identifier
- /// </summary>
- public PaymentStatus PaymentStatusId { get; set; }
-
- /// <summary>
- /// Gets or sets the payment method system name
- /// </summary>
- public string PaymentMethodSystemName { get; set; }
-
- public string PaymentOptionAttribute { get; set; }
-
- /// <summary>
- /// Gets or sets the customer currency code (at the moment of order placing)
- /// </summary>
- public string CustomerCurrencyCode { get; set; }
-
- /// <summary>
- /// Gets or sets the primary currency code (at the moment of order placing)
- /// </summary>
- public string PrimaryCurrencyCode { get; set; }
-
- /// <summary>
- /// Gets or sets the currency rate
- /// </summary>
- public double CurrencyRate { get; set; }
-
- /// <summary>
- /// Gets or sets the currency rate
- /// </summary>
- public double Rate { get; set; }
-
- /// <summary>
- /// Gets or sets the customer tax display type identifier
- /// </summary>
- public TaxDisplayType CustomerTaxDisplayTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the VAT number
- /// </summary>
- public string VatNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the VAT number status id
- /// </summary>
- public int VatNumberStatusId { get; set; }
-
- /// <summary>
- /// Gets or sets the Company name
- /// </summary>
- public string CompanyName { get; set; }
-
- /// <summary>
- /// Gets or sets the CustomerEmail
- /// </summary>
- public string CustomerEmail { get; set; }
-
- /// <summary>
- /// Gets or sets the FirstName
- /// </summary>
- public string FirstName { get; set; }
-
- /// <summary>
- /// Gets or sets the LastName
- /// </summary>
- public string LastName { get; set; }
-
- /// <summary>
- /// Gets or sets the order subtotal (incl tax)
- /// </summary>
- public double OrderSubtotalInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order subtotal (excl tax)
- /// </summary>
- public double OrderSubtotalExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order subtotal discount (incl tax)
- /// </summary>
- public double OrderSubTotalDiscountInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order subtotal discount (excl tax)
- /// </summary>
- public double OrderSubTotalDiscountExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order shipping (incl tax)
- /// </summary>
- public double OrderShippingInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order shipping (excl tax)
- /// </summary>
- public double OrderShippingExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the payment method additional fee (incl tax)
- /// </summary>
- public double PaymentMethodAdditionalFeeInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the payment method additional fee (excl tax)
- /// </summary>
- public double PaymentMethodAdditionalFeeExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order tax
- /// </summary>
- public double OrderTax { get; set; }
-
- /// <summary>
- /// Gets or sets the order discount (applied to order total)
- /// </summary>
- public double OrderDiscount { get; set; }
-
- /// <summary>
- /// Gets or sets the order total
- /// </summary>
- public double OrderTotal { get; set; }
-
- /// <summary>
- /// Gets or sets the paid amount
- /// </summary>
- public double PaidAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the paid date and time
- /// </summary>
- public DateTime? PaidDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the refunded amount
- /// </summary>
- public double RefundedAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating whether loyalty points were earned for this order
- /// </summary>
- public bool LoyaltyPointsWereAdded { get; set; }
-
- public int RedeemedLoyaltyPoints { get; set; }
-
- public double RedeemedLoyaltyPointsAmount { get; set; }
-
- /// Gets or sets the value indicating for calculated loyalty points
- public int CalcLoyaltyPoints { get; set; }
-
- /// <summary>
- /// Gets or sets the checkout attribute description
- /// </summary>
- public string CheckoutAttributeDescription { get; set; }
-
- public IList<CustomAttribute> CheckoutAttributes { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets the customer language identifier
- /// </summary>
- public string CustomerLanguageId { get; set; }
-
- /// <summary>
- /// Gets or sets the affiliate identifier
- /// </summary>
- public string AffiliateId { get; set; }
-
- /// <summary>
- /// Gets or sets the customer IP address
- /// </summary>
- public string CustomerIp { get; set; }
-
- /// <summary>
- /// Gets or sets the shipping method
- /// </summary>
- public string ShippingMethod { get; set; }
-
- /// <summary>
- /// Gets or sets the Shipping rate method identifier
- /// </summary>
- public string ShippingRateProviderSystemName { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity has been deleted
- /// </summary>
- public bool Deleted { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity has been imported
- /// </summary>
- public bool Imported { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the order is recurring
- /// </summary>
- public bool IsRecurring { get; set; }
- /// <summary>
- /// Gets or sets the cycle length
- /// </summary>
- public int RecurringCycleLength { get; set; }
- /// <summary>
- /// Gets or sets the cycle period
- /// </summary>
- public RecurringCyclePeriod RecurringCyclePeriodId { get; set; }
- /// <summary>
- /// Gets or sets the total cycles
- /// </summary>
- public int RecurringTotalCycles { get; set; }
- /// <summary>
- /// Gets or sets the total cycles
- /// </summary>
- public int RecurringUseCycles { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the url referrer exists
- /// </summary>
- public string UrlReferrer { get; set; }
-
- /// <summary>
- /// Gets or sets the Shipping Option description (customer friendly string)
- /// </summary>
- public string ShippingOptionAttributeDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the Shipping Option (developer friendly string)
- /// </summary>
- public string ShippingOptionAttribute { get; set; }
-
- #endregion
-
- #region Navigation properties
-
- /// <summary>
- /// Gets or sets the billing address
- /// </summary>
- public virtual Address BillingAddress { get; set; }
-
- /// <summary>
- /// Gets or sets the shipping address
- /// </summary>
- public virtual Address ShippingAddress { get; set; }
-
- /// <summary>
- /// Gets or sets the pickup point
- /// </summary>
- public virtual PickupPoint PickupPoint { get; set; }
-
- /// <summary>
- /// Gets or sets order items
- /// </summary>
- public virtual ICollection<OrderItem> OrderItems {
- get => _orderItems ??= new List<OrderItem>();
- protected set => _orderItems = value;
- }
-
- /// <summary>
- /// Gets or sets order taxes
- /// </summary>
- public virtual ICollection<OrderTax> OrderTaxes {
- get => _orderTaxes ??= new List<OrderTax>();
- protected set => _orderTaxes = value;
- }
-
- /// <summary>
- /// Gets or sets the order's tags
- /// </summary>
- public virtual ICollection<string> OrderTags {
- get => _orderTags ??= new List<string>();
- protected set => _orderTags = value;
- }
-
- #endregion
+ /// Gets or sets the customer IP address
+ /// </summary>
+ public string CustomerIp { get; set; }
+
+ /// <summary>
+ /// Gets or sets the shipping method
+ /// </summary>
+ public string ShippingMethod { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Shipping rate method identifier
+ /// </summary>
+ public string ShippingRateProviderSystemName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity has been deleted
+ /// </summary>
+ public bool Deleted { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity has been imported
+ /// </summary>
+ public bool Imported { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the order is recurring
+ /// </summary>
+ public bool IsRecurring { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cycle length
+ /// </summary>
+ public int RecurringCycleLength { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cycle period
+ /// </summary>
+ public RecurringCyclePeriod RecurringCyclePeriodId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total cycles
+ /// </summary>
+ public int RecurringTotalCycles { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total cycles
+ /// </summary>
+ public int RecurringUseCycles { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the url referrer exists
+ /// </summary>
+ public string UrlReferrer { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Shipping Option description (customer friendly string)
+ /// </summary>
+ public string ShippingOptionAttributeDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the Shipping Option (developer friendly string)
+ /// </summary>
+ public string ShippingOptionAttribute { get; set; }
+
+ #endregion
+
+ #region Navigation properties
+
+ /// <summary>
+ /// Gets or sets the billing address
+ /// </summary>
+ public virtual Address BillingAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the shipping address
+ /// </summary>
+ public virtual Address ShippingAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pickup point
+ /// </summary>
+ public virtual PickupPoint PickupPoint { get; set; }
+
+ /// <summary>
+ /// Gets or sets order items
+ /// </summary>
+ public virtual ICollection<OrderItem> OrderItems {
+ get => _orderItems ??= new List<OrderItem>();
+ protected set => _orderItems = value;
+ }
+
+ /// <summary>
+ /// Gets or sets order taxes
+ /// </summary>
+ public virtual ICollection<OrderTax> OrderTaxes {
+ get => _orderTaxes ??= new List<OrderTax>();
+ protected set => _orderTaxes = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets the order's tags
+ /// </summary>
+ public virtual ICollection<string> OrderTags {
+ get => _orderTags ??= new List<string>();
+ protected set => _orderTags = value;
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderExtensions.cs b/src/Core/Grand.Domain/Orders/OrderExtensions.cs
index 57189cb62..1f7a4d37d 100644
--- a/src/Core/Grand.Domain/Orders/OrderExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/OrderExtensions.cs
@@ -1,128 +1,125 @@
using Grand.Domain.Catalog;
using Grand.Domain.Payments;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public static class OrderExtensions
{
- public static class OrderExtensions
+ /// <summary>
+ /// Gets a value indicating - download is allowed
+ /// </summary>
+ /// <param name="order">Order</param>
+ /// <param name="orderItem">Order item to check</param>
+ /// <param name="product">Product</param>
+ /// <returns>True if download is allowed; otherwise, false.</returns>
+ public static bool IsDownloadAllowed(this Order order, OrderItem orderItem, Product product)
{
- /// <summary>
- /// Gets a value indicating - download is allowed
- /// </summary>
- /// <param name="order">Order</param>
- /// <param name="orderItem">Order item to check</param>
- /// <param name="product">Product</param>
- /// <returns>True if download is allowed; otherwise, false.</returns>
- public static bool IsDownloadAllowed(this Order order, OrderItem orderItem, Product product)
- {
- if (orderItem == null)
- return false;
+ if (orderItem == null)
+ return false;
- if (order == null || order.Deleted)
- return false;
+ if (order == null || order.Deleted)
+ return false;
- //order status
- if (order.OrderStatusId == (int)OrderStatusSystem.Cancelled)
- return false;
+ //order status
+ if (order.OrderStatusId == (int)OrderStatusSystem.Cancelled)
+ return false;
- if (product == null || !product.IsDownload)
- return false;
+ if (product == null || !product.IsDownload)
+ return false;
- //payment status
- switch (product.DownloadActivationTypeId)
+ //payment status
+ switch (product.DownloadActivationTypeId)
+ {
+ case DownloadActivationType.WhenOrderIsPaid:
+ {
+ if (order.PaymentStatusId == PaymentStatus.Paid && order.PaidDateUtc.HasValue)
+ {
+ //expiration date
+ if (product.DownloadExpirationDays.HasValue)
+ {
+ if (order.PaidDateUtc.Value.AddDays(product.DownloadExpirationDays.Value) > DateTime.UtcNow)
+ return true;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ break;
+ case DownloadActivationType.Manually:
{
- case DownloadActivationType.WhenOrderIsPaid:
+ if (orderItem.IsDownloadActivated)
+ {
+ //expiration date
+ if (product.DownloadExpirationDays.HasValue)
{
- if (order.PaymentStatusId == PaymentStatus.Paid && order.PaidDateUtc.HasValue)
- {
- //expiration date
- if (product.DownloadExpirationDays.HasValue)
- {
- if (order.PaidDateUtc.Value.AddDays(product.DownloadExpirationDays.Value) > DateTime.UtcNow)
- {
- return true;
- }
- }
- else
- {
- return true;
- }
- }
+ if (order.CreatedOnUtc.AddDays(product.DownloadExpirationDays.Value) > DateTime.UtcNow)
+ return true;
}
- break;
- case DownloadActivationType.Manually:
+ else
{
- if (orderItem.IsDownloadActivated)
- {
- //expiration date
- if (product.DownloadExpirationDays.HasValue)
- {
- if (order.CreatedOnUtc.AddDays(product.DownloadExpirationDays.Value) > DateTime.UtcNow)
- {
- return true;
- }
- }
- else
- {
- return true;
- }
- }
+ return true;
}
- break;
+ }
}
+ break;
+ }
+
+ return false;
+ }
+ /// <summary>
+ /// Gets a value indicating whether license download is allowed
+ /// </summary>
+ /// <param name="order">Order</param>
+ /// <param name="orderItem">Order item to check</param>
+ /// <param name="product">Product</param>
+ /// <returns>True if license download is allowed; otherwise, false.</returns>
+ public static bool IsLicenseDownloadAllowed(this Order order, OrderItem orderItem, Product product)
+ {
+ if (orderItem == null)
return false;
- }
- /// <summary>
- /// Gets a value indicating whether license download is allowed
- /// </summary>
- /// <param name="order">Order</param>
- /// <param name="orderItem">Order item to check</param>
- /// <param name="product">Product</param>
- /// <returns>True if license download is allowed; otherwise, false.</returns>
- public static bool IsLicenseDownloadAllowed(this Order order, OrderItem orderItem, Product product)
- {
- if (orderItem == null)
- return false;
- return !string.IsNullOrEmpty(orderItem.LicenseDownloadId) && IsDownloadAllowed(order, orderItem, product);
- }
+ return !string.IsNullOrEmpty(orderItem.LicenseDownloadId) && IsDownloadAllowed(order, orderItem, product);
+ }
- /// <summary>
- /// Gets a value indicating whether an order has items to be added to a shipment
- /// </summary>
- /// <param name="order">Order</param>
- /// <returns>A value indicating whether an order has items to be added to a shipment</returns>
- public static bool HasItemsToAddToShipment(this Order order)
- {
- ArgumentNullException.ThrowIfNull(order);
+ /// <summary>
+ /// Gets a value indicating whether an order has items to be added to a shipment
+ /// </summary>
+ /// <param name="order">Order</param>
+ /// <returns>A value indicating whether an order has items to be added to a shipment</returns>
+ public static bool HasItemsToAddToShipment(this Order order)
+ {
+ ArgumentNullException.ThrowIfNull(order);
- foreach (var orderItem in order.OrderItems)
- {
- //we can ship only shippable products
- if (!orderItem.IsShipEnabled)
- continue;
+ foreach (var orderItem in order.OrderItems)
+ {
+ //we can ship only shippable products
+ if (!orderItem.IsShipEnabled)
+ continue;
- if (orderItem.OpenQty <= 0 || orderItem.Status == OrderItemStatus.Close)
- continue;
+ if (orderItem.OpenQty <= 0 || orderItem.Status == OrderItemStatus.Close)
+ continue;
- //yes, we have at least one item to create a new shipment
- return true;
- }
- return false;
+ //yes, we have at least one item to create a new shipment
+ return true;
}
- /// <summary>
- /// Indicates whether a order's tag exists
- /// </summary>
- /// <param name="order">Order</param>
- /// <param name="orderTag">Order tag identifier</param>
- /// <returns>Result</returns>
- public static bool OrderTagExists(this Order order, OrderTag orderTag)
- {
- ArgumentNullException.ThrowIfNull(order);
+ return false;
+ }
- var result = order.OrderTags.FirstOrDefault(t => t == orderTag.Id) != null;
- return result;
- }
+ /// <summary>
+ /// Indicates whether a order's tag exists
+ /// </summary>
+ /// <param name="order">Order</param>
+ /// <param name="orderTag">Order tag identifier</param>
+ /// <returns>Result</returns>
+ public static bool OrderTagExists(this Order order, OrderTag orderTag)
+ {
+ ArgumentNullException.ThrowIfNull(order);
+
+ var result = order.OrderTags.FirstOrDefault(t => t == orderTag.Id) != null;
+ return result;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderItem.cs b/src/Core/Grand.Domain/Orders/OrderItem.cs
index e1f9078d8..d8059b479 100644
--- a/src/Core/Grand.Domain/Orders/OrderItem.cs
+++ b/src/Core/Grand.Domain/Orders/OrderItem.cs
@@ -1,182 +1,181 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents an order item
+/// </summary>
+public class OrderItem : SubBaseEntity
{
/// <summary>
- /// Represents an order item
- /// </summary>
- public class OrderItem : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the order item identifier
- /// </summary>
- public Guid OrderItemGuid { get; set; }
-
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the sku product identifier
- /// </summary>
- public string Sku { get; set; }
-
- /// <summary>
- /// Gets or sets the vendor identifier
- /// </summary>
- public string VendorId { get; set; }
-
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
-
- /// <summary>
- /// Gets or sets the sales employee identifier
- /// </summary>
- public string SeId { get; set; }
-
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
-
- /// <summary>
- /// Gets or sets item is ship
- /// </summary>
- public bool IsShipEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets the open quantity
- /// </summary>
- public int OpenQty { get; set; }
-
- /// <summary>
- /// Gets or sets the open quantity
- /// </summary>
- public int ShipQty { get; set; }
-
- /// <summary>
- /// Gets or sets the cancel quantity
- /// </summary>
- public int CancelQty { get; set; }
-
- /// <summary>
- /// Gets or sets the cancel amount
- /// </summary>
- public double CancelAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the return quantity
- /// </summary>
- public int ReturnQty { get; set; }
-
- /// <summary>
- /// Gets or sets the open quantity
- /// </summary>
- public OrderItemStatus Status { get; set; }
-
- /// <summary>
- /// Gets or sets the tax rate
- /// </summary>
- public double TaxRate { get; set; }
-
- /// <summary>
- /// Gets or sets the unit price without discount in primary store currency (incl tax)
- /// </summary>
- public double UnitPriceWithoutDiscInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the unit price without discount in primary store currency (excl tax)
- /// </summary>
- public double UnitPriceWithoutDiscExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the unit price in primary store currency (incl tax)
- /// </summary>
- public double UnitPriceInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the unit price in primary store currency (excl tax)
- /// </summary>
- public double UnitPriceExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the price in primary store currency (incl tax)
- /// </summary>
- public double PriceInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the price in primary store currency (excl tax)
- /// </summary>
- public double PriceExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the discount amount (incl tax)
- /// </summary>
- public double DiscountAmountInclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the discount amount (excl tax)
- /// </summary>
- public double DiscountAmountExclTax { get; set; }
-
- /// <summary>
- /// Gets or sets the original cost of this order item (when an order was placed), qty 1
- /// </summary>
- public double OriginalProductCost { get; set; }
-
- /// <summary>
- /// Gets or sets the attribute description
- /// </summary>
- public string AttributeDescription { get; set; }
-
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets the download count
- /// </summary>
- public int DownloadCount { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether download is activated
- /// </summary>
- public bool IsDownloadActivated { get; set; }
-
- /// <summary>
- /// Gets or sets a license download identifier (in case this is a downloadable product)
- /// </summary>
- public string LicenseDownloadId { get; set; }
-
- /// <summary>
- /// Gets or sets the total weight of one item
- /// </summary>
- public double? ItemWeight { get; set; }
-
- /// <summary>
- /// Gets or sets the rental product start date (null if it's not a rental product)
- /// </summary>
- public DateTime? RentalStartDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the rental product end date (null if it's not a rental product)
- /// </summary>
- public DateTime? RentalEndDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of order creation
- /// </summary>
- public DateTime CreatedOnUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the vendor`s commission
- /// </summary>
- public double Commission { get; set; }
-
- /// <summary>
- /// Gets or sets owner cid
- /// </summary>
- public string cId { get; set; }
- }
+ /// Gets or sets the order item identifier
+ /// </summary>
+ public Guid OrderItemGuid { get; set; }
+
+ /// <summary>
+ /// Gets or sets the product identifier
+ /// </summary>
+ public string ProductId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sku product identifier
+ /// </summary>
+ public string Sku { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vendor identifier
+ /// </summary>
+ public string VendorId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the sales employee identifier
+ /// </summary>
+ public string SeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets item is ship
+ /// </summary>
+ public bool IsShipEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets the open quantity
+ /// </summary>
+ public int OpenQty { get; set; }
+
+ /// <summary>
+ /// Gets or sets the open quantity
+ /// </summary>
+ public int ShipQty { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cancel quantity
+ /// </summary>
+ public int CancelQty { get; set; }
+
+ /// <summary>
+ /// Gets or sets the cancel amount
+ /// </summary>
+ public double CancelAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the return quantity
+ /// </summary>
+ public int ReturnQty { get; set; }
+
+ /// <summary>
+ /// Gets or sets the open quantity
+ /// </summary>
+ public OrderItemStatus Status { get; set; }
+
+ /// <summary>
+ /// Gets or sets the tax rate
+ /// </summary>
+ public double TaxRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets the unit price without discount in primary store currency (incl tax)
+ /// </summary>
+ public double UnitPriceWithoutDiscInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the unit price without discount in primary store currency (excl tax)
+ /// </summary>
+ public double UnitPriceWithoutDiscExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the unit price in primary store currency (incl tax)
+ /// </summary>
+ public double UnitPriceInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the unit price in primary store currency (excl tax)
+ /// </summary>
+ public double UnitPriceExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the price in primary store currency (incl tax)
+ /// </summary>
+ public double PriceInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the price in primary store currency (excl tax)
+ /// </summary>
+ public double PriceExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount amount (incl tax)
+ /// </summary>
+ public double DiscountAmountInclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the discount amount (excl tax)
+ /// </summary>
+ public double DiscountAmountExclTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets the original cost of this order item (when an order was placed), qty 1
+ /// </summary>
+ public double OriginalProductCost { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attribute description
+ /// </summary>
+ public string AttributeDescription { get; set; }
+
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets or sets the download count
+ /// </summary>
+ public int DownloadCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether download is activated
+ /// </summary>
+ public bool IsDownloadActivated { get; set; }
+
+ /// <summary>
+ /// Gets or sets a license download identifier (in case this is a downloadable product)
+ /// </summary>
+ public string LicenseDownloadId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total weight of one item
+ /// </summary>
+ public double? ItemWeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rental product start date (null if it's not a rental product)
+ /// </summary>
+ public DateTime? RentalStartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rental product end date (null if it's not a rental product)
+ /// </summary>
+ public DateTime? RentalEndDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of order creation
+ /// </summary>
+ public DateTime CreatedOnUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vendor`s commission
+ /// </summary>
+ public double Commission { get; set; }
+
+ /// <summary>
+ /// Gets or sets owner cid
+ /// </summary>
+ public string cId { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderItemStatus.cs b/src/Core/Grand.Domain/Orders/OrderItemStatus.cs
index f094a9b03..384491ff1 100644
--- a/src/Core/Grand.Domain/Orders/OrderItemStatus.cs
+++ b/src/Core/Grand.Domain/Orders/OrderItemStatus.cs
@@ -1,8 +1,7 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public enum OrderItemStatus
{
- public enum OrderItemStatus
- {
- Open = 0,
- Close = 1
- }
-}
+ Open = 0,
+ Close = 1
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderNote.cs b/src/Core/Grand.Domain/Orders/OrderNote.cs
index 3c2d41b2f..fa84a3b4f 100644
--- a/src/Core/Grand.Domain/Orders/OrderNote.cs
+++ b/src/Core/Grand.Domain/Orders/OrderNote.cs
@@ -1,33 +1,32 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents an order note
+/// </summary>
+public class OrderNote : BaseEntity
{
/// <summary>
- /// Represents an order note
+ /// Gets or sets the order identifier
/// </summary>
- public class OrderNote : BaseEntity
- {
- /// <summary>
- /// Gets or sets the order identifier
- /// </summary>
- public string OrderId { get; set; }
+ public string OrderId { get; set; }
- /// <summary>
- /// Gets or sets the note
- /// </summary>
- public string Note { get; set; }
+ /// <summary>
+ /// Gets or sets the note
+ /// </summary>
+ public string Note { get; set; }
- /// <summary>
- /// Gets or sets the attached file (download) identifier
- /// </summary>
- public string DownloadId { get; set; }
+ /// <summary>
+ /// Gets or sets the attached file (download) identifier
+ /// </summary>
+ public string DownloadId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether a customer can see a note
- /// </summary>
- public bool DisplayToCustomer { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer can see a note
+ /// </summary>
+ public bool DisplayToCustomer { get; set; }
- /// <summary>
- /// Gets or sets value indicating whether this order note was create by customer
- /// </summary>
- public bool CreatedByCustomer { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets value indicating whether this order note was create by customer
+ /// </summary>
+ public bool CreatedByCustomer { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderSettings.cs b/src/Core/Grand.Domain/Orders/OrderSettings.cs
index 52316d61a..d00058071 100644
--- a/src/Core/Grand.Domain/Orders/OrderSettings.cs
+++ b/src/Core/Grand.Domain/Orders/OrderSettings.cs
@@ -1,144 +1,149 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public class OrderSettings : ISettings
{
- public class OrderSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether customer can make re-order
- /// </summary>
- public bool IsReOrderAllowed { get; set; }
-
- /// <summary>
- /// Gets or sets a minimum order subtotal amount
- /// </summary>
- public double MinOrderSubtotalAmount { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'inimum order subtotal amount' option
- /// should be evaluated over 'X' value including tax or not
- /// </summary>
- public bool MinOrderSubtotalAmountIncludingTax { get; set; }
-
- /// <summary>
- /// Gets or sets a minimum order total amount
- /// </summary>
- public double MinOrderTotalAmount { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether anonymous checkout allowed
- /// </summary>
- public bool AnonymousCheckoutAllowed { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Terms of service' enabled on the shopping cart page
- /// </summary>
- public bool TermsOfServiceOnShoppingCartPage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Terms of service' enabled on the order confirmation page
- /// </summary>
- public bool TermsOfServiceOnOrderConfirmPage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "Order completed" page should be skipped
- /// </summary>
- public bool DisableOrderCompletedPage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating we should attach PDF invoice to "Order placed" email
- /// </summary>
- public bool AttachPdfInvoiceToOrderPlacedEmail { get; set; }
- /// <summary>
- /// Gets or sets a value indicating we should attach PDF invoice to "Order paid" email
- /// </summary>
- public bool AttachPdfInvoiceToOrderPaidEmail { get; set; }
- /// <summary>
- /// Gets or sets a value indicating we should attach PDF invoice to "Order completed" email
- /// </summary>
- public bool AttachPdfInvoiceToOrderCompletedEmail { get; set; }
- /// <summary>
- /// Gets or sets a value indicating we should attach PDF invoice to binary field
- /// </summary>
- public bool AttachPdfInvoiceToBinary { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether "Merchandise returns" are allowed
- /// </summary>
- public bool MerchandiseReturnsEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether merchandise return pickup address can be specified by customer
- /// </summary>
- public bool MerchandiseReturns_AllowToSpecifyPickupAddress { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether merchandise return pickup date can be specified by customer
- /// </summary>
- public bool MerchandiseReturns_AllowToSpecifyPickupDate { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether merchandise return pickup date has to be specified by customer
- /// </summary>
- public bool MerchandiseReturns_PickupDateRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a number of days that the Merchandise Return Link will be available for customers after order placing.
- /// </summary>
- public int NumberOfDaysMerchandiseReturnAvailable { get; set; }
-
- /// <summary>
- /// Gift vouchers are activated when the order status is
- /// </summary>
- public int GiftVouchers_Activated_OrderStatusId { get; set; }
-
- /// <summary>
- /// Gift vouchers are deactivated when the order is canceled
- /// </summary>
- public bool DeactivateGiftVouchersAfterCancelOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to deactivate related gift vouchers after deleting the order
- /// </summary>
- public bool DeactivateGiftVouchersAfterDeletingOrder { get; set; }
-
- /// <summary>
- /// Gift vouchers are assigned to the current store
- /// </summary>
- public bool GiftVouchers_Assign_StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets an order placement interval in seconds (prevent 2 orders being placed within an X seconds time frame).
- /// </summary>
- public int MinimumOrderPlacementInterval { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether an order status should be set to "Complete" only when its shipping status is "Delivered". Otherwise, "Shipped" status will be enough.
- /// </summary>
- public bool CompleteOrderWhenDelivered { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether order status can be marked as cancelled by user (if order isn't paid and shipped yet)
- /// </summary>
- public bool UserCanCancelUnpaidOrder { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether unpublish auction product after made order.
- /// </summary>
- public bool UnpublishAuctionProduct { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can add order notes
- /// </summary>
- public bool AllowCustomerToAddOrderNote { get; set; }
-
- /// <summary>
- /// Gets or sets a length for order code
- /// </summary>
- public int LengthCode { get; set; }
-
- /// <summary>
- /// Gets or sets a page size
- /// </summary>
- public int PageSize { get; set; }
-
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether customer can make re-order
+ /// </summary>
+ public bool IsReOrderAllowed { get; set; }
+
+ /// <summary>
+ /// Gets or sets a minimum order subtotal amount
+ /// </summary>
+ public double MinOrderSubtotalAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'inimum order subtotal amount' option
+ /// should be evaluated over 'X' value including tax or not
+ /// </summary>
+ public bool MinOrderSubtotalAmountIncludingTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets a minimum order total amount
+ /// </summary>
+ public double MinOrderTotalAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether anonymous checkout allowed
+ /// </summary>
+ public bool AnonymousCheckoutAllowed { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Terms of service' enabled on the shopping cart page
+ /// </summary>
+ public bool TermsOfServiceOnShoppingCartPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Terms of service' enabled on the order confirmation page
+ /// </summary>
+ public bool TermsOfServiceOnOrderConfirmPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Order completed" page should be skipped
+ /// </summary>
+ public bool DisableOrderCompletedPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating we should attach PDF invoice to "Order placed" email
+ /// </summary>
+ public bool AttachPdfInvoiceToOrderPlacedEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating we should attach PDF invoice to "Order paid" email
+ /// </summary>
+ public bool AttachPdfInvoiceToOrderPaidEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating we should attach PDF invoice to "Order completed" email
+ /// </summary>
+ public bool AttachPdfInvoiceToOrderCompletedEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating we should attach PDF invoice to binary field
+ /// </summary>
+ public bool AttachPdfInvoiceToBinary { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "Merchandise returns" are allowed
+ /// </summary>
+ public bool MerchandiseReturnsEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether merchandise return pickup address can be specified by customer
+ /// </summary>
+ public bool MerchandiseReturns_AllowToSpecifyPickupAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether merchandise return pickup date can be specified by customer
+ /// </summary>
+ public bool MerchandiseReturns_AllowToSpecifyPickupDate { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether merchandise return pickup date has to be specified by customer
+ /// </summary>
+ public bool MerchandiseReturns_PickupDateRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of days that the Merchandise Return Link will be available for customers after order placing.
+ /// </summary>
+ public int NumberOfDaysMerchandiseReturnAvailable { get; set; }
+
+ /// <summary>
+ /// Gift vouchers are activated when the order status is
+ /// </summary>
+ public int GiftVouchers_Activated_OrderStatusId { get; set; }
+
+ /// <summary>
+ /// Gift vouchers are deactivated when the order is canceled
+ /// </summary>
+ public bool DeactivateGiftVouchersAfterCancelOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to deactivate related gift vouchers after deleting the order
+ /// </summary>
+ public bool DeactivateGiftVouchersAfterDeletingOrder { get; set; }
+
+ /// <summary>
+ /// Gift vouchers are assigned to the current store
+ /// </summary>
+ public bool GiftVouchers_Assign_StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets an order placement interval in seconds (prevent 2 orders being placed within an X seconds time frame).
+ /// </summary>
+ public int MinimumOrderPlacementInterval { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether an order status should be set to "Complete" only when its shipping status
+ /// is "Delivered". Otherwise, "Shipped" status will be enough.
+ /// </summary>
+ public bool CompleteOrderWhenDelivered { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether order status can be marked as cancelled by user (if order isn't paid and
+ /// shipped yet)
+ /// </summary>
+ public bool UserCanCancelUnpaidOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether unpublish auction product after made order.
+ /// </summary>
+ public bool UnpublishAuctionProduct { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can add order notes
+ /// </summary>
+ public bool AllowCustomerToAddOrderNote { get; set; }
+
+ /// <summary>
+ /// Gets or sets a length for order code
+ /// </summary>
+ public int LengthCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets a page size
+ /// </summary>
+ public int PageSize { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderStatus.cs b/src/Core/Grand.Domain/Orders/OrderStatus.cs
index 3f896dccb..6d081012f 100644
--- a/src/Core/Grand.Domain/Orders/OrderStatus.cs
+++ b/src/Core/Grand.Domain/Orders/OrderStatus.cs
@@ -1,10 +1,9 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public class OrderStatus : BaseEntity
{
- public class OrderStatus : BaseEntity
- {
- public int StatusId { get; set; }
- public string Name { get; set; }
- public int DisplayOrder { get; set; }
- public bool IsSystem { get; set; }
- }
-}
+ public int StatusId { get; set; }
+ public string Name { get; set; }
+ public int DisplayOrder { get; set; }
+ public bool IsSystem { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderStatusSystem.cs b/src/Core/Grand.Domain/Orders/OrderStatusSystem.cs
index d08febd30..642c7d26e 100644
--- a/src/Core/Grand.Domain/Orders/OrderStatusSystem.cs
+++ b/src/Core/Grand.Domain/Orders/OrderStatusSystem.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents an order status enumeration
+/// </summary>
+public enum OrderStatusSystem
{
/// <summary>
- /// Represents an order status enumeration
+ /// Pending
/// </summary>
- public enum OrderStatusSystem
- {
- /// <summary>
- /// Pending
- /// </summary>
- Pending = 10,
- /// <summary>
- /// Processing
- /// </summary>
- Processing = 20,
- /// <summary>
- /// Complete
- /// </summary>
- Complete = 30,
- /// <summary>
- /// Cancelled
- /// </summary>
- Cancelled = 40
- }
-}
+ Pending = 10,
+
+ /// <summary>
+ /// Processing
+ /// </summary>
+ Processing = 20,
+
+ /// <summary>
+ /// Complete
+ /// </summary>
+ Complete = 30,
+
+ /// <summary>
+ /// Cancelled
+ /// </summary>
+ Cancelled = 40
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderTag.cs b/src/Core/Grand.Domain/Orders/OrderTag.cs
index 2fe7e6d8c..b79caaf1a 100644
--- a/src/Core/Grand.Domain/Orders/OrderTag.cs
+++ b/src/Core/Grand.Domain/Orders/OrderTag.cs
@@ -1,16 +1,14 @@
-namespace Grand.Domain.Orders
-{
- public class OrderTag : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+namespace Grand.Domain.Orders;
- /// <summary>
- /// Gets or sets the count
- /// </summary>
- public int Count { get; set; }
+public class OrderTag : BaseEntity
+{
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the count
+ /// </summary>
+ public int Count { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/OrderTax.cs b/src/Core/Grand.Domain/Orders/OrderTax.cs
index 51f8875fa..21ba730f9 100644
--- a/src/Core/Grand.Domain/Orders/OrderTax.cs
+++ b/src/Core/Grand.Domain/Orders/OrderTax.cs
@@ -1,9 +1,8 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public class OrderTax : SubBaseEntity
{
- public class OrderTax : SubBaseEntity
- {
- public double Percent { get; set; }
+ public double Percent { get; set; }
- public double Amount { get; set; }
- }
-}
+ public double Amount { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/ShoppingCartExtensions.cs b/src/Core/Grand.Domain/Orders/ShoppingCartExtensions.cs
index d67cae3c3..aa8e6c4f0 100644
--- a/src/Core/Grand.Domain/Orders/ShoppingCartExtensions.cs
+++ b/src/Core/Grand.Domain/Orders/ShoppingCartExtensions.cs
@@ -1,31 +1,29 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a shopping cart
+/// </summary>
+public static class ShoppingCartExtensions
{
/// <summary>
- /// Represents a shopping cart
+ /// Indicates whether the shopping cart requires shipping
/// </summary>
- public static class ShoppingCartExtensions
+ /// <param name="shoppingCart">Shopping cart</param>
+ /// <returns>True if the shopping cart requires shipping; otherwise, false.</returns>
+ public static bool RequiresShipping(this IList<ShoppingCartItem> shoppingCart)
{
- /// <summary>
- /// Indicates whether the shopping cart requires shipping
- /// </summary>
- /// <param name="shoppingCart">Shopping cart</param>
- /// <returns>True if the shopping cart requires shipping; otherwise, false.</returns>
- public static bool RequiresShipping(this IList<ShoppingCartItem> shoppingCart)
- {
- foreach (var shoppingCartItem in shoppingCart)
- {
- if (shoppingCartItem.IsShipEnabled)
- return true;
- }
- return false;
- }
+ foreach (var shoppingCartItem in shoppingCart)
+ if (shoppingCartItem.IsShipEnabled)
+ return true;
+ return false;
+ }
- public static IEnumerable<ShoppingCartItem> LimitPerStore(this IEnumerable<ShoppingCartItem> cart, bool cartsSharedBetweenStores, string storeId)
- {
- if (cartsSharedBetweenStores)
- return cart;
+ public static IEnumerable<ShoppingCartItem> LimitPerStore(this IEnumerable<ShoppingCartItem> cart,
+ bool cartsSharedBetweenStores, string storeId)
+ {
+ if (cartsSharedBetweenStores)
+ return cart;
- return cart.Where(x => x.StoreId == storeId);
- }
+ return cart.Where(x => x.StoreId == storeId);
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/ShoppingCartItem.cs b/src/Core/Grand.Domain/Orders/ShoppingCartItem.cs
index c624d7983..8758a7014 100644
--- a/src/Core/Grand.Domain/Orders/ShoppingCartItem.cs
+++ b/src/Core/Grand.Domain/Orders/ShoppingCartItem.cs
@@ -1,110 +1,109 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a shopping cart item
+/// </summary>
+public class ShoppingCartItem : SubBaseEntity
{
/// <summary>
- /// Represents a shopping cart item
- /// </summary>
- public class ShoppingCartItem : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
-
- /// <summary>
- /// Gets or sets the shopping cart type identifier
- /// </summary>
- public ShoppingCartType ShoppingCartTypeId { get; set; }
-
- /// <summary>
- /// Gets or sets the product identifier
- /// </summary>
- public string ProductId { get; set; }
-
- /// <summary>
- /// Gets or sets the custom attributes (see "ProductAttribute" entity for more info)
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
-
- /// <summary>
- /// Gets or sets the price enter by a customer
- /// </summary>
- public double? EnteredPrice { get; set; }
-
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
-
- /// <summary>
- /// Gets or sets the rental product start date (null if it's not a rental product)
- /// </summary>
- public DateTime? RentalStartDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the rental product end date (null if it's not a rental product)
- /// </summary>
- public DateTime? RentalEndDateUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of instance creation
- /// </summary>
- public DateTime CreatedOnUtc { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of instance update
- /// </summary>
- public DateTime? UpdatedOnUtc { get; set; }
-
- /// <summary>
- /// Gets a value indicating whether the shopping cart item is free shipping
- /// </summary>
- public bool IsFreeShipping { get; set; }
-
- /// <summary>
- /// Gets a value indicating whether the shopping cart item is gift voucher
- /// </summary>
- public bool IsGiftVoucher { get; set; }
-
- /// <summary>
- /// Gets a value indicating whether the shopping cart item is ship enabled
- /// </summary>
- public bool IsShipEnabled { get; set; }
-
- /// <summary>
- /// Gets a value the additional shipping charge for product
- /// </summary>
- public double AdditionalShippingChargeProduct { get; set; }
-
- /// <summary>
- /// Gets a value indicating whether the shopping cart item is tax exempt
- /// </summary>
- public bool IsTaxExempt { get; set; }
-
- /// <summary>
- /// Gets or sets the reservation identifier
- /// </summary>
- public string ReservationId { get; set; }
-
- /// <summary>
- /// Gets or sets parameter of reservation
- /// </summary>
- public string Parameter { get; set; }
-
- /// <summary>
- /// Gets or sets Duration of reservation
- /// </summary>
- public string Duration { get; set; }
-
- /// <summary>
- /// Gets or sets owner cid
- /// </summary>
- public string cId { get; set; }
- }
-}
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the shopping cart type identifier
+ /// </summary>
+ public ShoppingCartType ShoppingCartTypeId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the product identifier
+ /// </summary>
+ public string ProductId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the custom attributes (see "ProductAttribute" entity for more info)
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+
+ /// <summary>
+ /// Gets or sets the price enter by a customer
+ /// </summary>
+ public double? EnteredPrice { get; set; }
+
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rental product start date (null if it's not a rental product)
+ /// </summary>
+ public DateTime? RentalStartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rental product end date (null if it's not a rental product)
+ /// </summary>
+ public DateTime? RentalEndDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of instance creation
+ /// </summary>
+ public DateTime CreatedOnUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets the date and time of instance update
+ /// </summary>
+ public DateTime? UpdatedOnUtc { get; set; }
+
+ /// <summary>
+ /// Gets a value indicating whether the shopping cart item is free shipping
+ /// </summary>
+ public bool IsFreeShipping { get; set; }
+
+ /// <summary>
+ /// Gets a value indicating whether the shopping cart item is gift voucher
+ /// </summary>
+ public bool IsGiftVoucher { get; set; }
+
+ /// <summary>
+ /// Gets a value indicating whether the shopping cart item is ship enabled
+ /// </summary>
+ public bool IsShipEnabled { get; set; }
+
+ /// <summary>
+ /// Gets a value the additional shipping charge for product
+ /// </summary>
+ public double AdditionalShippingChargeProduct { get; set; }
+
+ /// <summary>
+ /// Gets a value indicating whether the shopping cart item is tax exempt
+ /// </summary>
+ public bool IsTaxExempt { get; set; }
+
+ /// <summary>
+ /// Gets or sets the reservation identifier
+ /// </summary>
+ public string ReservationId { get; set; }
+
+ /// <summary>
+ /// Gets or sets parameter of reservation
+ /// </summary>
+ public string Parameter { get; set; }
+
+ /// <summary>
+ /// Gets or sets Duration of reservation
+ /// </summary>
+ public string Duration { get; set; }
+
+ /// <summary>
+ /// Gets or sets owner cid
+ /// </summary>
+ public string cId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/ShoppingCartSettings.cs b/src/Core/Grand.Domain/Orders/ShoppingCartSettings.cs
index 6edde876e..0f279f32d 100644
--- a/src/Core/Grand.Domain/Orders/ShoppingCartSettings.cs
+++ b/src/Core/Grand.Domain/Orders/ShoppingCartSettings.cs
@@ -1,122 +1,127 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+public class ShoppingCartSettings : ISettings
{
- public class ShoppingCartSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a product to the cart/wishlist
- /// </summary>
- public bool DisplayCartAfterAddingProduct { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a product to the cart/wishlist
- /// </summary>
- public bool DisplayWishlistAfterAddingProduct { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating maximum number of items in the shopping cart
- /// </summary>
- public int MaximumShoppingCartItems { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating maximum number of items in the wishlist
- /// </summary>
- public int MaximumWishlistItems { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show product images in the mini-shopping cart block
- /// </summary>
- public bool AllowOutOfStockItemsToBeAddedToWishlist { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to move items from wishlist to cart when clicking "Add to cart" button. Otherwise, they are copied.
- /// </summary>
- public bool MoveItemsFromWishlistToCart { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show product image on shopping cart page
- /// </summary>
- public bool ShowProductImagesOnShoppingCart { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show product image on wishlist page
- /// </summary>
- public bool ShowProductImagesOnWishList { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show discount box on shopping cart page
- /// </summary>
- public bool ShowDiscountBox { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show gift voucher box on shopping cart page
- /// </summary>
- public bool ShowGiftVoucherBox { get; set; }
-
- /// <summary>
- /// Gets or sets a number of "Cross-sells" on shopping cart page
- /// </summary>
- public int CrossSellsNumber { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether "email a wishlist" feature is enabled
- /// </summary>
- public bool EmailWishlistEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to enabled "email a wishlist" for guests.
- /// </summary>
- public bool AllowAnonymousUsersToEmailWishlist { get; set; }
-
- /// <summary>Gets or sets a value indicating whether mini-shopping cart is enabled
- /// </summary>
- public bool MiniShoppingCartEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to show images in the sidebar cart block
- /// </summary>
- public bool ShowImagesInsidebarCart { get; set; }
-
- /// <summary>Gets or sets a maximum number of products which can be displayed in the mini-shopping cart block
- /// </summary>
- public int MiniCartProductNumber { get; set; }
-
- //Round is already an issue.
- /// <summary>
- /// Gets or sets a value indicating whether to round calculated prices and total during calculation
- /// </summary>
- public bool RoundPrices { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should group cart items for the same products
- /// (a customer have two items in the cart for the same products with (different product attributes)
- /// </summary>
- public bool GroupTierPrices { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a customer will beable to edit products in the cart
- /// </summary>
- public bool AllowCartItemEditing { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a customer will be able to on hold product in the cart
- /// </summary>
- public bool AllowOnHoldCart { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether shopping carts (and wishlist) are shared between stores (in multi-store environment)
- /// </summary>
- public bool SharedCartBetweenStores { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether a customer will be able to select warehouse before add to cart
- /// </summary>
- public bool AllowToSelectWarehouse { get; set; }
-
- /// <summary>
- /// Gets or sets a value reservation format date
- /// </summary>
- public string ReservationDateFormat { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a
+ /// product to the cart/wishlist
+ /// </summary>
+ public bool DisplayCartAfterAddingProduct { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a custoemr should be redirected to the shopping cart page after adding a
+ /// product to the cart/wishlist
+ /// </summary>
+ public bool DisplayWishlistAfterAddingProduct { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating maximum number of items in the shopping cart
+ /// </summary>
+ public int MaximumShoppingCartItems { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating maximum number of items in the wishlist
+ /// </summary>
+ public int MaximumWishlistItems { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show product images in the mini-shopping cart block
+ /// </summary>
+ public bool AllowOutOfStockItemsToBeAddedToWishlist { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to move items from wishlist to cart when clicking "Add to cart" button.
+ /// Otherwise, they are copied.
+ /// </summary>
+ public bool MoveItemsFromWishlistToCart { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show product image on shopping cart page
+ /// </summary>
+ public bool ShowProductImagesOnShoppingCart { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show product image on wishlist page
+ /// </summary>
+ public bool ShowProductImagesOnWishList { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show discount box on shopping cart page
+ /// </summary>
+ public bool ShowDiscountBox { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show gift voucher box on shopping cart page
+ /// </summary>
+ public bool ShowGiftVoucherBox { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of "Cross-sells" on shopping cart page
+ /// </summary>
+ public int CrossSellsNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether "email a wishlist" feature is enabled
+ /// </summary>
+ public bool EmailWishlistEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to enabled "email a wishlist" for guests.
+ /// </summary>
+ public bool AllowAnonymousUsersToEmailWishlist { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether mini-shopping cart is enabled
+ /// </summary>
+ public bool MiniShoppingCartEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to show images in the sidebar cart block
+ /// </summary>
+ public bool ShowImagesInsidebarCart { get; set; }
+
+ /// <summary>
+ /// Gets or sets a maximum number of products which can be displayed in the mini-shopping cart block
+ /// </summary>
+ public int MiniCartProductNumber { get; set; }
+
+ //Round is already an issue.
+ /// <summary>
+ /// Gets or sets a value indicating whether to round calculated prices and total during calculation
+ /// </summary>
+ public bool RoundPrices { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should group cart items for the same products
+ /// (a customer have two items in the cart for the same products with (different product attributes)
+ /// </summary>
+ public bool GroupTierPrices { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer will beable to edit products in the cart
+ /// </summary>
+ public bool AllowCartItemEditing { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer will be able to on hold product in the cart
+ /// </summary>
+ public bool AllowOnHoldCart { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether shopping carts (and wishlist) are shared between stores (in multi-store
+ /// environment)
+ /// </summary>
+ public bool SharedCartBetweenStores { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer will be able to select warehouse before add to cart
+ /// </summary>
+ public bool AllowToSelectWarehouse { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value reservation format date
+ /// </summary>
+ public string ReservationDateFormat { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Orders/ShoppingCartType.cs b/src/Core/Grand.Domain/Orders/ShoppingCartType.cs
index abbfb8d4d..fa02157e4 100644
--- a/src/Core/Grand.Domain/Orders/ShoppingCartType.cs
+++ b/src/Core/Grand.Domain/Orders/ShoppingCartType.cs
@@ -1,26 +1,27 @@
-namespace Grand.Domain.Orders
+namespace Grand.Domain.Orders;
+
+/// <summary>
+/// Represents a shoping cart type
+/// </summary>
+public enum ShoppingCartType
{
/// <summary>
- /// Represents a shoping cart type
+ /// On hold cart
/// </summary>
- public enum ShoppingCartType
- {
- /// <summary>
- /// On hold cart
- /// </summary>
- OnHoldCart = 0,
- /// <summary>
- /// Shopping cart
- /// </summary>
- ShoppingCart = 1,
- /// <summary>
- /// Wishlist
- /// </summary>
- Wishlist = 2,
- /// <summary>
- /// Auctions
- /// </summary>
- Auctions = 3
+ OnHoldCart = 0,
- }
-}
+ /// <summary>
+ /// Shopping cart
+ /// </summary>
+ ShoppingCart = 1,
+
+ /// <summary>
+ /// Wishlist
+ /// </summary>
+ Wishlist = 2,
+
+ /// <summary>
+ /// Auctions
+ /// </summary>
+ Auctions = 3
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/PagedList.cs b/src/Core/Grand.Domain/PagedList.cs
index 36ea6d6d0..a50031d64 100644
--- a/src/Core/Grand.Domain/PagedList.cs
+++ b/src/Core/Grand.Domain/PagedList.cs
@@ -1,84 +1,83 @@
-namespace Grand.Domain
+namespace Grand.Domain;
+
+/// <summary>
+/// Paged list
+/// </summary>
+/// <typeparam name="T">T</typeparam>
+[Serializable]
+public class PagedList<T> : List<T>, IPagedList<T>
{
- /// <summary>
- /// Paged list
- /// </summary>
- /// <typeparam name="T">T</typeparam>
- [Serializable]
- public class PagedList<T> : List<T>, IPagedList<T>
+ public PagedList()
{
+ }
- private void Initialize(IEnumerable<T> source, int pageIndex, int pageSize, int? totalCount = null)
- {
- ArgumentNullException.ThrowIfNull(source);
+ public PagedList(IEnumerable<T> source, int pageIndex, int pageSize)
+ {
+ Initialize(source, pageIndex, pageSize);
+ }
- if (pageSize <= 0)
- pageSize = 1;
+ public PagedList(IEnumerable<T> source, int pageIndex, int pageSize, int totalCount)
+ {
+ Initialize(source, pageIndex, pageSize, totalCount);
+ }
- TotalCount = totalCount ?? source.Count();
+ public int PageIndex { get; protected set; }
+ public int PageSize { get; protected set; }
+ public int TotalCount { get; protected set; }
+ public int TotalPages { get; protected set; }
- if (pageSize > 0)
- {
- TotalPages = TotalCount / pageSize;
- if (TotalCount % pageSize > 0)
- TotalPages++;
- }
+ public bool HasPreviousPage => PageIndex > 0;
- PageSize = pageSize;
- PageIndex = pageIndex;
- source = totalCount == null ? source.Skip(pageIndex * pageSize).Take(pageSize) : source;
- AddRange(source);
- }
+ public bool HasNextPage => PageIndex + 1 < TotalPages;
- public PagedList()
- {
- }
- public PagedList(IEnumerable<T> source, int pageIndex, int pageSize)
- {
- Initialize(source, pageIndex, pageSize);
- }
+ private void Initialize(IEnumerable<T> source, int pageIndex, int pageSize, int? totalCount = null)
+ {
+ ArgumentNullException.ThrowIfNull(source);
- public PagedList(IEnumerable<T> source, int pageIndex, int pageSize, int totalCount)
- {
- Initialize(source, pageIndex, pageSize, totalCount);
- }
+ if (pageSize <= 0)
+ pageSize = 1;
- private Task InitializeAsync(IQueryable<T> source, int pageIndex, int pageSize, int? totalCount = null)
+ TotalCount = totalCount ?? source.Count();
+
+ if (pageSize > 0)
{
- ArgumentNullException.ThrowIfNull(source);
- if (pageSize <= 0)
- pageSize = 1;
-
- TotalCount = totalCount ?? source.Count();
- source = totalCount == null ? source.Skip(pageIndex * pageSize).Take(pageSize) : source;
- AddRange(source);
-
- if (pageSize > 0)
- {
- TotalPages = TotalCount / pageSize;
- if (TotalCount % pageSize > 0)
- TotalPages++;
- }
-
- PageSize = pageSize;
- PageIndex = pageIndex;
- return Task.CompletedTask;
+ TotalPages = TotalCount / pageSize;
+ if (TotalCount % pageSize > 0)
+ TotalPages++;
}
- public static async Task<PagedList<T>> Create(IQueryable<T> source, int pageIndex, int pageSize)
+ PageSize = pageSize;
+ PageIndex = pageIndex;
+ source = totalCount == null ? source.Skip(pageIndex * pageSize).Take(pageSize) : source;
+ AddRange(source);
+ }
+
+ private Task InitializeAsync(IQueryable<T> source, int pageIndex, int pageSize, int? totalCount = null)
+ {
+ ArgumentNullException.ThrowIfNull(source);
+ if (pageSize <= 0)
+ pageSize = 1;
+
+ TotalCount = totalCount ?? source.Count();
+ source = totalCount == null ? source.Skip(pageIndex * pageSize).Take(pageSize) : source;
+ AddRange(source);
+
+ if (pageSize > 0)
{
- var pagelist = new PagedList<T>();
- await pagelist.InitializeAsync(source, pageIndex, pageSize);
- return pagelist;
+ TotalPages = TotalCount / pageSize;
+ if (TotalCount % pageSize > 0)
+ TotalPages++;
}
- public int PageIndex { get; protected set; }
- public int PageSize { get; protected set; }
- public int TotalCount { get; protected set; }
- public int TotalPages { get; protected set; }
-
- public bool HasPreviousPage => PageIndex > 0;
+ PageSize = pageSize;
+ PageIndex = pageIndex;
+ return Task.CompletedTask;
+ }
- public bool HasNextPage => PageIndex + 1 < TotalPages;
+ public static async Task<PagedList<T>> Create(IQueryable<T> source, int pageIndex, int pageSize)
+ {
+ var pagelist = new PagedList<T>();
+ await pagelist.InitializeAsync(source, pageIndex, pageSize);
+ return pagelist;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Pages/Page.cs b/src/Core/Grand.Domain/Pages/Page.cs
index 631728dd2..bb22146d3 100644
--- a/src/Core/Grand.Domain/Pages/Page.cs
+++ b/src/Core/Grand.Domain/Pages/Page.cs
@@ -3,125 +3,130 @@ using Grand.Domain.Permissions;
using Grand.Domain.Seo;
using Grand.Domain.Stores;
-namespace Grand.Domain.Pages
+namespace Grand.Domain.Pages;
+
+/// <summary>
+/// Represents a page
+/// </summary>
+public class Page : BaseEntity, ITranslationEntity, ISlugEntity, IStoreLinkEntity, IGroupLinkEntity
{
/// <summary>
- /// Represents a page
- /// </summary>
- public class Page : BaseEntity, ITranslationEntity, ISlugEntity, IStoreLinkEntity, IGroupLinkEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string SystemName { get; set; }
-
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating whether this page should be included in sitemap
- /// </summary>
- public bool IncludeInSitemap { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating whether this page should be included in menu
- /// </summary>
- public bool IncludeInMenu { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating whether this page should be included in footer (column 1)
- /// </summary>
- public bool IncludeInFooterRow1 { get; set; }
- /// <summary>
- /// Gets or sets the value indicating whether this page should be included in footer (column 1)
- /// </summary>
- public bool IncludeInFooterRow2 { get; set; }
- /// <summary>
- /// Gets or sets the value indicating whether this page should be included in footer (column 1)
- /// </summary>
- public bool IncludeInFooterRow3 { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating whether this page is accessible when a store is closed
- /// </summary>
- public bool AccessibleWhenStoreClosed { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating whether this page is password protected
- /// </summary>
- public bool IsPasswordProtected { get; set; }
-
- /// <summary>
- /// Gets or sets the password
- /// </summary>
- public string Password { get; set; }
-
- /// <summary>
- /// Gets or sets the title
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the body
- /// </summary>
- public string Body { get; set; }
-
- /// <summary>
- /// Gets or sets a value of used page layout identifier
- /// </summary>
- public string PageLayoutId { get; set; }
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
- /// </summary>
- public bool LimitedToStores { get; set; }
- public IList<string> Stores { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to ACL
- /// </summary>
- public bool LimitedToGroups { get; set; }
- public IList<string> CustomerGroups { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is published
- /// </summary>
- public bool Published { get; set; }
- /// <summary>
- /// Gets or sets a start date of page
- /// </summary>
- public DateTime? StartDateUtc { get; set; }
- /// <summary>
- /// Gets or sets a end date of page
- /// </summary>
- public DateTime? EndDateUtc { get; set; }
- }
-}
+ /// Gets or sets the name
+ /// </summary>
+ public string SystemName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page should be included in sitemap
+ /// </summary>
+ public bool IncludeInSitemap { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page should be included in menu
+ /// </summary>
+ public bool IncludeInMenu { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page should be included in footer (column 1)
+ /// </summary>
+ public bool IncludeInFooterRow1 { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page should be included in footer (column 1)
+ /// </summary>
+ public bool IncludeInFooterRow2 { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page should be included in footer (column 1)
+ /// </summary>
+ public bool IncludeInFooterRow3 { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page is accessible when a store is closed
+ /// </summary>
+ public bool AccessibleWhenStoreClosed { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating whether this page is password protected
+ /// </summary>
+ public bool IsPasswordProtected { get; set; }
+
+ /// <summary>
+ /// Gets or sets the password
+ /// </summary>
+ public string Password { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title
+ /// </summary>
+ public string Title { get; set; }
+
+ /// <summary>
+ /// Gets or sets the body
+ /// </summary>
+ public string Body { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of used page layout identifier
+ /// </summary>
+ public string PageLayoutId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is published
+ /// </summary>
+ public bool Published { get; set; }
+
+ /// <summary>
+ /// Gets or sets a start date of page
+ /// </summary>
+ public DateTime? StartDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets a end date of page
+ /// </summary>
+ public DateTime? EndDateUtc { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is subject to ACL
+ /// </summary>
+ public bool LimitedToGroups { get; set; }
+
+ public IList<string> CustomerGroups { get; set; } = new List<string>();
+
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
+ /// </summary>
+ public bool LimitedToStores { get; set; }
+
+ public IList<string> Stores { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Pages/PageLayout.cs b/src/Core/Grand.Domain/Pages/PageLayout.cs
index 32a5cee57..8d607216d 100644
--- a/src/Core/Grand.Domain/Pages/PageLayout.cs
+++ b/src/Core/Grand.Domain/Pages/PageLayout.cs
@@ -1,23 +1,22 @@
-namespace Grand.Domain.Pages
+namespace Grand.Domain.Pages;
+
+/// <summary>
+/// Represents a page layout
+/// </summary>
+public class PageLayout : BaseEntity
{
/// <summary>
- /// Represents a page layout
+ /// Gets or sets the layout name
/// </summary>
- public class PageLayout : BaseEntity
- {
- /// <summary>
- /// Gets or sets the layout name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the view path
- /// </summary>
- public string ViewPath { get; set; }
+ /// <summary>
+ /// Gets or sets the view path
+ /// </summary>
+ public string ViewPath { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/ParentEntity.cs b/src/Core/Grand.Domain/ParentEntity.cs
index 49aca7300..11bf167a6 100644
--- a/src/Core/Grand.Domain/ParentEntity.cs
+++ b/src/Core/Grand.Domain/ParentEntity.cs
@@ -1,22 +1,19 @@
using Grand.SharedKernel.Attributes;
-namespace Grand.Domain
-{
- public abstract class ParentEntity
- {
- protected ParentEntity()
- {
- _id = UniqueIdentifier.New;
- }
+namespace Grand.Domain;
- [DBFieldName("_id")]
- public string Id
- {
- get => _id;
- set => _id = string.IsNullOrEmpty(value) ? UniqueIdentifier.New : value;
- }
+public abstract class ParentEntity
+{
+ private string _id;
- private string _id;
+ protected ParentEntity()
+ {
+ _id = UniqueIdentifier.New;
+ }
+ [DBFieldName("_id")]
+ public string Id {
+ get => _id;
+ set => _id = string.IsNullOrEmpty(value) ? UniqueIdentifier.New : value;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Payments/PaymentRestrictedSettings.cs b/src/Core/Grand.Domain/Payments/PaymentRestrictedSettings.cs
index 70de4216b..f6b94e4b9 100644
--- a/src/Core/Grand.Domain/Payments/PaymentRestrictedSettings.cs
+++ b/src/Core/Grand.Domain/Payments/PaymentRestrictedSettings.cs
@@ -1,9 +1,8 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Payments
+namespace Grand.Domain.Payments;
+
+public class PaymentRestrictedSettings : ISettings
{
- public class PaymentRestrictedSettings : ISettings
- {
- public IList<string> Ids { get; set; } = new List<string>();
- }
-}
+ public IList<string> Ids { get; set; } = new List<string>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Payments/PaymentSettings.cs b/src/Core/Grand.Domain/Payments/PaymentSettings.cs
index 7f4203337..0fb4943e5 100644
--- a/src/Core/Grand.Domain/Payments/PaymentSettings.cs
+++ b/src/Core/Grand.Domain/Payments/PaymentSettings.cs
@@ -1,38 +1,38 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Payments
-{
- public class PaymentSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a system names of active payment methods
- /// </summary>
- public List<string> ActivePaymentProviderSystemNames { get; set; } = new();
+namespace Grand.Domain.Payments;
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to repost (complete) payments for redirection payment methods
- /// </summary>
- public bool AllowRePostingPayments { get; set; }
+public class PaymentSettings : ISettings
+{
+ /// <summary>
+ /// Gets or sets a system names of active payment methods
+ /// </summary>
+ public List<string> ActivePaymentProviderSystemNames { get; set; } = new();
- /// <summary>
- /// Gets or sets a value indicating whether we should skip select payment provider page if we have only one payment method
- /// </summary>
- public bool SkipPaymentIfOnlyOne { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to repost (complete) payments for redirection payment
+ /// methods
+ /// </summary>
+ public bool AllowRePostingPayments { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether we should show payment prvider if cart is zero
- /// </summary>
- public bool ShowPaymentIfCartIsZero { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether we should skip select payment provider page if we have only one payment
+ /// method
+ /// </summary>
+ public bool SkipPaymentIfOnlyOne { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether to show payment method descriptions on checkout pages in the public store
- /// </summary>
- public bool ShowPaymentDescriptions { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether we should show payment prvider if cart is zero
+ /// </summary>
+ public bool ShowPaymentIfCartIsZero { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether we skip payment info page for redirection payment provider
- /// </summary>
- public bool SkipPaymentInfo { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether to show payment method descriptions on checkout pages in the public store
+ /// </summary>
+ public bool ShowPaymentDescriptions { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether we skip payment info page for redirection payment provider
+ /// </summary>
+ public bool SkipPaymentInfo { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Payments/PaymentStatus.cs b/src/Core/Grand.Domain/Payments/PaymentStatus.cs
index 27d75bb99..82535b1f2 100644
--- a/src/Core/Grand.Domain/Payments/PaymentStatus.cs
+++ b/src/Core/Grand.Domain/Payments/PaymentStatus.cs
@@ -1,41 +1,47 @@
-namespace Grand.Domain.Payments
+namespace Grand.Domain.Payments;
+
+/// <summary>
+/// Represents a payment status enumeration
+/// </summary>
+public enum PaymentStatus
{
/// <summary>
- /// Represents a payment status enumeration
- /// </summary>
- public enum PaymentStatus
- {
- /// <summary>
- /// Pending
- /// </summary>
- Pending = 10,
- /// <summary>
- /// Authorized
- /// </summary>
- Authorized = 20,
- /// <summary>
- /// Paid
- /// </summary>
- PartiallyPaid = 25,
- /// <summary>
- /// Paid
- /// </summary>
- Paid = 30,
- /// <summary>
- /// Partially Refunded
- /// </summary>
- PartiallyRefunded = 35,
- /// <summary>
- /// Pending Refunded
- /// </summary>
- PendingRefunded = 39,
- /// <summary>
- /// Refunded
- /// </summary>
- Refunded = 40,
- /// <summary>
- /// Voided
- /// </summary>
- Voided = 50
- }
-}
+ /// Pending
+ /// </summary>
+ Pending = 10,
+
+ /// <summary>
+ /// Authorized
+ /// </summary>
+ Authorized = 20,
+
+ /// <summary>
+ /// Paid
+ /// </summary>
+ PartiallyPaid = 25,
+
+ /// <summary>
+ /// Paid
+ /// </summary>
+ Paid = 30,
+
+ /// <summary>
+ /// Partially Refunded
+ /// </summary>
+ PartiallyRefunded = 35,
+
+ /// <summary>
+ /// Pending Refunded
+ /// </summary>
+ PendingRefunded = 39,
+
+ /// <summary>
+ /// Refunded
+ /// </summary>
+ Refunded = 40,
+
+ /// <summary>
+ /// Voided
+ /// </summary>
+ Voided = 50
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Payments/PaymentTransaction.cs b/src/Core/Grand.Domain/Payments/PaymentTransaction.cs
index b5b03befa..f3422a48e 100644
--- a/src/Core/Grand.Domain/Payments/PaymentTransaction.cs
+++ b/src/Core/Grand.Domain/Payments/PaymentTransaction.cs
@@ -1,102 +1,113 @@
-namespace Grand.Domain.Payments
+namespace Grand.Domain.Payments;
+
+public class PaymentTransaction : BaseEntity
{
- public class PaymentTransaction : BaseEntity
- {
- /// <summary>
- /// Gets or sets payment method system name
- /// </summary>
- public string PaymentMethodSystemName { get; set; }
-
- /// <summary>
- /// Gets or sets transaction status
- /// </summary>
- public TransactionStatus TransactionStatus { get; set; }
- /// <summary>
- /// Gets or sets store ident
- /// </summary>
- public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets order guid
- /// </summary>
- public Guid OrderGuid { get; set; }
-
- /// <summary>
- /// Gets or sets order code
- /// </summary>
- public string OrderCode { get; set; }
- /// <summary>
- /// Gets or sets customer ident
- /// </summary>
- public string CustomerId { get; set; }
- /// <summary>
- /// Gets or sets customer email
- /// </summary>
- public string CustomerEmail { get; set; }
- /// <summary>
- /// Gets or sets currency code
- /// </summary>
- public string CurrencyCode { get; set; }
-
- public double CurrencyRate { get; set; }
-
- /// <summary>
- /// Gets or sets amount
- /// </summary>
- public double TransactionAmount { get; set; }
-
- public double PaidAmount { get; set; }
-
- /// <summary>
- /// Gets or sets the refunded amount
- /// </summary>
- public double RefundedAmount { get; set; }
-
- /// <summary>
- /// Gets or sets id transaction
- /// </summary>
- public string IPAddress { get; set; }
- /// <summary>
- /// Gets or sets authorization transaction id
- /// </summary>
- public string AuthorizationTransactionId { get; set; }
- /// <summary>
- /// Gets or sets authorization transaction code
- /// </summary>
- public string AuthorizationTransactionCode { get; set; }
- /// <summary>
- /// Gets or sets authorization transaction result
- /// </summary>
- public string AuthorizationTransactionResult { get; set; }
- /// <summary>
- /// Gets or sets capture transaction id
- /// </summary>
- public string CaptureTransactionId { get; set; }
- /// <summary>
- /// Gets or sets capture transaction result
- /// </summary>
- public string CaptureTransactionResult { get; set; }
- /// <summary>
- /// Gets or sets description
- /// </summary>
- public string Description { get; set; }
- /// <summary>
- /// Gets or sets additional info
- /// </summary>
- public string AdditionalInfo { get; set; }
-
- /// <summary>
- /// Gets or sets custom values
- /// </summary>
- public Dictionary<string, object> CustomValues { get; set; } = new();
-
- /// <summary>
- /// gets or sets errors
- /// </summary>
- public IList<string> Errors { get; set; } = new List<string>();
-
- /// <summary>
- /// Gets or sets
- /// </summary>
- public bool Temp { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets payment method system name
+ /// </summary>
+ public string PaymentMethodSystemName { get; set; }
+
+ /// <summary>
+ /// Gets or sets transaction status
+ /// </summary>
+ public TransactionStatus TransactionStatus { get; set; }
+
+ /// <summary>
+ /// Gets or sets store ident
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets order guid
+ /// </summary>
+ public Guid OrderGuid { get; set; }
+
+ /// <summary>
+ /// Gets or sets order code
+ /// </summary>
+ public string OrderCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets customer ident
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets customer email
+ /// </summary>
+ public string CustomerEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets currency code
+ /// </summary>
+ public string CurrencyCode { get; set; }
+
+ public double CurrencyRate { get; set; }
+
+ /// <summary>
+ /// Gets or sets amount
+ /// </summary>
+ public double TransactionAmount { get; set; }
+
+ public double PaidAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets the refunded amount
+ /// </summary>
+ public double RefundedAmount { get; set; }
+
+ /// <summary>
+ /// Gets or sets id transaction
+ /// </summary>
+ public string IPAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets authorization transaction id
+ /// </summary>
+ public string AuthorizationTransactionId { get; set; }
+
+ /// <summary>
+ /// Gets or sets authorization transaction code
+ /// </summary>
+ public string AuthorizationTransactionCode { get; set; }
+
+ /// <summary>
+ /// Gets or sets authorization transaction result
+ /// </summary>
+ public string AuthorizationTransactionResult { get; set; }
+
+ /// <summary>
+ /// Gets or sets capture transaction id
+ /// </summary>
+ public string CaptureTransactionId { get; set; }
+
+ /// <summary>
+ /// Gets or sets capture transaction result
+ /// </summary>
+ public string CaptureTransactionResult { get; set; }
+
+ /// <summary>
+ /// Gets or sets description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets additional info
+ /// </summary>
+ public string AdditionalInfo { get; set; }
+
+ /// <summary>
+ /// Gets or sets custom values
+ /// </summary>
+ public Dictionary<string, object> CustomValues { get; set; } = new();
+
+ /// <summary>
+ /// gets or sets errors
+ /// </summary>
+ public IList<string> Errors { get; set; } = new List<string>();
+
+ /// <summary>
+ /// Gets or sets
+ /// </summary>
+ public bool Temp { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Payments/TransactionStatus.cs b/src/Core/Grand.Domain/Payments/TransactionStatus.cs
index 9c87182a9..6ea86068c 100644
--- a/src/Core/Grand.Domain/Payments/TransactionStatus.cs
+++ b/src/Core/Grand.Domain/Payments/TransactionStatus.cs
@@ -1,38 +1,44 @@
-namespace Grand.Domain.Payments
+namespace Grand.Domain.Payments;
+
+public enum TransactionStatus
{
- public enum TransactionStatus
- {
- /// <summary>
- /// Pending
- /// </summary>
- Pending = 0,
- /// <summary>
- /// Authorized
- /// </summary>
- Authorized = 10,
- /// <summary>
- /// Partially Paid
- /// </summary>
- PartialPaid = 15,
- /// <summary>
- /// Paid
- /// </summary>
- Paid = 20,
- /// <summary>
- /// Partially Refunded
- /// </summary>
- PartiallyRefunded = 25,
- /// <summary>
- /// Refunded
- /// </summary>
- Refunded = 30,
- /// <summary>
- /// Voided
- /// </summary>
- Voided = 40,
- /// <summary>
- /// Canceled
- /// </summary>
- Canceled = 50
- }
-}
+ /// <summary>
+ /// Pending
+ /// </summary>
+ Pending = 0,
+
+ /// <summary>
+ /// Authorized
+ /// </summary>
+ Authorized = 10,
+
+ /// <summary>
+ /// Partially Paid
+ /// </summary>
+ PartialPaid = 15,
+
+ /// <summary>
+ /// Paid
+ /// </summary>
+ Paid = 20,
+
+ /// <summary>
+ /// Partially Refunded
+ /// </summary>
+ PartiallyRefunded = 25,
+
+ /// <summary>
+ /// Refunded
+ /// </summary>
+ Refunded = 30,
+
+ /// <summary>
+ /// Voided
+ /// </summary>
+ Voided = 40,
+
+ /// <summary>
+ /// Canceled
+ /// </summary>
+ Canceled = 50
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Permissions/DefaultPermission.cs b/src/Core/Grand.Domain/Permissions/DefaultPermission.cs
index 15c06c0dc..2e35a14ca 100644
--- a/src/Core/Grand.Domain/Permissions/DefaultPermission.cs
+++ b/src/Core/Grand.Domain/Permissions/DefaultPermission.cs
@@ -1,18 +1,17 @@
-namespace Grand.Domain.Permissions
+namespace Grand.Domain.Permissions;
+
+/// <summary>
+/// Represents a default permission
+/// </summary>
+public class DefaultPermission
{
/// <summary>
- /// Represents a default permission
+ /// Gets or sets the customer group system name
/// </summary>
- public class DefaultPermission
- {
- /// <summary>
- /// Gets or sets the customer group system name
- /// </summary>
- public string CustomerGroupSystemName { get; set; }
+ public string CustomerGroupSystemName { get; set; }
- /// <summary>
- /// Gets or sets the permissions
- /// </summary>
- public IEnumerable<Permission> Permissions { get; set; } = new List<Permission>();
- }
-}
+ /// <summary>
+ /// Gets or sets the permissions
+ /// </summary>
+ public IEnumerable<Permission> Permissions { get; set; } = new List<Permission>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Permissions/IGroupLinkEntity.cs b/src/Core/Grand.Domain/Permissions/IGroupLinkEntity.cs
index cb62d8b0b..d6a245f54 100644
--- a/src/Core/Grand.Domain/Permissions/IGroupLinkEntity.cs
+++ b/src/Core/Grand.Domain/Permissions/IGroupLinkEntity.cs
@@ -1,14 +1,14 @@
-namespace Grand.Domain.Permissions
+namespace Grand.Domain.Permissions;
+
+/// <summary>
+/// Represents an entity which entity group linking
+/// </summary>
+public interface IGroupLinkEntity
{
/// <summary>
- /// Represents an entity which entity group linking
+ /// Gets or sets a value indicating whether the entity is subject to group
/// </summary>
- public interface IGroupLinkEntity
- {
- /// <summary>
- /// Gets or sets a value indicating whether the entity is subject to group
- /// </summary>
- bool LimitedToGroups { get; set; }
- IList<string> CustomerGroups { get; set; }
- }
-}
+ bool LimitedToGroups { get; set; }
+
+ IList<string> CustomerGroups { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Permissions/Permission.cs b/src/Core/Grand.Domain/Permissions/Permission.cs
index a162907e0..30781a792 100644
--- a/src/Core/Grand.Domain/Permissions/Permission.cs
+++ b/src/Core/Grand.Domain/Permissions/Permission.cs
@@ -1,48 +1,46 @@
-namespace Grand.Domain.Permissions
+namespace Grand.Domain.Permissions;
+
+/// <summary>
+/// Represents a permission
+/// </summary>
+public class Permission : BaseEntity
{
+ private ICollection<string> _actions;
+ private ICollection<string> _customerGroups;
+
/// <summary>
- /// Represents a permission
+ /// Gets or sets the permission name
/// </summary>
- public class Permission : BaseEntity
- {
- private ICollection<string> _customerGroups;
- private ICollection<string> _actions;
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the permission name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the permission system name
- /// </summary>
- public string SystemName { get; set; }
+ /// <summary>
+ /// Gets or sets the permission system name
+ /// </summary>
+ public string SystemName { get; set; }
- /// <summary>
- /// Gets or sets the area name
- /// </summary>
- public string Area { get; set; }
+ /// <summary>
+ /// Gets or sets the area name
+ /// </summary>
+ public string Area { get; set; }
- /// <summary>
- /// Gets or sets the permission category
- /// </summary>
- public string Category { get; set; }
+ /// <summary>
+ /// Gets or sets the permission category
+ /// </summary>
+ public string Category { get; set; }
- /// <summary>
- /// Gets or sets customer groups
- /// </summary>
- public virtual ICollection<string> CustomerGroups
- {
- get => _customerGroups ??= new List<string>();
- protected set => _customerGroups = value;
- }
+ /// <summary>
+ /// Gets or sets customer groups
+ /// </summary>
+ public virtual ICollection<string> CustomerGroups {
+ get => _customerGroups ??= new List<string>();
+ protected set => _customerGroups = value;
+ }
- /// <summary>
- /// Gets or sets actions
- /// </summary>
- public virtual ICollection<string> Actions {
- get => _actions ??= new List<string>();
- set => _actions = value;
- }
+ /// <summary>
+ /// Gets or sets actions
+ /// </summary>
+ public virtual ICollection<string> Actions {
+ get => _actions ??= new List<string>();
+ set => _actions = value;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Permissions/PermissionAction.cs b/src/Core/Grand.Domain/Permissions/PermissionAction.cs
index 830cc269c..492716ea1 100644
--- a/src/Core/Grand.Domain/Permissions/PermissionAction.cs
+++ b/src/Core/Grand.Domain/Permissions/PermissionAction.cs
@@ -1,25 +1,22 @@
-namespace Grand.Domain.Permissions
+namespace Grand.Domain.Permissions;
+
+/// <summary>
+/// Represents permission for action denied
+/// </summary>
+public class PermissionAction : BaseEntity
{
/// <summary>
- /// Represents permission for action denied
+ /// Gets or sets the permission system name
/// </summary>
- public class PermissionAction : BaseEntity
- {
-
- /// <summary>
- /// Gets or sets the permission system name
- /// </summary>
- public string SystemName { get; set; }
+ public string SystemName { get; set; }
- /// <summary>
- /// Gets or sets the customer group ident
- /// </summary>
- public string CustomerGroupId { get; set; }
-
- /// <summary>
- /// Gets or sets the action name for denied access
- /// </summary>
- public string Action { get; set; }
+ /// <summary>
+ /// Gets or sets the customer group ident
+ /// </summary>
+ public string CustomerGroupId { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the action name for denied access
+ /// </summary>
+ public string Action { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/PushNotifications/PushMessage.cs b/src/Core/Grand.Domain/PushNotifications/PushMessage.cs
index ae7f24e0a..3c5f7ec8e 100644
--- a/src/Core/Grand.Domain/PushNotifications/PushMessage.cs
+++ b/src/Core/Grand.Domain/PushNotifications/PushMessage.cs
@@ -1,13 +1,12 @@
-namespace Grand.Domain.PushNotifications
+namespace Grand.Domain.PushNotifications;
+
+public class PushMessage : BaseEntity
{
- public class PushMessage : BaseEntity
- {
- public string Title { get; set; }
+ public string Title { get; set; }
- public string Text { get; set; }
+ public string Text { get; set; }
- public DateTime SentOn { get; set; }
+ public DateTime SentOn { get; set; }
- public int NumberOfReceivers { get; set; }
- }
-}
+ public int NumberOfReceivers { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/PushNotifications/PushNotificationsSettings.cs b/src/Core/Grand.Domain/PushNotifications/PushNotificationsSettings.cs
index 146d57d39..cdbc6f6c7 100644
--- a/src/Core/Grand.Domain/PushNotifications/PushNotificationsSettings.cs
+++ b/src/Core/Grand.Domain/PushNotifications/PushNotificationsSettings.cs
@@ -1,23 +1,23 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.PushNotifications
+namespace Grand.Domain.PushNotifications;
+
+public class PushNotificationsSettings : ISettings
{
- public class PushNotificationsSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether push notifications are enabled
- /// </summary>
- public bool Enabled { get; set; }
- public string PrivateApiKey { get; set; }
- public string PublicApiKey { get; set; }
- public string SenderId { get; set; }
- public string AuthDomain { get; set; }
- public string DatabaseUrl { get; set; }
- public string ProjectId { get; set; }
- public string StorageBucket { get; set; }
- public string PictureId { get; set; }
- public bool AllowGuestNotifications { get; set; }
- public string ClickUrl { get; set; }
- public string AppId { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets a value indicating whether push notifications are enabled
+ /// </summary>
+ public bool Enabled { get; set; }
+
+ public string PrivateApiKey { get; set; }
+ public string PublicApiKey { get; set; }
+ public string SenderId { get; set; }
+ public string AuthDomain { get; set; }
+ public string DatabaseUrl { get; set; }
+ public string ProjectId { get; set; }
+ public string StorageBucket { get; set; }
+ public string PictureId { get; set; }
+ public bool AllowGuestNotifications { get; set; }
+ public string ClickUrl { get; set; }
+ public string AppId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/PushNotifications/PushRegistration.cs b/src/Core/Grand.Domain/PushNotifications/PushRegistration.cs
index 897f1d75a..bf765768b 100644
--- a/src/Core/Grand.Domain/PushNotifications/PushRegistration.cs
+++ b/src/Core/Grand.Domain/PushNotifications/PushRegistration.cs
@@ -1,13 +1,12 @@
-namespace Grand.Domain.PushNotifications
+namespace Grand.Domain.PushNotifications;
+
+public class PushRegistration : BaseEntity
{
- public class PushRegistration : BaseEntity
- {
- public string CustomerId { get; set; }
+ public string CustomerId { get; set; }
- public bool Allowed { get; set; }
+ public bool Allowed { get; set; }
- public string Token { get; set; }
+ public string Token { get; set; }
- public DateTime RegisteredOn { get; set; }
- }
-}
+ public DateTime RegisteredOn { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Security/RefreshToken.cs b/src/Core/Grand.Domain/Security/RefreshToken.cs
index 356814b89..d8d97682c 100644
--- a/src/Core/Grand.Domain/Security/RefreshToken.cs
+++ b/src/Core/Grand.Domain/Security/RefreshToken.cs
@@ -1,10 +1,9 @@
-namespace Grand.Domain.Security
+namespace Grand.Domain.Security;
+
+public class RefreshToken
{
- public class RefreshToken
- {
- public string RefreshId { get; set; }
- public string Token { get; set; }
- public DateTime ValidTo { get; set; }
- public bool IsActive { get; set; }
- }
-}
+ public string RefreshId { get; set; }
+ public string Token { get; set; }
+ public DateTime ValidTo { get; set; }
+ public bool IsActive { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Security/SecuritySettings.cs b/src/Core/Grand.Domain/Security/SecuritySettings.cs
index 17987e82e..756103679 100644
--- a/src/Core/Grand.Domain/Security/SecuritySettings.cs
+++ b/src/Core/Grand.Domain/Security/SecuritySettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Security
+namespace Grand.Domain.Security;
+
+public class SecuritySettings : ISettings
{
- public class SecuritySettings : ISettings
- {
- /// <summary>
- /// Gets or sets a list of admin area allowed IP addresses
- /// </summary>
- public List<string> AdminAreaAllowedIpAddresses { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a list of admin area allowed IP addresses
+ /// </summary>
+ public List<string> AdminAreaAllowedIpAddresses { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Seo/EntityTypes.cs b/src/Core/Grand.Domain/Seo/EntityTypes.cs
index 56651e9f7..e3b3eeae3 100644
--- a/src/Core/Grand.Domain/Seo/EntityTypes.cs
+++ b/src/Core/Grand.Domain/Seo/EntityTypes.cs
@@ -1,4 +1,6 @@
-namespace Grand.Domain.Seo;
+using Grand.Domain.Knowledgebase;
+
+namespace Grand.Domain.Seo;
public struct EntityTypes
{
@@ -10,8 +12,7 @@ public struct EntityTypes
public const string NewsItem = nameof(News.NewsItem);
public const string BlogPost = nameof(Blogs.BlogPost);
public const string Page = nameof(Pages.Page);
- public const string KnowledgeBaseArticle = nameof(Knowledgebase.KnowledgebaseArticle);
- public const string KnowledgeBaseCategory = nameof(Knowledgebase.KnowledgebaseCategory);
+ public const string KnowledgeBaseArticle = nameof(KnowledgebaseArticle);
+ public const string KnowledgeBaseCategory = nameof(KnowledgebaseCategory);
public const string Course = nameof(Courses.Course);
-
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Seo/EntityUrl.cs b/src/Core/Grand.Domain/Seo/EntityUrl.cs
index 9ed2a5e40..475e16482 100644
--- a/src/Core/Grand.Domain/Seo/EntityUrl.cs
+++ b/src/Core/Grand.Domain/Seo/EntityUrl.cs
@@ -1,43 +1,42 @@
-namespace Grand.Domain.Seo
+namespace Grand.Domain.Seo;
+
+/// <summary>
+/// Represents an URL
+/// </summary>
+public class EntityUrl : BaseEntity
{
/// <summary>
- /// Represents an URL
+ /// Gets or sets the entity identifier
/// </summary>
- public class EntityUrl : BaseEntity
- {
- /// <summary>
- /// Gets or sets the entity identifier
- /// </summary>
- public string EntityId { get; set; }
+ public string EntityId { get; set; }
- /// <summary>
- /// Gets or sets the entity name
- /// </summary>
- public string EntityName { get; set; }
+ /// <summary>
+ /// Gets or sets the entity name
+ /// </summary>
+ public string EntityName { get; set; }
- /// <summary>
- /// Gets or sets the slug
- /// </summary>
- public string Slug { get; set; }
+ /// <summary>
+ /// Gets or sets the slug
+ /// </summary>
+ public string Slug { get; set; }
- /// <summary>
- /// Gets or sets the value indicating whether the item is active
- /// </summary>
- public bool IsActive { get; set; }
+ /// <summary>
+ /// Gets or sets the value indicating whether the item is active
+ /// </summary>
+ public bool IsActive { get; set; }
- /// <summary>
- /// Gets or sets the language identifier
- /// </summary>
- public string LanguageId { get; set; }
-
- /// <summary>
- /// Gets or sets the controller name
- /// </summary>
- public string Controller { get; set; }
-
- /// <summary>
- /// Gets or sets the action name
- /// </summary>
- public string Action { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the language identifier
+ /// </summary>
+ public string LanguageId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the controller name
+ /// </summary>
+ public string Controller { get; set; }
+
+ /// <summary>
+ /// Gets or sets the action name
+ /// </summary>
+ public string Action { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Seo/ISlugEntity.cs b/src/Core/Grand.Domain/Seo/ISlugEntity.cs
index 80af23716..c5cc33ad6 100644
--- a/src/Core/Grand.Domain/Seo/ISlugEntity.cs
+++ b/src/Core/Grand.Domain/Seo/ISlugEntity.cs
@@ -1,10 +1,9 @@
-namespace Grand.Domain.Seo
+namespace Grand.Domain.Seo;
+
+/// <summary>
+/// Represents an entity which use slug
+/// </summary>
+public interface ISlugEntity
{
- /// <summary>
- /// Represents an entity which use slug
- /// </summary>
- public interface ISlugEntity
- {
- string SeName { get; set; }
- }
-}
+ string SeName { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Seo/SeoSettings.cs b/src/Core/Grand.Domain/Seo/SeoSettings.cs
index 2492d9540..a02cb9f75 100644
--- a/src/Core/Grand.Domain/Seo/SeoSettings.cs
+++ b/src/Core/Grand.Domain/Seo/SeoSettings.cs
@@ -1,83 +1,89 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Seo
+namespace Grand.Domain.Seo;
+
+/// <summary>
+/// SEO settings
+/// </summary>
+public class SeoSettings : ISettings
{
/// <summary>
- /// SEO settings
- /// </summary>
- public class SeoSettings : ISettings
- {
- /// <summary>
- /// Page title separator
- /// </summary>
- public string PageTitleSeparator { get; set; }
-
- /// <summary>
- /// Page itle SEO adjustment
- /// </summary>
- public bool PageTitleSeoAdjustment { get; set; }
-
- /// <summary>
- /// Default title
- /// </summary>
- public string DefaultTitle { get; set; }
- /// <summary>
- /// Default META keywords
- /// </summary>
- public string DefaultMetaKeywords { get; set; }
- /// <summary>
- /// Default META description
- /// </summary>
- public string DefaultMetaDescription { get; set; }
- /// <summary>
- /// A value indicating whether product META descriptions will be generated automatically (if not entered)
- /// </summary>
- public bool GenerateProductMetaDescription { get; set; }
- /// <summary>
- /// A value indicating whether we should conver non-wetern chars to western ones
- /// </summary>
- public bool ConvertNonWesternChars { get; set; }
-
- /// <summary>
- /// A value indicating to conver non-wetern chars to western ones
- /// </summary>
- public string SeoCharConversion { get; set; }
-
- /// <summary>
- /// A value indicating whether unicode chars are allowed
- /// </summary>
- public bool AllowSlashChar { get; set; }
-
- /// <summary>
- /// A value indicating whether unicode chars are allowed
- /// </summary>
- public bool AllowUnicodeCharsInUrls { get; set; }
- /// <summary>
- /// A value indicating whether canonical URL tags should be used
- /// </summary>
- public bool CanonicalUrlsEnabled { get; set; }
-
- /// <summary>
- /// A value indicating whether Twitter META tags should be generated
- /// </summary>
- public bool TwitterMetaTags { get; set; }
- /// <summary>
- /// A value indicating whether Open Graph META tags should be generated
- /// </summary>
- public bool OpenGraphMetaTags { get; set; }
- /// <summary>
- /// Gets or sets a picture identifier of the store picture. If 0, then the default one will be used
- /// </summary>
- public string StorePictureId { get; set; }
- /// <summary>
- /// Slugs (sename) reserved for some other needs
- /// </summary>
- public List<string> ReservedEntityUrlSlugs { get; set; } = new();
-
- /// <summary>
- /// Custom tags in the head section
- /// </summary>
- public string CustomHeadTags { get; set; }
-
- }
+ /// Page title separator
+ /// </summary>
+ public string PageTitleSeparator { get; set; }
+
+ /// <summary>
+ /// Page itle SEO adjustment
+ /// </summary>
+ public bool PageTitleSeoAdjustment { get; set; }
+
+ /// <summary>
+ /// Default title
+ /// </summary>
+ public string DefaultTitle { get; set; }
+
+ /// <summary>
+ /// Default META keywords
+ /// </summary>
+ public string DefaultMetaKeywords { get; set; }
+
+ /// <summary>
+ /// Default META description
+ /// </summary>
+ public string DefaultMetaDescription { get; set; }
+
+ /// <summary>
+ /// A value indicating whether product META descriptions will be generated automatically (if not entered)
+ /// </summary>
+ public bool GenerateProductMetaDescription { get; set; }
+
+ /// <summary>
+ /// A value indicating whether we should conver non-wetern chars to western ones
+ /// </summary>
+ public bool ConvertNonWesternChars { get; set; }
+
+ /// <summary>
+ /// A value indicating to conver non-wetern chars to western ones
+ /// </summary>
+ public string SeoCharConversion { get; set; }
+
+ /// <summary>
+ /// A value indicating whether unicode chars are allowed
+ /// </summary>
+ public bool AllowSlashChar { get; set; }
+
+ /// <summary>
+ /// A value indicating whether unicode chars are allowed
+ /// </summary>
+ public bool AllowUnicodeCharsInUrls { get; set; }
+
+ /// <summary>
+ /// A value indicating whether canonical URL tags should be used
+ /// </summary>
+ public bool CanonicalUrlsEnabled { get; set; }
+
+ /// <summary>
+ /// A value indicating whether Twitter META tags should be generated
+ /// </summary>
+ public bool TwitterMetaTags { get; set; }
+
+ /// <summary>
+ /// A value indicating whether Open Graph META tags should be generated
+ /// </summary>
+ public bool OpenGraphMetaTags { get; set; }
+
+ /// <summary>
+ /// Gets or sets a picture identifier of the store picture. If 0, then the default one will be used
+ /// </summary>
+ public string StorePictureId { get; set; }
+
+ /// <summary>
+ /// Slugs (sename) reserved for some other needs
+ /// </summary>
+ public List<string> ReservedEntityUrlSlugs { get; set; } = new();
+
+ /// <summary>
+ /// Custom tags in the head section
+ /// </summary>
+ public string CustomHeadTags { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/DeliveryDate.cs b/src/Core/Grand.Domain/Shipping/DeliveryDate.cs
index 0c27c7d6d..c81289bf7 100644
--- a/src/Core/Grand.Domain/Shipping/DeliveryDate.cs
+++ b/src/Core/Grand.Domain/Shipping/DeliveryDate.cs
@@ -1,30 +1,29 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a delivery date
+/// </summary>
+public class DeliveryDate : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a delivery date
+ /// Gets or sets the name
/// </summary>
- public class DeliveryDate : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
+ public string Name { get; set; }
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
- /// <summary>
- /// Gets or sets the color RGB value (used with "Color squares" attribute type)
- /// </summary>
- public string ColorSquaresRgb { get; set; }
+ /// <summary>
+ /// Gets or sets the color RGB value (used with "Color squares" attribute type)
+ /// </summary>
+ public string ColorSquaresRgb { get; set; }
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/PickupPoints.cs b/src/Core/Grand.Domain/Shipping/PickupPoints.cs
index a12e0f730..30821f040 100644
--- a/src/Core/Grand.Domain/Shipping/PickupPoints.cs
+++ b/src/Core/Grand.Domain/Shipping/PickupPoints.cs
@@ -1,60 +1,59 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a shipment
+/// </summary>
+public class PickupPoint : BaseEntity
{
/// <summary>
- /// Represents a shipment
- /// </summary>
- public class PickupPoint : BaseEntity
- {
- /// <summary>
- /// Gets or sets the point name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
-
- /// <summary>
- /// Gets or sets the address identifier
- /// </summary>
- public Address Address { get; set; }
-
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
-
- /// <summary>
- /// Gets or sets a store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the pickup fee
- /// </summary>
- public double PickupFee { get; set; }
-
- /// <summary>
- /// Gets or sets the latitude of the GeoCoordinate.
- /// </summary>
- public double? Latitude { get; set; }
-
- /// <summary>
- /// Gets or sets the longitude of the GeoCoordinate.
- /// </summary>
- public double? Longitude { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
+ /// Gets or sets the point name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the address identifier
+ /// </summary>
+ public Address Address { get; set; }
+
+ /// <summary>
+ /// Gets or sets the warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the pickup fee
+ /// </summary>
+ public double PickupFee { get; set; }
+
+ /// <summary>
+ /// Gets or sets the latitude of the GeoCoordinate.
+ /// </summary>
+ public double? Latitude { get; set; }
+
+ /// <summary>
+ /// Gets or sets the longitude of the GeoCoordinate.
+ /// </summary>
+ public double? Longitude { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/Shipment.cs b/src/Core/Grand.Domain/Shipping/Shipment.cs
index 0ab26e982..974092327 100644
--- a/src/Core/Grand.Domain/Shipping/Shipment.cs
+++ b/src/Core/Grand.Domain/Shipping/Shipment.cs
@@ -1,69 +1,67 @@
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a shipment
+/// </summary>
+public class Shipment : BaseEntity
{
+ private ICollection<ShipmentItem> _shipmentItems;
+
/// <summary>
- /// Represents a shipment
+ /// Gets or sets the order identifier
/// </summary>
- public class Shipment : BaseEntity
- {
- private ICollection<ShipmentItem> _shipmentItems;
-
- /// <summary>
- /// Gets or sets the order identifier
- /// </summary>
- public string OrderId { get; set; }
+ public string OrderId { get; set; }
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
- /// <summary>
- /// Gets or sets the vendor identifier
- /// </summary>
- public string VendorId { get; set; }
+ /// <summary>
+ /// Gets or sets the vendor identifier
+ /// </summary>
+ public string VendorId { get; set; }
- /// <summary>
- /// Gets or sets the sales employee identifier
- /// </summary>
- public string SeId { get; set; }
+ /// <summary>
+ /// Gets or sets the sales employee identifier
+ /// </summary>
+ public string SeId { get; set; }
- /// <summary>
- /// Gets or sets the tracking number of this shipment
- /// </summary>
- public string TrackingNumber { get; set; }
+ /// <summary>
+ /// Gets or sets the tracking number of this shipment
+ /// </summary>
+ public string TrackingNumber { get; set; }
- /// <summary>
- /// Gets or sets the total weight of this shipment
- /// </summary>
- public double? TotalWeight { get; set; }
+ /// <summary>
+ /// Gets or sets the total weight of this shipment
+ /// </summary>
+ public double? TotalWeight { get; set; }
- /// <summary>
- /// Gets or sets the shipped date and time
- /// </summary>
- public DateTime? ShippedDateUtc { get; set; }
+ /// <summary>
+ /// Gets or sets the shipped date and time
+ /// </summary>
+ public DateTime? ShippedDateUtc { get; set; }
- /// <summary>
- /// Gets or sets the delivery date and time
- /// </summary>
- public DateTime? DeliveryDateUtc { get; set; }
+ /// <summary>
+ /// Gets or sets the delivery date and time
+ /// </summary>
+ public DateTime? DeliveryDateUtc { get; set; }
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
- /// <summary>
- /// Gets the shipment number
- /// </summary>
- public virtual int ShipmentNumber { get; set; }
+ /// <summary>
+ /// Gets the shipment number
+ /// </summary>
+ public virtual int ShipmentNumber { get; set; }
- /// <summary>
- /// Gets or sets the shipment items
- /// </summary>
- public virtual ICollection<ShipmentItem> ShipmentItems
- {
- get => _shipmentItems ??= new List<ShipmentItem>();
- protected set => _shipmentItems = value;
- }
+ /// <summary>
+ /// Gets or sets the shipment items
+ /// </summary>
+ public virtual ICollection<ShipmentItem> ShipmentItems {
+ get => _shipmentItems ??= new List<ShipmentItem>();
+ protected set => _shipmentItems = value;
}
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShipmentItem.cs b/src/Core/Grand.Domain/Shipping/ShipmentItem.cs
index ceb1cdd93..31db6f8d2 100644
--- a/src/Core/Grand.Domain/Shipping/ShipmentItem.cs
+++ b/src/Core/Grand.Domain/Shipping/ShipmentItem.cs
@@ -1,35 +1,34 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a shipment item
+/// </summary>
+public class ShipmentItem : SubBaseEntity
{
/// <summary>
- /// Represents a shipment item
+ /// Gets or sets the order item identifier
/// </summary>
- public class ShipmentItem : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the order item identifier
- /// </summary>
- public string OrderItemId { get; set; }
+ public string OrderItemId { get; set; }
- /// <summary>
- /// Gets or sets the product
- /// </summary>
- public string ProductId { get; set; }
+ /// <summary>
+ /// Gets or sets the product
+ /// </summary>
+ public string ProductId { get; set; }
- /// <summary>
- /// Gets or sets the product attribute xml
- /// </summary>
- public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
+ /// <summary>
+ /// Gets or sets the product attribute xml
+ /// </summary>
+ public IList<CustomAttribute> Attributes { get; set; } = new List<CustomAttribute>();
- /// <summary>
- /// Gets or sets the quantity
- /// </summary>
- public int Quantity { get; set; }
+ /// <summary>
+ /// Gets or sets the quantity
+ /// </summary>
+ public int Quantity { get; set; }
- /// <summary>
- /// Gets or sets the warehouse identifier
- /// </summary>
- public string WarehouseId { get; set; }
- }
+ /// <summary>
+ /// Gets or sets the warehouse identifier
+ /// </summary>
+ public string WarehouseId { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShipmentNote.cs b/src/Core/Grand.Domain/Shipping/ShipmentNote.cs
index 73f997a4e..baf15e641 100644
--- a/src/Core/Grand.Domain/Shipping/ShipmentNote.cs
+++ b/src/Core/Grand.Domain/Shipping/ShipmentNote.cs
@@ -1,33 +1,32 @@
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents an shipment note
+/// </summary>
+public class ShipmentNote : BaseEntity
{
/// <summary>
- /// Represents an shipment note
+ /// Gets or sets the shipment identifier
/// </summary>
- public class ShipmentNote : BaseEntity
- {
- /// <summary>
- /// Gets or sets the shipment identifier
- /// </summary>
- public string ShipmentId { get; set; }
+ public string ShipmentId { get; set; }
- /// <summary>
- /// Gets or sets the note
- /// </summary>
- public string Note { get; set; }
+ /// <summary>
+ /// Gets or sets the note
+ /// </summary>
+ public string Note { get; set; }
+
+ /// <summary>
+ /// Gets or sets the attached file (download) identifier
+ /// </summary>
+ public string DownloadId { get; set; }
- /// <summary>
- /// Gets or sets the attached file (download) identifier
- /// </summary>
- public string DownloadId { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether a customer can see a note
+ /// </summary>
+ public bool DisplayToCustomer { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether a customer can see a note
- /// </summary>
- public bool DisplayToCustomer { get; set; }
-
- /// <summary>
- /// Gets or sets value indicating whether this shipment note was create by customer
- /// </summary>
- public bool CreatedByCustomer { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets value indicating whether this shipment note was create by customer
+ /// </summary>
+ public bool CreatedByCustomer { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShippingMethod.cs b/src/Core/Grand.Domain/Shipping/ShippingMethod.cs
index 2d3260fb3..7a907089e 100644
--- a/src/Core/Grand.Domain/Shipping/ShippingMethod.cs
+++ b/src/Core/Grand.Domain/Shipping/ShippingMethod.cs
@@ -1,52 +1,49 @@
using Grand.Domain.Directory;
using Grand.Domain.Localization;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a shipping method (used for offline Shipping rate methods)
+/// </summary>
+public class ShippingMethod : BaseEntity, ITranslationEntity
{
+ private ICollection<Country> _restrictedCountries;
+ private ICollection<string> _restrictedGroups;
+
+ /// <summary>
+ /// Gets or sets the name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
/// <summary>
- /// Represents a shipping method (used for offline Shipping rate methods)
+ /// Gets or sets the restricted countries
/// </summary>
- public class ShippingMethod : BaseEntity, ITranslationEntity
- {
- private ICollection<Country> _restrictedCountries;
- private ICollection<string> _restrictedGroups;
-
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
-
- /// <summary>
- /// Gets or sets the restricted countries
- /// </summary>
- public virtual ICollection<Country> RestrictedCountries
- {
- get => _restrictedCountries ??= new List<Country>();
- protected set => _restrictedCountries = value;
- }
-
- /// <summary>
- /// Gets or sets the restricted roles
- /// </summary>
- public virtual ICollection<string> RestrictedGroups
- {
- get => _restrictedGroups ??= new List<string>();
- protected set => _restrictedGroups = value;
- }
+ public virtual ICollection<Country> RestrictedCountries {
+ get => _restrictedCountries ??= new List<Country>();
+ protected set => _restrictedCountries = value;
}
+
+ /// <summary>
+ /// Gets or sets the restricted roles
+ /// </summary>
+ public virtual ICollection<string> RestrictedGroups {
+ get => _restrictedGroups ??= new List<string>();
+ protected set => _restrictedGroups = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShippingOption.cs b/src/Core/Grand.Domain/Shipping/ShippingOption.cs
index aa077b94a..d787e43b9 100644
--- a/src/Core/Grand.Domain/Shipping/ShippingOption.cs
+++ b/src/Core/Grand.Domain/Shipping/ShippingOption.cs
@@ -1,29 +1,27 @@
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a shipping option
+/// </summary>
+public class ShippingOption
{
/// <summary>
- /// Represents a shipping option
+ /// Gets or sets the system name of shipping rate provider
/// </summary>
- public class ShippingOption
- {
- /// <summary>
- /// Gets or sets the system name of shipping rate provider
- /// </summary>
- public string ShippingRateProviderSystemName { get; set; }
-
- /// <summary>
- /// Gets or sets a shipping rate (without discounts, additional shipping charges, etc)
- /// </summary>
- public double Rate { get; set; }
+ public string ShippingRateProviderSystemName { get; set; }
- /// <summary>
- /// Gets or sets a shipping option name
- /// </summary>
- public string Name { get; set; }
+ /// <summary>
+ /// Gets or sets a shipping rate (without discounts, additional shipping charges, etc)
+ /// </summary>
+ public double Rate { get; set; }
- /// <summary>
- /// Gets or sets a shipping option description
- /// </summary>
- public string Description { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a shipping option name
+ /// </summary>
+ public string Name { get; set; }
-}
+ /// <summary>
+ /// Gets or sets a shipping option description
+ /// </summary>
+ public string Description { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShippingProviderSettings.cs b/src/Core/Grand.Domain/Shipping/ShippingProviderSettings.cs
index 16831c045..7c0f887b3 100644
--- a/src/Core/Grand.Domain/Shipping/ShippingProviderSettings.cs
+++ b/src/Core/Grand.Domain/Shipping/ShippingProviderSettings.cs
@@ -1,12 +1,11 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+public class ShippingProviderSettings : ISettings
{
- public class ShippingProviderSettings : ISettings
- {
- /// <summary>
- /// Gets or sets system names of active Shipping rate methods
- /// </summary>
- public List<string> ActiveSystemNames { get; set; } = new();
- }
-}
+ /// <summary>
+ /// Gets or sets system names of active Shipping rate methods
+ /// </summary>
+ public List<string> ActiveSystemNames { get; set; } = new();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShippingSettings.cs b/src/Core/Grand.Domain/Shipping/ShippingSettings.cs
index e9922be8a..e1c115f66 100644
--- a/src/Core/Grand.Domain/Shipping/ShippingSettings.cs
+++ b/src/Core/Grand.Domain/Shipping/ShippingSettings.cs
@@ -1,58 +1,60 @@
using Grand.Domain.Common;
using Grand.Domain.Configuration;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+public class ShippingSettings : ISettings
{
- public class ShippingSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether customers can choose "Pick Up in Store" option during checkout
- /// </summary>
- public bool AllowPickUpInStore { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Free shipping over X' is enabled
- /// </summary>
- public bool FreeShippingOverXEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value of 'Free shipping over X' option
- /// </summary>
- public double FreeShippingOverXValue { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Free shipping over X' option
- /// should be evaluated over 'X' value including tax or not
- /// </summary>
- public bool FreeShippingOverXIncludingTax { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Estimate shipping' option is enabled
- /// </summary>
- public bool EstimateShippingEnabled { get; set; }
-
- /// <summary>
- /// A value indicating whether customers should see shipment events on their order details pages
- /// </summary>
- public bool DisplayShipmentEventsToCustomers { get; set; }
- /// <summary>
- /// A value indicating whether store owner should see shipment events on the shipment details pages
- /// </summary>
- public bool DisplayShipmentEventsToStoreOwner { get; set; }
-
- /// <summary>
- /// Gets or sets shipping origin address
- /// </summary>
- public Address ShippingOriginAddress { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should skip 'select shipping method' page if we have only one shipping method
- /// </summary>
- public bool SkipShippingMethodSelectionIfOnlyOne { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should calculate additional shipping charge on product multiply by the quantity
- /// </summary>
- public bool AdditionalShippingChargeByQty { get; set; }
- }
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can choose "Pick Up in Store" option during checkout
+ /// </summary>
+ public bool AllowPickUpInStore { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Free shipping over X' is enabled
+ /// </summary>
+ public bool FreeShippingOverXEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value of 'Free shipping over X' option
+ /// </summary>
+ public double FreeShippingOverXValue { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Free shipping over X' option
+ /// should be evaluated over 'X' value including tax or not
+ /// </summary>
+ public bool FreeShippingOverXIncludingTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Estimate shipping' option is enabled
+ /// </summary>
+ public bool EstimateShippingEnabled { get; set; }
+
+ /// <summary>
+ /// A value indicating whether customers should see shipment events on their order details pages
+ /// </summary>
+ public bool DisplayShipmentEventsToCustomers { get; set; }
+
+ /// <summary>
+ /// A value indicating whether store owner should see shipment events on the shipment details pages
+ /// </summary>
+ public bool DisplayShipmentEventsToStoreOwner { get; set; }
+
+ /// <summary>
+ /// Gets or sets shipping origin address
+ /// </summary>
+ public Address ShippingOriginAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should skip 'select shipping method' page if we have only one shipping
+ /// method
+ /// </summary>
+ public bool SkipShippingMethodSelectionIfOnlyOne { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should calculate additional shipping charge on product multiply by the
+ /// quantity
+ /// </summary>
+ public bool AdditionalShippingChargeByQty { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/ShippingStatus.cs b/src/Core/Grand.Domain/Shipping/ShippingStatus.cs
index 84307b910..404b13c0f 100644
--- a/src/Core/Grand.Domain/Shipping/ShippingStatus.cs
+++ b/src/Core/Grand.Domain/Shipping/ShippingStatus.cs
@@ -1,33 +1,37 @@
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents the shipping status enumeration
+/// </summary>
+public enum ShippingStatus
{
/// <summary>
- /// Represents the shipping status enumeration
+ /// Shipping not required
/// </summary>
- public enum ShippingStatus
- {
- /// <summary>
- /// Shipping not required
- /// </summary>
- ShippingNotRequired = 0,
- /// <summary>
- /// Pending - not yet shipped
- /// </summary>
- Pending = 10,
- /// <summary>
- /// Prepared to shipped
- /// </summary>
- PreparedToShipped = 15,
- /// <summary>
- /// Partially shipped
- /// </summary>
- PartiallyShipped = 25,
- /// <summary>
- /// Shipped
- /// </summary>
- Shipped = 30,
- /// <summary>
- /// Delivered
- /// </summary>
- Delivered = 40
- }
-}
+ ShippingNotRequired = 0,
+
+ /// <summary>
+ /// Pending - not yet shipped
+ /// </summary>
+ Pending = 10,
+
+ /// <summary>
+ /// Prepared to shipped
+ /// </summary>
+ PreparedToShipped = 15,
+
+ /// <summary>
+ /// Partially shipped
+ /// </summary>
+ PartiallyShipped = 25,
+
+ /// <summary>
+ /// Shipped
+ /// </summary>
+ Shipped = 30,
+
+ /// <summary>
+ /// Delivered
+ /// </summary>
+ Delivered = 40
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Shipping/Warehouse.cs b/src/Core/Grand.Domain/Shipping/Warehouse.cs
index f5c33a63e..d39645359 100644
--- a/src/Core/Grand.Domain/Shipping/Warehouse.cs
+++ b/src/Core/Grand.Domain/Shipping/Warehouse.cs
@@ -1,45 +1,44 @@
using Grand.Domain.Common;
-namespace Grand.Domain.Shipping
+namespace Grand.Domain.Shipping;
+
+/// <summary>
+/// Represents a shipment
+/// </summary>
+public class Warehouse : BaseEntity
{
/// <summary>
- /// Represents a shipment
+ /// Gets or sets the warehouse code
+ /// </summary>
+ public string Code { get; set; }
+
+ /// <summary>
+ /// Gets or sets the warehouse name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
+
+ /// <summary>
+ /// Gets or sets the latitude of the GeoCoordinate.
+ /// </summary>
+ public double? Latitude { get; set; }
+
+ /// <summary>
+ /// Gets or sets the longitude of the GeoCoordinate.
+ /// </summary>
+ public double? Longitude { get; set; }
+
+ /// <summary>
+ /// Gets or sets the address identifier of the warehouse
+ /// </summary>
+ public Address Address { get; set; } = new();
+
+ /// <summary>
+ /// Gets or sets the display order
/// </summary>
- public class Warehouse : BaseEntity
- {
- /// <summary>
- /// Gets or sets the warehouse code
- /// </summary>
- public string Code { get; set; }
- /// <summary>
- /// Gets or sets the warehouse name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
-
- /// <summary>
- /// Gets or sets the latitude of the GeoCoordinate.
- /// </summary>
- public double? Latitude { get; set; }
-
- /// <summary>
- /// Gets or sets the longitude of the GeoCoordinate.
- /// </summary>
- public double? Longitude { get; set; }
-
- /// <summary>
- /// Gets or sets the address identifier of the warehouse
- /// </summary>
- public Address Address { get; set; } = new();
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- }
+ public int DisplayOrder { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Stores/BankAccount.cs b/src/Core/Grand.Domain/Stores/BankAccount.cs
index 4a3d9085c..2dccb4c86 100644
--- a/src/Core/Grand.Domain/Stores/BankAccount.cs
+++ b/src/Core/Grand.Domain/Stores/BankAccount.cs
@@ -1,11 +1,9 @@
-namespace Grand.Domain.Stores
-{
- public class BankAccount : SubBaseEntity
- {
- public string BankCode { get; set; }
- public string BankName { get; set; }
- public string SwiftCode { get; set; }
- public string AccountNumber { get; set; }
+namespace Grand.Domain.Stores;
- }
-}
+public class BankAccount : SubBaseEntity
+{
+ public string BankCode { get; set; }
+ public string BankName { get; set; }
+ public string SwiftCode { get; set; }
+ public string AccountNumber { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Stores/DomainHost.cs b/src/Core/Grand.Domain/Stores/DomainHost.cs
index 2dca87875..2e1171f05 100644
--- a/src/Core/Grand.Domain/Stores/DomainHost.cs
+++ b/src/Core/Grand.Domain/Stores/DomainHost.cs
@@ -1,10 +1,8 @@
-namespace Grand.Domain.Stores
-{
- public class DomainHost : SubBaseEntity
- {
- public string HostName { get; set; }
- public string Url { get; set; }
- public bool Primary { get; set; }
+namespace Grand.Domain.Stores;
- }
-}
+public class DomainHost : SubBaseEntity
+{
+ public string HostName { get; set; }
+ public string Url { get; set; }
+ public bool Primary { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Stores/IStoreLinkEntity.cs b/src/Core/Grand.Domain/Stores/IStoreLinkEntity.cs
index cae3bb25b..aab72855f 100644
--- a/src/Core/Grand.Domain/Stores/IStoreLinkEntity.cs
+++ b/src/Core/Grand.Domain/Stores/IStoreLinkEntity.cs
@@ -1,14 +1,14 @@
-namespace Grand.Domain.Stores
+namespace Grand.Domain.Stores;
+
+/// <summary>
+/// Represents an entity which user store linking
+/// </summary>
+public interface IStoreLinkEntity
{
/// <summary>
- /// Represents an entity which user store linking
+ /// Gets or sets a value indicating whether the entity is limited to some stores
/// </summary>
- public interface IStoreLinkEntity
- {
- /// <summary>
- /// Gets or sets a value indicating whether the entity is limited to some stores
- /// </summary>
- bool LimitedToStores { get; set; }
- IList<string> Stores { get; set; }
- }
-}
+ bool LimitedToStores { get; set; }
+
+ IList<string> Stores { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Stores/Store.cs b/src/Core/Grand.Domain/Stores/Store.cs
index c72c4d03e..f1cb7a661 100644
--- a/src/Core/Grand.Domain/Stores/Store.cs
+++ b/src/Core/Grand.Domain/Stores/Store.cs
@@ -1,108 +1,108 @@
using Grand.Domain.Localization;
-namespace Grand.Domain.Stores
+namespace Grand.Domain.Stores;
+
+/// <summary>
+/// Represents a store
+/// </summary>
+public class Store : BaseEntity, ITranslationEntity
{
/// <summary>
- /// Represents a store
- /// </summary>
- public class Store : BaseEntity, ITranslationEntity
- {
- /// <summary>
- /// Gets or sets the store name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the store shortcut
- /// </summary>
- public string Shortcut { get; set; }
-
- /// <summary>
- /// Gets or sets the store URL
- /// </summary>
- public string Url { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether SSL is enabled
- /// </summary>
- public bool SslEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets the store secure URL (HTTPS)
- /// </summary>
- public string SecureUrl { get; set; }
-
- /// <summary>
- /// Gets or sets the list of domains
- /// </summary>
- public IList<DomainHost> Domains { get; set; } = new List<DomainHost>();
-
- /// <summary>
- /// Gets or sets the identifier of the default language for this store; "" is set when we use the default language display order
- /// </summary>
- public string DefaultLanguageId { get; set; }
-
- /// <summary>
- /// Gets or sets the identifier of the default waregouse for this store
- /// </summary>
- public string DefaultWarehouseId { get; set; }
-
- /// <summary>
- /// Gets or sets the identifier of the default country for this store
- /// </summary>
- public string DefaultCountryId { get; set; }
-
- /// <summary>
- /// Gets or sets the identifier of the default currency for this store
- /// </summary>
- public string DefaultCurrencyId { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
- /// <summary>
- /// Gets or sets the company name
- /// </summary>
- public string CompanyName { get; set; }
-
- /// <summary>
- /// Gets or sets the company registration number
- /// </summary>
- public string CompanyRegNo { get; set; }
-
- /// <summary>
- /// Gets or sets the company address
- /// </summary>
- public string CompanyAddress { get; set; }
-
- /// <summary>
- /// Gets or sets the store phone number
- /// </summary>
- public string CompanyPhoneNumber { get; set; }
-
- /// <summary>
- /// Gets or sets the company VAT (used in Europe Union countries)
- /// </summary>
- public string CompanyVat { get; set; }
-
- /// <summary>
- /// Gets or sets the company email
- /// </summary>
- public string CompanyEmail { get; set; }
-
- /// <summary>
- /// Gets or sets the company opening hours
- /// </summary>
- public string CompanyHours { get; set; }
-
-
- public BankAccount BankAccount { get; set; } = new();
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
- }
-}
+ /// Gets or sets the store name
+ /// </summary>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store shortcut
+ /// </summary>
+ public string Shortcut { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store URL
+ /// </summary>
+ public string Url { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether SSL is enabled
+ /// </summary>
+ public bool SslEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store secure URL (HTTPS)
+ /// </summary>
+ public string SecureUrl { get; set; }
+
+ /// <summary>
+ /// Gets or sets the list of domains
+ /// </summary>
+ public IList<DomainHost> Domains { get; set; } = new List<DomainHost>();
+
+ /// <summary>
+ /// Gets or sets the identifier of the default language for this store; "" is set when we use the default language
+ /// display order
+ /// </summary>
+ public string DefaultLanguageId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the identifier of the default waregouse for this store
+ /// </summary>
+ public string DefaultWarehouseId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the identifier of the default country for this store
+ /// </summary>
+ public string DefaultCountryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the identifier of the default currency for this store
+ /// </summary>
+ public string DefaultCurrencyId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company name
+ /// </summary>
+ public string CompanyName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company registration number
+ /// </summary>
+ public string CompanyRegNo { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company address
+ /// </summary>
+ public string CompanyAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store phone number
+ /// </summary>
+ public string CompanyPhoneNumber { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company VAT (used in Europe Union countries)
+ /// </summary>
+ public string CompanyVat { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company email
+ /// </summary>
+ public string CompanyEmail { get; set; }
+
+ /// <summary>
+ /// Gets or sets the company opening hours
+ /// </summary>
+ public string CompanyHours { get; set; }
+
+
+ public BankAccount BankAccount { get; set; } = new();
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; } = new List<TranslationEntity>();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Stores/StoreExtensions.cs b/src/Core/Grand.Domain/Stores/StoreExtensions.cs
index 32a8f8487..cf5f7d08d 100644
--- a/src/Core/Grand.Domain/Stores/StoreExtensions.cs
+++ b/src/Core/Grand.Domain/Stores/StoreExtensions.cs
@@ -1,34 +1,36 @@
-namespace Grand.Domain.Stores
+namespace Grand.Domain.Stores;
+
+public static class StoreExtensions
{
- public static class StoreExtensions
+ /// <summary>
+ /// Indicates whether a store contains a specified host
+ /// </summary>
+ /// <param name="store">Store</param>
+ /// <param name="host">Host</param>
+ /// <returns>true - contains, false - no</returns>
+ public static bool ContainsHostValue(this Store store, string host)
{
- /// <summary>
- /// Indicates whether a store contains a specified host
- /// </summary>
- /// <param name="store">Store</param>
- /// <param name="host">Host</param>
- /// <returns>true - contains, false - no</returns>
- public static bool ContainsHostValue(this Store store, string host)
- {
- ArgumentNullException.ThrowIfNull(store);
+ ArgumentNullException.ThrowIfNull(store);
- if (string.IsNullOrEmpty(host))
- return false;
+ if (string.IsNullOrEmpty(host))
+ return false;
- var contains = store.Domains.FirstOrDefault(x => x.HostName.Equals(host, StringComparison.OrdinalIgnoreCase)) != null;
- return contains;
- }
+ var contains = store.Domains.FirstOrDefault(x => x.HostName.Equals(host, StringComparison.OrdinalIgnoreCase)) !=
+ null;
+ return contains;
+ }
- /// <summary>
- /// Return domain host
- /// </summary>
- /// <param name="store">Store</param>
- /// <param name="host">Host</param>
- /// <returns>DomainHost</returns>
- public static DomainHost HostValue(this Store store, string host)
- {
- ArgumentNullException.ThrowIfNull(store);
- return string.IsNullOrEmpty(host) ? null : store.Domains.FirstOrDefault(x => x.HostName.Equals(host, StringComparison.OrdinalIgnoreCase));
- }
+ /// <summary>
+ /// Return domain host
+ /// </summary>
+ /// <param name="store">Store</param>
+ /// <param name="host">Host</param>
+ /// <returns>DomainHost</returns>
+ public static DomainHost HostValue(this Store store, string host)
+ {
+ ArgumentNullException.ThrowIfNull(store);
+ return string.IsNullOrEmpty(host)
+ ? null
+ : store.Domains.FirstOrDefault(x => x.HostName.Equals(host, StringComparison.OrdinalIgnoreCase));
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Stores/StoreInformationSettings.cs b/src/Core/Grand.Domain/Stores/StoreInformationSettings.cs
index c216483e7..ea582a100 100644
--- a/src/Core/Grand.Domain/Stores/StoreInformationSettings.cs
+++ b/src/Core/Grand.Domain/Stores/StoreInformationSettings.cs
@@ -1,77 +1,76 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Stores
+namespace Grand.Domain.Stores;
+
+public class StoreInformationSettings : ISettings
{
- public class StoreInformationSettings : ISettings
- {
- /// <summary>
- /// Gets or sets a value indicating whether store is closed
- /// </summary>
- public bool StoreClosed { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether store is closed
+ /// </summary>
+ public bool StoreClosed { get; set; }
- /// <summary>
- /// Gets or sets a default store theme
- /// </summary>
- public string DefaultStoreTheme { get; set; }
+ /// <summary>
+ /// Gets or sets a default store theme
+ /// </summary>
+ public string DefaultStoreTheme { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to select a theme
- /// </summary>
- public bool AllowCustomerToSelectTheme { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to select a theme
+ /// </summary>
+ public bool AllowCustomerToSelectTheme { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to select a admin theme
- /// </summary>
- public bool AllowToSelectAdminTheme { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to select a admin theme
+ /// </summary>
+ public bool AllowToSelectAdminTheme { get; set; }
- /// <summary>
- /// Gets or sets a logo
- /// </summary>
- public string LogoPictureId { get; set; }
+ /// <summary>
+ /// Gets or sets a logo
+ /// </summary>
+ public string LogoPictureId { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether we should display info about the cookie
- /// </summary>
- public bool DisplayCookieInformation { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether we should display info about the cookie
+ /// </summary>
+ public bool DisplayCookieInformation { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether we should display privacy preference
- /// </summary>
- public bool DisplayPrivacyPreference { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether we should display privacy preference
+ /// </summary>
+ public bool DisplayPrivacyPreference { get; set; }
- /// <summary>
- /// Gets or sets a value of Facebook page URL of the site
- /// </summary>
- public string FacebookLink { get; set; }
+ /// <summary>
+ /// Gets or sets a value of Facebook page URL of the site
+ /// </summary>
+ public string FacebookLink { get; set; }
- /// <summary>
- /// Gets or sets a value of Twitter page URL of the site
- /// </summary>
- public string TwitterLink { get; set; }
+ /// <summary>
+ /// Gets or sets a value of Twitter page URL of the site
+ /// </summary>
+ public string TwitterLink { get; set; }
- /// <summary>
- /// Gets or sets a value of YouTube channel URL of the site
- /// </summary>
- public string YoutubeLink { get; set; }
+ /// <summary>
+ /// Gets or sets a value of YouTube channel URL of the site
+ /// </summary>
+ public string YoutubeLink { get; set; }
- /// <summary>
- /// Gets or sets a value of Instagram page URL of the site
- /// </summary>
- public string InstagramLink { get; set; }
+ /// <summary>
+ /// Gets or sets a value of Instagram page URL of the site
+ /// </summary>
+ public string InstagramLink { get; set; }
- /// <summary>
- /// Gets or sets a value of LinkedIn page URL of the site
- /// </summary>
- public string LinkedInLink { get; set; }
+ /// <summary>
+ /// Gets or sets a value of LinkedIn page URL of the site
+ /// </summary>
+ public string LinkedInLink { get; set; }
- /// <summary>
- /// Gets or sets a value of Pinterest page URL of the site
- /// </summary>
- public string PinterestLink { get; set; }
+ /// <summary>
+ /// Gets or sets a value of Pinterest page URL of the site
+ /// </summary>
+ public string PinterestLink { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether we enable voice navigation
- /// </summary>
- public bool VoiceNavigation { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets a value indicating whether we enable voice navigation
+ /// </summary>
+ public bool VoiceNavigation { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/SubBaseEntity.cs b/src/Core/Grand.Domain/SubBaseEntity.cs
index 3f7b0f92e..b3faa20c7 100644
--- a/src/Core/Grand.Domain/SubBaseEntity.cs
+++ b/src/Core/Grand.Domain/SubBaseEntity.cs
@@ -1,8 +1,5 @@
-namespace Grand.Domain
-{
-
- public abstract class SubBaseEntity : ParentEntity
- {
+namespace Grand.Domain;
- }
-}
+public abstract class SubBaseEntity : ParentEntity
+{
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tasks/ScheduleTask.cs b/src/Core/Grand.Domain/Tasks/ScheduleTask.cs
index 0bd25d5a9..ae6ea19c5 100644
--- a/src/Core/Grand.Domain/Tasks/ScheduleTask.cs
+++ b/src/Core/Grand.Domain/Tasks/ScheduleTask.cs
@@ -1,17 +1,16 @@
-namespace Grand.Domain.Tasks
+namespace Grand.Domain.Tasks;
+
+public class ScheduleTask : BaseEntity
{
- public class ScheduleTask : BaseEntity
- {
- public string ScheduleTaskName { get; set; }
- public string Type { get; set; }
- public bool Enabled { get; set; }
- public bool StopOnError { get; set; }
- public DateTime? LastStartUtc { get; set; }
- public DateTime? LastNonSuccessEndUtc { get; set; }
- public DateTime? LastSuccessUtc { get; set; }
- public string LeasedByMachineName { get; set; }
- public DateTime? LeasedUntilUtc { get; set; }
- public int TimeInterval { get; set; }
- public string StoreId { get; set; }
- }
-}
+ public string ScheduleTaskName { get; set; }
+ public string Type { get; set; }
+ public bool Enabled { get; set; }
+ public bool StopOnError { get; set; }
+ public DateTime? LastStartUtc { get; set; }
+ public DateTime? LastNonSuccessEndUtc { get; set; }
+ public DateTime? LastSuccessUtc { get; set; }
+ public string LeasedByMachineName { get; set; }
+ public DateTime? LeasedUntilUtc { get; set; }
+ public int TimeInterval { get; set; }
+ public string StoreId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tax/TaxBasedOn.cs b/src/Core/Grand.Domain/Tax/TaxBasedOn.cs
index ea0185659..970eb1650 100644
--- a/src/Core/Grand.Domain/Tax/TaxBasedOn.cs
+++ b/src/Core/Grand.Domain/Tax/TaxBasedOn.cs
@@ -1,21 +1,22 @@
-namespace Grand.Domain.Tax
+namespace Grand.Domain.Tax;
+
+/// <summary>
+/// Represents the tax based on
+/// </summary>
+public enum TaxBasedOn
{
/// <summary>
- /// Represents the tax based on
+ /// Billing address
/// </summary>
- public enum TaxBasedOn
- {
- /// <summary>
- /// Billing address
- /// </summary>
- BillingAddress = 1,
- /// <summary>
- /// Shipping address
- /// </summary>
- ShippingAddress = 2,
- /// <summary>
- /// Default address
- /// </summary>
- DefaultAddress = 3
- }
-}
+ BillingAddress = 1,
+
+ /// <summary>
+ /// Shipping address
+ /// </summary>
+ ShippingAddress = 2,
+
+ /// <summary>
+ /// Default address
+ /// </summary>
+ DefaultAddress = 3
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tax/TaxCategory.cs b/src/Core/Grand.Domain/Tax/TaxCategory.cs
index 64e0e1f91..322cd41fc 100644
--- a/src/Core/Grand.Domain/Tax/TaxCategory.cs
+++ b/src/Core/Grand.Domain/Tax/TaxCategory.cs
@@ -1,19 +1,17 @@
-namespace Grand.Domain.Tax
+namespace Grand.Domain.Tax;
+
+/// <summary>
+/// Represents a tax category
+/// </summary>
+public class TaxCategory : BaseEntity
{
/// <summary>
- /// Represents a tax category
+ /// Gets or sets the name
/// </summary>
- public class TaxCategory : BaseEntity
- {
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
- }
+ public string Name { get; set; }
-}
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tax/TaxDisplayType.cs b/src/Core/Grand.Domain/Tax/TaxDisplayType.cs
index 9ab5e1d2a..8ff34b9bc 100644
--- a/src/Core/Grand.Domain/Tax/TaxDisplayType.cs
+++ b/src/Core/Grand.Domain/Tax/TaxDisplayType.cs
@@ -1,17 +1,17 @@
-namespace Grand.Domain.Tax
+namespace Grand.Domain.Tax;
+
+/// <summary>
+/// Represents the tax display type enumeration
+/// </summary>
+public enum TaxDisplayType
{
/// <summary>
- /// Represents the tax display type enumeration
+ /// Including tax
/// </summary>
- public enum TaxDisplayType
- {
- /// <summary>
- /// Including tax
- /// </summary>
- IncludingTax = 0,
- /// <summary>
- /// Excluding tax
- /// </summary>
- ExcludingTax = 10
- }
-}
+ IncludingTax = 0,
+
+ /// <summary>
+ /// Excluding tax
+ /// </summary>
+ ExcludingTax = 10
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tax/TaxProviderSettings.cs b/src/Core/Grand.Domain/Tax/TaxProviderSettings.cs
index 6310dc5d3..88b11b867 100644
--- a/src/Core/Grand.Domain/Tax/TaxProviderSettings.cs
+++ b/src/Core/Grand.Domain/Tax/TaxProviderSettings.cs
@@ -1,9 +1,8 @@
using Grand.Domain.Configuration;
-namespace Grand.Domain.Tax
+namespace Grand.Domain.Tax;
+
+public class TaxProviderSettings : ISettings
{
- public class TaxProviderSettings : ISettings
- {
- public string ActiveTaxProviderSystemName { get; set; }
- }
+ public string ActiveTaxProviderSystemName { get; set; }
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tax/TaxSettings.cs b/src/Core/Grand.Domain/Tax/TaxSettings.cs
index c1524bbca..f7abf8155 100644
--- a/src/Core/Grand.Domain/Tax/TaxSettings.cs
+++ b/src/Core/Grand.Domain/Tax/TaxSettings.cs
@@ -1,126 +1,126 @@
using Grand.Domain.Common;
using Grand.Domain.Configuration;
-namespace Grand.Domain.Tax
+namespace Grand.Domain.Tax;
+
+public class TaxSettings : ISettings
{
- public class TaxSettings : ISettings
- {
- /// <summary>
- /// Tax based on
- /// </summary>
- public TaxBasedOn TaxBasedOn { get; set; }
-
- /// <summary>
- /// Tax display type
- /// </summary>
- public TaxDisplayType TaxDisplayType { get; set; }
-
- /// <summary>
- /// Gets or sets default address used for tax calculation
- /// </summary>
- public Address DefaultTaxAddress { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether each tax rate should be displayed on separate line (shopping cart page)
- /// </summary>
- public bool DisplayTaxRates { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether prices incude tax
- /// </summary>
- public bool PricesIncludeTax { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers are allowed to select tax display type
- /// </summary>
- public bool AllowCustomersToSelectTaxDisplayType { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide zero tax
- /// </summary>
- public bool HideZeroTax { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to hide tax in order summary when prices are shown tax inclusive
- /// </summary>
- public bool HideTaxInOrderSummary { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should always exclude tax from order subtotal (no matter of selected tax dispay type)
- /// </summary>
- public bool ForceTaxExclusionFromOrderSubtotal { get; set; }
-
-
- /// <summary>
- /// Gets or sets a default tax category identifier for products
- /// </summary>
- public string DefaultTaxCategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether shipping price is taxable
- /// </summary>
- public bool ShippingIsTaxable { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether shipping price incudes tax
- /// </summary>
- public bool ShippingPriceIncludesTax { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the shipping tax category identifier
- /// </summary>
- public string ShippingTaxCategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether payment method additional fee is taxable
- /// </summary>
- public bool PaymentMethodAdditionalFeeIsTaxable { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether payment method additional fee incudes tax
- /// </summary>
- public bool PaymentMethodAdditionalFeeIncludesTax { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the payment method additional fee tax class identifier
- /// </summary>
- public string PaymentMethodAdditionalFeeTaxCategoryId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether EU VAT (Eupore Union Value Added Tax) is enabled
- /// </summary>
- public bool EuVatEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a shop country identifier
- /// </summary>
- public string EuVatShopCountryId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether this store will exempt eligible VAT-registered customers from VAT
- /// </summary>
- public bool EuVatAllowVatExemption { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should use the EU web service to validate VAT numbers
- /// </summary>
- public bool EuVatUseWebService { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether VAT numbers should be automatically assumed valid
- /// </summary>
- public bool EuVatAssumeValid { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether we should read country by address IP
- /// </summary>
- public bool GetCountryByIPAddress { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating for rounding calulate price
- /// </summary>
- public int CalculateRoundPrice { get; set; } = 2;
-
- public MidpointRounding MidpointRounding { get; set; } = MidpointRounding.ToEven;
- }
+ /// <summary>
+ /// Tax based on
+ /// </summary>
+ public TaxBasedOn TaxBasedOn { get; set; }
+
+ /// <summary>
+ /// Tax display type
+ /// </summary>
+ public TaxDisplayType TaxDisplayType { get; set; }
+
+ /// <summary>
+ /// Gets or sets default address used for tax calculation
+ /// </summary>
+ public Address DefaultTaxAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether each tax rate should be displayed on separate line (shopping cart page)
+ /// </summary>
+ public bool DisplayTaxRates { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether prices incude tax
+ /// </summary>
+ public bool PricesIncludeTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers are allowed to select tax display type
+ /// </summary>
+ public bool AllowCustomersToSelectTaxDisplayType { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide zero tax
+ /// </summary>
+ public bool HideZeroTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to hide tax in order summary when prices are shown tax inclusive
+ /// </summary>
+ public bool HideTaxInOrderSummary { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should always exclude tax from order subtotal (no matter of selected tax
+ /// dispay type)
+ /// </summary>
+ public bool ForceTaxExclusionFromOrderSubtotal { get; set; }
+
+
+ /// <summary>
+ /// Gets or sets a default tax category identifier for products
+ /// </summary>
+ public string DefaultTaxCategoryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether shipping price is taxable
+ /// </summary>
+ public bool ShippingIsTaxable { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether shipping price incudes tax
+ /// </summary>
+ public bool ShippingPriceIncludesTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the shipping tax category identifier
+ /// </summary>
+ public string ShippingTaxCategoryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether payment method additional fee is taxable
+ /// </summary>
+ public bool PaymentMethodAdditionalFeeIsTaxable { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether payment method additional fee incudes tax
+ /// </summary>
+ public bool PaymentMethodAdditionalFeeIncludesTax { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the payment method additional fee tax class identifier
+ /// </summary>
+ public string PaymentMethodAdditionalFeeTaxCategoryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether EU VAT (Eupore Union Value Added Tax) is enabled
+ /// </summary>
+ public bool EuVatEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a shop country identifier
+ /// </summary>
+ public string EuVatShopCountryId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this store will exempt eligible VAT-registered customers from VAT
+ /// </summary>
+ public bool EuVatAllowVatExemption { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should use the EU web service to validate VAT numbers
+ /// </summary>
+ public bool EuVatUseWebService { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether VAT numbers should be automatically assumed valid
+ /// </summary>
+ public bool EuVatAssumeValid { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether we should read country by address IP
+ /// </summary>
+ public bool GetCountryByIPAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating for rounding calulate price
+ /// </summary>
+ public int CalculateRoundPrice { get; set; } = 2;
+
+ public MidpointRounding MidpointRounding { get; set; } = MidpointRounding.ToEven;
}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Tax/VatNumberStatus.cs b/src/Core/Grand.Domain/Tax/VatNumberStatus.cs
index 22af47d05..3c66048c5 100644
--- a/src/Core/Grand.Domain/Tax/VatNumberStatus.cs
+++ b/src/Core/Grand.Domain/Tax/VatNumberStatus.cs
@@ -1,25 +1,27 @@
-namespace Grand.Domain.Tax
+namespace Grand.Domain.Tax;
+
+/// <summary>
+/// Represents the VAT number status enumeration
+/// </summary>
+public enum VatNumberStatus
{
/// <summary>
- /// Represents the VAT number status enumeration
+ /// Unknown
/// </summary>
- public enum VatNumberStatus
- {
- /// <summary>
- /// Unknown
- /// </summary>
- Unknown = 0,
- /// <summary>
- /// Empty
- /// </summary>
- Empty = 10,
- /// <summary>
- /// Valid
- /// </summary>
- Valid = 20,
- /// <summary>
- /// Invalid
- /// </summary>
- Invalid = 30
- }
-}
+ Unknown = 0,
+
+ /// <summary>
+ /// Empty
+ /// </summary>
+ Empty = 10,
+
+ /// <summary>
+ /// Valid
+ /// </summary>
+ Valid = 20,
+
+ /// <summary>
+ /// Invalid
+ /// </summary>
+ Invalid = 30
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/UniqueIdentifier.cs b/src/Core/Grand.Domain/UniqueIdentifier.cs
index f9de46eef..bc506d531 100644
--- a/src/Core/Grand.Domain/UniqueIdentifier.cs
+++ b/src/Core/Grand.Domain/UniqueIdentifier.cs
@@ -1,9 +1,8 @@
using MongoDB.Bson;
-namespace Grand.Domain
+namespace Grand.Domain;
+
+public static class UniqueIdentifier
{
- public static class UniqueIdentifier
- {
- public static string New => ObjectId.GenerateNewId().ToString();
- }
-}
+ public static string New => ObjectId.GenerateNewId().ToString();
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Vendors/Vendor.cs b/src/Core/Grand.Domain/Vendors/Vendor.cs
index 49ce5594e..43f1765fb 100644
--- a/src/Core/Grand.Domain/Vendors/Vendor.cs
+++ b/src/Core/Grand.Domain/Vendors/Vendor.cs
@@ -2,161 +2,161 @@ using Grand.Domain.Common;
using Grand.Domain.Localization;
using Grand.Domain.Seo;
-namespace Grand.Domain.Vendors
+namespace Grand.Domain.Vendors;
+
+/// <summary>
+/// Represents a vendor
+/// </summary>
+public class Vendor : BaseEntity, ITranslationEntity, ISlugEntity
{
+ private ICollection<string> _appliedDiscounts;
+ private ICollection<VendorNote> _vendorNotes;
+
+ public Vendor()
+ {
+ Locales = new List<TranslationEntity>();
+ Address = new Address();
+ }
+
/// <summary>
- /// Represents a vendor
+ /// Gets or sets the name
/// </summary>
- public class Vendor : BaseEntity, ITranslationEntity, ISlugEntity
- {
- private ICollection<VendorNote> _vendorNotes;
- private ICollection<string> _appliedDiscounts;
-
- public Vendor()
- {
- Locales = new List<TranslationEntity>();
- Address = new Address();
- }
- /// <summary>
- /// Gets or sets the name
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Gets or sets the sename
- /// </summary>
- public string SeName { get; set; }
-
- /// <summary>
- /// Gets or sets the picture identifier
- /// </summary>
- public string PictureId { get; set; }
- /// <summary>
- /// Gets or sets the email
- /// </summary>
- public string Email { get; set; }
-
- /// <summary>
- /// Gets or sets the description
- /// </summary>
- public string Description { get; set; }
-
- /// <summary>
- /// Gets or sets the store identifier
- /// </summary>
- public string StoreId { get; set; }
-
- /// <summary>
- /// Gets or sets the admin comment
- /// </summary>
- public string AdminComment { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity is active
- /// </summary>
- public bool Active { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the entity has been deleted
- /// </summary>
- public bool Deleted { get; set; }
-
- /// <summary>
- /// Gets or sets the display order
- /// </summary>
- public int DisplayOrder { get; set; }
-
-
- /// <summary>
- /// Gets or sets the meta keywords
- /// </summary>
- public string MetaKeywords { get; set; }
-
- /// <summary>
- /// Gets or sets the meta description
- /// </summary>
- public string MetaDescription { get; set; }
-
- /// <summary>
- /// Gets or sets the meta title
- /// </summary>
- public string MetaTitle { get; set; }
-
- /// <summary>
- /// Gets or sets the page size
- /// </summary>
- public int PageSize { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can select the page size
- /// </summary>
- public bool AllowCustomersToSelectPageSize { get; set; }
-
- /// <summary>
- /// Gets or sets the available customer selectable page size options
- /// </summary>
- public string PageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the vendor allows customer reviews
- /// </summary>
- public bool AllowCustomerReviews { get; set; }
-
- /// <summary>
- /// Gets or sets the rating sum (approved reviews)
- /// </summary>
- public int ApprovedRatingSum { get; set; }
-
- /// <summary>
- /// Gets or sets the rating sum (not approved reviews)
- /// </summary>
- public int NotApprovedRatingSum { get; set; }
-
- /// <summary>
- /// Gets or sets the total rating votes (approved reviews)
- /// </summary>
- public int ApprovedTotalReviews { get; set; }
-
- /// <summary>
- /// Gets or sets the total rating votes (not approved reviews)
- /// </summary>
- public int NotApprovedTotalReviews { get; set; }
-
- /// <summary>
- /// Gets or sets the commission rate
- /// </summary>
- public double? Commission { get; set; }
-
- /// <summary>
- /// Gets or sets the vendor address
- /// </summary>
- public virtual Address Address { get; set; }
-
- /// <summary>
- /// Gets or sets the coordinates
- /// </summary>
- public GeoCoordinates Coordinates { get; set; }
-
- /// <summary>
- /// Gets or sets the collection of locales
- /// </summary>
- public IList<TranslationEntity> Locales { get; set; }
- /// <summary>
- /// Gets or sets vendor notes
- /// </summary>
- public virtual ICollection<VendorNote> VendorNotes
- {
- get => _vendorNotes ??= new List<VendorNote>();
- protected set => _vendorNotes = value;
- }
- /// <summary>
- /// Gets or sets the collection of applied discounts
- /// </summary>
- public virtual ICollection<string> AppliedDiscounts
- {
- get => _appliedDiscounts ??= new List<string>();
- protected set => _appliedDiscounts = value;
- }
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the picture identifier
+ /// </summary>
+ public string PictureId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the email
+ /// </summary>
+ public string Email { get; set; }
+
+ /// <summary>
+ /// Gets or sets the description
+ /// </summary>
+ public string Description { get; set; }
+
+ /// <summary>
+ /// Gets or sets the store identifier
+ /// </summary>
+ public string StoreId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the admin comment
+ /// </summary>
+ public string AdminComment { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity is active
+ /// </summary>
+ public bool Active { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the entity has been deleted
+ /// </summary>
+ public bool Deleted { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display order
+ /// </summary>
+ public int DisplayOrder { get; set; }
+
+
+ /// <summary>
+ /// Gets or sets the meta keywords
+ /// </summary>
+ public string MetaKeywords { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta description
+ /// </summary>
+ public string MetaDescription { get; set; }
+
+ /// <summary>
+ /// Gets or sets the meta title
+ /// </summary>
+ public string MetaTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the page size
+ /// </summary>
+ public int PageSize { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can select the page size
+ /// </summary>
+ public bool AllowCustomersToSelectPageSize { get; set; }
+
+ /// <summary>
+ /// Gets or sets the available customer selectable page size options
+ /// </summary>
+ public string PageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the vendor allows customer reviews
+ /// </summary>
+ public bool AllowCustomerReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rating sum (approved reviews)
+ /// </summary>
+ public int ApprovedRatingSum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the rating sum (not approved reviews)
+ /// </summary>
+ public int NotApprovedRatingSum { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total rating votes (approved reviews)
+ /// </summary>
+ public int ApprovedTotalReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total rating votes (not approved reviews)
+ /// </summary>
+ public int NotApprovedTotalReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the commission rate
+ /// </summary>
+ public double? Commission { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vendor address
+ /// </summary>
+ public virtual Address Address { get; set; }
+
+ /// <summary>
+ /// Gets or sets the coordinates
+ /// </summary>
+ public GeoCoordinates Coordinates { get; set; }
+
+ /// <summary>
+ /// Gets or sets vendor notes
+ /// </summary>
+ public virtual ICollection<VendorNote> VendorNotes {
+ get => _vendorNotes ??= new List<VendorNote>();
+ protected set => _vendorNotes = value;
}
-}
+
+ /// <summary>
+ /// Gets or sets the collection of applied discounts
+ /// </summary>
+ public virtual ICollection<string> AppliedDiscounts {
+ get => _appliedDiscounts ??= new List<string>();
+ protected set => _appliedDiscounts = value;
+ }
+
+ /// <summary>
+ /// Gets or sets the sename
+ /// </summary>
+ public string SeName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the collection of locales
+ /// </summary>
+ public IList<TranslationEntity> Locales { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Vendors/VendorNote.cs b/src/Core/Grand.Domain/Vendors/VendorNote.cs
index 9444838fb..0cf805da2 100644
--- a/src/Core/Grand.Domain/Vendors/VendorNote.cs
+++ b/src/Core/Grand.Domain/Vendors/VendorNote.cs
@@ -1,20 +1,17 @@
-namespace Grand.Domain.Vendors
+namespace Grand.Domain.Vendors;
+
+/// <summary>
+/// Represents a vendor note
+/// </summary>
+public class VendorNote : SubBaseEntity
{
/// <summary>
- /// Represents a vendor note
+ /// Gets or sets the note
/// </summary>
- public class VendorNote : SubBaseEntity
- {
-
- /// <summary>
- /// Gets or sets the note
- /// </summary>
- public string Note { get; set; }
-
- /// <summary>
- /// Gets or sets the date and time of vendor note creation
- /// </summary>
- public DateTime CreatedOnUtc { get; set; }
+ public string Note { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the date and time of vendor note creation
+ /// </summary>
+ public DateTime CreatedOnUtc { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Vendors/VendorReview.cs b/src/Core/Grand.Domain/Vendors/VendorReview.cs
index 8af53d8c1..1b9f8fad6 100644
--- a/src/Core/Grand.Domain/Vendors/VendorReview.cs
+++ b/src/Core/Grand.Domain/Vendors/VendorReview.cs
@@ -1,59 +1,57 @@
-namespace Grand.Domain.Vendors
+namespace Grand.Domain.Vendors;
+
+/// <summary>
+/// Represents a vendor review
+/// </summary>
+public class VendorReview : BaseEntity
{
+ private ICollection<VendorReviewHelpfulness> _vendorReviewHelpfulnessEntries;
+
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the vendor identifier
+ /// </summary>
+ public string VendorId { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the content is approved
+ /// </summary>
+ public bool IsApproved { get; set; }
+
+ /// <summary>
+ /// Gets or sets the title
+ /// </summary>
+ public string Title { get; set; }
+
/// <summary>
- /// Represents a vendor review
- /// </summary>
- public class VendorReview : BaseEntity
- {
- private ICollection<VendorReviewHelpfulness> _vendorReviewHelpfulnessEntries;
-
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
-
- /// <summary>
- /// Gets or sets the vendor identifier
- /// </summary>
- public string VendorId { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether the content is approved
- /// </summary>
- public bool IsApproved { get; set; }
-
- /// <summary>
- /// Gets or sets the title
- /// </summary>
- public string Title { get; set; }
-
- /// <summary>
- /// Gets or sets the review text
- /// </summary>
- public string ReviewText { get; set; }
-
- /// <summary>
- /// Review rating
- /// </summary>
- public int Rating { get; set; }
-
- /// <summary>
- /// Review helpful votes total
- /// </summary>
- public int HelpfulYesTotal { get; set; }
-
- /// <summary>
- /// Review not helpful votes total
- /// </summary>
- public int HelpfulNoTotal { get; set; }
-
- /// <summary>
- /// Gets the entries of vendor review helpfulness
- /// </summary>
- public virtual ICollection<VendorReviewHelpfulness> VendorReviewHelpfulnessEntries
- {
- get => _vendorReviewHelpfulnessEntries ??= new List<VendorReviewHelpfulness>();
- protected set => _vendorReviewHelpfulnessEntries = value;
- }
+ /// Gets or sets the review text
+ /// </summary>
+ public string ReviewText { get; set; }
+
+ /// <summary>
+ /// Review rating
+ /// </summary>
+ public int Rating { get; set; }
+
+ /// <summary>
+ /// Review helpful votes total
+ /// </summary>
+ public int HelpfulYesTotal { get; set; }
+
+ /// <summary>
+ /// Review not helpful votes total
+ /// </summary>
+ public int HelpfulNoTotal { get; set; }
+
+ /// <summary>
+ /// Gets the entries of vendor review helpfulness
+ /// </summary>
+ public virtual ICollection<VendorReviewHelpfulness> VendorReviewHelpfulnessEntries {
+ get => _vendorReviewHelpfulnessEntries ??= new List<VendorReviewHelpfulness>();
+ protected set => _vendorReviewHelpfulnessEntries = value;
}
-}
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Vendors/VendorReviewHelpfulness.cs b/src/Core/Grand.Domain/Vendors/VendorReviewHelpfulness.cs
index 4bc687405..d3c6f1d8d 100644
--- a/src/Core/Grand.Domain/Vendors/VendorReviewHelpfulness.cs
+++ b/src/Core/Grand.Domain/Vendors/VendorReviewHelpfulness.cs
@@ -1,24 +1,22 @@
-namespace Grand.Domain.Vendors
+namespace Grand.Domain.Vendors;
+
+/// <summary>
+/// Represents a vendor review helpfulness
+/// </summary>
+public class VendorReviewHelpfulness : SubBaseEntity
{
/// <summary>
- /// Represents a vendor review helpfulness
+ /// Gets or sets the vendor review identifier
/// </summary>
- public class VendorReviewHelpfulness : SubBaseEntity
- {
- /// <summary>
- /// Gets or sets the vendor review identifier
- /// </summary>
- public string VendorReviewId { get; set; }
-
- /// <summary>
- /// A value indicating whether a review a helpful
- /// </summary>
- public bool WasHelpful { get; set; }
+ public string VendorReviewId { get; set; }
- /// <summary>
- /// Gets or sets the customer identifier
- /// </summary>
- public string CustomerId { get; set; }
+ /// <summary>
+ /// A value indicating whether a review a helpful
+ /// </summary>
+ public bool WasHelpful { get; set; }
- }
-}
+ /// <summary>
+ /// Gets or sets the customer identifier
+ /// </summary>
+ public string CustomerId { get; set; }
+}
\ No newline at end of file
diff --git a/src/Core/Grand.Domain/Vendors/VendorSettings.cs b/src/Core/Grand.Domain/Vendors/VendorSettings.cs
index 625ab359f..dbe176ddd 100644
--- a/src/Core/Grand.Domain/Vendors/VendorSettings.cs
+++ b/src/Core/Grand.Domain/Vendors/VendorSettings.cs
@@ -1,197 +1,205 @@
-using Grand.Domain.Configuration;
-using Grand.Domain.Common;
+using Grand.Domain.Common;
+using Grand.Domain.Configuration;
-namespace Grand.Domain.Vendors
+namespace Grand.Domain.Vendors;
+
+/// <summary>
+/// Vendor settings
+/// </summary>
+public class VendorSettings : ISettings
{
/// <summary>
- /// Vendor settings
- /// </summary>
- public class VendorSettings : ISettings
- {
- /// <summary>
- /// Gets or sets the default value to use for Vendor page size options (for new vendors)
- /// </summary>
- public string DefaultVendorPageSizeOptions { get; set; }
-
- /// <summary>
- /// Gets or sets the value indicating how many vendors to display in vendors block
- /// </summary>
- public int VendorsBlockItemsToDisplay { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to display vendor name on the product details page
- /// </summary>
- public bool ShowVendorOnProductDetailsPage { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether customers can contact vendors
- /// </summary>
- public bool AllowCustomersToContactVendors { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether users can fill a form to become a new vendor
- /// </summary>
- public bool AllowCustomersToApplyForVendorAccount { get; set; }
- /// <summary>
- /// Gets or sets a value that indicates whether it is possible to carry out advanced search in the store by vendor
- /// </summary>
- public bool AllowSearchByVendor { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether vendors have to accept terms of service during registration
- /// </summary>
- public bool TermsOfServiceEnabled { get; set; }
-
- /// <summary>
- /// Get or sets a value indicating whether vendor can edit information about itself (public store)
- /// </summary>
- public bool AllowVendorsToEditInfo { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether the store owner is notified that the vendor information has been changed
- /// </summary>
- public bool NotifyStoreOwnerAboutVendorInformationChange { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating vendor reviews must be approved
- /// </summary>
- public bool VendorReviewsMustBeApproved { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether to allow anonymous users write vendor reviews.
- /// </summary>
- public bool AllowAnonymousUsersToReviewVendor { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether vendor can be reviewed only by customer who have already ordered a product from this vendor
- /// </summary>
- public bool VendorReviewPossibleOnlyAfterPurchasing { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether notification of a store owner about new vendor reviews is enabled
- /// </summary>
- public bool NotifyVendorAboutNewVendorReviews { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the default rating value of the vendor reviews
- /// </summary>
- public int DefaultVendorRatingValue { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating the default allow customer review value of the vendor
- /// </summary>
- public bool DefaultAllowCustomerReview { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether vendor can be reviewed only once by customer
- /// </summary>
- public bool VendorReviewPossibleOnlyOnce { get; set; }
-
- /// <summary>
- /// Gets or sets a number of review on vendor page
- /// </summary>
- public int NumberOfReview { get; set; } = 10;
-
- #region Address settings
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Company' is enabled
- /// </summary>
- public bool CompanyEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Company' is required
- /// </summary>
- public bool CompanyRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address' is enabled
- /// </summary>
- public bool StreetAddressEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address' is required
- /// </summary>
- public bool StreetAddressRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address 2' is enabled
- /// </summary>
- public bool StreetAddress2Enabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Street address 2' is required
- /// </summary>
- public bool StreetAddress2Required { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Zip / postal code' is enabled
- /// </summary>
- public bool ZipPostalCodeEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Zip / postal code' is required
- /// </summary>
- public bool ZipPostalCodeRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'City' is enabled
- /// </summary>
- public bool CityEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'City' is required
- /// </summary>
- public bool CityRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Country' is enabled
- /// </summary>
- public bool CountryEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'State / province' is enabled
- /// </summary>
- public bool StateProvinceEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Phone number' is enabled
- /// </summary>
- public bool PhoneEnabled { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether 'Phone number' is required
- /// </summary>
- public bool PhoneRequired { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Fax number' is enabled
- /// </summary>
- public bool FaxEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Note' is enabled
- /// </summary>
- public bool NoteEnabled { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether 'Fax number' is required
- /// </summary>
- public bool FaxRequired { get; set; }
-
- public AddressSettings AddressSettings => new AddressSettings {
- CityEnabled = CityEnabled,
- CityRequired = CityRequired,
- CompanyEnabled = CompanyEnabled,
- CompanyRequired = CompanyRequired,
- CountryEnabled = CountryEnabled,
- FaxEnabled = FaxEnabled,
- NoteEnabled = NoteEnabled,
- FaxRequired = FaxRequired,
- PhoneEnabled = PhoneEnabled,
- PhoneRequired = PhoneRequired,
- StateProvinceEnabled = StateProvinceEnabled,
- StreetAddress2Enabled = StreetAddress2Enabled,
- StreetAddress2Required = StreetAddress2Required,
- StreetAddressEnabled = StreetAddressEnabled,
- StreetAddressRequired = StreetAddressRequired,
- ZipPostalCodeEnabled = ZipPostalCodeEnabled,
- ZipPostalCodeRequired = ZipPostalCodeRequired
- };
-
- #endregion
-
- }
-}
+ /// Gets or sets the default value to use for Vendor page size options (for new vendors)
+ /// </summary>
+ public string DefaultVendorPageSizeOptions { get; set; }
+
+ /// <summary>
+ /// Gets or sets the value indicating how many vendors to display in vendors block
+ /// </summary>
+ public int VendorsBlockItemsToDisplay { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to display vendor name on the product details page
+ /// </summary>
+ public bool ShowVendorOnProductDetailsPage { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether customers can contact vendors
+ /// </summary>
+ public bool AllowCustomersToContactVendors { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether users can fill a form to become a new vendor
+ /// </summary>
+ public bool AllowCustomersToApplyForVendorAccount { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value that indicates whether it is possible to carry out advanced search in the store by vendor
+ /// </summary>
+ public bool AllowSearchByVendor { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether vendors have to accept terms of service during registration
+ /// </summary>
+ public bool TermsOfServiceEnabled { get; set; }
+
+ /// <summary>
+ /// Get or sets a value indicating whether vendor can edit information about itself (public store)
+ /// </summary>
+ public bool AllowVendorsToEditInfo { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the store owner is notified that the vendor information has been changed
+ /// </summary>
+ public bool NotifyStoreOwnerAboutVendorInformationChange { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating vendor reviews must be approved
+ /// </summary>
+ public bool VendorReviewsMustBeApproved { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to allow anonymous users write vendor reviews.
+ /// </summary>
+ public bool AllowAnonymousUsersToReviewVendor { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether vendor can be reviewed only by customer who have already ordered a product
+ /// from this vendor
+ /// </summary>
+ public bool VendorReviewPossibleOnlyAfterPurchasing { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether notification of a store owner about new vendor reviews is enabled
+ /// </summary>
+ public bool NotifyVendorAboutNewVendorReviews { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the default rating value of the vendor reviews
+ /// </summary>
+ public int DefaultVendorRatingValue { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating the default allow customer review value of the vendor
+ /// </summary>
+ public bool DefaultAllowCustomerReview { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether vendor can be reviewed only once by customer
+ /// </summary>
+ public bool VendorReviewPossibleOnlyOnce { get; set; }
+
+ /// <summary>
+ /// Gets or sets a number of review on vendor page
+ /// </summary>
+ public int NumberOfReview { get; set; } = 10;
+
+ #region Address settings
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Company' is enabled
+ /// </summary>
+ public bool CompanyEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Company' is required
+ /// </summary>
+ public bool CompanyRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address' is enabled
+ /// </summary>
+ public bool StreetAddressEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address' is required
+ /// </summary>
+ public bool StreetAddressRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address 2' is enabled
+ /// </summary>
+ public bool StreetAddress2Enabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Street address 2' is required
+ /// </summary>
+ public bool StreetAddress2Required { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Zip / postal code' is enabled
+ /// </summary>
+ public bool ZipPostalCodeEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Zip / postal code' is required
+ /// </summary>
+ public bool ZipPostalCodeRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'City' is enabled
+ /// </summary>
+ public bool CityEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'City' is required
+ /// </summary>
+ public bool CityRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Country' is enabled
+ /// </summary>
+ public bool CountryEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'State / province' is enabled
+ /// </summary>
+ public bool StateProvinceEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Phone number' is enabled
+ /// </summary>
+ public bool PhoneEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Phone number' is required
+ /// </summary>
+ public bool PhoneRequired { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Fax number' is enabled
+ /// </summary>
+ public bool FaxEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Note' is enabled
+ /// </summary>
+ public bool NoteEnabled { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether 'Fax number' is required
+ /// </summary>
+ public bool FaxRequired { get; set; }
+
+ public AddressSettings AddressSettings => new() {
+ CityEnabled = CityEnabled,
+ CityRequired = CityRequired,
+ CompanyEnabled = CompanyEnabled,
+ CompanyRequired = CompanyRequired,
+ CountryEnabled = CountryEnabled,
+ FaxEnabled = FaxEnabled,
+ NoteEnabled = NoteEnabled,
+ FaxRequired = FaxRequired,
+ PhoneEnabled = PhoneEnabled,
+ PhoneRequired = PhoneRequired,
+ StateProvinceEnabled = StateProvinceEnabled,
+ StreetAddress2Enabled = StreetAddress2Enabled,
+ StreetAddress2Required = StreetAddress2Required,
+ StreetAddressEnabled = StreetAddressEnabled,
+ StreetAddressRequired = StreetAddressRequired,
+ ZipPostalCodeEnabled = ZipPostalCodeEnabled,
+ ZipPostalCodeRequired = ZipPostalCodeRequired
+ };
+
+ #endregion
+}
\ No newline at end of file