Skip to content

noscai/senior-backend-engineer-job-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Task Description for Software Engineer Applicant

Overview

You will be tasked with setting up a local instance of MedusaJS with a PostgreSQL database and developing a custom plugin named medusa-plugin-anamnesis for a digital anamnesis form system for ClinicOS. This system will enable the creation and management of anamnesis forms, sections, and questions, which will be displayed to patients on the frontend and store their responses in the backend.

Part 1: Setting Up MedusaJS Locally

  1. Install MedusaJS Backend
    • Follow the official MedusaJS documentation to install MedusaJS locally with a PostgreSQL database.
    • Documentation: MedusaJS Installation

Part 2: Develop medusa-plugin-anamnesis

  1. Create the Plugin

    • Follow the MedusaJS plugin creation guide to scaffold a new plugin named medusa-plugin-anamnesis.
    • Documentation: Creating Plugins in MedusaJS
  2. Plugin Requirements

    • The plugin should allow for the creation of digital anamnesis forms.
    • An anamnesis form will have multiple sections (anamnesis_sections), and each section will have multiple questions (anamnesis_questions).
  3. Data Models and Relationships

    • AnamnesisForm
      • id
      • title
      • description
      • created_at
      • updated_at
    • AnamnesisSection
      • id
      • form_id (foreign key to AnamnesisForm)
      • title
      • description
      • order (integer to maintain section order)
      • created_at
      • updated_at
    • AnamnesisQuestion
      • id
      • section_id (foreign key to AnamnesisSection)
      • question_text
      • question_type (enum: short_answer, long_answer, date, date_time, time, multiple_choice, select)
      • options (JSONB, used for multiple_choice and select types)
      • created_at
      • updated_at
  4. Handling Responses

    • Create a model to store patient responses with the following fields:
      • AnamnesisResponse
        • id
        • customer_id
        • order_id
        • form_id (foreign key to AnamnesisForm)
        • responses (JSONB: [{question_id, answer}, ...])
        • created_at
        • updated_at
  5. API Endpoints

    • Create both /admin and /store endpoints for managing and retrieving forms.
      • /admin Endpoints:
        • Create a new anamnesis form
        • Add sections to a form
        • Add questions to a section
        • Retrieve a form template for management
        • Delete forms, sections, and questions
      • /store Endpoints:
        • Retrieve a form template for patient use
        • Submit patient responses

Part 3: Internationalization (Extra Task)

  1. Internationalization
    • Implement internationalization support for anamnesis forms, sections, and questions.
    • Design your tables/models to include a language_code field for each text field or create separate tables to manage translations.
    • Ensure the frontend can request forms in the desired language.

Part 4: Testing Requirements

  1. Unit Tests

    • Write unit tests using Jest for all models and utility functions.
    • Ensure comprehensive test coverage for functionality and edge cases.
  2. Integration Tests

    • Write integration tests for API endpoints using Jest and Supertest.
    • Ensure that endpoints behave correctly and data is properly handled.

Submission

  • Provide a GitHub repository link with your MedusaJS project and medusa-plugin-anamnesis plugin.
  • Include a README.md with instructions on how to set up and run your project, and how to test the plugin functionality.
  • Document your design decisions, especially for the data models and internationalization approach.

Evaluation Criteria

  • Correctness: The plugin works as intended, with proper CRUD operations for forms, sections, and questions.
  • Code Quality: Clean, readable, and maintainable code.
  • Design: Efficient and scalable data model design.
  • API Endpoints: Proper implementation of both /admin and /store endpoints.
  • Extra Task: Implementation of internationalization support.
  • Unit Tests: Comprehensive and effective unit tests.
  • Integration Tests: Thorough and reliable integration tests.
  • Documentation: Clear instructions and well-documented code.

Good luck, and we look forward to reviewing your submission!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published