GitXplorerGitXplorer
a

vpo-help

public
1 stars
1 forks
0 issues

Commits

List of commits on branch main.
Unverified
4b7cbbb6e2190b9dee961b46f5d60f64b57d1cc0

feat: show relatives fields based on env

aalexeychikk committed 2 years ago
Unverified
56bd93dffa2a3a885ab15ed7e6d38a8dba9b2855

feat: admin can mark registration period as the last one

aalexeychikk committed 2 years ago
Unverified
e5c9670503340972da977aebd7f314edef092921

fix: show correct message when vpo schedules 2nd time after receiving help

aalexeychikk committed 2 years ago
Verified
cd5323c7c954c40cc14e7ccfa66ec1484df7b94c

feat: return to slot selection step if slot is not available (#2)

VVintorezVS committed 2 years ago
Unverified
cc60cfab322ffc7c359e09f1b83a4904bea844be

fix: date rerender on info screen

aalexeychikk committed 2 years ago
Verified
c41dac8ae2d6a77abadc15ef7ff40297b3582793

feat: showing vpo reference numbers on success registration screen (#1)

VVintorezVS committed 2 years ago

README

The README file for this repository.

VPO Help

This project was generated using Nx.
Server is a monolith built using NestJS framework.
Client is a React application.


Deploy

Using Docker

  1. Copy ./apps/api/.env.dev and rename to .env. Change environment variables to production ones.
  2. Run the following command:
    docker compose -f compose.prod.yaml up --build

Manually

  1. Install dependencies
    1.1 Git
    1.2 Node.js 16+
    1.3 MongoDB
  2. Install npm dependencies (in project's folder):
    npm i
  3. Build (in project's folder):
    npm run build
  4. Create .env file in project's root (see ./apps/api/.env.dev) OR provide environment variables to the run command (see the next step).
  5. Run API server (in project's folder):
    npm start

Test

Run automated tests:

npm run test

API

This project has monolithic architecture and provides the following REST-full API (some endpoints might not be reflected in this doc):

POST /auth/login

// PAYLOAD
LoginAsUserDto {
  email: String,
  password: String
}
// RESPONSE
LoginAsUserResponse {
  user: UserModel {
    id: String,
    role: "ADMIN",
    email: String,
  },
  permissions: PermissionMap,
  accessToken: { access_token: String }
}

POST /auth/login/vpo

// PAYLOAD
LoginAsVpoDto {
  vpoReferenceNumber: String,
}
// RESPONSE
LoginAsVpoResponseDto {
  user: VpoUserModel {
    id: String,
    role: "VPO",
    vpoReferenceNumber: String,
    scheduleDate: DateISOString,
  },
  permissions: PermissionMap,
  accessToken: { access_token: String },
}

POST /send-vpo-verification

// PAYLOAD
EmailHolderDto {
  email: String,
}
// RESPONSE
200

PUT /schedule

Auth, Permissions: ["SCHEDULE.WRITE"]

// PAYLOAD
ScheduleDto {
  0: [
    {
      timeFrom: TimeString,
      timeTo: TimeString,
      numberOfPersons: Number,
    }
  ],
  ...,
  6: [{...}],
}
// RESPONSE
{ ...ScheduleDto }

GET /schedule

// RESPONSE
{ ...ScheduleDto }

GET /schedule/available

// RESPONSE
ScheduleAvailableDto {
  items: [
    ScheduleSlotAvailableDto {
      dateFrom: DateISOString,
      dateTo: DateISOString,
    },
  ];
}

POST /vpo

// PAYLOAD
RegisterVpoDto {
  email: String,
  verificationCode: String,
  vpoIssueDate: DateISOString,
  vpoReferenceNumber: String,
  firstName: String,
  lastName: String,
  middleName: String,
  phoneNumber: String,
  dateOfBirth: DateISOString,
  addressOfRegistration: String,
  addressOfResidence: String,
  numberOfRelatives: Number,
  numberOfRelativesBelow16: Number,
  numberOfRelativesAbove65: Number,
  scheduleDate: DateISOString,
  receivedHelpDate?: DateISOString,
  receivedGoods?: { [productName]: Number },
}
// RESPONSE
{ ...VpoUserModel }

GET /vpo?PaginationSearchSort

Auth, Permissions: ["VPO_LIST.READ"]

// RESPONSE
{
  items: [VpoModel],
  totalItems: Number,
}

GET /vpo/export?PaginationSearchSort

Auth, Permissions: ["VPO_EXPORT.READ"]

// RESPONSE
vpo_table.csv;

POST /vpo/import

Auth, Permissions: ["VPO_IMPORT.WRITE"]

// PAYLOAD
vpo_that_received_goods_table.csv;

// RESPONSE
200;

PUT /settings

Auth, Permissions: ["SETTINGS.WRITE"]

// PAYLOAD
UpdateSettingsDto {
  daysToNextVpoRegistration?: Number,
  endOfRegistrationDate?: DateISOString,
  scheduleDaysAvailable?: Number,
}
// RESPONSE
{ ...SettingsDto }

GET /settings

Auth, Permissions: ["SETTINGS.READ"]

// RESPONSE
{ ...SettingsDto }

GET /html/:pageName

// RESPONSE
HtmlPageModel {
  id: String,
  name: String,
  content: {
    [fieldName]: String,
  }
}

PUT /html/:pageName

Auth, Permissions: ["HTML.WRITE"]

// PAYLOAD
{
  name?: String,
  content: {
    [fieldName]: String,
  }
}
// RESPONSE
{ ...HtmlPageModel }