-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes as per sonarcloud recommendation.
- Loading branch information
1 parent
7e20238
commit 89abea4
Showing
9 changed files
with
110 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Allergy : MongoEntity | ||
namespace CookingApp.Models | ||
{ | ||
[BsonElement("name")] | ||
public string Name { get; set; } | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Allergy : MongoEntity | ||
{ | ||
[BsonElement("name")] | ||
public string Name { get; set; } | ||
|
||
[BsonElement("severity")] | ||
public AllergySeverity Severity { get; set; } | ||
[BsonElement("severity")] | ||
public AllergySeverity Severity { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
public enum AllergySeverity | ||
namespace CookingApp.Models | ||
{ | ||
Mild, | ||
Moderate, | ||
Severe | ||
public enum AllergySeverity | ||
{ | ||
Mild, | ||
Moderate, | ||
Severe | ||
} | ||
} |
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 |
---|---|---|
@@ -1,23 +1,26 @@ | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Chat : MongoEntity | ||
namespace CookingApp.Models | ||
{ | ||
[BsonElement("ApiGeneratedId")] | ||
public string ApiGeneratedId { get; set; } | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Chat : MongoEntity | ||
{ | ||
[BsonElement("ApiGeneratedId")] | ||
public string ApiGeneratedId { get; set; } | ||
|
||
[BsonElement("title")] | ||
public string Title { get; set; } | ||
[BsonElement("title")] | ||
public string Title { get; set; } | ||
|
||
[BsonElement("userId")] | ||
public string UserId { get; set; } | ||
[BsonElement("userId")] | ||
public string UserId { get; set; } | ||
|
||
[BsonElement("createdTime")] | ||
public DateTime CreatedTime { get; set; } | ||
[BsonElement("createdTime")] | ||
public DateTime CreatedTime { get; set; } | ||
|
||
[BsonElement("requests")] | ||
public List<Request> Requests { get; set; } = new List<Request>(); | ||
[BsonElement("requests")] | ||
public List<Request> Requests { get; set; } = new List<Request>(); | ||
|
||
[BsonElement("responses")] | ||
public List<Response> Responses { get; set; } = new List<Response>(); | ||
[BsonElement("responses")] | ||
public List<Response> Responses { get; set; } = new List<Response>(); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
public enum DietaryPreference | ||
namespace CookingApp.Models | ||
{ | ||
None, | ||
Vegan, | ||
Vegetarian | ||
public enum DietaryPreference | ||
{ | ||
None, | ||
Vegan, | ||
Vegetarian | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Food : MongoEntity | ||
namespace CookingApp.Models | ||
{ | ||
[BsonElement("name")] | ||
public string Name { get; set; } | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Food : MongoEntity | ||
{ | ||
[BsonElement("name")] | ||
public string Name { get; set; } | ||
|
||
[BsonElement("type")] | ||
public FoodType Type { get; set; } | ||
[BsonElement("type")] | ||
public FoodType Type { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
public enum FoodType | ||
namespace CookingApp.Models | ||
{ | ||
Vegetable, | ||
Fruit, | ||
Grain, | ||
Protein, | ||
Dairy, | ||
Other | ||
public enum FoodType | ||
{ | ||
Vegetable, | ||
Fruit, | ||
Grain, | ||
Protein, | ||
Dairy, | ||
Other | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Request : MongoEntity | ||
namespace CookingApp.Models | ||
{ | ||
[BsonElement("message")] | ||
public string Message { get; set; } | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Request : MongoEntity | ||
{ | ||
[BsonElement("message")] | ||
public string Message { get; set; } | ||
|
||
[BsonElement("timestamp")] | ||
public DateTime Timestamp { get; set; } | ||
} | ||
[BsonElement("timestamp")] | ||
public DateTime Timestamp { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Response : MongoEntity | ||
namespace CookingApp.Models | ||
{ | ||
[BsonElement("message")] | ||
public string Message { get; set; } | ||
using CookingApp.Infrastructure.Common; | ||
using MongoDB.Bson.Serialization.Attributes; | ||
|
||
public class Response : MongoEntity | ||
{ | ||
[BsonElement("message")] | ||
public string Message { get; set; } | ||
|
||
[BsonElement("timestamp")] | ||
public DateTime Timestamp { get; set; } | ||
[BsonElement("timestamp")] | ||
public DateTime Timestamp { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
using MongoDB.Bson.Serialization.Attributes; | ||
using MongoDB.Bson; | ||
using System; | ||
using CookingApp.Infrastructure.Common; | ||
|
||
public class User : MongoEntity | ||
namespace CookingApp.Models | ||
{ | ||
[BsonId] | ||
[BsonRepresentation(BsonType.ObjectId)] | ||
public string Id { get; set; } | ||
using MongoDB.Bson.Serialization.Attributes; | ||
using MongoDB.Bson; | ||
using System; | ||
using CookingApp.Infrastructure.Common; | ||
|
||
public class User : MongoEntity | ||
{ | ||
[BsonId] | ||
[BsonRepresentation(BsonType.ObjectId)] | ||
public string Id { get; set; } | ||
|
||
[BsonElement("name")] | ||
public string Name { get; set; } | ||
[BsonElement("name")] | ||
public string Name { get; set; } | ||
|
||
[BsonElement("dietaryPreference")] | ||
public DietaryPreference DietaryPreference { get; set; } | ||
[BsonElement("dietaryPreference")] | ||
public DietaryPreference DietaryPreference { get; set; } | ||
|
||
[BsonElement("allergies")] | ||
public List<Allergy> Allergies { get; set; } = new List<Allergy>(); | ||
[BsonElement("allergies")] | ||
public List<Allergy> Allergies { get; set; } = new List<Allergy>(); | ||
|
||
[BsonElement("avoidedFoods")] | ||
public List<Food> AvoidedFoods { get; set; } = new List<Food>(); | ||
[BsonElement("avoidedFoods")] | ||
public List<Food> AvoidedFoods { get; set; } = new List<Food>(); | ||
|
||
[BsonElement("chats")] | ||
public List<Chat> Chats { get; set; } = new List<Chat>(); | ||
[BsonElement("chats")] | ||
public List<Chat> Chats { get; set; } = new List<Chat>(); | ||
} | ||
} |