Feature : Create Problem Schema Model
Closed this issue · 4 comments
fallen-ecstasy commented
Create Problem Model
Description:
Implement a Mongoose model for the "Problem" entity. This model will be used to store and retrieve coding problems within the NovaCode platform.
Define Mongoose Model:
- Create a Mongoose model for the "Problem" entity.
- Use the provided schema as a reference for field types and structure.
Problem{
_id: number,
title: string,
level: string,
companies: [string],
topics: [string],
statement : string,
examples: [{
input:string,
output: string,
explanation : string,
}],
sampleTest: [{
input: string,
output: string,
}],
testCases:[{
input: string,
output: string,
}]
noOfHiddenTests: number,
}
-
_id
shoudld notObjectId
type, but it should be Autogenerated Sequentialnumber
. -
levels
will have 3 values onlyEasy
,Medium
andHard
.
Testing:
- Create unit tests using Mocha+Chai to ensure the correctness of the model.
- Include tests for data validation and uniqueness constraints.
Additional Notes:
- Ensure proper error handling in case of database failures or validation errors.
- Follow the established coding style and standards of the project.
- Consider adding indexes for fields that will be frequently queried.
Reference:
Deadpool2e commented
Hey, I am interested in working on the issue and would appreciate the opportunity to be assigned to it.
Yaswanthtoga commented
Hi @fallen-ecstasy i'm interested to work on this issue, could you please assign it to me?
fallen-ecstasy commented
@Deadpool2e @Yaswanthtoga I assigned you both for the issue, I'll be merging the first and most accurate PR
It is Quick Win ⚡
rahul9852-dot commented
@fallen-ecstasy I've already created a PR. If possible can you look into that.