Fix for Namespace SurveyResponses
This commit is contained in:
parent
d2ae8a30a6
commit
6ae57c9818
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Test
|
namespace DamageAssesment.Api.Responses.Test
|
||||||
{
|
{
|
||||||
public class MockData
|
public class MockData
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Controllers;
|
using DamageAssesment.Api.Responses.Controllers;
|
||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using DamageAssesment.Api.SurveyResponses.Test;
|
using DamageAssesment.Api.Responses.Test;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Moq;
|
using Moq;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
@ -17,7 +17,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
mockSurveyResponseService = new Mock<ISurveysResponse>();
|
mockSurveyResponseService = new Mock<ISurveysResponse>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses - Ok case")]
|
[Fact(DisplayName = "Get Responses - Ok case")]
|
||||||
public async Task GetSurveyResponsesAsync_ShouldReturnStatusCode200()
|
public async Task GetSurveyResponsesAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -28,7 +28,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses - BadRequest case")]
|
[Fact(DisplayName = "Get Responses - BadRequest case")]
|
||||||
public async Task GetSurveyResponsesAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -38,7 +38,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(400, result.StatusCode);
|
Assert.Equal(400, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by surveyId - Ok case")]
|
[Fact(DisplayName = "Get Responses by surveyId - Ok case")]
|
||||||
public async Task GetSurveyResponsesBySurveyAsync_ShouldReturnStatusCode200()
|
public async Task GetSurveyResponsesBySurveyAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -49,7 +49,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by surveyId - NoContent case")]
|
[Fact(DisplayName = "Get Responses by surveyId - NoContent case")]
|
||||||
public async Task GetSurveyResponsesBySurveyAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesBySurveyAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -62,7 +62,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by surveyId and locationId - Ok case")]
|
[Fact(DisplayName = "Get Responses by surveyId and locationId - Ok case")]
|
||||||
public async Task GetSurveyResponsesBySurveyLocationAsync_ShouldReturnStatusCode200()
|
public async Task GetSurveyResponsesBySurveyLocationAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -73,7 +73,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by surveyId and locationId - NoContent case")]
|
[Fact(DisplayName = "Get Responses by surveyId and locationId - NoContent case")]
|
||||||
public async Task GetSurveyResponsesBySurveyLocationAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesBySurveyLocationAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -83,7 +83,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(204, result.StatusCode);
|
Assert.Equal(204, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by surveyId and QuestionId and Answer - Ok case")]
|
[Fact(DisplayName = "Get Responses by surveyId and QuestionId and Answer - Ok case")]
|
||||||
public async Task GetSurveyResponsesBySurveyQuestionAnswerAsync_ShouldReturnStatusCode200()
|
public async Task GetSurveyResponsesBySurveyQuestionAnswerAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -94,7 +94,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by surveyId and QuestionId and Answer - NoContent case")]
|
[Fact(DisplayName = "Get Responses by surveyId and QuestionId and Answer - NoContent case")]
|
||||||
public async Task GetSurveyResponsesBySurveyQuestionAnswerAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesBySurveyQuestionAnswerAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -105,7 +105,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by region and surveyId - Ok case")]
|
[Fact(DisplayName = "Get Responses by region and surveyId - Ok case")]
|
||||||
public async Task GetSurveyResponsesByRegionSurveyAsync_ShouldReturnStatusCode200()
|
public async Task GetSurveyResponsesByRegionSurveyAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -116,7 +116,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by region and surveyId - NoContent Case")]
|
[Fact(DisplayName = "Get Responses by region and surveyId - NoContent Case")]
|
||||||
public async Task GetSurveyResponsesByRegionSurveyAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesByRegionSurveyAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -126,7 +126,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(204, result.StatusCode);
|
Assert.Equal(204, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by maintenanceCenter and surveyId - Ok case")]
|
[Fact(DisplayName = "Get Responses by maintenanceCenter and surveyId - Ok case")]
|
||||||
public async Task GetSurveyResponsesMaintenanceCenterSurveyAsync_ShouldReturnStatusCode200()
|
public async Task GetSurveyResponsesMaintenanceCenterSurveyAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -137,7 +137,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by maintenanceCenter and surveyId - No Content Case")]
|
[Fact(DisplayName = "Get Responses by maintenanceCenter and surveyId - No Content Case")]
|
||||||
public async Task GetSurveyResponsesMaintenanceCenterSurveyAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesMaintenanceCenterSurveyAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -158,7 +158,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Get SurveyResponses by maintenanceCenter and surveyId - NoContent Case")]
|
[Fact(DisplayName = "Get Responses by maintenanceCenter and surveyId - NoContent Case")]
|
||||||
public async Task GetSurveyResponsesByResponseIdyAsync_ShouldReturnStatusCode204()
|
public async Task GetSurveyResponsesByResponseIdyAsync_ShouldReturnStatusCode204()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
@ -169,7 +169,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Fact(DisplayName = "Post SurveyResponses - Ok case")]
|
[Fact(DisplayName = "Post Responses - Ok case")]
|
||||||
public async Task PostSurveyAsync_ShouldReturnStatusCode200()
|
public async Task PostSurveyAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -180,7 +180,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Post SurveyResponses - BadRequest case")]
|
[Fact(DisplayName = "Post Responses - BadRequest case")]
|
||||||
public async Task PostSurveyAsync_ShouldReturnStatusCode400()
|
public async Task PostSurveyAsync_ShouldReturnStatusCode400()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -191,7 +191,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(400, result.StatusCode);
|
Assert.Equal(400, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Put SurveyResponses - Ok case")]
|
[Fact(DisplayName = "Put Responses - Ok case")]
|
||||||
public async Task PutSurveyAsync_ShouldReturnStatusCode200()
|
public async Task PutSurveyAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -202,7 +202,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Put SurveyResponses - BadRequest case")]
|
[Fact(DisplayName = "Put Responses - BadRequest case")]
|
||||||
public async Task PutSurveyAsync_ShouldReturnStatusCode404()
|
public async Task PutSurveyAsync_ShouldReturnStatusCode404()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -213,7 +213,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(400, result.StatusCode);
|
Assert.Equal(400, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Delete SurveyResponses - Ok case")]
|
[Fact(DisplayName = "Delete Responses - Ok case")]
|
||||||
public async Task DeleteSurveyAsync_ShouldReturnStatusCode200()
|
public async Task DeleteSurveyAsync_ShouldReturnStatusCode200()
|
||||||
{
|
{
|
||||||
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
SurveyResponse mockRequestObject = await MockData.getSurveyResponseObject();
|
||||||
@ -224,7 +224,7 @@ namespace DamageAssesment.SurveyResponses.Test
|
|||||||
Assert.Equal(200, result.StatusCode);
|
Assert.Equal(200, result.StatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(DisplayName = "Delete SurveyResponses - NotFound case")]
|
[Fact(DisplayName = "Delete Responses - NotFound case")]
|
||||||
public async Task DeleteSurveyAsync_ShouldReturnStatusCode404()
|
public async Task DeleteSurveyAsync_ShouldReturnStatusCode404()
|
||||||
{
|
{
|
||||||
var mockResponse = await MockData.getResponse();
|
var mockResponse = await MockData.getResponse();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Controllers
|
namespace DamageAssesment.Api.Responses.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class SurveyResponsesController : ControllerBase
|
public class SurveyResponsesController : ControllerBase
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Db
|
namespace DamageAssesment.Api.Responses.Db
|
||||||
{
|
{
|
||||||
public class SurveyResponse
|
public class SurveyResponse
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Db
|
namespace DamageAssesment.Api.Responses.Db
|
||||||
{
|
{
|
||||||
public class SurveyResponseDbContext:DbContext
|
public class SurveyResponseDbContext:DbContext
|
||||||
{
|
{
|
||||||
|
@ -6,10 +6,10 @@ EXPOSE 80
|
|||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.Responses.csproj", "DamageAssesment.Api.SurveyResponses/"]
|
COPY ["DamageAssesment.Api.Responses/DamageAssesment.Api.Responses.csproj", "DamageAssesment.Api.Responses/"]
|
||||||
RUN dotnet restore "DamageAssesment.Api.SurveyResponses/DamageAssesment.Api.Responses.csproj"
|
RUN dotnet restore "DamageAssesment.Api.Responses/DamageAssesment.Api.Responses.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/DamageAssesment.Api.SurveyResponses"
|
WORKDIR "/src/DamageAssesment.Api.Responses"
|
||||||
RUN dotnet build "DamageAssesment.Api.Responses.csproj" -c Release -o /app/build
|
RUN dotnet build "DamageAssesment.Api.Responses.csproj" -c Release -o /app/build
|
||||||
|
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface IAnswerServiceProvider
|
public interface IAnswerServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface IAttachmentServiceProvider
|
public interface IAttachmentServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface IEmployeeServiceProvider
|
public interface IEmployeeServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface IHttpUtil
|
public interface IHttpUtil
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface ILocationServiceProvider
|
public interface ILocationServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface IQuestionServiceProvider
|
public interface IQuestionServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface IRegionServiceProvider
|
public interface IRegionServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface ISurveyServiceProvider
|
public interface ISurveyServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Interfaces
|
namespace DamageAssesment.Api.Responses.Interfaces
|
||||||
{
|
{
|
||||||
public interface ISurveysResponse
|
public interface ISurveysResponse
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Answer
|
public class Answer
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class AnswerRequest
|
public class AnswerRequest
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Attachment
|
public class Attachment
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class AttachmentInfo
|
public class AttachmentInfo
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Employee
|
public class Employee
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Location
|
public class Location
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Question
|
public class Question
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Region
|
public class Region
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Request
|
public class Request
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class Survey
|
public class Survey
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class SurveyQuestions
|
public class SurveyQuestions
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class SurveyResponse
|
public class SurveyResponse
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Models
|
namespace DamageAssesment.Api.Responses.Models
|
||||||
{
|
{
|
||||||
public class SurveyTranslation
|
public class SurveyTranslation
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace DamageAssesment.Api.SurveyResponses.Profiles
|
namespace DamageAssesment.Api.Responses.Profiles
|
||||||
{
|
{
|
||||||
public class SurveyResponsesProvider : AutoMapper.Profile
|
public class SurveyResponsesProvider : AutoMapper.Profile
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Db;
|
using DamageAssesment.Api.Responses.Db;
|
||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Services;
|
using DamageAssesment.Api.Responses.Services;
|
||||||
using DamageAssesment.Api.SurveyResponses.Providers;
|
using DamageAssesment.Api.Responses.Providers;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Polly;
|
using Polly;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@ -44,7 +44,7 @@ builder.Services.AddSwaggerGen(c =>
|
|||||||
});
|
});
|
||||||
builder.Services.AddDbContext<SurveyResponseDbContext>(option =>
|
builder.Services.AddDbContext<SurveyResponseDbContext>(option =>
|
||||||
{
|
{
|
||||||
option.UseInMemoryDatabase("SurveyResponses");
|
option.UseInMemoryDatabase("Responses");
|
||||||
});
|
});
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using DamageAssesment.Api.SurveyResponses.Db;
|
using DamageAssesment.Api.Responses.Db;
|
||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Providers
|
namespace DamageAssesment.Api.Responses.Providers
|
||||||
{
|
{
|
||||||
public class SurveyResponsesProvider : ISurveysResponse
|
public class SurveyResponsesProvider : ISurveysResponse
|
||||||
{
|
{
|
||||||
@ -40,10 +40,10 @@ namespace DamageAssesment.Api.SurveyResponses.Providers
|
|||||||
{
|
{
|
||||||
surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { SurveyId = 1, EmployeeId = 1, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { SurveyId = 1, EmployeeId = 1, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||||
surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { SurveyId = 1, EmployeeId = 2, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { SurveyId = 1, EmployeeId = 2, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 3, SurveyId = 3, EmployeeId = 4, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 3, SurveyId = 3, EmployeeId = 4, LocationId = 1, ClientDevice = "Mobile", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 4, SurveyId = 4, EmployeeId = 1, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 4, SurveyId = 4, EmployeeId = 1, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
||||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 6, SurveyId = 1, EmployeeId = 4, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 6, SurveyId = 1, EmployeeId = 4, LocationId = 2, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "true", CreatedDate = DateTime.Now });
|
||||||
//surveyResponseDbContext.SurveyResponses.Add(new Db.SurveyResponse { Id = 7, SurveyId = 1, EmployeeId = 4, LocationId = 3, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
//surveyResponseDbContext.Responses.Add(new Db.SurveyResponse { Id = 7, SurveyId = 1, EmployeeId = 4, LocationId = 3, ClientDevice = "Desktop", Latitude = 98.8767, Longitute = -129.9897, KeyAnswerResult = "false", CreatedDate = DateTime.Now });
|
||||||
surveyResponseDbContext.SaveChanges();
|
surveyResponseDbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -851,7 +851,7 @@ namespace DamageAssesment.Api.SurveyResponses.Providers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//var surveyResponses = await surveyResponseDbContext.SurveyResponses.Where(x => x.SurveyId == survey.Id).ToListAsync();
|
//var surveyResponses = await surveyResponseDbContext.Responses.Where(x => x.SurveyId == survey.Id).ToListAsync();
|
||||||
// var employees = await employeeServiceProvider.getEmployeesAsync();
|
// var employees = await employeeServiceProvider.getEmployeesAsync();
|
||||||
var answers = await answerServiceProvider.getAnswersAsync();
|
var answers = await answerServiceProvider.getAnswersAsync();
|
||||||
var attachments = await attachmentServiceProvider.getAttachmentsAsync();
|
var attachments = await attachmentServiceProvider.getAttachmentsAsync();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class AnswerServiceProvider : ServiceProviderBase, IAnswerServiceProvider
|
public class AnswerServiceProvider : ServiceProviderBase, IAnswerServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class AttachmentServiceProvider : ServiceProviderBase, IAttachmentServiceProvider
|
public class AttachmentServiceProvider : ServiceProviderBase, IAttachmentServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Microsoft.AspNetCore.Mvc.Routing;
|
using Microsoft.AspNetCore.Mvc.Routing;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class EmployeeServiceProvider : ServiceProviderBase, IEmployeeServiceProvider
|
public class EmployeeServiceProvider : ServiceProviderBase, IEmployeeServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class HttpUtil : IHttpUtil
|
public class HttpUtil : IHttpUtil
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class LocationServiceProvider :ServiceProviderBase, ILocationServiceProvider
|
public class LocationServiceProvider :ServiceProviderBase, ILocationServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class QuestionServiceProvider : ServiceProviderBase, IQuestionServiceProvider
|
public class QuestionServiceProvider : ServiceProviderBase, IQuestionServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class RegionServiceProvider : ServiceProviderBase, IRegionServiceProvider
|
public class RegionServiceProvider : ServiceProviderBase, IRegionServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class ServiceProviderBase
|
public class ServiceProviderBase
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using DamageAssesment.Api.SurveyResponses.Interfaces;
|
using DamageAssesment.Api.Responses.Interfaces;
|
||||||
using DamageAssesment.Api.SurveyResponses.Models;
|
using DamageAssesment.Api.Responses.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace DamageAssesment.Api.SurveyResponses.Services
|
namespace DamageAssesment.Api.Responses.Services
|
||||||
{
|
{
|
||||||
public class SurveyServiceProvider : ServiceProviderBase, ISurveyServiceProvider
|
public class SurveyServiceProvider : ServiceProviderBase, ISurveyServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@ services:
|
|||||||
- "6005:80"
|
- "6005:80"
|
||||||
|
|
||||||
|
|
||||||
damageassesment.api.surveyresponses:
|
damageassesment.api.responses:
|
||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Development
|
- ASPNETCORE_ENVIRONMENT=Development
|
||||||
- services__Answers=http://damageassesment.api.answers:80
|
- services__Answers=http://damageassesment.api.answers:80
|
||||||
@ -62,3 +62,5 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "6009:80"
|
- "6009:80"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,11 +35,11 @@ services:
|
|||||||
dockerfile: DamageAssesment.Api.Questions/Dockerfile
|
dockerfile: DamageAssesment.Api.Questions/Dockerfile
|
||||||
|
|
||||||
|
|
||||||
damageassesment.api.surveyresponses:
|
# damageassesment.api.surveyresponses:
|
||||||
image: ${DOCKER_REGISTRY-}damageassesmentapisurveyresponses
|
# image: ${DOCKER_REGISTRY-}damageassesmentapisurveyresponses
|
||||||
build:
|
# build:
|
||||||
context: .
|
# context: .
|
||||||
dockerfile: DamageAssesment.Api.SurveyResponses/Dockerfile
|
# dockerfile: DamageAssesment.Api.SurveyResponses/Dockerfile
|
||||||
|
|
||||||
|
|
||||||
damageassesment.api.surveys:
|
damageassesment.api.surveys:
|
||||||
@ -55,3 +55,10 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: DamageAssesment.Api.DocuLinks/Dockerfile
|
dockerfile: DamageAssesment.Api.DocuLinks/Dockerfile
|
||||||
|
|
||||||
|
|
||||||
|
damageassesment.api.responses:
|
||||||
|
image: ${DOCKER_REGISTRY-}damageassesmentapiresponses
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: DamageAssesment.Api.Responses/Dockerfile
|
||||||
|
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
"damageassesment.api.questions": "StartDebugging",
|
"damageassesment.api.questions": "StartDebugging",
|
||||||
"damageassesment.api.surveyresponses": "StartDebugging",
|
"damageassesment.api.surveyresponses": "StartDebugging",
|
||||||
"damageassesment.api.surveys": "StartDebugging",
|
"damageassesment.api.surveys": "StartDebugging",
|
||||||
"damageassesment.api.doculinks": "StartDebugging"
|
"damageassesment.api.doculinks": "StartDebugging",
|
||||||
|
"damageassesment.api.responses": "StartDebugging"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user