add stepable schema
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import { isValid, v } from 'suretype'
|
||||||
|
|
||||||
export interface Stepable {
|
export interface Stepable {
|
||||||
id: string
|
id: string
|
||||||
title: string
|
title: string
|
||||||
@@ -8,3 +10,12 @@ export interface Stepable {
|
|||||||
*/
|
*/
|
||||||
totalEstimation: number
|
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