-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] Create resources for cricket: format
, state
and event
#26
Comments
Mongoose Schema for Cricket State@majorbruteforce Please verify this Mongoose Schema for Cricket State
|
Mongoose Schema for Cricket Event@majorbruteforce please verify this Mongoose Schema for Cricket event @Prop({
type: `Types.ObjectId,`
required: true,
index: true,
ref: Matches.name,
set: EnsureObjectId
})
match: Types.ObjectId
@Prop({
type: String,
required: true,
})
type: string;
@Prop({
type: Object,
required: true
})
details: {
runs?: number | null;
playerOut?: string | null;
outReason?: any[];
wickets?: number | null;
scoringType?: number | null;
illegal?: string | null;
penalty?: number | null
} |
Mongoose Schema for Cricket Format@majorbruteforce please verify the Mongoose Schema for Cricket Format @Prop({
required: true,
index: true,
trim: true
})
sport: string;
@Prop()
totalOvers: number
@Prop()
powerplayOvers: number
@Prop()
legalDeliveriesPerOver: number
@Prop({
type: Object
})
penaltyActions: PenaltyActions
@Prop({
type: Object
})
extraActions: ExtraActions
Types for the Cricket Format Schema enum PenaltyType {
no_ball = "no_ball",
wide = "wide",
field_obstruction = "field_obstruction",
over_rate_exceeded = "over_rate_exceeded",
}
declare type PenaltyActions = {
illegal : PenaltyType,
freeHit : boolean,
penalty : number
}
enum ExtraActionsType{
byes = "byes",
leg_byes = "leg_byes",
feilding_error = "feilding_error",
}
declare type ExtraActions = {
type : ExtraActionsType,
penalty : number,
description : string
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/cricket
GET /:matchId/state
: To fetch the latest match stateGET /:matchId/event?id=previousEventId
: To fetch the most recent event next to the passed event (get most recent if nothing is passed)GET /:matchId/event-series?id=previousEventId
: To fetch all the events for the match sorted in descending order of time after the event with idpreviousEventId
. (get all if nothing is passed)POST /:matchId/event
: To post a new event.PATCH /event/:eventId
: To patch a created eventDELETE /event/:eventId
: To delete a created eventNOTE: Comment the schema for the three entities in the same thread.
The text was updated successfully, but these errors were encountered: