fallen-ecstasy/NovaCode-Server

Feature : Create Problem Schema Model

Closed this issue · 4 comments

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 not ObjectId type, but it should be Autogenerated Sequential number.

  • levels will have 3 values only Easy, Medium and Hard.


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:

Hey, I am interested in working on the issue and would appreciate the opportunity to be assigned to it.

Hi @fallen-ecstasy i'm interested to work on this issue, could you please assign it to me?

@Deadpool2e @Yaswanthtoga I assigned you both for the issue, I'll be merging the first and most accurate PR

It is Quick Win ⚡

@fallen-ecstasy I've already created a PR. If possible can you look into that.