Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCST-1924: Add validation to the process of adding a review #64

Merged
merged 21 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions VirtoCommerce.CustomerReviews.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=postgre/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=virto/@EntryIndexedValue">True</s:Boolean>
</wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using VirtoCommerce.Platform.Core.Common;
using VirtoCommerce.Platform.Core.Common;

namespace VirtoCommerce.CustomerReviews.Core.Models
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.CustomerModule.Core" Version="3.817.0" />
<PackageReference Include="VirtoCommerce.NotificationsModule.Core" Version="3.809.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.830.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.832.0" />
<PackageReference Include="VirtoCommerce.Platform.Core" Version="3.853.0" />
</ItemGroup>
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace VirtoCommerce.CustomerReviews.Data.MySql.Migrations
{
/// <inheritdoc />
public partial class FixOfFieldsRequirements : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "CustomerReview",
keyColumn: "StoreId",
keyValue: null,
column: "StoreId",
value: "");

migrationBuilder.AlterColumn<string>(
name: "StoreId",
table: "CustomerReview",
type: "varchar(128)",
maxLength: 128,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");

migrationBuilder.AlterColumn<string>(
name: "EntityName",
table: "CustomerReview",
type: "varchar(1024)",
maxLength: 1024,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(1024)",
oldMaxLength: 1024)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "StoreId",
table: "CustomerReview",
type: "varchar(128)",
maxLength: 128,
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(128)",
oldMaxLength: 128)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");

migrationBuilder.UpdateData(
table: "CustomerReview",
keyColumn: "EntityName",
keyValue: null,
column: "EntityName",
value: "");

migrationBuilder.AlterColumn<string>(
name: "EntityName",
table: "CustomerReview",
type: "varchar(1024)",
maxLength: 1024,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(1024)",
oldMaxLength: 1024,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using VirtoCommerce.CustomerReviews.Data.Repositories;

Expand All @@ -16,9 +17,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 64);

MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);

modelBuilder.Entity("VirtoCommerce.CustomerReviews.Data.Models.CustomerReviewEntity", b =>
{
b.Property<string>("Id")
Expand All @@ -39,7 +42,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("varchar(128)");

b.Property<string>("EntityName")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)");

Expand All @@ -66,6 +68,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("int");

b.Property<string>("StoreId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");

Expand Down
Loading
Loading