Update scripts

This commit is contained in:
freearhey 2025-04-29 00:18:35 +03:00
parent 37b4197fb2
commit 6244ba7adb
54 changed files with 2020 additions and 1145 deletions

View file

@ -0,0 +1,33 @@
import { CategoryData } from '../types/category'
import { Model } from './model'
import Joi from 'joi'
export class Category extends Model {
id: string
name: string
constructor(data: CategoryData) {
super()
this.id = data.id
this.name = data.name
}
data(): CategoryData {
return {
id: this.id,
name: this.name
}
}
getSchema() {
return Joi.object({
id: Joi.string()
.regex(/^[a-z]+$/)
.required(),
name: Joi.string()
.regex(/^[A-Z]+$/i)
.required()
})
}
}