@timardex/cluemart-server-shared 1.0.132 → 1.0.134

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.
@@ -4656,10 +4656,10 @@ var Condition = class _Condition {
4656
4656
  otherwise
4657
4657
  } = config;
4658
4658
  let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
4659
- return new _Condition(refs, (values, schema15) => {
4659
+ return new _Condition(refs, (values, schema16) => {
4660
4660
  var _branch;
4661
4661
  let branch = check(...values) ? then : otherwise;
4662
- return (_branch = branch == null ? void 0 : branch(schema15)) != null ? _branch : schema15;
4662
+ return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
4663
4663
  });
4664
4664
  }
4665
4665
  constructor(refs, builder) {
@@ -4673,13 +4673,13 @@ var Condition = class _Condition {
4673
4673
  // TODO: ? operator here?
4674
4674
  ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
4675
4675
  ));
4676
- let schema15 = this.fn(values, base, options);
4677
- if (schema15 === void 0 || // @ts-ignore this can be base
4678
- schema15 === base) {
4676
+ let schema16 = this.fn(values, base, options);
4677
+ if (schema16 === void 0 || // @ts-ignore this can be base
4678
+ schema16 === base) {
4679
4679
  return base;
4680
4680
  }
4681
- if (!isSchema(schema15)) throw new TypeError("conditions must return a schema object");
4682
- return schema15.resolve(options);
4681
+ if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
4682
+ return schema16.resolve(options);
4683
4683
  }
4684
4684
  };
4685
4685
  var prefixes = {
@@ -4749,7 +4749,7 @@ function createValidation(config) {
4749
4749
  path = "",
4750
4750
  options,
4751
4751
  originalValue,
4752
- schema: schema15
4752
+ schema: schema16
4753
4753
  }, panic, next) {
4754
4754
  const {
4755
4755
  name,
@@ -4761,8 +4761,8 @@ function createValidation(config) {
4761
4761
  let {
4762
4762
  parent,
4763
4763
  context,
4764
- abortEarly = schema15.spec.abortEarly,
4765
- disableStackTrace = schema15.spec.disableStackTrace
4764
+ abortEarly = schema16.spec.abortEarly,
4765
+ disableStackTrace = schema16.spec.disableStackTrace
4766
4766
  } = options;
4767
4767
  function resolve(item) {
4768
4768
  return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
@@ -4771,9 +4771,9 @@ function createValidation(config) {
4771
4771
  const nextParams = Object.assign({
4772
4772
  value,
4773
4773
  originalValue,
4774
- label: schema15.spec.label,
4774
+ label: schema16.spec.label,
4775
4775
  path: overrides.path || path,
4776
- spec: schema15.spec,
4776
+ spec: schema16.spec,
4777
4777
  disableStackTrace: overrides.disableStackTrace || disableStackTrace
4778
4778
  }, params, overrides.params);
4779
4779
  for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
@@ -4791,7 +4791,7 @@ function createValidation(config) {
4791
4791
  resolve,
4792
4792
  options,
4793
4793
  originalValue,
4794
- schema: schema15
4794
+ schema: schema16
4795
4795
  };
4796
4796
  const handleResult = (validOrError) => {
4797
4797
  if (ValidationError.isError(validOrError)) invalid(validOrError);
@@ -4825,42 +4825,42 @@ function createValidation(config) {
4825
4825
  validate.OPTIONS = config;
4826
4826
  return validate;
4827
4827
  }
4828
- function getIn(schema15, path, value, context = value) {
4828
+ function getIn(schema16, path, value, context = value) {
4829
4829
  let parent, lastPart, lastPartDebug;
4830
4830
  if (!path) return {
4831
4831
  parent,
4832
4832
  parentPath: path,
4833
- schema: schema15
4833
+ schema: schema16
4834
4834
  };
4835
4835
  (0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
4836
4836
  let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
4837
- schema15 = schema15.resolve({
4837
+ schema16 = schema16.resolve({
4838
4838
  context,
4839
4839
  parent,
4840
4840
  value
4841
4841
  });
4842
- let isTuple = schema15.type === "tuple";
4842
+ let isTuple = schema16.type === "tuple";
4843
4843
  let idx = isArray ? parseInt(part, 10) : 0;
4844
- if (schema15.innerType || isTuple) {
4844
+ if (schema16.innerType || isTuple) {
4845
4845
  if (isTuple && !isArray) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${lastPartDebug}" must contain an index to the tuple element, e.g. "${lastPartDebug}[0]"`);
4846
4846
  if (value && idx >= value.length) {
4847
4847
  throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. because there is no value at that index. `);
4848
4848
  }
4849
4849
  parent = value;
4850
4850
  value = value && value[idx];
4851
- schema15 = isTuple ? schema15.spec.types[idx] : schema15.innerType;
4851
+ schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
4852
4852
  }
4853
4853
  if (!isArray) {
4854
- if (!schema15.fields || !schema15.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema15.type}")`);
4854
+ if (!schema16.fields || !schema16.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema16.type}")`);
4855
4855
  parent = value;
4856
4856
  value = value && value[part];
4857
- schema15 = schema15.fields[part];
4857
+ schema16 = schema16.fields[part];
4858
4858
  }
4859
4859
  lastPart = part;
4860
4860
  lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
4861
4861
  });
4862
4862
  return {
4863
- schema: schema15,
4863
+ schema: schema16,
4864
4864
  parent,
4865
4865
  parentPath: lastPart
4866
4866
  };
@@ -4997,20 +4997,20 @@ var Schema = class {
4997
4997
  this._mutate = before;
4998
4998
  return result;
4999
4999
  }
5000
- concat(schema15) {
5001
- if (!schema15 || schema15 === this) return this;
5002
- if (schema15.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema15.type}`);
5000
+ concat(schema16) {
5001
+ if (!schema16 || schema16 === this) return this;
5002
+ if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
5003
5003
  let base = this;
5004
- let combined = schema15.clone();
5004
+ let combined = schema16.clone();
5005
5005
  const mergedSpec = Object.assign({}, base.spec, combined.spec);
5006
5006
  combined.spec = mergedSpec;
5007
5007
  combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
5008
- combined._whitelist = base._whitelist.merge(schema15._whitelist, schema15._blacklist);
5009
- combined._blacklist = base._blacklist.merge(schema15._blacklist, schema15._whitelist);
5008
+ combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
5009
+ combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
5010
5010
  combined.tests = base.tests;
5011
5011
  combined.exclusiveTests = base.exclusiveTests;
5012
5012
  combined.withMutation((next) => {
5013
- schema15.tests.forEach((fn) => {
5013
+ schema16.tests.forEach((fn) => {
5014
5014
  next.test(fn.OPTIONS);
5015
5015
  });
5016
5016
  });
@@ -5026,15 +5026,15 @@ var Schema = class {
5026
5026
  return this._typeCheck(v);
5027
5027
  }
5028
5028
  resolve(options) {
5029
- let schema15 = this;
5030
- if (schema15.conditions.length) {
5031
- let conditions = schema15.conditions;
5032
- schema15 = schema15.clone();
5033
- schema15.conditions = [];
5034
- schema15 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema15);
5035
- schema15 = schema15.resolve(options);
5029
+ let schema16 = this;
5030
+ if (schema16.conditions.length) {
5031
+ let conditions = schema16.conditions;
5032
+ schema16 = schema16.clone();
5033
+ schema16.conditions = [];
5034
+ schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
5035
+ schema16 = schema16.resolve(options);
5036
5036
  }
5037
- return schema15;
5037
+ return schema16;
5038
5038
  }
5039
5039
  resolveOptions(options) {
5040
5040
  var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
@@ -5188,11 +5188,11 @@ attempted value: ${formattedValue}
5188
5188
  }
5189
5189
  validate(value, options) {
5190
5190
  var _options$disableStack2;
5191
- let schema15 = this.resolve(Object.assign({}, options, {
5191
+ let schema16 = this.resolve(Object.assign({}, options, {
5192
5192
  value
5193
5193
  }));
5194
- let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema15.spec.disableStackTrace;
5195
- return new Promise((resolve, reject) => schema15._validate(value, options, (error, parsed) => {
5194
+ let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
5195
+ return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
5196
5196
  if (ValidationError.isError(error)) error.value = parsed;
5197
5197
  reject(error);
5198
5198
  }, (errors, validated) => {
@@ -5202,12 +5202,12 @@ attempted value: ${formattedValue}
5202
5202
  }
5203
5203
  validateSync(value, options) {
5204
5204
  var _options$disableStack3;
5205
- let schema15 = this.resolve(Object.assign({}, options, {
5205
+ let schema16 = this.resolve(Object.assign({}, options, {
5206
5206
  value
5207
5207
  }));
5208
5208
  let result;
5209
- let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema15.spec.disableStackTrace;
5210
- schema15._validate(value, Object.assign({}, options, {
5209
+ let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
5210
+ schema16._validate(value, Object.assign({}, options, {
5211
5211
  sync: true
5212
5212
  }), (error, parsed) => {
5213
5213
  if (ValidationError.isError(error)) error.value = parsed;
@@ -5241,8 +5241,8 @@ attempted value: ${formattedValue}
5241
5241
  return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
5242
5242
  }
5243
5243
  getDefault(options) {
5244
- let schema15 = this.resolve(options || {});
5245
- return schema15._getDefault(options);
5244
+ let schema16 = this.resolve(options || {});
5245
+ return schema16._getDefault(options);
5246
5246
  }
5247
5247
  default(def) {
5248
5248
  if (arguments.length === 0) {
@@ -5477,9 +5477,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
5477
5477
  const {
5478
5478
  parent,
5479
5479
  parentPath,
5480
- schema: schema15
5480
+ schema: schema16
5481
5481
  } = getIn(this, path, value, options.context);
5482
- return schema15[method](parent && parent[parentPath], Object.assign({}, options, {
5482
+ return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
5483
5483
  parent,
5484
5484
  path
5485
5485
  }));
@@ -5653,7 +5653,7 @@ var StringSchema = class extends Schema {
5653
5653
  });
5654
5654
  }
5655
5655
  required(message) {
5656
- return super.required(message).withMutation((schema15) => schema15.test({
5656
+ return super.required(message).withMutation((schema16) => schema16.test({
5657
5657
  message: message || mixed.required,
5658
5658
  name: "required",
5659
5659
  skipAbsent: true,
@@ -5661,9 +5661,9 @@ var StringSchema = class extends Schema {
5661
5661
  }));
5662
5662
  }
5663
5663
  notRequired() {
5664
- return super.notRequired().withMutation((schema15) => {
5665
- schema15.tests = schema15.tests.filter((t) => t.OPTIONS.name !== "required");
5666
- return schema15;
5664
+ return super.notRequired().withMutation((schema16) => {
5665
+ schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
5666
+ return schema16;
5667
5667
  });
5668
5668
  }
5669
5669
  length(length, message = string.length) {
@@ -6052,28 +6052,28 @@ var parseJson = (value, _, ctx) => {
6052
6052
  }
6053
6053
  return ctx.isType(parsed) ? parsed : value;
6054
6054
  };
6055
- function deepPartial(schema15) {
6056
- if ("fields" in schema15) {
6055
+ function deepPartial(schema16) {
6056
+ if ("fields" in schema16) {
6057
6057
  const partial = {};
6058
- for (const [key, fieldSchema] of Object.entries(schema15.fields)) {
6058
+ for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
6059
6059
  partial[key] = deepPartial(fieldSchema);
6060
6060
  }
6061
- return schema15.setFields(partial);
6061
+ return schema16.setFields(partial);
6062
6062
  }
6063
- if (schema15.type === "array") {
6064
- const nextArray = schema15.optional();
6063
+ if (schema16.type === "array") {
6064
+ const nextArray = schema16.optional();
6065
6065
  if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
6066
6066
  return nextArray;
6067
6067
  }
6068
- if (schema15.type === "tuple") {
6069
- return schema15.optional().clone({
6070
- types: schema15.spec.types.map(deepPartial)
6068
+ if (schema16.type === "tuple") {
6069
+ return schema16.optional().clone({
6070
+ types: schema16.spec.types.map(deepPartial)
6071
6071
  });
6072
6072
  }
6073
- if ("optional" in schema15) {
6074
- return schema15.optional();
6073
+ if ("optional" in schema16) {
6074
+ return schema16.optional();
6075
6075
  }
6076
- return schema15;
6076
+ return schema16;
6077
6077
  }
6078
6078
  var deepHas = (obj, p) => {
6079
6079
  const path = [...(0, import_property_expr.normalizePath)(p)];
@@ -6207,8 +6207,8 @@ var ObjectSchema = class extends Schema {
6207
6207
  next._sortErrors = this._sortErrors;
6208
6208
  return next;
6209
6209
  }
6210
- concat(schema15) {
6211
- let next = super.concat(schema15);
6210
+ concat(schema16) {
6211
+ let next = super.concat(schema16);
6212
6212
  let nextFields = next.fields;
6213
6213
  for (let [field, schemaOrRef] of Object.entries(this.fields)) {
6214
6214
  const target = nextFields[field];
@@ -6216,7 +6216,7 @@ var ObjectSchema = class extends Schema {
6216
6216
  }
6217
6217
  return next.withMutation((s) => (
6218
6218
  // XXX: excludes here is wrong
6219
- s.setFields(nextFields, [...this._excludedEdges, ...schema15._excludedEdges])
6219
+ s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
6220
6220
  ));
6221
6221
  }
6222
6222
  _getDefault(options) {
@@ -6261,8 +6261,8 @@ var ObjectSchema = class extends Schema {
6261
6261
  }
6262
6262
  partial() {
6263
6263
  const partial = {};
6264
- for (const [key, schema15] of Object.entries(this.fields)) {
6265
- partial[key] = "optional" in schema15 && schema15.optional instanceof Function ? schema15.optional() : schema15;
6264
+ for (const [key, schema16] of Object.entries(this.fields)) {
6265
+ partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
6266
6266
  }
6267
6267
  return this.setFields(partial);
6268
6268
  }
@@ -6460,22 +6460,22 @@ var ArraySchema = class extends Schema {
6460
6460
  json() {
6461
6461
  return this.transform(parseJson);
6462
6462
  }
6463
- concat(schema15) {
6464
- let next = super.concat(schema15);
6463
+ concat(schema16) {
6464
+ let next = super.concat(schema16);
6465
6465
  next.innerType = this.innerType;
6466
- if (schema15.innerType)
6466
+ if (schema16.innerType)
6467
6467
  next.innerType = next.innerType ? (
6468
6468
  // @ts-expect-error Lazy doesn't have concat and will break
6469
- next.innerType.concat(schema15.innerType)
6470
- ) : schema15.innerType;
6469
+ next.innerType.concat(schema16.innerType)
6470
+ ) : schema16.innerType;
6471
6471
  return next;
6472
6472
  }
6473
- of(schema15) {
6473
+ of(schema16) {
6474
6474
  let next = this.clone();
6475
- if (!isSchema(schema15)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema15));
6476
- next.innerType = schema15;
6475
+ if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
6476
+ next.innerType = schema16;
6477
6477
  next.spec = Object.assign({}, next.spec, {
6478
- types: schema15
6478
+ types: schema16
6479
6479
  });
6480
6480
  return next;
6481
6481
  }
@@ -6619,7 +6619,7 @@ var TupleSchema = class extends Schema {
6619
6619
  describe(options) {
6620
6620
  const next = (options ? this.resolve(options) : this).clone();
6621
6621
  const base = super.describe(options);
6622
- base.innerType = next.spec.types.map((schema15, index) => {
6622
+ base.innerType = next.spec.types.map((schema16, index) => {
6623
6623
  var _innerOptions;
6624
6624
  let innerOptions = options;
6625
6625
  if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
@@ -6628,7 +6628,7 @@ var TupleSchema = class extends Schema {
6628
6628
  value: innerOptions.value[index]
6629
6629
  });
6630
6630
  }
6631
- return schema15.describe(innerOptions);
6631
+ return schema16.describe(innerOptions);
6632
6632
  });
6633
6633
  return base;
6634
6634
  }
@@ -6645,6 +6645,7 @@ var import_react2 = __toESM(require_react(), 1);
6645
6645
  var React8 = __toESM(require_react(), 1);
6646
6646
  var import_react3 = __toESM(require_react(), 1);
6647
6647
  var import_react4 = __toESM(require_react(), 1);
6648
+ var import_react5 = __toESM(require_react(), 1);
6648
6649
  var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
6649
6650
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
6650
6651
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -8269,6 +8270,7 @@ var USER_FIELDS_FRAGMENT = gql`
8269
8270
  promoCodes
8270
8271
  refreshToken
8271
8272
  role
8273
+ school
8272
8274
  termsAgreement {
8273
8275
  ...TermsAgreementFields
8274
8276
  }
@@ -10107,6 +10109,80 @@ var UPDATE_DAILY_CLUE_MUTATION = gql`
10107
10109
  }
10108
10110
  ${GAME_DOC_FIELDS_FRAGMENT}
10109
10111
  `;
10112
+ var SCHOOL = gql`
10113
+ fragment SchoolFields on SchoolType {
10114
+ _id
10115
+ active
10116
+ contactDetails {
10117
+ ...ContactDetailsFields
10118
+ }
10119
+ location {
10120
+ ...LocationFields
10121
+ }
10122
+ createdAt
10123
+ deletedAt
10124
+ logo {
10125
+ ...ResourceImageFields
10126
+ }
10127
+ name
10128
+ owner {
10129
+ ...OwnerFields
10130
+ }
10131
+ overallPoints
10132
+ region
10133
+ studentCount
10134
+ socialMedia {
10135
+ ...SocialMediaFields
10136
+ }
10137
+ termsAgreement {
10138
+ ...TermsAgreementFields
10139
+ }
10140
+ updatedAt
10141
+ }
10142
+ ${OWNER_FIELDS_FRAGMENT}
10143
+ ${LOCATION_FIELDS_FRAGMENT}
10144
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
10145
+ ${CONTACT_DETAILS_FIELDS_FRAGMENT}
10146
+ ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
10147
+ ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
10148
+ `;
10149
+ var GET_SCHOOL = gql`
10150
+ query getSchool($_id: ID!) {
10151
+ school(_id: $_id) {
10152
+ ...SchoolFields
10153
+ }
10154
+ }
10155
+ ${SCHOOL}
10156
+ `;
10157
+ var GET_SCHOOLS = gql`
10158
+ query getSchools {
10159
+ schools {
10160
+ ...SchoolFields
10161
+ }
10162
+ }
10163
+ ${SCHOOL}
10164
+ `;
10165
+ var CREATE_SCHOOL_MUTATION = gql`
10166
+ mutation createSchool($input: SchoolInputType!) {
10167
+ createSchool(input: $input) {
10168
+ ...SchoolFields
10169
+ }
10170
+ }
10171
+ ${SCHOOL}
10172
+ `;
10173
+ var UPDATE_SCHOOL_MUTATION = gql`
10174
+ mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
10175
+ updateSchool(_id: $_id, input: $input) {
10176
+ ...SchoolFields
10177
+ }
10178
+ }
10179
+ ${SCHOOL}
10180
+ `;
10181
+ var DELETE_SCHOOL_MUTATION = gql`
10182
+ mutation deleteSchool($_id: ID!) {
10183
+ deleteSchool(_id: $_id)
10184
+ }
10185
+ `;
10110
10186
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
10111
10187
  var nzbnRegex = /^94\d{11}$/;
10112
10188
  var normalizedUrlTransform = () => create$6().trim().transform(
@@ -10258,7 +10334,7 @@ var socialMediaSchema = create$3({
10258
10334
  is: (name) => !!name,
10259
10335
  // If name has a value
10260
10336
  then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
10261
- otherwise: (schema15) => schema15.notRequired()
10337
+ otherwise: (schema16) => schema16.notRequired()
10262
10338
  })
10263
10339
  });
10264
10340
  var globalResourceSchema = create$3().shape({
@@ -10334,21 +10410,21 @@ var paymentInfoSchema = create$3({
10334
10410
  ).required("Please select a Payment method"),
10335
10411
  accountHolderName: create$6().when("paymentMethod", {
10336
10412
  is: "bank_transfer",
10337
- then: (schema15) => schema15.required("Account holder name is required for bank transfer").trim(),
10338
- otherwise: (schema15) => schema15.notRequired()
10413
+ then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
10414
+ otherwise: (schema16) => schema16.notRequired()
10339
10415
  }),
10340
10416
  accountNumber: create$6().when("paymentMethod", {
10341
10417
  is: "bank_transfer",
10342
- then: (schema15) => schema15.required("Account number is required for bank transfer").matches(
10418
+ then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
10343
10419
  nzBankAccountRegex,
10344
10420
  "Account number must be in format: XX-XXXX-XXXXXXX-XX"
10345
10421
  ).trim(),
10346
- otherwise: (schema15) => schema15.notRequired()
10422
+ otherwise: (schema16) => schema16.notRequired()
10347
10423
  }),
10348
10424
  link: create$6().when("paymentMethod", {
10349
10425
  is: (val) => val === "paypal" || val === "stripe",
10350
10426
  then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
10351
- otherwise: (schema15) => schema15.notRequired()
10427
+ otherwise: (schema16) => schema16.notRequired()
10352
10428
  })
10353
10429
  });
10354
10430
  var eventInfoSchema = create$3().shape({
@@ -10498,16 +10574,16 @@ var vendorInfoSchema = create$3().shape({
10498
10574
  var userSchema = create$3().shape({
10499
10575
  active: create$7().required("Active is required"),
10500
10576
  email: emailRequiredSchema,
10501
- firstName: create$6().label("First Name").required("First name is required"),
10502
- lastName: create$6().label("Last Name").required("Last name is required"),
10577
+ firstName: create$6().label("First Name").trim().required("First name is required"),
10578
+ lastName: create$6().label("Last Name").trim().required("Last name is required"),
10503
10579
  isTester: create$7().required("Tester status is required"),
10504
10580
  password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
10505
10581
  preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
10506
10582
  confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
10507
10583
  is: (val) => !!val,
10508
10584
  // only necessary if password typed
10509
- then: (schema15) => schema15.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10510
- otherwise: (schema15) => schema15.notRequired()
10585
+ then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10586
+ otherwise: (schema16) => schema16.notRequired()
10511
10587
  }),
10512
10588
  role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
10513
10589
  });
@@ -10578,7 +10654,7 @@ var adSchema = create$3().shape({
10578
10654
  return endDate > now;
10579
10655
  }).when("start", {
10580
10656
  is: (val) => val && val.length > 0,
10581
- then: (schema15) => schema15.test(
10657
+ then: (schema16) => schema16.test(
10582
10658
  "is-after-start",
10583
10659
  "End date must be after start date",
10584
10660
  function(value) {
@@ -10722,6 +10798,15 @@ var contactUsSchema = create$3().shape({
10722
10798
  lastName: create$6().label("Last Name").required("Last name is required"),
10723
10799
  message: create$6().label("Message").required("Message is required")
10724
10800
  });
10801
+ var schoolSchema = create$3().shape({
10802
+ active: create$7().required("Active is required"),
10803
+ contactDetails: contactDetailsSchema,
10804
+ location: locationSchema,
10805
+ name: create$6().trim().required("Name is required"),
10806
+ region: create$6().trim().required("Region is required"),
10807
+ socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
10808
+ studentCount: create$5().label("Student Count").min(0, "Student count cannot be negative").required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
10809
+ });
10725
10810
  var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
10726
10811
  EnumActivity2["FAVORITE"] = "FAVORITE";
10727
10812
  EnumActivity2["GOING"] = "GOING";
@@ -11289,27 +11374,27 @@ var baseResourceFields = {
11289
11374
  required: false,
11290
11375
  type: [associatesSchema]
11291
11376
  },
11292
- contactDetails: ContactDetailsSchema,
11377
+ contactDetails: { required: false, type: ContactDetailsSchema },
11293
11378
  cover: {
11294
11379
  required: true,
11295
11380
  type: ResourceImageTypeSchema
11296
11381
  },
11297
11382
  deletedAt: { default: null, required: false, type: Date },
11298
11383
  description: { required: true, type: String },
11299
- images: [ResourceImageTypeSchema],
11300
- logo: ResourceImageTypeSchema,
11384
+ images: { required: false, type: [ResourceImageTypeSchema] },
11385
+ logo: { required: false, type: ResourceImageTypeSchema },
11301
11386
  name: { required: true, type: String },
11302
11387
  owner: {
11303
11388
  required: false,
11304
11389
  type: OwnerTypeSchema
11305
11390
  },
11306
- posterUsage: PosterUsageTypeSchema,
11391
+ posterUsage: { required: false, type: PosterUsageTypeSchema },
11307
11392
  promoCodes: { required: false, type: [String] },
11308
11393
  rating: { required: false, type: Number },
11309
11394
  region: { required: true, type: String },
11310
11395
  reviewCount: { required: false, type: Number },
11311
- socialMedia: [SocialMediaTypeSchema],
11312
- termsAgreement: termsAgreementSchema
11396
+ socialMedia: { required: false, type: [SocialMediaTypeSchema] },
11397
+ termsAgreement: { required: true, type: termsAgreementSchema }
11313
11398
  };
11314
11399
 
11315
11400
  // src/mongoose/GoogleImportedMarket.ts
@@ -11622,6 +11707,11 @@ var schema7 = new MongooseSchema11(
11622
11707
  required: true,
11623
11708
  type: String
11624
11709
  },
11710
+ school: {
11711
+ ref: "School",
11712
+ required: false,
11713
+ type: mongoose11.Schema.Types.ObjectId
11714
+ },
11625
11715
  stripe: {
11626
11716
  required: false,
11627
11717
  type: stripeSchema
@@ -12012,9 +12102,9 @@ var gameDataSchemas = {
12012
12102
  [EnumGameType.DAILY_CLUE]: schemaDailyClue
12013
12103
  };
12014
12104
  var gameDataDefinition = Object.fromEntries(
12015
- Object.entries(gameDataSchemas).map(([key, schema15]) => [
12105
+ Object.entries(gameDataSchemas).map(([key, schema16]) => [
12016
12106
  key,
12017
- { default: null, required: false, type: schema15 }
12107
+ { default: null, required: false, type: schema16 }
12018
12108
  ])
12019
12109
  );
12020
12110
  var gameHistorySchema = new MongooseSchema19(
@@ -12062,6 +12152,34 @@ var schema14 = new MongooseSchema19(
12062
12152
  );
12063
12153
  var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
12064
12154
 
12155
+ // src/mongoose/School.ts
12156
+ import mongoose20 from "mongoose";
12157
+ var MongooseSchema20 = mongoose20.Schema;
12158
+ var schema15 = new MongooseSchema20(
12159
+ {
12160
+ active: { default: false, required: true, type: Boolean },
12161
+ contactDetails: { required: false, type: ContactDetailsSchema },
12162
+ deletedAt: { default: null, required: false, type: Date },
12163
+ location: {
12164
+ required: true,
12165
+ type: locationsSchema
12166
+ },
12167
+ logo: { required: false, type: ResourceImageTypeSchema },
12168
+ name: { required: true, type: String },
12169
+ overallPoints: { default: 0, required: false, type: Number },
12170
+ owner: {
12171
+ required: true,
12172
+ type: OwnerTypeSchema
12173
+ },
12174
+ region: { required: true, type: String },
12175
+ socialMedia: { required: false, type: [SocialMediaTypeSchema] },
12176
+ studentCount: { required: true, type: Number },
12177
+ termsAgreement: { required: true, type: termsAgreementSchema }
12178
+ },
12179
+ { timestamps: true }
12180
+ );
12181
+ var SchoolModel = mongoose20.models.School || mongoose20.model("School", schema15);
12182
+
12065
12183
  export {
12066
12184
  EnumUserLicence,
12067
12185
  EnumAdStatus,
@@ -12081,6 +12199,7 @@ export {
12081
12199
  CategorySchema,
12082
12200
  userLicenseSchema,
12083
12201
  associatesSchema,
12202
+ ContactDetailsSchema,
12084
12203
  termsAgreementSchema,
12085
12204
  resourceRelationsSchema,
12086
12205
  dateTimeSchema3 as dateTimeSchema,
@@ -12100,7 +12219,8 @@ export {
12100
12219
  PostModel,
12101
12220
  APP_SETTINGS_ID,
12102
12221
  AppSettingModel,
12103
- GameModel
12222
+ GameModel,
12223
+ SchoolModel
12104
12224
  };
12105
12225
  /*! Bundled license information:
12106
12226
 
@@ -12126,4 +12246,4 @@ react/cjs/react.development.js:
12126
12246
  * LICENSE file in the root directory of this source tree.
12127
12247
  *)
12128
12248
  */
12129
- //# sourceMappingURL=chunk-OBW4LAAG.mjs.map
12249
+ //# sourceMappingURL=chunk-AMB6NVKD.mjs.map