0.0.4 • Published 11 months ago

@assetval/employee v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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