0.2.9 • Published 11 months ago

@assetval/order v0.2.9

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

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