tods-competition-factory 1.8.7 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ interface Tournament {
33
33
  notes?: string;
34
34
  onlineResources?: OnlineResource[];
35
35
  parentOrganisationId?: string;
36
+ parentOrganisation?: Organisation;
36
37
  participants?: Participant[];
37
38
  processCodes?: string[];
38
39
  promotionalName?: string;
@@ -55,6 +56,15 @@ interface Tournament {
55
56
  updatedAt?: Date | string;
56
57
  venues?: Venue[];
57
58
  }
59
+ interface Organisation {
60
+ onlineResources?: OnlineResource[];
61
+ organisationAbbreviation: string;
62
+ parentOrganisationId?: string;
63
+ extensions?: Extension[];
64
+ organisationName: string;
65
+ organisationId: string;
66
+ notes?: string;
67
+ }
58
68
  interface Event {
59
69
  allowedDrawTypes?: DrawTypeEnum[];
60
70
  category?: Category;
@@ -715,6 +715,10 @@ const INVALID_OBJECT = {
715
715
  message: "Invalid object",
716
716
  code: "ERR_INVALID_OBJECT"
717
717
  };
718
+ const INVALID_GENDER = {
719
+ message: "Invalid gender",
720
+ code: "ERR_INVALID_GENDER"
721
+ };
718
722
  const INVALID_CATEGORY = {
719
723
  message: "Invalid category",
720
724
  code: "ERR_INVALID_CATEGORY"
@@ -10398,8 +10402,8 @@ function getAvoidanceConflicts({ isRoundRobin, groupedParticipants }) {
10398
10402
  function getSwapOptions({
10399
10403
  positionedParticipants,
10400
10404
  potentialDrawPositions,
10401
- avoidanceConflicts,
10402
10405
  drawPositionGroups,
10406
+ avoidanceConflicts,
10403
10407
  isRoundRobin
10404
10408
  }) {
10405
10409
  return avoidanceConflicts.map((conflict) => {
@@ -16677,6 +16681,11 @@ function validateCollectionDefinition({
16677
16681
  }
16678
16682
  if (checkGender && referenceGender && gender && [GenderEnum.Male, GenderEnum.Female].includes(referenceGender) && referenceGender !== gender) {
16679
16683
  errors.push(`Invalid gender: ${gender}`);
16684
+ return decorateResult({
16685
+ context: { referenceGender, gender },
16686
+ result: { error: INVALID_GENDER },
16687
+ stack
16688
+ });
16680
16689
  }
16681
16690
  if (checkCategory && referenceCategory && category) {
16682
16691
  const result = categoryCanContain({