Generator Changes at 10/13/2025 8:22:12 AM
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.113</Version>
|
||||
<Version>0.0.114</Version>
|
||||
<DebugType>None</DebugType>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
|
||||
@@ -42,6 +42,12 @@ service UserAddressContract
|
||||
|
||||
};
|
||||
};
|
||||
rpc SetAddressAsDefault(SetAddressAsDefaultRequest) returns (google.protobuf.Empty){
|
||||
option (google.api.http) = {
|
||||
post: "/SetAddressAsDefault"
|
||||
body: "*"
|
||||
};
|
||||
};
|
||||
}
|
||||
message CreateNewUserAddressRequest
|
||||
{
|
||||
@@ -113,6 +119,10 @@ message GetAllUserAddressByFilterResponseModel
|
||||
bool is_default = 6;
|
||||
int64 city_id = 7;
|
||||
}
|
||||
message SetAddressAsDefaultRequest
|
||||
{
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message PaginationState
|
||||
{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using FluentValidation;
|
||||
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress;
|
||||
namespace FrontOffice.BFF.UserAddress.Protobuf.Validator;
|
||||
|
||||
public class SetAddressAsDefaultRequestValidator : AbstractValidator<SetAddressAsDefaultRequest>
|
||||
{
|
||||
public SetAddressAsDefaultRequestValidator()
|
||||
{
|
||||
RuleFor(model => model.Id)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
var result = await ValidateAsync(ValidationContext<SetAddressAsDefaultRequest>.CreateWithOptions((SetAddressAsDefaultRequest)model, x => x.IncludeProperties(propertyName)));
|
||||
if (result.IsValid)
|
||||
return Array.Empty<string>();
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user