more bracket work
This commit is contained in:
@@ -1,5 +1,38 @@
|
||||
import { z } from "zod";
|
||||
|
||||
/**
|
||||
* class TMatchSlot(BaseModel):
|
||||
pass
|
||||
|
||||
|
||||
class Seed(TMatchSlot):
|
||||
seed: int
|
||||
|
||||
|
||||
class TBD(TMatchSlot):
|
||||
parent: "TMatchBase"
|
||||
loser: bool
|
||||
|
||||
|
||||
class TMatchBase(BaseModel):
|
||||
lid: int # local id
|
||||
round: int
|
||||
order: Optional[int] = None
|
||||
|
||||
|
||||
class TMatch(TMatchBase):
|
||||
home: Seed | TBD
|
||||
away: Seed | TBD
|
||||
reset: bool = False
|
||||
|
||||
def __repr__(self):
|
||||
return f'{self.order}'
|
||||
|
||||
|
||||
class TBye(TMatchBase):
|
||||
home: Seed | TBD
|
||||
*/
|
||||
|
||||
export interface Match {
|
||||
id: string;
|
||||
order: number;
|
||||
@@ -22,6 +55,8 @@ export interface Match {
|
||||
away: string;
|
||||
created: string;
|
||||
updated: string;
|
||||
home_seed?: number;
|
||||
away_seed?: number;
|
||||
}
|
||||
|
||||
export const matchInputSchema = z.object({
|
||||
@@ -43,6 +78,7 @@ export const matchInputSchema = z.object({
|
||||
tournament: z.string().min(1),
|
||||
home: z.string().min(1).optional(),
|
||||
away: z.string().min(1).optional(),
|
||||
seed: z.number().int().min(1).optional(),
|
||||
});
|
||||
|
||||
export type MatchInput = z.infer<typeof matchInputSchema>;
|
||||
|
||||
Reference in New Issue
Block a user