11import * as z from "minizod" ;
22
33import { BroadcastTiebreakExtendedCode } from "./BroadcastTiebreakExtendedCode" ;
4- import { FideTimeControl } from "./FideTimeControl " ;
4+ import { BroadcastTourInfo } from "./BroadcastTourInfo " ;
55
66const BroadcastForm = z . object ( {
77 name : z . string ( ) . check ( z . minLength ( 3 ) ) . check ( z . maxLength ( 80 ) ) ,
8- "info.format" : z . optional ( z . string ( ) . check ( z . maxLength ( 80 ) ) ) ,
9- "info.location" : z . optional ( z . string ( ) . check ( z . maxLength ( 80 ) ) ) ,
10- "info.tc" : z . optional ( z . string ( ) . check ( z . maxLength ( 80 ) ) ) ,
11- "info.fideTC" : z . optional ( FideTimeControl ) ,
12- "info.timeZone" : z . optional ( z . string ( ) ) ,
13- "info.players" : z . optional ( z . string ( ) . check ( z . maxLength ( 120 ) ) ) ,
14- "info.website" : z . optional ( z . url ( ) ) ,
15- "info.standings" : z . optional ( z . url ( ) ) ,
8+ info : z . optional ( BroadcastTourInfo ) ,
169 markdown : z . optional ( z . string ( ) . check ( z . maxLength ( 20000 ) ) ) ,
1710 showScores : z . optional ( z . boolean ( ) ) ,
1811 showRatingDiffs : z . optional ( z . boolean ( ) ) ,
@@ -21,9 +14,20 @@ const BroadcastForm = z.object({
2114 players : z . optional ( z . string ( ) ) ,
2215 teams : z . optional ( z . string ( ) ) ,
2316 tier : z . optional ( z . literal ( [ 3 , 4 , 5 ] ) ) ,
24- " tiebreaks[]" : z . optional (
17+ tiebreaks : z . optional (
2518 z . array ( BroadcastTiebreakExtendedCode ) . check ( z . maxLength ( 5 ) ) ,
2619 ) ,
20+ grouping : z . optional (
21+ z . object ( {
22+ info : z . optional (
23+ z . object ( {
24+ name : z . optional ( z . string ( ) ) ,
25+ tours : z . optional ( z . string ( ) ) ,
26+ } ) ,
27+ ) ,
28+ scoreGroups : z . optional ( z . array ( z . string ( ) ) . check ( z . maxLength ( 10 ) ) ) ,
29+ } ) ,
30+ ) ,
2731} ) ;
2832
2933type BroadcastForm = z . infer < typeof BroadcastForm > ;
0 commit comments