diff --git a/Readme.md b/Readme.md index d5319f6..cdf759c 100644 --- a/Readme.md +++ b/Readme.md @@ -10,3 +10,8 @@ dotnet --version ``` This is a side project and it's still work in progress, therefore the lack of documentation. The goal is to create a Web Application for managing Feedback. + +## Architecture + +TODO + diff --git a/Retroactiune.Core/Interfaces/IDatabaseSettings.cs b/Retroactiune.Core/Interfaces/IDatabaseSettings.cs index 152708c..d8772dd 100644 --- a/Retroactiune.Core/Interfaces/IDatabaseSettings.cs +++ b/Retroactiune.Core/Interfaces/IDatabaseSettings.cs @@ -5,9 +5,9 @@ /// public interface IDatabaseSettings { - public string FeedbackCollectionName { get; set; } + public string FeedbacksCollectionName { get; set; } public string TokensCollectionName { get; set; } - public string FeedbackReceiverCollectionName { get; set; } + public string FeedbackReceiversCollectionName { get; set; } public string ConnectionString { get; set; } public string DatabaseName { get; set; } } diff --git a/Retroactiune.Core/Services/FeedbackReceiversService.cs b/Retroactiune.Core/Services/FeedbackReceiversService.cs index 915f42e..c58fb8f 100644 --- a/Retroactiune.Core/Services/FeedbackReceiversService.cs +++ b/Retroactiune.Core/Services/FeedbackReceiversService.cs @@ -19,7 +19,7 @@ namespace Retroactiune.Core.Services public FeedbackReceiversService(IMongoClient client, IDatabaseSettings settings) { var database = client.GetDatabase(settings.DatabaseName); - _collection = database.GetCollection(settings.FeedbackReceiverCollectionName); + _collection = database.GetCollection(settings.FeedbackReceiversCollectionName); } public async Task CreateManyAsync(IEnumerable items) diff --git a/Retroactiune.Core/Services/FeedbacksService.cs b/Retroactiune.Core/Services/FeedbacksService.cs index 6020956..ab20416 100644 --- a/Retroactiune.Core/Services/FeedbacksService.cs +++ b/Retroactiune.Core/Services/FeedbacksService.cs @@ -13,12 +13,11 @@ namespace Retroactiune.Core.Services public FeedbacksService(IMongoClient client, IDatabaseSettings settings) { var database = client.GetDatabase(settings.DatabaseName); - _collection = database.GetCollection(settings.FeedbackCollectionName); + _collection = database.GetCollection(settings.FeedbacksCollectionName); } public async Task AddFeedbackAsync(Feedback feedback, FeedbackReceiver receiver) { - // TODO: Unit test. Guard.Against.Null(feedback, nameof(feedback)); Guard.Against.Null(receiver, nameof(receiver)); diff --git a/Retroactiune.Core/Services/TokensService.cs b/Retroactiune.Core/Services/TokensService.cs index 6ad22c4..fe05ea5 100644 --- a/Retroactiune.Core/Services/TokensService.cs +++ b/Retroactiune.Core/Services/TokensService.cs @@ -120,7 +120,7 @@ namespace Retroactiune.Core.Services public async Task MarkTokenAsUsedAsync(Token token) { - // TODO: Unit test. + Guard.Against.Null(token, nameof(token)); var filterBuilder = new FilterDefinitionBuilder(); var updateBuilder = new UpdateDefinitionBuilder(); await _collection.UpdateOneAsync(filterBuilder.Eq(i => i.Id, token.Id), diff --git a/Retroactiune.Infrastructure/DatabaseSettings.cs b/Retroactiune.Infrastructure/DatabaseSettings.cs index 76fcdf1..af72d10 100644 --- a/Retroactiune.Infrastructure/DatabaseSettings.cs +++ b/Retroactiune.Infrastructure/DatabaseSettings.cs @@ -8,9 +8,9 @@ namespace Retroactiune.Infrastructure /// public class DatabaseSettings : IDatabaseSettings { - public string FeedbackCollectionName { get; set; } + public string FeedbacksCollectionName { get; set; } public string TokensCollectionName { get; set; } - public string FeedbackReceiverCollectionName { get; set; } + public string FeedbackReceiversCollectionName { get; set; } public string ConnectionString { get; set; } public string DatabaseName { get; set; } } diff --git a/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiversController.cs b/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiversController.cs index 24c4052..bc2aed3 100644 --- a/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiversController.cs +++ b/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiversController.cs @@ -156,7 +156,7 @@ namespace Retroactiune.IntegrationTests.Retroactiune.WebAPI.Controllers var feedbackReceiver = new FeedbackReceiver { Id = ObjectId.GenerateNewId().ToString(), - Description = "blam", + Description = "blame", CreatedAt = DateTime.UtcNow, Name = "test" }; @@ -406,5 +406,44 @@ namespace Retroactiune.IntegrationTests.Retroactiune.WebAPI.Controllers Assert.Single(items); Assert.Equal(feedbackReceivers[1], items[0]); } + + [Fact] + public async Task Test_AddFeedback_Happy() + { + // Setup + await _mongoDb.DropAsync(); + var feedbackReceiver = new FeedbackReceiver(); + var token = new Token + { + FeedbackReceiverId = feedbackReceiver.Id + }; + await _mongoDb.FeedbackReceiverCollection.InsertOneAsync(feedbackReceiver); + await _mongoDb.TokensCollection.InsertOneAsync(token); + + // Test + var feedback = new FeedbackInDto + { + TokenId = token.Id, + Description = "ok", + Rating = 4 + }; + var content = JsonSerializer.Serialize(feedback); + var response = await _client.PostAsync($"api/v1/feedback_receivers/{feedbackReceiver.Id}/feedbacks", + new StringContent(content, Encoding.UTF8, "application/json")); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var feedbacksCursor = await _mongoDb.FeedbacksCollection.FindAsync(FilterDefinition.Empty); + var feedbacks = await feedbacksCursor.ToListAsync(); + + Assert.Equal("ok", feedbacks.ElementAt(0).Description); + Assert.Equal(4u, feedbacks.ElementAt(0).Rating); + Assert.Equal(feedbackReceiver.Id, feedbacks.ElementAt(0).FeedbackReceiverId); + + var tokensCursor = await _mongoDb.TokensCollection.FindAsync(FilterDefinition.Empty); + var tokens = await tokensCursor.ToListAsync(); + + Assert.NotNull(tokens.ElementAt(0).TimeUsed); + } } } \ No newline at end of file diff --git a/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Fixtures/MongoDbFixture.cs b/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Fixtures/MongoDbFixture.cs index e6db0bd..1e20307 100644 --- a/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Fixtures/MongoDbFixture.cs +++ b/Retroactiune.IntegrationTests/Retroactiune.WebAPI/Fixtures/MongoDbFixture.cs @@ -15,10 +15,13 @@ namespace Retroactiune.IntegrationTests.Retroactiune.WebAPI.Fixtures private IMongoDatabase Database { get; } public IMongoCollection FeedbackReceiverCollection => - Database.GetCollection(_settings.FeedbackReceiverCollectionName); + Database.GetCollection(_settings.FeedbackReceiversCollectionName); public IMongoCollection TokensCollection => Database.GetCollection(_settings.TokensCollectionName); + + public IMongoCollection FeedbacksCollection => + Database.GetCollection(_settings.FeedbacksCollectionName); public MongoDbFixture(IOptions options) { @@ -32,8 +35,8 @@ namespace Retroactiune.IntegrationTests.Retroactiune.WebAPI.Fixtures await Task.WhenAll( new List() { - Database.DropCollectionAsync(_settings.FeedbackCollectionName), - Database.DropCollectionAsync(_settings.FeedbackReceiverCollectionName), + Database.DropCollectionAsync(_settings.FeedbacksCollectionName), + Database.DropCollectionAsync(_settings.FeedbackReceiversCollectionName), Database.DropCollectionAsync(_settings.TokensCollectionName) }); } diff --git a/Retroactiune.UnitTests/Retroactiune.Core/Entities/TestToken.cs b/Retroactiune.UnitTests/Retroactiune.Core/Entities/TestToken.cs new file mode 100644 index 0000000..c1a075e --- /dev/null +++ b/Retroactiune.UnitTests/Retroactiune.Core/Entities/TestToken.cs @@ -0,0 +1,46 @@ +using System; +using AutoFixture.Xunit2; +using Retroactiune.Core.Entities; +using Xunit; + +namespace Retroactiune.Tests.Retroactiune.Core.Entities +{ + public class TestToken + { + [Theory, AutoData] + public void Test_IsValid_Null(Token token) + { + Assert.Throws(() => + { + token.IsValid(null); + }); + } + + [Theory, AutoData] + public void Test_IsValid_Expired(Token token, FeedbackReceiver feedbackReceiver) + { + token.FeedbackReceiverId = feedbackReceiver.Id; + token.ExpiryTime = new DateTime(1970, 01, 01); + token.TimeUsed = null; + Assert.False(token.IsValid(feedbackReceiver)); + } + + [Theory, AutoData] + public void Test_IsValid_Used(Token token, FeedbackReceiver feedbackReceiver) + { + token.FeedbackReceiverId = feedbackReceiver.Id; + token.ExpiryTime = DateTime.UtcNow.AddDays(10); + token.TimeUsed = DateTime.UtcNow; + Assert.False(token.IsValid(feedbackReceiver)); + } + + [Theory, AutoData] + public void Test_IsValid_Valid(Token token, FeedbackReceiver feedbackReceiver) + { + token.FeedbackReceiverId = feedbackReceiver.Id; + token.ExpiryTime = DateTime.UtcNow.AddDays(10); + token.TimeUsed = null; + Assert.True(token.IsValid(feedbackReceiver)); + } + } +} \ No newline at end of file diff --git a/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbackReceiverService.cs b/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbackReceiverService.cs index 9c855ff..905339f 100644 --- a/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbackReceiverService.cs +++ b/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbackReceiverService.cs @@ -24,7 +24,7 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services var mongoCollectionMock = new Mock>(); mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); - mongoSettingsMock.SetupGet(i => i.FeedbackReceiverCollectionName).Returns("feedback_receiver"); + mongoSettingsMock.SetupGet(i => i.FeedbackReceiversCollectionName).Returns("feedback_receiver"); mongoClientMock .Setup(stub => stub.GetDatabase(It.IsAny(), It.IsAny())) @@ -59,7 +59,7 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services var mongoCollectionMock = new Mock>(); mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); - mongoSettingsMock.SetupGet(i => i.FeedbackReceiverCollectionName).Returns("feedback_receiver"); + mongoSettingsMock.SetupGet(i => i.FeedbackReceiversCollectionName).Returns("feedback_receiver"); mongoClientMock .Setup(i => i.GetDatabase(It.IsAny(), It.IsAny())) @@ -100,7 +100,7 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services var mongoCollectionMock = new Mock>(); mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); - mongoSettingsMock.SetupGet(i => i.FeedbackReceiverCollectionName).Returns("feedback_receiver"); + mongoSettingsMock.SetupGet(i => i.FeedbackReceiversCollectionName).Returns("feedback_receiver"); mongoClientMock .Setup(i => i.GetDatabase(It.IsAny(), It.IsAny())) @@ -141,7 +141,7 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services var mongoCollectionMock = new Mock>(); mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); - mongoSettingsMock.SetupGet(i => i.FeedbackReceiverCollectionName).Returns("feedback_receiver"); + mongoSettingsMock.SetupGet(i => i.FeedbackReceiversCollectionName).Returns("feedback_receiver"); mongoClientMock .Setup(stub => stub.GetDatabase(It.IsAny(), It.IsAny())) @@ -177,7 +177,7 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services var mongoCursorMock = new Mock>(); mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); - mongoSettingsMock.SetupGet(i => i.FeedbackReceiverCollectionName).Returns("feedback_receiver"); + mongoSettingsMock.SetupGet(i => i.FeedbackReceiversCollectionName).Returns("feedback_receiver"); mongoClientMock .Setup(stub => stub.GetDatabase(It.IsAny(), It.IsAny())) diff --git a/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbacksService.cs b/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbacksService.cs new file mode 100644 index 0000000..ba69681 --- /dev/null +++ b/Retroactiune.UnitTests/Retroactiune.Core/Services/TestFeedbacksService.cs @@ -0,0 +1,85 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using AutoFixture.Xunit2; +using MongoDB.Driver; +using Moq; +using Retroactiune.Core.Entities; +using Retroactiune.Core.Interfaces; +using Retroactiune.Core.Services; +using Xunit; + +namespace Retroactiune.Tests.Retroactiune.Core.Services +{ + public class TestFeedbacksService + { + [Fact] + public async Task Test_AddFeedbackAsync_NullGuards() + { + // Setup + var mongoDatabaseMock = new Mock(); + var mongoClientMock = new Mock(); + var mongoSettingsMock = new Mock(); + var mongoCollectionMock = new Mock>(); + + mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); + mongoSettingsMock.SetupGet(i => i.FeedbacksCollectionName).Returns("feedbacks"); + + mongoClientMock + .Setup(stub => stub.GetDatabase(It.IsAny(), + It.IsAny())) + .Returns(mongoDatabaseMock.Object); + + mongoDatabaseMock + .Setup(i => i.GetCollection(It.IsAny(), + It.IsAny())) + .Returns(mongoCollectionMock.Object); + + // Test & Assert + var service = new FeedbacksService(mongoClientMock.Object, mongoSettingsMock.Object); + await Assert.ThrowsAsync(async () => + { + await service.AddFeedbackAsync(null, new FeedbackReceiver()); + }); + await Assert.ThrowsAsync(async () => + { + await service.AddFeedbackAsync(new Feedback(), null); + }); + } + + [Theory, AutoData] + public async Task Test_AddFeedbackAsync_Ok(Feedback feedback, FeedbackReceiver feedbackReceiver) + { + // Setup + var mongoDatabaseMock = new Mock(); + var mongoClientMock = new Mock(); + var mongoSettingsMock = new Mock(); + var mongoCollectionMock = new Mock>(); + + mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); + mongoSettingsMock.SetupGet(i => i.FeedbacksCollectionName).Returns("feedbacks"); + + mongoClientMock + .Setup(stub => stub.GetDatabase(It.IsAny(), + It.IsAny())) + .Returns(mongoDatabaseMock.Object); + + mongoDatabaseMock + .Setup(i => i.GetCollection(It.IsAny(), + It.IsAny())) + .Returns(mongoCollectionMock.Object); + + // Test + var service = new FeedbacksService(mongoClientMock.Object, mongoSettingsMock.Object); + await service.AddFeedbackAsync(feedback, feedbackReceiver); + + // Assert + feedback.FeedbackReceiverId = feedbackReceiver.Id; + mongoCollectionMock.Verify( + i => i.InsertOneAsync( + feedback, + It.IsAny(), + It.IsAny())); + } + } +} \ No newline at end of file diff --git a/Retroactiune.UnitTests/Retroactiune.Core/Services/TestTokensService.cs b/Retroactiune.UnitTests/Retroactiune.Core/Services/TestTokensService.cs index a69e1ea..fdc0544 100644 --- a/Retroactiune.UnitTests/Retroactiune.Core/Services/TestTokensService.cs +++ b/Retroactiune.UnitTests/Retroactiune.Core/Services/TestTokensService.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using AutoFixture.Xunit2; using MongoDB.Driver; using Moq; using Retroactiune.Core.Entities; @@ -255,6 +256,7 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services mongoCollectionMock.Setup(i => i.DeleteManyAsync(It.IsAny>(), It.IsAny())) .ThrowsAsync(new GenericServiceException("op failed")); + // Test var service = new TokensService(mongoClientMock.Object, mongoSettingsMock.Object); await Assert.ThrowsAsync(async () => @@ -269,5 +271,45 @@ namespace Retroactiune.Tests.Retroactiune.Core.Services It.IsAny>(), It.IsAny()), Times.Once); } + + + [Theory, AutoData] + public async Task Test_MarkTokenAsUsedAsync(Token token) + { + // Setup + var mongoDatabaseMock = new Mock(); + var mongoClientMock = new Mock(); + var mongoSettingsMock = new Mock(); + var mongoCollectionMock = new Mock>(); + + mongoSettingsMock.SetupGet(i => i.DatabaseName).Returns("MyDB"); + mongoSettingsMock.SetupGet(i => i.TokensCollectionName).Returns("tokens"); + + mongoClientMock + .Setup(stub => stub.GetDatabase(It.IsAny(), + It.IsAny())) + .Returns(mongoDatabaseMock.Object); + + mongoDatabaseMock + .Setup(i => i.GetCollection(It.IsAny(), + It.IsAny())) + .Returns(mongoCollectionMock.Object); + + // Test + var tokensService = new TokensService(mongoClientMock.Object, mongoSettingsMock.Object); + await tokensService.MarkTokenAsUsedAsync(token); + + // Assert + await Assert.ThrowsAsync(async () => + { + await tokensService.MarkTokenAsUsedAsync(null); + }); + mongoCollectionMock.Verify(i => + i.UpdateOneAsync( + It.IsAny>(), + It.IsAny>(), + It.IsAny(), + It.IsAny())); + } } } \ No newline at end of file diff --git a/Retroactiune.UnitTests/Retroactiune.UnitTests.csproj b/Retroactiune.UnitTests/Retroactiune.UnitTests.csproj index 59b0138..489d2be 100644 --- a/Retroactiune.UnitTests/Retroactiune.UnitTests.csproj +++ b/Retroactiune.UnitTests/Retroactiune.UnitTests.csproj @@ -24,8 +24,4 @@ - - - - diff --git a/Retroactiune.UnitTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiverController.cs b/Retroactiune.UnitTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiverController.cs index 624bac0..cfe8886 100644 --- a/Retroactiune.UnitTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiverController.cs +++ b/Retroactiune.UnitTests/Retroactiune.WebAPI/Controllers/TestFeedbackReceiverController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using AutoFixture.Xunit2; @@ -200,5 +201,123 @@ namespace Retroactiune.Tests.Retroactiune.WebAPI.Controllers Assert.IsType(result); mockService.Verify(s => s.FindAsync(filterArr, offset, limit), Times.Once); } + + // Invalid token + // happy + + [Theory, AutoData] + public async Task AddFeedback_No_FeedbackReceiver(FeedbackInDto requestBody) + { + // Arrange + var mapper = TestUtils.GetMapper(); + var feedbackReceiversService = new Mock(); + var tokensService = new Mock(); + var feedbacksService = new Mock(); + var logger = new Mock>(); + + // Test + var controller = new FeedbackReceiversController(feedbackReceiversService.Object, tokensService.Object, + feedbacksService.Object, mapper, null, + logger.Object); + var result = await controller.AddFeedback("guid-test", requestBody); + + // Assert + Assert.IsType(result); + } + + [Theory, AutoData] + public async Task AddFeedback_No_Token(FeedbackInDto requestBody) + { + // Arrange + var mapper = TestUtils.GetMapper(); + var feedbackReceiversService = new Mock(); + var tokensService = new Mock(); + var feedbacksService = new Mock(); + var logger = new Mock>(); + + feedbackReceiversService + .Setup(i => i.FindAsync(It.IsAny>(), It.IsAny(), It.IsAny())) + .ReturnsAsync(new[] {new FeedbackReceiver()}); + + // Test + var controller = new FeedbackReceiversController(feedbackReceiversService.Object, tokensService.Object, + feedbacksService.Object, mapper, null, + logger.Object); + var result = await controller.AddFeedback("guid-test", requestBody); + + // Assert + Assert.IsType(result); + } + + [Theory, AutoData] + public async Task AddFeedback_Invalid_Token(FeedbackInDto requestBody) + { + // Arrange + var mapper = TestUtils.GetMapper(); + var feedbackReceiversService = new Mock(); + var tokensService = new Mock(); + var feedbacksService = new Mock(); + var logger = new Mock>(); + + feedbackReceiversService + .Setup(i => i.FindAsync(It.IsAny>(), It.IsAny(), It.IsAny())) + .ReturnsAsync(new[] {new FeedbackReceiver()}); + + tokensService.Setup(i => i.FindAsync(It.IsAny())) + .ReturnsAsync(new[] + { + new Token + { + FeedbackReceiverId = "batman", + TimeUsed = DateTime.UtcNow + } + }); + + // Test + var controller = new FeedbackReceiversController(feedbackReceiversService.Object, tokensService.Object, + feedbacksService.Object, mapper, null, + logger.Object); + var result = await controller.AddFeedback("guid-test", requestBody); + + // Assert + Assert.IsType(result); + } + + + [Theory, AutoData] + public async Task AddFeedback_Happy(FeedbackInDto requestBody) + { + // Arrange + var mapper = TestUtils.GetMapper(); + var feedbackReceiversService = new Mock(); + var tokensService = new Mock(); + var feedbacksService = new Mock(); + var logger = new Mock>(); + + feedbackReceiversService + .Setup(i => i.FindAsync(It.IsAny>(), It.IsAny(), It.IsAny())) + .ReturnsAsync(new[] {new FeedbackReceiver + { + Id = "batman" + }}); + + tokensService.Setup(i => i.FindAsync(It.IsAny())) + .ReturnsAsync(new[] + { + new Token + { + FeedbackReceiverId = "batman", + TimeUsed = null + } + }); + + // Test + var controller = new FeedbackReceiversController(feedbackReceiversService.Object, tokensService.Object, + feedbacksService.Object, mapper, null, logger.Object); + var result = await controller.AddFeedback("guid-test", requestBody); + + // Assert + Assert.IsType(result); + } } } \ No newline at end of file diff --git a/Retroactiune.WebAPI/Controllers/FeedbackReceiversController.cs b/Retroactiune.WebAPI/Controllers/FeedbackReceiversController.cs index 0b519d3..75e22a6 100644 --- a/Retroactiune.WebAPI/Controllers/FeedbackReceiversController.cs +++ b/Retroactiune.WebAPI/Controllers/FeedbackReceiversController.cs @@ -181,7 +181,6 @@ namespace Retroactiune.Controllers [ProducesResponseType(typeof(BasicResponse), StatusCodes.Status400BadRequest)] public async Task AddFeedback(string guid, [FromBody] FeedbackInDto feedbackInDto) { - // TODO: Unit & integration test. var receivers = await _feedbackReceiversService.FindAsync(new[] {guid}, limit: 1); var tokenEnum = await _tokensService.FindAsync(new TokenListFilters { @@ -219,5 +218,7 @@ namespace Retroactiune.Controllers _feedbacksService.AddFeedbackAsync(feedback, feedbackReceivers[0])); return Ok(); } + + // TODO: Implement get for feedbacks. } } \ No newline at end of file diff --git a/Retroactiune.WebAPI/Startup.cs b/Retroactiune.WebAPI/Startup.cs index c877a75..61909c3 100644 --- a/Retroactiune.WebAPI/Startup.cs +++ b/Retroactiune.WebAPI/Startup.cs @@ -18,6 +18,10 @@ namespace Retroactiune [ExcludeFromCodeCoverage] public class Startup { + // TODO: Support for Sentry. + // TODO: Support for Prometheus. + // TODO: External auth provider. + // TODO: UI? public Startup(IConfiguration configuration) { Configuration = configuration; diff --git a/Retroactiune.WebAPI/appsettings.Testing.json b/Retroactiune.WebAPI/appsettings.Testing.json index a9d7170..7477838 100644 --- a/Retroactiune.WebAPI/appsettings.Testing.json +++ b/Retroactiune.WebAPI/appsettings.Testing.json @@ -1,8 +1,8 @@ { "DatabaseSettings": { - "FeedbackCollectionName": "feedbacks", + "FeedbacksCollectionName": "feedbacks", "TokensCollectionName": "tokens", - "FeedbackReceiverCollectionName": "feedback_receivers", + "FeedbackReceiversCollectionName": "feedback_receivers", "ConnectionString": "mongodb://localhost:27017", "DatabaseName": "RetroactiuneTesting" } diff --git a/Retroactiune.WebAPI/appsettings.json b/Retroactiune.WebAPI/appsettings.json index 7415215..f698f55 100644 --- a/Retroactiune.WebAPI/appsettings.json +++ b/Retroactiune.WebAPI/appsettings.json @@ -1,8 +1,8 @@ { "DatabaseSettings": { - "FeedbackCollectionName": "feedbacks", + "FeedbacksCollectionName": "feedbacks", "TokensCollectionName": "tokens", - "FeedbackReceiverCollectionName": "feedback_receivers", + "FeedbackReceiversCollectionName": "feedback_receivers", "ConnectionString": "mongodb://localhost:27017", "DatabaseName": "Retroactiune" },