Skip to content

Commit 9e5082c

Browse files
committed
Introduce Feature Flag to control MobilePay Webhooks registration (#268)
When migrating to the new MobilePay Vipps API, the existing MobilePay Webhooks API will be disabled, thus we need a way to disable the feature until the new integration has been developed. We use Feature Flags to disable registration to the Webhooks API.
1 parent 49ecff7 commit 9e5082c

File tree

148 files changed

+877
-927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+877
-927
lines changed

coffeecard/CoffeeCard.Common/Configuration/DatabaseSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations;
2-
using NetEscapades.Configuration.Validation;
1+
using NetEscapades.Configuration.Validation;
2+
using System.ComponentModel.DataAnnotations;
33

44
namespace CoffeeCard.Common.Configuration
55
{

coffeecard/CoffeeCard.Common/Configuration/EnvironmentSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations;
2-
using NetEscapades.Configuration.Validation;
1+
using NetEscapades.Configuration.Validation;
2+
using System.ComponentModel.DataAnnotations;
33

44
namespace CoffeeCard.Common.Configuration
55
{

coffeecard/CoffeeCard.Common/Configuration/IdentitySettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations;
2-
using NetEscapades.Configuration.Validation;
1+
using NetEscapades.Configuration.Validation;
2+
using System.ComponentModel.DataAnnotations;
33

44
namespace CoffeeCard.Common.Configuration
55
{

coffeecard/CoffeeCard.Common/Configuration/LoginLimiterSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations;
21
using NetEscapades.Configuration.Validation;
2+
using System.ComponentModel.DataAnnotations;
33

44
namespace CoffeeCard.Common.Configuration
55
{

coffeecard/CoffeeCard.Common/Configuration/MailgunSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.ComponentModel.DataAnnotations;
2-
using NetEscapades.Configuration.Validation;
1+
using NetEscapades.Configuration.Validation;
2+
using System.ComponentModel.DataAnnotations;
33

44
namespace CoffeeCard.Common.Configuration
55
{

coffeecard/CoffeeCard.Common/Configuration/MobilePaySettingsV2.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using System;
1+
using NetEscapades.Configuration.Validation;
2+
using System;
23
using System.ComponentModel.DataAnnotations;
3-
using NetEscapades.Configuration.Validation;
44

55
namespace CoffeeCard.Common.Configuration
66
{

coffeecard/CoffeeCard.Common/Errors/ConflictException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
using Microsoft.AspNetCore.Http;
12
using System;
23
using System.Runtime.Serialization;
3-
using Microsoft.AspNetCore.Http;
44

55
namespace CoffeeCard.Common.Errors
66
{

coffeecard/CoffeeCard.Common/Errors/EntityNotFoundException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
using Microsoft.AspNetCore.Http;
12
using System;
23
using System.Runtime.Serialization;
3-
using Microsoft.AspNetCore.Http;
44

55
namespace CoffeeCard.Common.Errors
66
{

coffeecard/CoffeeCard.Common/Errors/IllegalUserOperationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
using Microsoft.AspNetCore.Http;
12
using System;
23
using System.Runtime.Serialization;
3-
using Microsoft.AspNetCore.Http;
44

55
namespace CoffeeCard.Common.Errors
66
{

coffeecard/CoffeeCard.Generators/Builder/BuilderGenerator.cs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using System.Text;
21
using Microsoft.CodeAnalysis;
32
using Microsoft.CodeAnalysis.CSharp.Syntax;
43
using Microsoft.CodeAnalysis.Text;
4+
using System.Text;
55

66
namespace CoffeeCard.Generators.Builder;
77

@@ -37,7 +37,7 @@ private static bool IsSyntaxTargetForGeneration(
3737
SyntaxNode syntaxNode,
3838
CancellationToken cancellationToken)
3939
{
40-
return syntaxNode is ClassDeclarationSyntax classDeclaration;
40+
return syntaxNode is ClassDeclarationSyntax;
4141
}
4242

4343
private static INamedTypeSymbol GetSemanticTargetForGeneration(GeneratorAttributeSyntaxContext context,
@@ -50,16 +50,16 @@ private string GenerateBuilderCode(INamedTypeSymbol typeSymbol, ITypeSymbol enti
5050
{
5151
var codeBuilder = new StringBuilder();
5252

53-
codeBuilder.AppendLine("// <auto-generated/>");
54-
codeBuilder.AppendLine("using System;");
55-
codeBuilder.AppendLine("using AutoBogus.Conventions;");
56-
codeBuilder.AppendLine($"using {entity.ContainingNamespace};");
57-
codeBuilder.AppendLine();
58-
codeBuilder.AppendLine($"namespace {typeSymbol.ContainingNamespace};");
59-
codeBuilder.AppendLine();
53+
_ = codeBuilder.AppendLine("// <auto-generated/>");
54+
_ = codeBuilder.AppendLine("using System;");
55+
_ = codeBuilder.AppendLine("using AutoBogus.Conventions;");
56+
_ = codeBuilder.AppendLine($"using {entity.ContainingNamespace};");
57+
_ = codeBuilder.AppendLine();
58+
_ = codeBuilder.AppendLine($"namespace {typeSymbol.ContainingNamespace};");
59+
_ = codeBuilder.AppendLine();
6060

61-
codeBuilder.AppendLine($"public partial class {typeSymbol.Name} : BaseBuilder<{entity.Name}>, IBuilder<{typeSymbol.Name}>");
62-
codeBuilder.AppendLine("{");
61+
_ = codeBuilder.AppendLine($"public partial class {typeSymbol.Name} : BaseBuilder<{entity.Name}>, IBuilder<{typeSymbol.Name}>");
62+
_ = codeBuilder.AppendLine("{");
6363

6464
// Retrieve all properties of the given entity
6565
var properties = entity.GetMembers().OfType<IPropertySymbol>().Where(p => p.Kind == SymbolKind.Property);
@@ -71,7 +71,7 @@ private string GenerateBuilderCode(INamedTypeSymbol typeSymbol, ITypeSymbol enti
7171
{
7272
if (property.Name.Contains("Id"))
7373
{
74-
configBuilder.AppendLine($" .WithSkip<{entity.Name}>(\"{property.Name}\")");
74+
_ = configBuilder.AppendLine($" .WithSkip<{entity.Name}>(\"{property.Name}\")");
7575
}
7676
AddWithPropertyValueToCodeBuilder(codeBuilder: codeBuilder,
7777
typeSymbol: typeSymbol,
@@ -87,7 +87,7 @@ private string GenerateBuilderCode(INamedTypeSymbol typeSymbol, ITypeSymbol enti
8787
AddPrivateConstructorToCodeBuilder(codeBuilder, typeSymbol, configBuilder);
8888

8989
// End class
90-
codeBuilder.AppendLine("}");
90+
_ = codeBuilder.AppendLine("}");
9191

9292
return codeBuilder.ToString();
9393
}
@@ -100,35 +100,35 @@ private string GenerateBuilderCode(INamedTypeSymbol typeSymbol, ITypeSymbol enti
100100
/// <param name="configBuilder"></param>
101101
private void AddPrivateConstructorToCodeBuilder(StringBuilder codeBuilder, ITypeSymbol typeSymbol, StringBuilder configBuilder)
102102
{
103-
codeBuilder.AppendLine(
103+
_ = codeBuilder.AppendLine(
104104
$" private {typeSymbol.Name} ()");
105-
codeBuilder.AppendLine(" {");
106-
codeBuilder.AppendLine(" Faker.Configure(builder => builder");
107-
codeBuilder.Append($"{configBuilder}");
108-
codeBuilder.AppendLine(" .WithConventions());");
109-
codeBuilder.AppendLine(" }");
105+
_ = codeBuilder.AppendLine(" {");
106+
_ = codeBuilder.AppendLine(" Faker.Configure(builder => builder");
107+
_ = codeBuilder.Append($"{configBuilder}");
108+
_ = codeBuilder.AppendLine(" .WithConventions());");
109+
_ = codeBuilder.AppendLine(" }");
110110
}
111111

112112
private void AddWithPropertyValueToCodeBuilder(StringBuilder codeBuilder, ITypeSymbol typeSymbol, IPropertySymbol property, char entityNameChar)
113113
{
114-
codeBuilder.AppendLine(
114+
_ = codeBuilder.AppendLine(
115115
$" public {typeSymbol.Name} With{property.Name}({property.Type} {property.Name}Value)");
116-
codeBuilder.AppendLine(" {");
116+
_ = codeBuilder.AppendLine(" {");
117117

118-
codeBuilder.AppendLine(
118+
_ = codeBuilder.AppendLine(
119119
$" Faker.RuleFor({entityNameChar} => {entityNameChar}.{property.Name}, {property.Name}Value);");
120-
codeBuilder.AppendLine(" return this;");
121-
codeBuilder.AppendLine(" }");
120+
_ = codeBuilder.AppendLine(" return this;");
121+
_ = codeBuilder.AppendLine(" }");
122122
}
123123
private void AddWithPropertySetterToCodeBuilder(StringBuilder codeBuilder, ITypeSymbol typeSymbol, IPropertySymbol property, char entityNameChar)
124124
{
125-
codeBuilder.AppendLine(
125+
_ = codeBuilder.AppendLine(
126126
$" public {typeSymbol.Name} With{property.Name}(Func<Bogus.Faker, {property.Type}> {property.Name}Setter)");
127-
codeBuilder.AppendLine(" {");
127+
_ = codeBuilder.AppendLine(" {");
128128

129-
codeBuilder.AppendLine(
129+
_ = codeBuilder.AppendLine(
130130
$" Faker.RuleFor({entityNameChar} => {entityNameChar}.{property.Name}, {property.Name}Setter);");
131-
codeBuilder.AppendLine(" return this;");
132-
codeBuilder.AppendLine(" }");
131+
_ = codeBuilder.AppendLine(" return this;");
132+
_ = codeBuilder.AppendLine(" }");
133133
}
134134
}

0 commit comments

Comments
 (0)