@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.
@@ -4721,10 +4721,10 @@ var Condition = class _Condition {
4721
4721
  otherwise
4722
4722
  } = config;
4723
4723
  let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
4724
- return new _Condition(refs, (values, schema15) => {
4724
+ return new _Condition(refs, (values, schema16) => {
4725
4725
  var _branch;
4726
4726
  let branch = check(...values) ? then : otherwise;
4727
- return (_branch = branch == null ? void 0 : branch(schema15)) != null ? _branch : schema15;
4727
+ return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
4728
4728
  });
4729
4729
  }
4730
4730
  constructor(refs, builder) {
@@ -4738,13 +4738,13 @@ var Condition = class _Condition {
4738
4738
  // TODO: ? operator here?
4739
4739
  ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
4740
4740
  ));
4741
- let schema15 = this.fn(values, base, options);
4742
- if (schema15 === void 0 || // @ts-ignore this can be base
4743
- schema15 === base) {
4741
+ let schema16 = this.fn(values, base, options);
4742
+ if (schema16 === void 0 || // @ts-ignore this can be base
4743
+ schema16 === base) {
4744
4744
  return base;
4745
4745
  }
4746
- if (!isSchema(schema15)) throw new TypeError("conditions must return a schema object");
4747
- return schema15.resolve(options);
4746
+ if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
4747
+ return schema16.resolve(options);
4748
4748
  }
4749
4749
  };
