Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
configured_endpoints: 239
openapi_spec_hash: ec98ee98f7777d5d0f87bcb178e47d8d
openapi_spec_hash: a60179a6c13a28289a8f38a5c4064852
config_hash: 1ca082e374ef7000e2a5971e8da740e0
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ public class EventCategoryTest : TestBase
[InlineData(EventCategory.InboundWireDrawdownRequestCreated)]
[InlineData(EventCategory.InboundWireTransferCreated)]
[InlineData(EventCategory.InboundWireTransferUpdated)]
[InlineData(EventCategory.InterestRatePlanCreated)]
[InlineData(EventCategory.InterestRatePlanUpdated)]
[InlineData(EventCategory.IntrafiAccountEnrollmentCreated)]
[InlineData(EventCategory.IntrafiAccountEnrollmentUpdated)]
[InlineData(EventCategory.IntrafiExclusionCreated)]
Expand Down Expand Up @@ -390,6 +392,8 @@ public void InvalidEnumValidationThrows_Works()
[InlineData(EventCategory.InboundWireDrawdownRequestCreated)]
[InlineData(EventCategory.InboundWireTransferCreated)]
[InlineData(EventCategory.InboundWireTransferUpdated)]
[InlineData(EventCategory.InterestRatePlanCreated)]
[InlineData(EventCategory.InterestRatePlanUpdated)]
[InlineData(EventCategory.IntrafiAccountEnrollmentCreated)]
[InlineData(EventCategory.IntrafiAccountEnrollmentUpdated)]
[InlineData(EventCategory.IntrafiExclusionCreated)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,12 @@ public class EventSubscriptionSelectedEventCategoryEventCategoryTest : TestBase
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.InboundWireTransferUpdated
)]
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.InterestRatePlanCreated
)]
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.InterestRatePlanUpdated
)]
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.IntrafiAccountEnrollmentCreated
)]
Expand Down Expand Up @@ -872,6 +878,12 @@ public void InvalidEnumValidationThrows_Works()
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.InboundWireTransferUpdated
)]
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.InterestRatePlanCreated
)]
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.InterestRatePlanUpdated
)]
[InlineData(
EventSubscriptions::EventSubscriptionSelectedEventCategoryEventCategory.IntrafiAccountEnrollmentCreated
)]
Expand Down
4 changes: 4 additions & 0 deletions src/Increase.Api.Tests/Models/Events/EventListParamsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ public class InTest : TestBase
[InlineData(In.InboundWireDrawdownRequestCreated)]
[InlineData(In.InboundWireTransferCreated)]
[InlineData(In.InboundWireTransferUpdated)]
[InlineData(In.InterestRatePlanCreated)]
[InlineData(In.InterestRatePlanUpdated)]
[InlineData(In.IntrafiAccountEnrollmentCreated)]
[InlineData(In.IntrafiAccountEnrollmentUpdated)]
[InlineData(In.IntrafiExclusionCreated)]
Expand Down Expand Up @@ -475,6 +477,8 @@ public void InvalidEnumValidationThrows_Works()
[InlineData(In.InboundWireDrawdownRequestCreated)]
[InlineData(In.InboundWireTransferCreated)]
[InlineData(In.InboundWireTransferUpdated)]
[InlineData(In.InterestRatePlanCreated)]
[InlineData(In.InterestRatePlanUpdated)]
[InlineData(In.IntrafiAccountEnrollmentCreated)]
[InlineData(In.IntrafiAccountEnrollmentUpdated)]
[InlineData(In.IntrafiExclusionCreated)]
Expand Down
4 changes: 4 additions & 0 deletions src/Increase.Api.Tests/Models/Events/EventTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ public class EventCategoryTest : TestBase
[InlineData(Events::EventCategory.InboundWireDrawdownRequestCreated)]
[InlineData(Events::EventCategory.InboundWireTransferCreated)]
[InlineData(Events::EventCategory.InboundWireTransferUpdated)]
[InlineData(Events::EventCategory.InterestRatePlanCreated)]
[InlineData(Events::EventCategory.InterestRatePlanUpdated)]
[InlineData(Events::EventCategory.IntrafiAccountEnrollmentCreated)]
[InlineData(Events::EventCategory.IntrafiAccountEnrollmentUpdated)]
[InlineData(Events::EventCategory.IntrafiExclusionCreated)]
Expand Down Expand Up @@ -338,6 +340,8 @@ public void InvalidEnumValidationThrows_Works()
[InlineData(Events::EventCategory.InboundWireDrawdownRequestCreated)]
[InlineData(Events::EventCategory.InboundWireTransferCreated)]
[InlineData(Events::EventCategory.InboundWireTransferUpdated)]
[InlineData(Events::EventCategory.InterestRatePlanCreated)]
[InlineData(Events::EventCategory.InterestRatePlanUpdated)]
[InlineData(Events::EventCategory.IntrafiAccountEnrollmentCreated)]
[InlineData(Events::EventCategory.IntrafiAccountEnrollmentUpdated)]
[InlineData(Events::EventCategory.IntrafiExclusionCreated)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ public class UnwrapWebhookEventCategoryTest : TestBase
[InlineData(UnwrapWebhookEventCategory.InboundWireDrawdownRequestCreated)]
[InlineData(UnwrapWebhookEventCategory.InboundWireTransferCreated)]
[InlineData(UnwrapWebhookEventCategory.InboundWireTransferUpdated)]
[InlineData(UnwrapWebhookEventCategory.InterestRatePlanCreated)]
[InlineData(UnwrapWebhookEventCategory.InterestRatePlanUpdated)]
[InlineData(UnwrapWebhookEventCategory.IntrafiAccountEnrollmentCreated)]
[InlineData(UnwrapWebhookEventCategory.IntrafiAccountEnrollmentUpdated)]
[InlineData(UnwrapWebhookEventCategory.IntrafiExclusionCreated)]
Expand Down Expand Up @@ -338,6 +340,8 @@ public void InvalidEnumValidationThrows_Works()
[InlineData(UnwrapWebhookEventCategory.InboundWireDrawdownRequestCreated)]
[InlineData(UnwrapWebhookEventCategory.InboundWireTransferCreated)]
[InlineData(UnwrapWebhookEventCategory.InboundWireTransferUpdated)]
[InlineData(UnwrapWebhookEventCategory.InterestRatePlanCreated)]
[InlineData(UnwrapWebhookEventCategory.InterestRatePlanUpdated)]
[InlineData(UnwrapWebhookEventCategory.IntrafiAccountEnrollmentCreated)]
[InlineData(UnwrapWebhookEventCategory.IntrafiAccountEnrollmentUpdated)]
[InlineData(UnwrapWebhookEventCategory.IntrafiExclusionCreated)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public void FieldRoundtrip_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -36,6 +37,7 @@ public void FieldRoundtrip_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand Down Expand Up @@ -65,6 +67,7 @@ public void SerializationRoundtrip_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand Down Expand Up @@ -96,6 +99,7 @@ public void FieldRoundtripThroughSerialization_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -120,6 +124,7 @@ public void FieldRoundtripThroughSerialization_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand Down Expand Up @@ -149,6 +154,7 @@ public void Validation_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -174,6 +180,7 @@ public void CopyConstructor_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public void FieldRoundtrip_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -27,6 +28,10 @@ public void FieldRoundtrip_Works()
ApiEnum<string, RoutingNumberListResponseFednowTransfers> expectedFednowTransfers =
RoutingNumberListResponseFednowTransfers.Supported;
string expectedName = "First Bank of the United States";
ApiEnum<
string,
RealTimePaymentsRequestForPayment
> expectedRealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported;
ApiEnum<
string,
RoutingNumberListResponseRealTimePaymentsTransfers
Expand All @@ -40,6 +45,10 @@ public void FieldRoundtrip_Works()
Assert.Equal(expectedAchTransfers, model.AchTransfers);
Assert.Equal(expectedFednowTransfers, model.FednowTransfers);
Assert.Equal(expectedName, model.Name);
Assert.Equal(
expectedRealTimePaymentsRequestForPayment,
model.RealTimePaymentsRequestForPayment
);
Assert.Equal(expectedRealTimePaymentsTransfers, model.RealTimePaymentsTransfers);
Assert.Equal(expectedRoutingNumber, model.RoutingNumber);
Assert.Equal(expectedType, model.Type);
Expand All @@ -54,6 +63,7 @@ public void SerializationRoundtrip_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -78,6 +88,7 @@ public void FieldRoundtripThroughSerialization_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -97,6 +108,10 @@ public void FieldRoundtripThroughSerialization_Works()
ApiEnum<string, RoutingNumberListResponseFednowTransfers> expectedFednowTransfers =
RoutingNumberListResponseFednowTransfers.Supported;
string expectedName = "First Bank of the United States";
ApiEnum<
string,
RealTimePaymentsRequestForPayment
> expectedRealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported;
ApiEnum<
string,
RoutingNumberListResponseRealTimePaymentsTransfers
Expand All @@ -110,6 +125,10 @@ public void FieldRoundtripThroughSerialization_Works()
Assert.Equal(expectedAchTransfers, deserialized.AchTransfers);
Assert.Equal(expectedFednowTransfers, deserialized.FednowTransfers);
Assert.Equal(expectedName, deserialized.Name);
Assert.Equal(
expectedRealTimePaymentsRequestForPayment,
deserialized.RealTimePaymentsRequestForPayment
);
Assert.Equal(expectedRealTimePaymentsTransfers, deserialized.RealTimePaymentsTransfers);
Assert.Equal(expectedRoutingNumber, deserialized.RoutingNumber);
Assert.Equal(expectedType, deserialized.Type);
Expand All @@ -124,6 +143,7 @@ public void Validation_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand All @@ -142,6 +162,7 @@ public void CopyConstructor_Works()
AchTransfers = RoutingNumberListResponseAchTransfers.Supported,
FednowTransfers = RoutingNumberListResponseFednowTransfers.Supported,
Name = "First Bank of the United States",
RealTimePaymentsRequestForPayment = RealTimePaymentsRequestForPayment.Supported,
RealTimePaymentsTransfers =
RoutingNumberListResponseRealTimePaymentsTransfers.Supported,
RoutingNumber = "021000021",
Expand Down Expand Up @@ -263,6 +284,62 @@ public void InvalidEnumSerializationRoundtrip_Works()
}
}

