@assetval/employee
v0.0.4
Published
AssetVal's employee workspace
Downloads
5
Readme
Employee
This is the Veritas Employee Schema workspace.
Installation
yarn add @assetval/employee
Usage
As a Class (Front End)
import { Employee } from '@assetval/employee';
const employee = new Employee();
As Schema (Back End)
import { {Employee}Schema, Employee } from '@assetval/employee';
import { Model } from 'mongoose';
export const {Employee}Model = model<Employee>('{employee}es', {Employee}Schema);
As Validation (Back End)
import { {Employee}ValidationSchema } from '@assetval/employee';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateEmployee', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: {Employee}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