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.
@@ -49,6 +49,7 @@ interface Tournament {
49
49
  notes?: string;
50
50
  onlineResources?: OnlineResource[];
51
51
  parentOrganisationId?: string;
52
+ parentOrganisation?: Organisation;
52
53
  participants?: Participant[];
53
54
  processCodes?: string[];
54
55
  promotionalName?: string;
@@ -71,6 +72,15 @@ interface Tournament {
71
72
  updatedAt?: Date | string;
72
73
  venues?: Venue[];
73
74
  }
75
+ interface Organisation {
76
+ onlineResources?: OnlineResource[];
77
+ organisationAbbreviation: string;
78
+ parentOrganisationId?: string;
79
+ extensions?: Extension[];
80
+ organisationName: string;
81
+ organisationId: string;
82
+ notes?: string;
83
+ }
74
84
  interface Event {
75
85
  allowedDrawTypes?: DrawTypeEnum[];
76
86
  category?: Category;
@@ -373,6 +373,10 @@ const INVALID_OBJECT = {
373
373
  message: "Invalid object",
374
374
  code: "ERR_INVALID_OBJECT"
375
375
  };
376
+ const INVALID_GENDER = {
377
+ message: "Invalid gender",
378
+ code: "ERR_INVALID_GENDER"
379
+ };
376
380
  const INVALID_CATEGORY = {
377
381
  message: "Invalid category",
378
382
  code: "ERR_INVALID_CATEGORY"
@@ -2106,6 +2110,11 @@ function validateCollectionDefinition({
2106
2110
  }
2107
2111
  if (checkGender && referenceGender && gender && [GenderEnum.Male, GenderEnum.Female].includes(referenceGender) && referenceGender !== gender) {
2108
2112
  errors.push(`Invalid gender: ${gender}`);
2113
+ return decorateResult({
2114
+ context: { referenceGender, gender },
2115
+ result: { error: INVALID_GENDER },
2116
+ stack
2117
+ });
2109
2118
  }
2110
2119
  if (checkCategory && referenceCategory && category) {
2111
2120
  const result = categoryCanContain({