@assetval/questionnaire
v0.0.3
Published
AssetVal's questionnaire workspace
Downloads
8
Readme
Questionnaire
This is the Veritas Questionnaire Schema workspace.
Installation
yarn add @assetval/questionnaire
Usage
As a Class (Front End)
import { Questionnaire } from '@assetval/questionnaire';
const questionnaire = new Questionnaire();
As Schema (Back End)
import { {Questionnaire}Schema, Questionnaire } from '@assetval/questionnaire';
import { Model } from 'mongoose';
export const {Questionnaire}Model = model<Questionnaire>('{questionnaire}es', {Questionnaire}Schema);
As Validation (Back End)
import { {Questionnaire}ValidationSchema } from '@assetval/questionnaire';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateQuestionnaire', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: {Questionnaire}ValidationSchema
}),
route: async (req, res): Promise<void> => {
// Do something
}
});
License
MIT
Authors
Contributing
Download the Schema repository and make sure you have the following installed:
- asdf
- NodeJS (ASDF)
- PNPM (Corepack / Node / ASDF)
- NX
Then run the following commands:
pnpm install