add stepable schema
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { isValid, v } from 'suretype'
|
||||
|
||||
export interface Stepable {
|
||||
id: string
|
||||
title: string
|
||||
@@ -8,3 +10,12 @@ export interface Stepable {
|
||||
*/
|
||||
totalEstimation: number
|
||||
}
|
||||
|
||||
const stepableSchema = v.object({
|
||||
id: v.string().minLength(1).required(),
|
||||
title: v.string().minLength(1).required(),
|
||||
estimation: v.number(),
|
||||
totalEstimation: v.number().required()
|
||||
})
|
||||
|
||||
const isValidStepable = (data: unknown) => isValid(stepableSchema, data)
|
||||
|
||||
Reference in New Issue
Block a user