public class RealTimePaymentsRequestForPaymentTest : TestBase
{
[Theory]
[InlineData(RealTimePaymentsRequestForPayment.Supported)]
[InlineData(RealTimePaymentsRequestForPayment.NotSupported)]
public void Validation_Works(RealTimePaymentsRequestForPayment rawValue)
{
// force implicit conversion because Theory can't do that for us
ApiEnum<string, RealTimePaymentsRequestForPayment> value = rawValue;
value.Validate();
}

[Fact]
public void InvalidEnumValidationThrows_Works()
{
var value = JsonSerializer.Deserialize<ApiEnum<string, RealTimePaymentsRequestForPayment>>(
JsonSerializer.SerializeToElement("invalid value"),
ModelBase.SerializerOptions
);

Assert.NotNull(value);
Assert.Throws<IncreaseInvalidDataException>(() => value.Validate());
}

[Theory]
[InlineData(RealTimePaymentsRequestForPayment.Supported)]
[InlineData(RealTimePaymentsRequestForPayment.NotSupported)]
public void SerializationRoundtrip_Works(RealTimePaymentsRequestForPayment rawValue)
{
// force implicit conversion because Theory can't do that for us
ApiEnum<string, RealTimePaymentsRequestForPayment> value = rawValue;

string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<
ApiEnum<string, RealTimePaymentsRequestForPayment>
>(json, ModelBase.SerializerOptions);

Assert.Equal(value, deserialized);
}

[Fact]
public void InvalidEnumSerializationRoundtrip_Works()
{
var value = JsonSerializer.Deserialize<ApiEnum<string, RealTimePaymentsRequestForPayment>>(
JsonSerializer.SerializeToElement("invalid value"),
ModelBase.SerializerOptions
);
string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<
ApiEnum<string, RealTimePaymentsRequestForPayment>
>(json, ModelBase.SerializerOptions);

Assert.Equal(value, deserialized);
}
}

