Skip to content

marcusoshea/Polling-API

Repository files navigation

Completed Work

-Login
--Password reset

-OrderMember
--Create, Delete, Get, (All secured to Admin roles) 
--Edit (Secured to record owner changes only)

-Polling
--Create, Edit, Delete -> Name of Polling, Polling dates

-Candidate
--Create, Edit, Delete

-Polling Order
--Create Edit, Delete

-Polling-Note-Vote
--Creates notes and votes associated with a specific candidate and polling, 
which will be attributed to the contributor

-Polling-Summary
--Pulls data for each poll, and lists all candidates and thier data

-Polling-Candidates
-- Add, Remove

-Candidate-External-Notes
--Create, Edit, Delete -> this would be for data added outside of a polling for a candidate

Planned Work

Pre Reqs

    1. Have access to a Postgres database
    2. Run PollingBackup.sql on database
    3. Update src/common/env/.development.env with login info for postgres database as well as email host info 
    4. Update src/auth/constants.ts with a new secret prior to going to production.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

If you use Postman ( https://www.postman.com/downloads/ ) you can use the 
Polling.postman_collection.json file which will have the most up to date endpoints listed.

Running tests

Tests use Jest.

# Run all tests once
npm test -- --watchAll=false

# Run tests in watch mode (reruns on file changes)
npm test

# Run with coverage report
npm run test:cov

Test setup notes

  • Module path aliases (src/...) are resolved via moduleNameMapper in package.json Jest config.
  • Repository mocks require both getRepositoryToken(Entity) providers when a service depends on multiple entities (e.g. MemberService needs Member and PollingOrder repositories).
  • DTOs use class-validator@IsNumber(), @IsString(), @IsNotEmpty() decorators are tested via ValidationPipe in e2e tests.

About

API for polling application (located here: https://github.com/marcusoshea/Polling ) - NestJS & Postgres

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors