Skip to content

Commit

Permalink
Fixed a bug in the BulkVS provider and added status message logging t…
Browse files Browse the repository at this point in the history
…o FirstPointCom.
  • Loading branch information
uncheckederror committed Nov 4, 2024
1 parent adb3289 commit e513ed6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions FirstCom/Models/FirstCom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,17 @@ public static async Task<PhoneNumber[]> GetPhoneNumbersByNpaNxxAsync(int npa, in
NXX = nxx.ToString("000"),
RateCenter = string.Empty
};
// Limited to 100 results at the moment. There's no way to offset the results to get the complete list of numbers, so we won't bother.
int ReturnAmount = 100;
// There's no way to offset the results to get the complete list of numbers, so we won't bother.
int ReturnAmount = 9999;

using var client = new DIDManagementSoapClient(DIDManagementSoapClient.EndpointConfiguration.DIDManagementSoap);
DIDOrderInfoArray result = await client.DIDInventorySearchAsync(Auth, DIDSearch, ReturnAmount);

// Supply a default capacity to the list to skip resizing it.
List<PhoneNumber> list = new(result.DIDOrder.Length);

Log.Information("[FirstPointCom] {@text}", result.queryresult.text);

foreach (var item in result.DIDOrder)
{
if (item.DID.StartsWith('1'))
Expand Down
2 changes: 1 addition & 1 deletion NumberSearch.DataAccess/BulkVS/OrderTn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static async ValueTask<OrderTn[]> GetRawAsync(int npa, int nxx, ReadOnlyM
string baseUrl = "https://portal.bulkvs.com/api/v1.0/";
string endpoint = "orderTn";
string npaParameter = $"?Npa={npa:000}";
string nxxParameter = PhoneNumbersNA.AreaCode.ValidNXX(nxx) ? string.Empty : $"&Nxx={nxx:000}";
string nxxParameter = PhoneNumbersNA.AreaCode.ValidNXX(nxx) ? $"&Nxx={nxx:000}" : string.Empty;
string route = $"{baseUrl}{endpoint}{npaParameter}{nxxParameter}";
try
{
Expand Down
2 changes: 1 addition & 1 deletion NumberSearch.Ingest/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static async Task<IngestStatistics> BulkVSPriorityAsync(TimeSpan cycle, I

// Ingest priority phones numbers from the BulkVs API.
Log.Information("[BulkVS] Ingesting priority data from BulkVS.");
var BulkVSStats = await Provider.BulkVSAsync(appConfig.BulkVSUsername, appConfig.BulkVSPassword, AreaCode.Priority, appConfig.Postgresql).ConfigureAwait(false);
var BulkVSStats = await Provider.BulkVSAsync(appConfig.BulkVSUsername, appConfig.BulkVSPassword, AreaCode.Priority, appConfig.Postgresql);

var combined = new IngestStatistics
{
Expand Down
2 changes: 1 addition & 1 deletion NumberSearch.Tests/Ingest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public FunctionalIngest(ITestOutputHelper output)
//public async Task TestFirstPointComIngest()
//{
// TimeSpan cycle = TimeSpan.FromMinutes(10);
// await Provider.FirstPointComCompleteAsync(cycle, ingestConfiguration);
// await Provider.FirstPointComPriorityAsync(cycle, ingestConfiguration);

// output.WriteLine("Done");
//}
Expand Down

0 comments on commit e513ed6

Please sign in to comment.