Skip to content

Commit

Permalink
Merge pull request #7 from sherweb/TenantsWebhooks
Browse files Browse the repository at this point in the history
Cumulus response updated
  • Loading branch information
asantossheweb authored Nov 15, 2024
2 parents 1616263 + 8be8847 commit c351866
Show file tree
Hide file tree
Showing 6 changed files with 308 additions and 47 deletions.
4 changes: 4 additions & 0 deletions Xtkl.NceTransferWebhooks/DTOs/CompleteTransferDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Xtkl.NceTransferWebhooks.DTOs
{
record TransferWebhookDto(string EventName, string ResourceUri, string ResourceName, string AuditUri, DateTime ResourceChangeUtcDate);
}
38 changes: 38 additions & 0 deletions Xtkl.NceTransferWebhooks/DTOs/CreateTransferDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Swashbuckle.AspNetCore.Annotations;
using System.Text.Json.Serialization;

namespace Xtkl.NceTransferWebhooks.DTOs
{
record CreateTransferDto
{
[JsonRequired]
[SwaggerSchema("The region of the tenant, restricted to 'CA', 'US', or 'EU'.")]
[System.Text.Json.Serialization.JsonConverter(typeof(JsonStringEnumConverter))]
public TenantRegion TenantRegion { get; init; }

[JsonRequired]
[SwaggerSchema("A GUID formatted customer ID that identifies the customer.")]
public Guid CustomerId { get; init; }

[JsonRequired]
[SwaggerSchema("A GUID formatted partner ID that identifies the partner initiating the transfer.")]
public Guid SourcePartnerTenantId { get; init; }

[JsonRequired]
[SwaggerSchema("The name of the partner's organization initiating the transfer.")]
public string SourcePartnerName { get; init; }

Check warning on line 23 in Xtkl.NceTransferWebhooks/DTOs/CreateTransferDto.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'SourcePartnerName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

[JsonRequired]
[SwaggerSchema("The email ID of the customer to receive notifications of the transfer creation.")]
public string CustomerEmailId { get; init; }

Check warning on line 27 in Xtkl.NceTransferWebhooks/DTOs/CreateTransferDto.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'CustomerEmailId' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

[SwaggerSchema("The name of the customer whose subscriptions are being transferred.")]
public string CustomerName { get; init; }

Check warning on line 30 in Xtkl.NceTransferWebhooks/DTOs/CreateTransferDto.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'CustomerName' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

[SwaggerSchema("A GUID formatted partner tenant ID that identifies the partner to whom the transfer is targeted.")]
public Guid TargetPartnerTenantId { get; init; }

[SwaggerSchema("The email ID of the partner to whom the transfer is targeted.")]
public string TargetPartnerEmailId { get; init; }

Check warning on line 36 in Xtkl.NceTransferWebhooks/DTOs/CreateTransferDto.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'TargetPartnerEmailId' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}
}
13 changes: 13 additions & 0 deletions Xtkl.NceTransferWebhooks/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

enum TenantRegion
{
CA, // Canada
US, // United States
EU // Europe
}

enum TransferStatus
{
Complete,
Expired
}
25 changes: 25 additions & 0 deletions Xtkl.NceTransferWebhooks/Model/Transfer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Xtkl.NceTransferWebhooks.Model
{
record Transfer(
string id,
string status,
int transferType,
string customerEmailId,
DateTime createdTime,
DateTime LastModifiedTime,
DateTime? completedTime,
DateTime? expirationTime,
string customerName,
string customerTenantId,
string partnerTenantId,
string sourcePartnerName,
string sourcePartnerTenantId,
string targetPartnerName,
string targetPartnerTenantId,
string argetPartnerEmailId,
int transferDirection,
bool ignoreEligibilityCheck,
string lastModifiedUser
);

}
Loading

0 comments on commit c351866

Please sign in to comment.