Skip to content

Commit

Permalink
feat: add vintage validation in units
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Jan 12, 2022
1 parent 4350b7d commit 8b5b1c0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- '**'

jobs:
test:
name: NPM Tests
runs-on: ubuntu-latest
container:
image: node:lts

steps:
- uses: Chia-Network/actions/clean-workspace@main

- name: Checkout Code
uses: actions/checkout@v2

- name: npm install
run: npm install

- name: npm tests
run: npm run test
4 changes: 3 additions & 1 deletion src/validations/units.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ const unitsBaseSchema = {
correspondingAdjustmentStatus: Joi.string()
.valid('Not Started', 'Pending')
.required(),
vintages: Joi.object({}).optional(),
vintages: Joi.alternatives()
.try(newVintageScheme, existingVintageSchema)
.optional(),
};

export const unitsPostSchema = Joi.object({
Expand Down

0 comments on commit 8b5b1c0

Please sign in to comment.