public class RoutingNumberListResponseRealTimePaymentsTransfersTest : TestBase
{
[Theory]
Expand Down
1 change: 1 addition & 0 deletions src/Increase.Api/Core/ModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ protected ModelBase(ModelBase modelBase)
string,
RoutingNumbers::RoutingNumberListResponseFednowTransfers
>(),
new ApiEnumConverter<string, RoutingNumbers::RealTimePaymentsRequestForPayment>(),
new ApiEnumConverter<
string,
RoutingNumbers::RoutingNumberListResponseRealTimePaymentsTransfers
Expand Down
10 changes: 5 additions & 5 deletions src/Increase.Api/Increase.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Increase.Api.Tests"/>
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
<PackageReference Include="System.Text.Json" Version="9.0.9"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<InternalsVisibleTo Include="Increase.Api.Tests" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<PackageReference Include="System.Text.Json" Version="9.0.9" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Collections.Immutable" Version="8.0.0"/>
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
</ItemGroup>
</Project>
6 changes: 2 additions & 4 deletions src/Increase.Api/Models/CheckTransfers/CheckTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1819,14 +1819,12 @@ IReadOnlyDictionary<string, JsonElement> rawData
public enum CheckTransferPhysicalCheckShippingMethod
{
/// <summary>
/// Ship the checks via USPS First Class, which supports a maximum of 1000 pages
/// (checks and attachments combined).
/// USPS First Class
/// </summary>
UspsFirstClass,

/// <summary>
/// Ship the checks via FedEx Overnight, which supports a maximum of 50 pages
/// (checks and attachments combined).
/// FedEx Overnight
/// </summary>
FedexOvernight,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,12 @@ public ReturnAddress FromRawUnchecked(IReadOnlyDictionary<string, JsonElement> r
public enum ShippingMethod
{
/// <summary>
/// Ship the checks via USPS First Class, which supports a maximum of 1000 pages
/// (checks and attachments combined).
/// USPS First Class
/// </summary>
UspsFirstClass,

/// <summary>
/// Ship the checks via FedEx Overnight, which supports a maximum of 50 pages
/// (checks and attachments combined).
/// FedEx Overnight
/// </summary>
FedexOvernight,
}
Expand Down
Loading