4750
4750
  var prefixes = {
@@ -4814,7 +4814,7 @@ function createValidation(config) {
4814
4814
  path = "",
4815
4815
  options,
4816
4816
  originalValue,
4817
- schema: schema15
4817
+ schema: schema16
4818
4818
  }, panic, next) {
4819
4819
  const {
4820
4820
  name,
@@ -4826,8 +4826,8 @@ function createValidation(config) {
4826
4826
  let {
4827
4827
  parent,
4828
4828
  context,
4829
- abortEarly = schema15.spec.abortEarly,
4830
- disableStackTrace = schema15.spec.disableStackTrace
4829
+ abortEarly = schema16.spec.abortEarly,
4830
+ disableStackTrace = schema16.spec.disableStackTrace
4831
4831
  } = options;
4832
4832
  function resolve(item) {
4833
4833
  return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
@@ -4836,9 +4836,9 @@ function createValidation(config) {
4836
4836
  const nextParams = Object.assign({
4837
4837
  value,
4838
4838
  originalValue,
4839
- label: schema15.spec.label,
4839
+ label: schema16.spec.label,
4840
4840
  path: overrides.path || path,
4841
- spec: schema15.spec,
4841
+ spec: schema16.spec,
4842
4842
  disableStackTrace: overrides.disableStackTrace || disableStackTrace
4843
4843
  }, params, overrides.params);
4844
4844
  for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
@@ -4856,7 +4856,7 @@ function createValidation(config) {
4856
4856
  resolve,
4857
4857
  options,
4858
4858
  originalValue,
4859
- schema: schema15
4859
+ schema: schema16
4860
4860
  };
4861
4861
  const handleResult = (validOrError) => {
4862
4862
  if (ValidationError.isError(validOrError)) invalid(validOrError);
@@ -4890,42 +4890,42 @@ function createValidation(config) {
4890
4890
  validate.OPTIONS = config;
4891
4891
  return validate;
4892
4892
  }
4893
- function getIn(schema15, path, value, context = value) {
4893
+ function getIn(schema16, path, value, context = value) {
4894
4894
  let parent, lastPart, lastPartDebug;
4895
4895
  if (!path) return {
4896
4896
  parent,
4897
4897
  parentPath: path,
4898
- schema: schema15
4898
+ schema: schema16
4899
4899
  };
4900
4900
  (0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
4901
4901
  let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
4902
- schema15 = schema15.resolve({
4902
+ schema16 = schema16.resolve({
4903
4903
  context,
4904
4904
  parent,
4905
4905
  value
4906
4906
  });
4907
- let isTuple = schema15.type === "tuple";
4907
+ let isTuple = schema16.type === "tuple";
4908
4908
  let idx = isArray ? parseInt(part, 10) : 0;
4909
- if (schema15.innerType || isTuple) {
4909
+ if (schema16.innerType || isTuple) {
4910
4910
  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]"`);
4911
4911
  if (value && idx >= value.length) {
4912
4912
  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. `);
4913
4913
  }
4914
4914
  parent = value;
4915
4915
  value = value && value[idx];
4916
- schema15 = isTuple ? schema15.spec.types[idx] : schema15.innerType;
4916
+ schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
4917
4917
  }
4918
4918
  if (!isArray) {
4919
- 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}")`);
4919
+ 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}")`);
4920
4920
  parent = value;
4921
4921
  value = value && value[part];
4922
- schema15 = schema15.fields[part];
4922
+ schema16 = schema16.fields[part];
4923
4923
  }
4924
4924
  lastPart = part;
4925
4925
  lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
4926
4926
  });
4927
4927
  return {
4928
- schema: schema15,
4928
+ schema: schema16,
4929
4929
  parent,
4930
4930
  parentPath: lastPart
4931
4931
  };
@@ -5062,20 +5062,20 @@ var Schema = class {
5062
5062
  this._mutate = before;
5063
5063
  return result;
5064
5064
  }
5065
- concat(schema15) {
5066
- if (!schema15 || schema15 === this) return this;
5067
- if (schema15.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema15.type}`);
5065
+ concat(schema16) {
5066
+ if (!schema16 || schema16 === this) return this;
5067
+ if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
5068
5068
  let base = this;
5069
- let combined = schema15.clone();
5069
+ let combined = schema16.clone();
5070
5070
  const mergedSpec = Object.assign({}, base.spec, combined.spec);
5071
5071
  combined.spec = mergedSpec;
5072
5072
  combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
5073
- combined._whitelist = base._whitelist.merge(schema15._whitelist, schema15._blacklist);
5074
- combined._blacklist = base._blacklist.merge(schema15._blacklist, schema15._whitelist);
5073
+ combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
5074
+ combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
5075
5075
  combined.tests = base.tests;
5076
5076
  combined.exclusiveTests = base.exclusiveTests;
5077
5077
  combined.withMutation((next) => {
5078
- schema15.tests.forEach((fn) => {
5078
+ schema16.tests.forEach((fn) => {
5079
5079
  next.test(fn.OPTIONS);
5080
5080
  });
5081
5081
  });
@@ -5091,15 +5091,15 @@ var Schema = class {
5091
5091
  return this._typeCheck(v);
5092
5092
  }
5093
5093
  resolve(options) {
5094
- let schema15 = this;
5095
- if (schema15.conditions.length) {
5096
- let conditions = schema15.conditions;
5097
- schema15 = schema15.clone();
5098
- schema15.conditions = [];
5099
- schema15 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema15);
5100
- schema15 = schema15.resolve(options);
5094
+ let schema16 = this;
5095
+ if (schema16.conditions.length) {
5096
+ let conditions = schema16.conditions;
5097
+ schema16 = schema16.clone();
5098
+ schema16.conditions = [];
5099
+ schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
5100
+ schema16 = schema16.resolve(options);
5101
5101
  }
5102
- return schema15;
5102
+ return schema16;
5103
5103
  }
5104
5104
  resolveOptions(options) {
5105
5105
  var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
@@ -5253,11 +5253,11 @@ attempted value: ${formattedValue}
5253
5253
  }
5254
5254
  validate(value, options) {
5255
5255
  var _options$disableStack2;
5256
- let schema15 = this.resolve(Object.assign({}, options, {
5256
+ let schema16 = this.resolve(Object.assign({}, options, {
5257
5257
  value
5258
5258
  }));
5259
- let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema15.spec.disableStackTrace;
5260
- return new Promise((resolve, reject) => schema15._validate(value, options, (error, parsed) => {
5259
+ let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
5260
+ return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
5261
5261
  if (ValidationError.isError(error)) error.value = parsed;
5262
5262
  reject(error);
5263
5263
  }, (errors, validated) => {
@@ -5267,12 +5267,12 @@ attempted value: ${formattedValue}
5267
5267
  }
5268
5268
  validateSync(value, options) {
5269
5269
  var _options$disableStack3;
5270
- let schema15 = this.resolve(Object.assign({}, options, {
5270
+ let schema16 = this.resolve(Object.assign({}, options, {
5271
5271
  value
5272
5272
  }));
5273
5273
  let result;
5274
- let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema15.spec.disableStackTrace;
5275
- schema15._validate(value, Object.assign({}, options, {
5274
+ let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
5275
+ schema16._validate(value, Object.assign({}, options, {
5276
5276
  sync: true
5277
5277
  }), (error, parsed) => {
5278
5278
  if (ValidationError.isError(error)) error.value = parsed;
@@ -5306,8 +5306,8 @@ attempted value: ${formattedValue}
5306
5306
  return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
5307
5307
  }
5308
5308
  getDefault(options) {
5309
- let schema15 = this.resolve(options || {});
5310
- return schema15._getDefault(options);
5309
+ let schema16 = this.resolve(options || {});
5310
+ return schema16._getDefault(options);
5311
5311
  }
5312
5312
  default(def) {
5313
5313
  if (arguments.length === 0) {
@@ -5542,9 +5542,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
5542
5542
  const {
5543
5543
  parent,
5544
5544
  parentPath,
5545
- schema: schema15
5545
+ schema: schema16
5546
5546
  } = getIn(this, path, value, options.context);
5547
- return schema15[method](parent && parent[parentPath], Object.assign({}, options, {
5547
+ return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
5548
5548
  parent,
5549
5549
  path
5550
5550
  }));
@@ -5718,7 +5718,7 @@ var StringSchema = class extends Schema {
5718
5718
  });
5719
5719
  }
5720
5720
  required(message) {
5721
- return super.required(message).withMutation((schema15) => schema15.test({
5721
+ return super.required(message).withMutation((schema16) => schema16.test({
5722
5722
  message: message || mixed.required,
5723
5723
  name: "required",
5724
5724
  skipAbsent: true,
@@ -5726,9 +5726,9 @@ var StringSchema = class extends Schema {
5726
5726
  }));
5727
5727
  }
5728
5728
  notRequired() {
5729
- return super.notRequired().withMutation((schema15) => {
5730
- schema15.tests = schema15.tests.filter((t) => t.OPTIONS.name !== "required");
5731
- return schema15;
5729
+ return super.notRequired().withMutation((schema16) => {
5730
+ schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
5731
+ return schema16;
5732
5732
  });
5733
5733
  }
5734
5734
  length(length, message = string.length) {
@@ -6117,28 +6117,28 @@ var parseJson = (value, _, ctx) => {
6117
6117
  }
6118
6118
  return ctx.isType(parsed) ? parsed : value;
6119
6119
  };
6120
- function deepPartial(schema15) {
6121
- if ("fields" in schema15) {
6120
+ function deepPartial(schema16) {
6121
+ if ("fields" in schema16) {
6122
6122
  const partial = {};
6123
- for (const [key, fieldSchema] of Object.entries(schema15.fields)) {
6123
+ for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
6124
6124
  partial[key] = deepPartial(fieldSchema);
6125
6125
  }
6126
- return schema15.setFields(partial);
6126
+ return schema16.setFields(partial);
6127
6127
  }
6128
- if (schema15.type === "array") {
6129
- const nextArray = schema15.optional();
6128
+ if (schema16.type === "array") {
6129
+ const nextArray = schema16.optional();
6130
6130
  if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
6131
6131
  return nextArray;
6132
6132
  }
6133
- if (schema15.type === "tuple") {
6134
- return schema15.optional().clone({
6135
- types: schema15.spec.types.map(deepPartial)
6133
+ if (schema16.type === "tuple") {
6134
+ return schema16.optional().clone({
6135
+ types: schema16.spec.types.map(deepPartial)
6136
6136
  });
6137
6137
  }
6138
- if ("optional" in schema15) {
6139
- return schema15.optional();
6138
+ if ("optional" in schema16) {
6139
+ return schema16.optional();
6140
6140
  }
6141
- return schema15;
6141
+ return schema16;
6142
6142
  }
6143
6143
  var deepHas = (obj, p) => {
6144
6144
  const path = [...(0, import_property_expr.normalizePath)(p)];
@@ -6272,8 +6272,8 @@ var ObjectSchema = class extends Schema {
6272
6272
  next._sortErrors = this._sortErrors;
6273
6273
  return next;
6274
6274
  }
6275
- concat(schema15) {
6276
- let next = super.concat(schema15);
6275
+ concat(schema16) {
6276
+ let next = super.concat(schema16);
6277
6277
  let nextFields = next.fields;
6278
6278
  for (let [field, schemaOrRef] of Object.entries(this.fields)) {
6279
6279
  const target = nextFields[field];
@@ -6281,7 +6281,7 @@ var ObjectSchema = class extends Schema {
6281
6281
  }
6282
6282
  return next.withMutation((s) => (
6283
6283
  // XXX: excludes here is wrong
6284
- s.setFields(nextFields, [...this._excludedEdges, ...schema15._excludedEdges])
6284
+ s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
6285
6285
  ));
6286
6286
  }
6287
6287
  _getDefault(options) {
@@ -6326,8 +6326,8 @@ var ObjectSchema = class extends Schema {
6326
6326
  }
6327
6327
  partial() {
6328
6328
  const partial = {};
6329
- for (const [key, schema15] of Object.entries(this.fields)) {
6330
- partial[key] = "optional" in schema15 && schema15.optional instanceof Function ? schema15.optional() : schema15;
6329
+ for (const [key, schema16] of Object.entries(this.fields)) {
6330
+ partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
6331
6331
  }
6332
6332
  return this.setFields(partial);
6333
6333
  }
@@ -6525,22 +6525,22 @@ var ArraySchema = class extends Schema {
6525
6525
  json() {
6526
6526
  return this.transform(parseJson);
6527
6527
  }
6528
- concat(schema15) {
6529
- let next = super.concat(schema15);
6528
+ concat(schema16) {
6529
+ let next = super.concat(schema16);
6530
6530
  next.innerType = this.innerType;
6531
- if (schema15.innerType)
6531
+ if (schema16.innerType)
6532
6532
  next.innerType = next.innerType ? (
6533
6533
  // @ts-expect-error Lazy doesn't have concat and will break
6534
- next.innerType.concat(schema15.innerType)
6535
- ) : schema15.innerType;
6534
+ next.innerType.concat(schema16.innerType)
6535
+ ) : schema16.innerType;
6536
6536
  return next;
6537
6537
  }
6538
- of(schema15) {
6538
+ of(schema16) {
6539
6539
  let next = this.clone();
6540
- if (!isSchema(schema15)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema15));
6541
- next.innerType = schema15;
6540
+ if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
6541
+ next.innerType = schema16;
6542
6542
  next.spec = Object.assign({}, next.spec, {
6543
- types: schema15
6543
+ types: schema16
6544
6544
  });
6545
6545
  return next;
6546
6546
  }
@@ -6684,7 +6684,7 @@ var TupleSchema = class extends Schema {
6684
6684
  describe(options) {
6685
6685
  const next = (options ? this.resolve(options) : this).clone();
6686
6686
  const base = super.describe(options);
6687
- base.innerType = next.spec.types.map((schema15, index) => {
6687
+ base.innerType = next.spec.types.map((schema16, index) => {
6688
6688
  var _innerOptions;
6689
6689
  let innerOptions = options;
6690
6690
  if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
@@ -6693,7 +6693,7 @@ var TupleSchema = class extends Schema {
6693
6693
  value: innerOptions.value[index]
6694
6694
  });
6695
6695
  }
6696
- return schema15.describe(innerOptions);
6696
+ return schema16.describe(innerOptions);
6697
6697
  });
6698
6698
  return base;
6699
6699
  }
@@ -6710,6 +6710,7 @@ var import_react2 = __toESM(require_react(), 1);
6710
6710
  var React8 = __toESM(require_react(), 1);
6711
6711
  var import_react3 = __toESM(require_react(), 1);
6712
6712
  var import_react4 = __toESM(require_react(), 1);
6713
+ var import_react5 = __toESM(require_react(), 1);
6713
6714
  var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
6714
6715
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
6715
6716
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -8334,6 +8335,7 @@ var USER_FIELDS_FRAGMENT = gql`
8334
8335
  promoCodes
8335
8336
  refreshToken
8336
8337
  role
8338
+ school
8337
8339
  termsAgreement {
8338
8340
  ...TermsAgreementFields
8339
8341
  }
@@ -10172,6 +10174,80 @@ var UPDATE_DAILY_CLUE_MUTATION = gql`
10172
10174
  }
10173
10175
  ${GAME_DOC_FIELDS_FRAGMENT}
10174
10176
  `;
10177
+ var SCHOOL = gql`
10178
+ fragment SchoolFields on SchoolType {
10179
+ _id
10180
+ active
10181
+ contactDetails {
10182
+ ...ContactDetailsFields
10183
+ }
10184
+ location {
10185
+ ...LocationFields
10186
+ }
10187
+ createdAt
10188
+ deletedAt
10189
+ logo {
10190
+ ...ResourceImageFields
10191
+ }
10192
+ name
10193
+ owner {
10194
+ ...OwnerFields
10195
+ }
10196
+ overallPoints
10197
+ region
10198
+ studentCount
10199
+ socialMedia {
10200
+ ...SocialMediaFields
10201
+ }
10202
+ termsAgreement {
10203
+ ...TermsAgreementFields
10204
+ }
10205
+ updatedAt
10206
+ }
10207
+ ${OWNER_FIELDS_FRAGMENT}
10208
+ ${LOCATION_FIELDS_FRAGMENT}
10209
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
10210
+ ${CONTACT_DETAILS_FIELDS_FRAGMENT}
10211
+ ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
10212
+ ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
10213
+ `;
10214
+ var GET_SCHOOL = gql`
10215
+ query getSchool($_id: ID!) {
10216
+ school(_id: $_id) {
10217
+ ...SchoolFields
10218
+ }
10219
+ }
10220
+ ${SCHOOL}
10221
+ `;
10222
+ var GET_SCHOOLS = gql`
10223
+ query getSchools {
10224
+ schools {
10225
+ ...SchoolFields
10226
+ }
10227
+ }
10228
+ ${SCHOOL}
10229
+ `;
10230
+ var CREATE_SCHOOL_MUTATION = gql`
10231
+ mutation createSchool($input: SchoolInputType!) {
10232
+ createSchool(input: $input) {
10233
+ ...SchoolFields
10234
+ }
10235
+ }
10236
+ ${SCHOOL}
10237
+ `;
10238
+ var UPDATE_SCHOOL_MUTATION = gql`
10239
+ mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
10240
+ updateSchool(_id: $_id, input: $input) {
10241
+ ...SchoolFields
10242
+ }
10243
+ }
10244
+ ${SCHOOL}
10245
+ `;
10246
+ var DELETE_SCHOOL_MUTATION = gql`
10247
+ mutation deleteSchool($_id: ID!) {
10248
+ deleteSchool(_id: $_id)
10249
+ }
10250
+ `;
10175
10251
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
10176
10252
  var nzbnRegex = /^94\d{11}$/;
10177
10253
  var normalizedUrlTransform = () => create$6().trim().transform(
@@ -10323,7 +10399,7 @@ var socialMediaSchema = create$3({
10323
10399
  is: (name) => !!name,
10324
10400
  // If name has a value
10325
10401
  then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
10326
- otherwise: (schema15) => schema15.notRequired()
10402
+ otherwise: (schema16) => schema16.notRequired()
10327
10403
  })
10328
10404
  });
10329
10405
  var globalResourceSchema = create$3().shape({
@@ -10399,21 +10475,21 @@ var paymentInfoSchema = create$3({
10399
10475
  ).required("Please select a Payment method"),
10400
10476
  accountHolderName: create$6().when("paymentMethod", {
10401
10477
  is: "bank_transfer",
10402
- then: (schema15) => schema15.required("Account holder name is required for bank transfer").trim(),
10403
- otherwise: (schema15) => schema15.notRequired()
10478
+ then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
10479
+ otherwise: (schema16) => schema16.notRequired()
10404
10480
  }),
10405
10481
  accountNumber: create$6().when("paymentMethod", {
10406
10482
  is: "bank_transfer",
10407
- then: (schema15) => schema15.required("Account number is required for bank transfer").matches(
10483
+ then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
10408
10484
  nzBankAccountRegex,
10409
10485
  "Account number must be in format: XX-XXXX-XXXXXXX-XX"
10410
10486
  ).trim(),
10411
- otherwise: (schema15) => schema15.notRequired()
10487
+ otherwise: (schema16) => schema16.notRequired()
10412
10488
  }),
10413
10489
  link: create$6().when("paymentMethod", {
10414
10490
  is: (val) => val === "paypal" || val === "stripe",
10415
10491
  then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
10416
- otherwise: (schema15) => schema15.notRequired()
10492
+ otherwise: (schema16) => schema16.notRequired()
10417
10493
  })
10418
10494
  });
10419
10495
  var eventInfoSchema = create$3().shape({
@@ -10563,16 +10639,16 @@ var vendorInfoSchema = create$3().shape({
10563
10639
  var userSchema = create$3().shape({
10564
10640
  active: create$7().required("Active is required"),
10565
10641
  email: emailRequiredSchema,
10566
- firstName: create$6().label("First Name").required("First name is required"),
10567
- lastName: create$6().label("Last Name").required("Last name is required"),
10642
+ firstName: create$6().label("First Name").trim().required("First name is required"),
10643
+ lastName: create$6().label("Last Name").trim().required("Last name is required"),
10568
10644
  isTester: create$7().required("Tester status is required"),
10569
10645
  password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
10570
10646
  preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
10571
10647
  confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
10572
10648
  is: (val) => !!val,
10573
10649
  // only necessary if password typed
10574
- then: (schema15) => schema15.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10575
- otherwise: (schema15) => schema15.notRequired()
10650
+ then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10651
+ otherwise: (schema16) => schema16.notRequired()
10576
10652
  }),
10577
10653
  role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
10578
10654
  });
@@ -10643,7 +10719,7 @@ var adSchema = create$3().shape({
10643
10719
  return endDate > now;
10644
10720
  }).when("start", {
10645
10721
  is: (val) => val && val.length > 0,
10646
- then: (schema15) => schema15.test(
10722
+ then: (schema16) => schema16.test(
10647
10723
  "is-after-start",
10648
10724
  "End date must be after start date",
10649
10725
  function(value) {
@@ -10787,6 +10863,15 @@ var contactUsSchema = create$3().shape({
10787
10863
  lastName: create$6().label("Last Name").required("Last name is required"),
10788
10864
  message: create$6().label("Message").required("Message is required")
10789
10865
  });
10866
+ var schoolSchema = create$3().shape({
10867
+ active: create$7().required("Active is required"),
10868
+ contactDetails: contactDetailsSchema,
10869
+ location: locationSchema,
10870
+ name: create$6().trim().required("Name is required"),
10871
+ region: create$6().trim().required("Region is required"),
10872
+ socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
10873
+ 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"))
10874
+ });
10790
10875
  var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
10791
10876
  EnumActivity2["FAVORITE"] = "FAVORITE";
10792
10877
  EnumActivity2["GOING"] = "GOING";
@@ -11548,27 +11633,27 @@ var baseResourceFields = {
11548
11633
  required: false,
11549
11634
  type: [associatesSchema]
11550
11635
  },
11551
- contactDetails: ContactDetailsSchema,
11636
+ contactDetails: { required: false, type: ContactDetailsSchema },
11552
11637
  cover: {
11553
11638
  required: true,
11554
11639
  type: ResourceImageTypeSchema
11555
11640
  },
11556
11641
  deletedAt: { default: null, required: false, type: Date },
11557
11642
  description: { required: true, type: String },
11558
- images: [ResourceImageTypeSchema],
11559
- logo: ResourceImageTypeSchema,
11643
+ images: { required: false, type: [ResourceImageTypeSchema] },
11644
+ logo: { required: false, type: ResourceImageTypeSchema },
11560
11645
  name: { required: true, type: String },
11561
11646
  owner: {
11562
11647
  required: false,
11563
11648
  type: OwnerTypeSchema
11564
11649
  },
11565
- posterUsage: PosterUsageTypeSchema,
11650
+ posterUsage: { required: false, type: PosterUsageTypeSchema },
11566
11651
  promoCodes: { required: false, type: [String] },
11567
11652
  rating: { required: false, type: Number },
11568
11653
  region: { required: true, type: String },
11569
11654
  reviewCount: { required: false, type: Number },
11570
- socialMedia: [SocialMediaTypeSchema],
11571
- termsAgreement: termsAgreementSchema
11655
+ socialMedia: { required: false, type: [SocialMediaTypeSchema] },
11656
+ termsAgreement: { required: true, type: termsAgreementSchema }
11572
11657
  };
11573
11658
 
11574
11659
  // src/mongoose/GoogleImportedMarket.ts
@@ -11821,6 +11906,11 @@ var schema7 = new MongooseSchema11(
11821
11906
  required: true,
11822
11907
  type: String
11823
11908
  },
11909
+ school: {
11910
+ ref: "School",
11911
+ required: false,
11912
+ type: import_mongoose12.default.Schema.Types.ObjectId
11913
+ },
11824
11914
  stripe: {
11825
11915
  required: false,
11826
11916
  type: stripeSchema
@@ -12211,9 +12301,9 @@ var gameDataSchemas = {
12211
12301
  [EnumGameType.DAILY_CLUE]: schemaDailyClue
12212
12302
  };
12213
12303
  var gameDataDefinition = Object.fromEntries(
12214
- Object.entries(gameDataSchemas).map(([key, schema15]) => [
12304
+ Object.entries(gameDataSchemas).map(([key, schema16]) => [
12215
12305
  key,
12216
- { default: null, required: false, type: schema15 }
12306
+ { default: null, required: false, type: schema16 }
12217
12307
  ])
12218
12308
  );
12219
12309
  var gameHistorySchema = new MongooseSchema19(
@@ -12261,6 +12351,34 @@ var schema14 = new MongooseSchema19(
12261
12351
  );
12262
12352
  var GameModel = import_mongoose20.default.models.Game || import_mongoose20.default.model("Game", schema14);
12263
12353
 
12354
+ // src/mongoose/School.ts
12355
+ var import_mongoose21 = __toESM(require("mongoose"));
12356
+ var MongooseSchema20 = import_mongoose21.default.Schema;
12357
+ var schema15 = new MongooseSchema20(
12358
+ {
12359
+ active: { default: false, required: true, type: Boolean },
12360
+ contactDetails: { required: false, type: ContactDetailsSchema },
12361
+ deletedAt: { default: null, required: false, type: Date },
12362
+ location: {
12363
+ required: true,
12364
+ type: locationsSchema
12365
+ },
12366
+ logo: { required: false, type: ResourceImageTypeSchema },
12367
+ name: { required: true, type: String },
12368
+ overallPoints: { default: 0, required: false, type: Number },
12369
+ owner: {
12370
+ required: true,
12371
+ type: OwnerTypeSchema
12372
+ },
12373
+ region: { required: true, type: String },
12374
+ socialMedia: { required: false, type: [SocialMediaTypeSchema] },
12375
+ studentCount: { required: true, type: Number },
12376
+ termsAgreement: { required: true, type: termsAgreementSchema }
12377
+ },
12378
+ { timestamps: true }
12379
+ );
12380
+ var SchoolModel = import_mongoose21.default.models.School || import_mongoose21.default.model("School", schema15);
12381
+
12264
12382
  // src/service/updateAdStatus.ts
12265
12383
  async function updateAdStatuses() {
12266
12384
  const now = /* @__PURE__ */ new Date();
@@ -12354,12 +12472,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
12354
12472
  }
12355
12473
 
12356
12474
  // src/service/objectIdToString.ts
12357
- var import_mongoose23 = __toESM(require("mongoose"));
12475
+ var import_mongoose24 = __toESM(require("mongoose"));
12358
12476
  function convertObjectIdsToStrings(obj) {
12359
12477
  if (obj === null || obj === void 0) {
12360
12478
  return obj;
12361
12479
  }
12362
- if (obj instanceof import_mongoose23.default.Types.ObjectId) {
12480
+ if (obj instanceof import_mongoose24.default.Types.ObjectId) {
12363
12481
  return obj.toString();
12364
12482
  }
12365
12483
  if (Array.isArray(obj)) {