-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from eurofurence/feature/artistsalley
Merging Artist Alley Feature branch to master
- Loading branch information
Showing
20 changed files
with
576 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Eurofurence.App.Domain.Model.MongoDb/ArtistsAlley/TableRegistrationRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Eurofurence.App.Domain.Model.ArtistsAlley; | ||
using Eurofurence.App.Domain.Model.MongoDb.Repositories; | ||
using MongoDB.Driver; | ||
|
||
namespace Eurofurence.App.Domain.Model.MongoDb.ArtShow | ||
{ | ||
public class TableRegistrationRepository : | ||
MongoDbEntityRepositoryBase<TableRegistrationRecord> | ||
{ | ||
public TableRegistrationRepository(IMongoCollection<TableRegistrationRecord> collection) | ||
: base(collection) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/Eurofurence.App.Domain.Model/ArtistsAlley/TableRegistrationRecord.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Eurofurence.App.Domain.Model.Fragments; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Eurofurence.App.Domain.Model.ArtistsAlley | ||
{ | ||
public class TableRegistrationRecord : EntityBase | ||
{ | ||
public class StateChangeRecord | ||
{ | ||
public DateTime ChangedDateTimeUtc{ get; set; } | ||
public string ChangedByUid { get; set; } | ||
public RegistrationStateEnum OldState { get; set; } | ||
public RegistrationStateEnum NewState { get; set; } | ||
} | ||
|
||
public enum RegistrationStateEnum | ||
{ | ||
Pending = 0, | ||
Accepted = 1, | ||
Published = 2, | ||
Rejected = 3 | ||
} | ||
|
||
public string OwnerUid { get; set; } | ||
|
||
public string DisplayName { get; set; } | ||
|
||
public string WebsiteUrl { get; set; } | ||
|
||
public string ShortDescription { get; set; } | ||
|
||
public ImageFragment Image { get; set; } | ||
|
||
public RegistrationStateEnum State { get; set; } | ||
|
||
public IList<StateChangeRecord> StateChangeLog { get; set; } | ||
|
||
public TableRegistrationRecord() | ||
{ | ||
this.StateChangeLog = new List<StateChangeRecord>(); | ||
} | ||
|
||
public void ChangeState(RegistrationStateEnum newState, string uid) | ||
{ | ||
StateChangeLog.Add(new StateChangeRecord() | ||
{ | ||
ChangedByUid = uid, | ||
ChangedDateTimeUtc = DateTime.UtcNow, | ||
NewState = newState, | ||
OldState = State | ||
}); | ||
|
||
State = newState; | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/Eurofurence.App.Domain.Model/Fragments/ImageFragment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Eurofurence.App.Domain.Model.Fragments | ||
{ | ||
[DataContract] | ||
public class ImageFragment | ||
{ | ||
[Required] | ||
[DataMember] | ||
public int Width { get; set; } | ||
|
||
[Required] | ||
[DataMember] | ||
public int Height { get; set; } | ||
|
||
[Required] | ||
[DataMember] | ||
public long SizeInBytes { get; set; } | ||
|
||
[Required] | ||
[DataMember] | ||
public string MimeType { get; set; } | ||
|
||
[Required] | ||
public byte[] ImageBytes { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Eurofurence.App.Server.Services/Abstractions/ArtistsAlley/ArtistAlleyConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Eurofurence.App.Server.Services.Abstractions.ArtistsAlley | ||
{ | ||
public class ArtistAlleyConfiguration | ||
{ | ||
public string TelegramAdminGroupChatId { get; set; } | ||
public string TelegramAnnouncementChannelId { get; set; } | ||
public string TwitterConsumerKey { get; set; } | ||
public string TwitterConsumerSecret { get; set; } | ||
public string TwitterAccessToken { get; set; } | ||
public string TwitterAccessTokenSecret { get; set; } | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Eurofurence.App.Server.Services/Abstractions/ArtistsAlley/ITableRegistrationService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Eurofurence.App.Domain.Model.ArtistsAlley; | ||
|
||
namespace Eurofurence.App.Server.Services.Abstractions.ArtistsAlley | ||
{ | ||
public interface ITableRegistrationService | ||
{ | ||
Task RegisterTableAsync(string uid, TableRegistrationRequest request); | ||
Task<IEnumerable<TableRegistrationRecord>> GetRegistrations(TableRegistrationRecord.RegistrationStateEnum? state); | ||
|
||
Task ApproveByIdAsync(Guid id, string operatorUid); | ||
Task RejectByIdAsync(Guid id, string operatorUid); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Eurofurence.App.Server.Services/Abstractions/ArtistsAlley/TableRegistrationRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Eurofurence.App.Server.Services.Abstractions.ArtistsAlley | ||
{ | ||
public class TableRegistrationRequest | ||
{ | ||
public string DisplayName { get; set; } | ||
|
||
public string WebsiteUrl { get; set; } | ||
|
||
public string ShortDescription { get; set; } | ||
|
||
public string ImageContent { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.