Table of Contents

Class TeamAccessRequestEntity

Namespace
Tharga.Team.MongoDB
Assembly
Tharga.Team.MongoDB.dll

A TeamAccessRequest as stored inside its team document.

public sealed record TeamAccessRequestEntity : IEquatable<TeamAccessRequestEntity>
Inheritance
TeamAccessRequestEntity
Implements
Inherited Members

Remarks

A separate type so the enums carry [BsonRepresentation(BsonType.String)]; the contract in Tharga.Team has no storage dependency to put the attribute on. Stored on the team so approving a request and setting the team's consent are one document update.

Properties

AccessLevel

[BsonRepresentation(BsonType.String)]
public required AccessLevel AccessLevel { get; init; }

Property Value

AccessLevel

DecidedAt

[BsonIgnoreIfNull]
public DateTime? DecidedAt { get; init; }

Property Value

DateTime?

DecidedBy

[BsonIgnoreIfNull]
public string DecidedBy { get; init; }

Property Value

string

Duration

[BsonIgnoreIfNull]
public TimeSpan? Duration { get; init; }

Property Value

TimeSpan?

GrantedUntil

[BsonIgnoreIfNull]
public DateTime? GrantedUntil { get; init; }

Property Value

DateTime?

Id

public required string Id { get; init; }

Property Value

string

Message

[BsonIgnoreIfNull]
public string Message { get; init; }

Property Value

string

RequestedAt

public required DateTime RequestedAt { get; init; }

Property Value

DateTime

RequesterKey

public required string RequesterKey { get; init; }

Property Value

string

RequesterName

[BsonIgnoreIfNull]
public string RequesterName { get; init; }

Property Value

string

Status

[BsonRepresentation(BsonType.String)]
public TeamAccessRequestStatus Status { get; init; }

Property Value

TeamAccessRequestStatus

Methods

FromContract(TeamAccessRequest)

public static TeamAccessRequestEntity FromContract(TeamAccessRequest request)

Parameters

request TeamAccessRequest

Returns

TeamAccessRequestEntity

ToContract()

public TeamAccessRequest ToContract()

Returns

TeamAccessRequest