New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ors-cp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ors-cp

A tool for calculating available course enrollment

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

Online Registration System

Installation

$ npm install ors-cp --save

Running Tests

If you have mocha installed globally, e.g. npm install -g mocha

$ mocha

Or

$ node node_modules/mocha/bin/mocha

Usage

First, import the module via require

const OnlineRegistration = require('ors-cp');

Instantiate the instance of the class and pass in the assumed classData object

const classData = {
  "enrollmentCapacity": 8,
  "reservations": [
    {
      "reservationCapacity": 4,
      "sequenceId": "1",
      "effectiveStartDate": "2017-12-01"
    },
    ....
  ],
  "currentEnrollment": {
    "effectiveDate": "2017-12-06",
    "reservedSeatsEnrolled": 1,
    "openSeatsEnrolled": 1
  }
}

//Instantiate instance of OnlineRegistration
//Since os is a native Node module, I use ors for the naming convention
//e.g. OnlineRegistrationSystem
const ors = new OnlineRegistration(classData);

API Docs

Most of the API usage is calling various getters. Optional parameters are available as per the method signature stated below.

showCourseEnrollment

ors.showCourseEnrollment(); Returns an Object containing keys reservedSeatsAvailable, openSeatsAvailable

getOpenSeatsAvailable

ors.getOpenSeatsAvailable(); Returns a Number containing the sum of all open seats available for students to enroll in for a course

getTotalOpenSeats

ors.getTotalOpenSeats(); Returns a Number containing the sum of all open seats assigned to a course

getReservedSeatsAvailable

ors.getReservedSeatsAvailable(); Returns a Number the sum of reserved seats available for a student to enroll (given their correct enrollment critier etc)

getEnabledReservedSeats

ors.getEnabledReservedSeats() Returns a Number containing the sum of all reserved seats enabled in a course e.g. the reserved seats who's effective start date is less than the date of the request.

getTotalReservedSeats

ors.getTotalReservedSeats(optionalReservationsArray); Returns a Number containing the sum of all reserved seats assigned to a course regardless of the date of request/effective start date for each reservation object.

FAQs

Package last updated on 03 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts