@assetval/order
v0.2.9
Published
AssetVal's internal order model
Downloads
9
Readme
Order
This is the Veritas Order Schema workspace.
Installation
yarn add @assetval/order
Usage
As a Class (Front End)
import { Order } from '@assetval/order';
const order = new Order();
As Schema (Back End)
import { {Order}Schema, Order } from '@assetval/order';
import { Model } from 'mongoose';
export const {Order}Model = model<Order>('{order}es', {Order}Schema);
As Validation (Back End)
import { {Order}ValidationSchema } from '@assetval/order';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateOrder', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: {Order}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)
- Yarn (Corepack / Node / ASDF)
- moonrepo
- git-chglog (ASDF)
Then run the following commands:
yarn install