Added: Beer API, Docs API and tests for both, fixed build

This commit is contained in:
2024-05-03 01:46:23 +02:00
parent ef4cabff78
commit 44dbf74f1c
10 changed files with 436 additions and 2 deletions

34
api/src/models/Beer.ts Normal file
View File

@ -0,0 +1,34 @@
import path from 'path';
import { Schema, model } from 'mongoose';
import { IBeer } from '../validators/beerValidator';
const schema = new Schema<IBeer | any>(
{
name: {
type: String,
required: true
},
degree: {
type: Number,
required: true
},
packaging: {
type: String,
required: true
},
brand: {
type: String,
required: true
},
imgs: {
type: Array,
required: false,
default: []
}
},
{
timestamps: true
}
);
export default model(path.basename(__filename).split('.')[0], schema);