@eeplatform/basic-edu 1.4.1 → 1.4.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eeplatform/basic-edu
2
2
 
3
+ ## 1.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e84952a: Parse createdBy, updatedBy, and deletedBy to ObjectId
8
+
3
9
  ## 1.4.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -105,9 +105,9 @@ type TLearner = {
105
105
  createdAt?: Date | string;
106
106
  updatedAt?: Date | string;
107
107
  deletedAt?: Date | string;
108
- createdBy?: string;
109
- updatedBy?: string;
110
- deletedBy?: string;
108
+ createdBy?: string | ObjectId;
109
+ updatedBy?: string | ObjectId;
110
+ deletedBy?: string | ObjectId;
111
111
  };
112
112
  type TLearnerInfo = {
113
113
  psaBirthCertificateNo?: string;
@@ -195,9 +195,9 @@ declare function MLearner(value: TLearner): {
195
195
  createdAt: string | Date;
196
196
  updatedAt: string | Date;
197
197
  deletedAt: string | Date;
198
- createdBy: string;
199
- updatedBy: string;
200
- deletedBy: string;
198
+ createdBy: string | ObjectId;
199
+ updatedBy: string | ObjectId;
200
+ deletedBy: string | ObjectId;
201
201
  };
202
202
 
203
203
  declare function useEnrollmentRepo(): {
package/dist/index.js CHANGED
@@ -1986,6 +1986,27 @@ function MLearner(value) {
1986
1986
  throw new import_nodejs_utils4.BadRequestError("Invalid school format");
1987
1987
  }
1988
1988
  }
1989
+ if (value.createdBy && typeof value.createdBy === "string") {
1990
+ try {
1991
+ value.createdBy = new import_mongodb3.ObjectId(value.createdBy);
1992
+ } catch (error2) {
1993
+ throw new import_nodejs_utils4.BadRequestError("Invalid createdBy format");
1994
+ }
1995
+ }
1996
+ if (value.updatedBy && typeof value.updatedBy === "string") {
1997
+ try {
1998
+ value.updatedBy = new import_mongodb3.ObjectId(value.updatedBy);
1999
+ } catch (error2) {
2000
+ throw new import_nodejs_utils4.BadRequestError("Invalid updatedBy format");
2001
+ }
2002
+ }
2003
+ if (value.deletedBy && typeof value.deletedBy === "string") {
2004
+ try {
2005
+ value.deletedBy = new import_mongodb3.ObjectId(value.deletedBy);
2006
+ } catch (error2) {
2007
+ throw new import_nodejs_utils4.BadRequestError("Invalid deletedBy format");
2008
+ }
2009
+ }
1989
2010
  return {
1990
2011
  _id: value._id ?? void 0,
1991
2012
  region: value.region,