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