@goweekdays/core 2.15.5 → 2.15.6
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 +6 -0
- package/dist/index.js +37 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +268 -278
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -474,9 +474,9 @@ function useAuthService() {
|
|
|
474
474
|
// src/resources/auth/auth.controller.ts
|
|
475
475
|
import Joi55 from "joi";
|
|
476
476
|
import {
|
|
477
|
-
AppError as
|
|
477
|
+
AppError as AppError30,
|
|
478
478
|
BadRequestError as BadRequestError59,
|
|
479
|
-
InternalServerError as
|
|
479
|
+
InternalServerError as InternalServerError30,
|
|
480
480
|
logger as logger31
|
|
481
481
|
} from "@goweekdays/utils";
|
|
482
482
|
|
|
@@ -488,9 +488,9 @@ import {
|
|
|
488
488
|
getDirectory as getDirectory2,
|
|
489
489
|
BadRequestError as BadRequestError58,
|
|
490
490
|
NotFoundError as NotFoundError3,
|
|
491
|
-
InternalServerError as
|
|
491
|
+
InternalServerError as InternalServerError29,
|
|
492
492
|
useAtlas as useAtlas6,
|
|
493
|
-
AppError as
|
|
493
|
+
AppError as AppError29
|
|
494
494
|
} from "@goweekdays/utils";
|
|
495
495
|
|
|
496
496
|
// src/resources/verification/verification.model.ts
|
|
@@ -885,9 +885,9 @@ var APP_ORG = process.env.APP_ORG || "http://localhost/organizations/create";
|
|
|
885
885
|
|
|
886
886
|
// src/resources/user/user.service.ts
|
|
887
887
|
import {
|
|
888
|
-
AppError as
|
|
888
|
+
AppError as AppError27,
|
|
889
889
|
BadRequestError as BadRequestError56,
|
|
890
|
-
InternalServerError as
|
|
890
|
+
InternalServerError as InternalServerError27,
|
|
891
891
|
NotFoundError as NotFoundError2,
|
|
892
892
|
hashPassword,
|
|
893
893
|
logger as logger29,
|
|
@@ -4741,10 +4741,11 @@ function useOrgRepo() {
|
|
|
4741
4741
|
|
|
4742
4742
|
// src/resources/organization/organization.service.ts
|
|
4743
4743
|
import {
|
|
4744
|
+
AppError as AppError26,
|
|
4744
4745
|
BadRequestError as BadRequestError54,
|
|
4745
4746
|
compileHandlebar,
|
|
4746
4747
|
getDirectory,
|
|
4747
|
-
|
|
4748
|
+
InternalServerError as InternalServerError26,
|
|
4748
4749
|
useAtlas as useAtlas4,
|
|
4749
4750
|
useMailer
|
|
4750
4751
|
} from "@goweekdays/utils";
|
|
@@ -11005,22 +11006,23 @@ function useOrgService() {
|
|
|
11005
11006
|
},
|
|
11006
11007
|
filePath
|
|
11007
11008
|
});
|
|
11008
|
-
mailer.sendMail({
|
|
11009
|
+
await mailer.sendMail({
|
|
11009
11010
|
to: verification.email,
|
|
11010
11011
|
subject: "Welcome to GoWeekdays - Your Organization is Ready",
|
|
11011
11012
|
from: `"GoWeekdays" <support@goweekdays.com>`,
|
|
11012
11013
|
html: emailContent
|
|
11013
|
-
}).catch((error2) => {
|
|
11014
|
-
logger28.log({
|
|
11015
|
-
level: "error",
|
|
11016
|
-
message: `Error sending user invite email: ${error2}`
|
|
11017
|
-
});
|
|
11018
11014
|
});
|
|
11019
11015
|
await session?.commitTransaction();
|
|
11020
11016
|
return "Successfully created organization with verification.";
|
|
11021
11017
|
} catch (error2) {
|
|
11022
11018
|
await session?.abortTransaction();
|
|
11023
|
-
|
|
11019
|
+
if (error2 instanceof AppError26) {
|
|
11020
|
+
throw error2;
|
|
11021
|
+
} else {
|
|
11022
|
+
throw new InternalServerError26(
|
|
11023
|
+
"Failed to create organization with verification."
|
|
11024
|
+
);
|
|
11025
|
+
}
|
|
11024
11026
|
} finally {
|
|
11025
11027
|
await session?.endSession();
|
|
11026
11028
|
}
|
|
@@ -11129,22 +11131,23 @@ function useOrgService() {
|
|
|
11129
11131
|
},
|
|
11130
11132
|
filePath
|
|
11131
11133
|
});
|
|
11132
|
-
mailer.sendMail({
|
|
11134
|
+
await mailer.sendMail({
|
|
11133
11135
|
to: verification.email,
|
|
11134
11136
|
subject: "Welcome to GoWeekdays - Your Organization is Ready",
|
|
11135
11137
|
from: `"GoWeekdays" <support@goweekdays.com>`,
|
|
11136
11138
|
html: emailContent
|
|
11137
|
-
}).catch((error2) => {
|
|
11138
|
-
logger28.log({
|
|
11139
|
-
level: "error",
|
|
11140
|
-
message: `Error sending user invite email: ${error2}`
|
|
11141
|
-
});
|
|
11142
11139
|
});
|
|
11143
11140
|
await session?.commitTransaction();
|
|
11144
11141
|
return "Successfully created organization with verification.";
|
|
11145
11142
|
} catch (error2) {
|
|
11146
11143
|
await session?.abortTransaction();
|
|
11147
|
-
|
|
11144
|
+
if (error2 instanceof AppError26) {
|
|
11145
|
+
throw error2;
|
|
11146
|
+
} else {
|
|
11147
|
+
throw new InternalServerError26(
|
|
11148
|
+
"Failed to create organization with verification."
|
|
11149
|
+
);
|
|
11150
|
+
}
|
|
11148
11151
|
} finally {
|
|
11149
11152
|
await session?.endSession();
|
|
11150
11153
|
}
|
|
@@ -11455,10 +11458,10 @@ function useUserService() {
|
|
|
11455
11458
|
});
|
|
11456
11459
|
return insertedId;
|
|
11457
11460
|
} catch (error) {
|
|
11458
|
-
if (error instanceof
|
|
11461
|
+
if (error instanceof AppError27) {
|
|
11459
11462
|
throw error;
|
|
11460
11463
|
} else {
|
|
11461
|
-
throw new
|
|
11464
|
+
throw new InternalServerError27(`Error creating user: ${error}`);
|
|
11462
11465
|
}
|
|
11463
11466
|
}
|
|
11464
11467
|
}
|
|
@@ -11535,10 +11538,10 @@ function useUserService() {
|
|
|
11535
11538
|
return userId;
|
|
11536
11539
|
} catch (error) {
|
|
11537
11540
|
await session?.abortTransaction();
|
|
11538
|
-
if (error instanceof
|
|
11541
|
+
if (error instanceof AppError27) {
|
|
11539
11542
|
throw error;
|
|
11540
11543
|
} else {
|
|
11541
|
-
throw new
|
|
11544
|
+
throw new InternalServerError27("Failed to create user by invite.");
|
|
11542
11545
|
}
|
|
11543
11546
|
} finally {
|
|
11544
11547
|
session?.endSession();
|
|
@@ -11604,11 +11607,11 @@ function useUserService() {
|
|
|
11604
11607
|
try {
|
|
11605
11608
|
hashedPassword = await hashPassword(value.newPassword);
|
|
11606
11609
|
} catch (error) {
|
|
11607
|
-
throw new
|
|
11610
|
+
throw new InternalServerError27(`Error hashing password: ${error}`);
|
|
11608
11611
|
}
|
|
11609
11612
|
const session = useAtlas5.getClient()?.startSession();
|
|
11610
11613
|
if (!session) {
|
|
11611
|
-
throw new
|
|
11614
|
+
throw new InternalServerError27("Failed to start database session.");
|
|
11612
11615
|
}
|
|
11613
11616
|
try {
|
|
11614
11617
|
session.startTransaction();
|
|
@@ -11635,10 +11638,10 @@ function useUserService() {
|
|
|
11635
11638
|
return "Successfully reset password.";
|
|
11636
11639
|
} catch (error) {
|
|
11637
11640
|
await session.abortTransaction();
|
|
11638
|
-
if (error instanceof
|
|
11641
|
+
if (error instanceof AppError27) {
|
|
11639
11642
|
throw error;
|
|
11640
11643
|
}
|
|
11641
|
-
throw new
|
|
11644
|
+
throw new InternalServerError27("Failed to reset password.");
|
|
11642
11645
|
}
|
|
11643
11646
|
}
|
|
11644
11647
|
const { updateName: updateMemberName } = useMemberRepo();
|
|
@@ -11756,9 +11759,9 @@ function useUserService() {
|
|
|
11756
11759
|
|
|
11757
11760
|
// src/resources/user/user.controller.ts
|
|
11758
11761
|
import {
|
|
11759
|
-
AppError as
|
|
11762
|
+
AppError as AppError28,
|
|
11760
11763
|
BadRequestError as BadRequestError57,
|
|
11761
|
-
InternalServerError as
|
|
11764
|
+
InternalServerError as InternalServerError28
|
|
11762
11765
|
} from "@goweekdays/utils";
|
|
11763
11766
|
import Joi53 from "joi";
|
|
11764
11767
|
function useUserController() {
|
|
@@ -11903,10 +11906,10 @@ function useUserController() {
|
|
|
11903
11906
|
res.json({ message: "Successfully updated profile picture." });
|
|
11904
11907
|
return;
|
|
11905
11908
|
} catch (error2) {
|
|
11906
|
-
if (error2 instanceof
|
|
11909
|
+
if (error2 instanceof AppError28) {
|
|
11907
11910
|
next(error2);
|
|
11908
11911
|
} else {
|
|
11909
|
-
next(new
|
|
11912
|
+
next(new InternalServerError28(error2));
|
|
11910
11913
|
}
|
|
11911
11914
|
}
|
|
11912
11915
|
}
|
|
@@ -12042,16 +12045,11 @@ function useVerificationService() {
|
|
|
12042
12045
|
},
|
|
12043
12046
|
filePath: filePath2
|
|
12044
12047
|
});
|
|
12045
|
-
mailer.sendMail({
|
|
12048
|
+
await mailer.sendMail({
|
|
12046
12049
|
to: email,
|
|
12047
12050
|
subject: "Member Invite",
|
|
12048
12051
|
html: emailContent2,
|
|
12049
12052
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12050
|
-
}).catch((error) => {
|
|
12051
|
-
logger30.log({
|
|
12052
|
-
level: "error",
|
|
12053
|
-
message: `Error sending user invite email: ${error}`
|
|
12054
|
-
});
|
|
12055
12053
|
});
|
|
12056
12054
|
return res2;
|
|
12057
12055
|
}
|
|
@@ -12064,20 +12062,19 @@ function useVerificationService() {
|
|
|
12064
12062
|
},
|
|
12065
12063
|
filePath
|
|
12066
12064
|
});
|
|
12067
|
-
mailer.sendMail({
|
|
12065
|
+
await mailer.sendMail({
|
|
12068
12066
|
to: email,
|
|
12069
12067
|
subject: "User Invite",
|
|
12070
12068
|
html: emailContent,
|
|
12071
12069
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12072
|
-
}).catch((error) => {
|
|
12073
|
-
logger30.log({
|
|
12074
|
-
level: "error",
|
|
12075
|
-
message: `Error sending user invite email: ${error}`
|
|
12076
|
-
});
|
|
12077
12070
|
});
|
|
12078
12071
|
return res;
|
|
12079
12072
|
} catch (error) {
|
|
12080
|
-
|
|
12073
|
+
if (error instanceof AppError29) {
|
|
12074
|
+
throw error;
|
|
12075
|
+
} else {
|
|
12076
|
+
throw new InternalServerError29("Failed to create user invitation.");
|
|
12077
|
+
}
|
|
12081
12078
|
}
|
|
12082
12079
|
}
|
|
12083
12080
|
async function createForgetPassword(email) {
|
|
@@ -12099,20 +12096,19 @@ function useVerificationService() {
|
|
|
12099
12096
|
},
|
|
12100
12097
|
filePath
|
|
12101
12098
|
});
|
|
12102
|
-
mailer.sendMail({
|
|
12099
|
+
await mailer.sendMail({
|
|
12103
12100
|
to: email,
|
|
12104
12101
|
subject: "Forget Password",
|
|
12105
12102
|
from: `"GoWeekdays" <support@goweekdays.com>`,
|
|
12106
12103
|
html: emailContent
|
|
12107
|
-
}).catch((error) => {
|
|
12108
|
-
logger30.log({
|
|
12109
|
-
level: "error",
|
|
12110
|
-
message: `Error sending forget password email: ${error}`
|
|
12111
|
-
});
|
|
12112
12104
|
});
|
|
12113
12105
|
return "Successfully created a link to reset password. Please check your email.";
|
|
12114
12106
|
} catch (error) {
|
|
12115
|
-
|
|
12107
|
+
if (error instanceof AppError29) {
|
|
12108
|
+
throw error;
|
|
12109
|
+
} else {
|
|
12110
|
+
throw new InternalServerError29("Failed to create forget password link.");
|
|
12111
|
+
}
|
|
12116
12112
|
}
|
|
12117
12113
|
}
|
|
12118
12114
|
async function getById(id) {
|
|
@@ -12248,7 +12244,7 @@ function useVerificationService() {
|
|
|
12248
12244
|
try {
|
|
12249
12245
|
await updateStatusById(id, "cancelled");
|
|
12250
12246
|
} catch (error) {
|
|
12251
|
-
throw new
|
|
12247
|
+
throw new InternalServerError29(
|
|
12252
12248
|
`Error cancelling user invitation: ${error}`
|
|
12253
12249
|
);
|
|
12254
12250
|
}
|
|
@@ -12289,20 +12285,19 @@ function useVerificationService() {
|
|
|
12289
12285
|
},
|
|
12290
12286
|
filePath
|
|
12291
12287
|
});
|
|
12292
|
-
mailer.sendMail({
|
|
12288
|
+
await mailer.sendMail({
|
|
12293
12289
|
to: email,
|
|
12294
12290
|
subject: "Sign Up Verification",
|
|
12295
12291
|
html: emailContent,
|
|
12296
12292
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12297
|
-
}).catch((error) => {
|
|
12298
|
-
logger30.log({
|
|
12299
|
-
level: "error",
|
|
12300
|
-
message: `Error sending user invite email: ${error}`
|
|
12301
|
-
});
|
|
12302
12293
|
});
|
|
12303
12294
|
return res;
|
|
12304
12295
|
} catch (error) {
|
|
12305
|
-
|
|
12296
|
+
if (error instanceof AppError29) {
|
|
12297
|
+
throw error;
|
|
12298
|
+
} else {
|
|
12299
|
+
throw new InternalServerError29("Failed to create sign up verification.");
|
|
12300
|
+
}
|
|
12306
12301
|
}
|
|
12307
12302
|
}
|
|
12308
12303
|
const { getByOrg } = useSubscriptionRepo();
|
|
@@ -12381,16 +12376,11 @@ function useVerificationService() {
|
|
|
12381
12376
|
},
|
|
12382
12377
|
filePath: filePath2
|
|
12383
12378
|
});
|
|
12384
|
-
mailer.sendMail({
|
|
12379
|
+
await mailer.sendMail({
|
|
12385
12380
|
to: value.email,
|
|
12386
12381
|
subject: "Member Invite",
|
|
12387
12382
|
html: emailContent2,
|
|
12388
12383
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12389
|
-
}).catch((error2) => {
|
|
12390
|
-
logger30.log({
|
|
12391
|
-
level: "error",
|
|
12392
|
-
message: `Error sending user invite email: ${error2}`
|
|
12393
|
-
});
|
|
12394
12384
|
});
|
|
12395
12385
|
return verificationId2;
|
|
12396
12386
|
}
|
|
@@ -12403,7 +12393,7 @@ function useVerificationService() {
|
|
|
12403
12393
|
},
|
|
12404
12394
|
filePath
|
|
12405
12395
|
});
|
|
12406
|
-
mailer.sendMail({
|
|
12396
|
+
await mailer.sendMail({
|
|
12407
12397
|
to: value.email,
|
|
12408
12398
|
subject: "User Invite",
|
|
12409
12399
|
html: emailContent,
|
|
@@ -12416,10 +12406,10 @@ function useVerificationService() {
|
|
|
12416
12406
|
});
|
|
12417
12407
|
return verificationId;
|
|
12418
12408
|
} catch (error2) {
|
|
12419
|
-
if (error2 instanceof
|
|
12409
|
+
if (error2 instanceof AppError29) {
|
|
12420
12410
|
throw error2;
|
|
12421
12411
|
} else {
|
|
12422
|
-
throw new
|
|
12412
|
+
throw new InternalServerError29("Failed to invite member.");
|
|
12423
12413
|
}
|
|
12424
12414
|
}
|
|
12425
12415
|
}
|
|
@@ -12442,10 +12432,10 @@ function useVerificationService() {
|
|
|
12442
12432
|
await _updateStatusById(id, "cancelled");
|
|
12443
12433
|
return "Successfully cancelled the invitation.";
|
|
12444
12434
|
} catch (error2) {
|
|
12445
|
-
if (error2 instanceof
|
|
12435
|
+
if (error2 instanceof AppError29) {
|
|
12446
12436
|
throw error2;
|
|
12447
12437
|
} else {
|
|
12448
|
-
throw new
|
|
12438
|
+
throw new InternalServerError29("Failed to cancel the invitation.");
|
|
12449
12439
|
}
|
|
12450
12440
|
}
|
|
12451
12441
|
}
|
|
@@ -12483,10 +12473,10 @@ function useVerificationService() {
|
|
|
12483
12473
|
});
|
|
12484
12474
|
return "Successfully created a link to reset password. Please check your email.";
|
|
12485
12475
|
} catch (error2) {
|
|
12486
|
-
if (error2 instanceof
|
|
12476
|
+
if (error2 instanceof AppError29) {
|
|
12487
12477
|
throw error2;
|
|
12488
12478
|
} else {
|
|
12489
|
-
throw new
|
|
12479
|
+
throw new InternalServerError29(
|
|
12490
12480
|
"Failed to process forget password request."
|
|
12491
12481
|
);
|
|
12492
12482
|
}
|
|
@@ -12544,10 +12534,10 @@ function useVerificationService() {
|
|
|
12544
12534
|
message: `Error processing organization setup fee: ${error}`
|
|
12545
12535
|
});
|
|
12546
12536
|
await session?.abortTransaction();
|
|
12547
|
-
if (error instanceof
|
|
12537
|
+
if (error instanceof AppError29) {
|
|
12548
12538
|
throw error;
|
|
12549
12539
|
}
|
|
12550
|
-
throw new
|
|
12540
|
+
throw new InternalServerError29(
|
|
12551
12541
|
"Failed to process organization setup fee."
|
|
12552
12542
|
);
|
|
12553
12543
|
} finally {
|
|
@@ -12604,10 +12594,10 @@ function useVerificationService() {
|
|
|
12604
12594
|
message: `Error inviting organization: ${error2}`
|
|
12605
12595
|
});
|
|
12606
12596
|
await session?.abortTransaction();
|
|
12607
|
-
if (error2 instanceof
|
|
12597
|
+
if (error2 instanceof AppError29) {
|
|
12608
12598
|
throw error2;
|
|
12609
12599
|
}
|
|
12610
|
-
throw new
|
|
12600
|
+
throw new InternalServerError29(
|
|
12611
12601
|
"Failed to process organization setup fee."
|
|
12612
12602
|
);
|
|
12613
12603
|
} finally {
|
|
@@ -12663,10 +12653,10 @@ function useAuthController() {
|
|
|
12663
12653
|
level: "error",
|
|
12664
12654
|
message: `Error during login: ${error2.message}`
|
|
12665
12655
|
});
|
|
12666
|
-
if (error2 instanceof
|
|
12656
|
+
if (error2 instanceof AppError30) {
|
|
12667
12657
|
next(error2);
|
|
12668
12658
|
} else {
|
|
12669
|
-
next(new
|
|
12659
|
+
next(new InternalServerError30("An unexpected error occurred"));
|
|
12670
12660
|
}
|
|
12671
12661
|
return;
|
|
12672
12662
|
}
|
|
@@ -12681,10 +12671,10 @@ function useAuthController() {
|
|
|
12681
12671
|
await useAuthService().logout(user);
|
|
12682
12672
|
res.json({ message: "Logged out successfully" });
|
|
12683
12673
|
} catch (error) {
|
|
12684
|
-
if (error instanceof
|
|
12674
|
+
if (error instanceof AppError30) {
|
|
12685
12675
|
next(error);
|
|
12686
12676
|
} else {
|
|
12687
|
-
next(new
|
|
12677
|
+
next(new InternalServerError30("An unexpected error occurred"));
|
|
12688
12678
|
}
|
|
12689
12679
|
}
|
|
12690
12680
|
}
|
|
@@ -12812,9 +12802,9 @@ function MBuildingUnit(value) {
|
|
|
12812
12802
|
|
|
12813
12803
|
// src/resources/building/building.repository.ts
|
|
12814
12804
|
import {
|
|
12815
|
-
AppError as
|
|
12805
|
+
AppError as AppError31,
|
|
12816
12806
|
BadRequestError as BadRequestError61,
|
|
12817
|
-
InternalServerError as
|
|
12807
|
+
InternalServerError as InternalServerError31,
|
|
12818
12808
|
logger as logger33,
|
|
12819
12809
|
makeCacheKey as makeCacheKey19,
|
|
12820
12810
|
paginate as paginate17,
|
|
@@ -12846,7 +12836,7 @@ function useBuildingRepo() {
|
|
|
12846
12836
|
level: "error",
|
|
12847
12837
|
message: error.message
|
|
12848
12838
|
});
|
|
12849
|
-
if (error instanceof
|
|
12839
|
+
if (error instanceof AppError31) {
|
|
12850
12840
|
throw error;
|
|
12851
12841
|
} else {
|
|
12852
12842
|
const isDuplicated = error.message.includes("duplicate");
|
|
@@ -12876,7 +12866,7 @@ function useBuildingRepo() {
|
|
|
12876
12866
|
level: "error",
|
|
12877
12867
|
message: error.message
|
|
12878
12868
|
});
|
|
12879
|
-
if (error instanceof
|
|
12869
|
+
if (error instanceof AppError31) {
|
|
12880
12870
|
throw error;
|
|
12881
12871
|
} else {
|
|
12882
12872
|
throw new Error("Failed to update building.");
|
|
@@ -12988,10 +12978,10 @@ function useBuildingRepo() {
|
|
|
12988
12978
|
});
|
|
12989
12979
|
return result;
|
|
12990
12980
|
} catch (error) {
|
|
12991
|
-
if (error instanceof
|
|
12981
|
+
if (error instanceof AppError31) {
|
|
12992
12982
|
throw error;
|
|
12993
12983
|
} else {
|
|
12994
|
-
throw new
|
|
12984
|
+
throw new InternalServerError31("Failed to get building.");
|
|
12995
12985
|
}
|
|
12996
12986
|
}
|
|
12997
12987
|
}
|
|
@@ -13013,10 +13003,10 @@ function useBuildingRepo() {
|
|
|
13013
13003
|
level: "error",
|
|
13014
13004
|
message: error.message
|
|
13015
13005
|
});
|
|
13016
|
-
if (error instanceof
|
|
13006
|
+
if (error instanceof AppError31) {
|
|
13017
13007
|
throw error;
|
|
13018
13008
|
} else {
|
|
13019
|
-
throw new
|
|
13009
|
+
throw new InternalServerError31("Failed to delete building.");
|
|
13020
13010
|
}
|
|
13021
13011
|
}
|
|
13022
13012
|
}
|
|
@@ -13035,9 +13025,9 @@ import { BadRequestError as BadRequestError63, NotFoundError as NotFoundError4,
|
|
|
13035
13025
|
|
|
13036
13026
|
// src/resources/building/building-unit.repository.ts
|
|
13037
13027
|
import {
|
|
13038
|
-
AppError as
|
|
13028
|
+
AppError as AppError32,
|
|
13039
13029
|
BadRequestError as BadRequestError62,
|
|
13040
|
-
InternalServerError as
|
|
13030
|
+
InternalServerError as InternalServerError32,
|
|
13041
13031
|
logger as logger34,
|
|
13042
13032
|
makeCacheKey as makeCacheKey20,
|
|
13043
13033
|
paginate as paginate18,
|
|
@@ -13083,7 +13073,7 @@ function useBuildingUnitRepo() {
|
|
|
13083
13073
|
level: "error",
|
|
13084
13074
|
message: error.message
|
|
13085
13075
|
});
|
|
13086
|
-
if (error instanceof
|
|
13076
|
+
if (error instanceof AppError32) {
|
|
13087
13077
|
throw error;
|
|
13088
13078
|
} else {
|
|
13089
13079
|
throw new Error("Failed to create building unit.");
|
|
@@ -13113,7 +13103,7 @@ function useBuildingUnitRepo() {
|
|
|
13113
13103
|
level: "error",
|
|
13114
13104
|
message: error2.message
|
|
13115
13105
|
});
|
|
13116
|
-
if (error2 instanceof
|
|
13106
|
+
if (error2 instanceof AppError32) {
|
|
13117
13107
|
throw error2;
|
|
13118
13108
|
} else {
|
|
13119
13109
|
throw new Error("Failed to create building unit.");
|
|
@@ -13143,7 +13133,7 @@ function useBuildingUnitRepo() {
|
|
|
13143
13133
|
level: "error",
|
|
13144
13134
|
message: error2.message
|
|
13145
13135
|
});
|
|
13146
|
-
if (error2 instanceof
|
|
13136
|
+
if (error2 instanceof AppError32) {
|
|
13147
13137
|
throw error2;
|
|
13148
13138
|
} else {
|
|
13149
13139
|
throw new Error("Failed to update building unit.");
|
|
@@ -13270,10 +13260,10 @@ function useBuildingUnitRepo() {
|
|
|
13270
13260
|
});
|
|
13271
13261
|
return result;
|
|
13272
13262
|
} catch (error) {
|
|
13273
|
-
if (error instanceof
|
|
13263
|
+
if (error instanceof AppError32) {
|
|
13274
13264
|
throw error;
|
|
13275
13265
|
} else {
|
|
13276
|
-
throw new
|
|
13266
|
+
throw new InternalServerError32("Failed to get building unit.");
|
|
13277
13267
|
}
|
|
13278
13268
|
}
|
|
13279
13269
|
}
|
|
@@ -13314,10 +13304,10 @@ function useBuildingUnitRepo() {
|
|
|
13314
13304
|
});
|
|
13315
13305
|
return result;
|
|
13316
13306
|
} catch (error) {
|
|
13317
|
-
if (error instanceof
|
|
13307
|
+
if (error instanceof AppError32) {
|
|
13318
13308
|
throw error;
|
|
13319
13309
|
} else {
|
|
13320
|
-
throw new
|
|
13310
|
+
throw new InternalServerError32("Failed to get building unit.");
|
|
13321
13311
|
}
|
|
13322
13312
|
}
|
|
13323
13313
|
}
|
|
@@ -13356,10 +13346,10 @@ function useBuildingUnitRepo() {
|
|
|
13356
13346
|
});
|
|
13357
13347
|
return result;
|
|
13358
13348
|
} catch (error) {
|
|
13359
|
-
if (error instanceof
|
|
13349
|
+
if (error instanceof AppError32) {
|
|
13360
13350
|
throw error;
|
|
13361
13351
|
} else {
|
|
13362
|
-
throw new
|
|
13352
|
+
throw new InternalServerError32("Failed to get building unit.");
|
|
13363
13353
|
}
|
|
13364
13354
|
}
|
|
13365
13355
|
}
|
|
@@ -13382,7 +13372,7 @@ function useBuildingUnitRepo() {
|
|
|
13382
13372
|
level: "error",
|
|
13383
13373
|
message: error.message
|
|
13384
13374
|
});
|
|
13385
|
-
if (error instanceof
|
|
13375
|
+
if (error instanceof AppError32) {
|
|
13386
13376
|
throw error;
|
|
13387
13377
|
} else {
|
|
13388
13378
|
throw new Error("Failed to deleted room/facility.");
|
|
@@ -14014,9 +14004,9 @@ function useFileService() {
|
|
|
14014
14004
|
|
|
14015
14005
|
// src/resources/file/file.controller.ts
|
|
14016
14006
|
import {
|
|
14017
|
-
AppError as
|
|
14007
|
+
AppError as AppError33,
|
|
14018
14008
|
BadRequestError as BadRequestError67,
|
|
14019
|
-
InternalServerError as
|
|
14009
|
+
InternalServerError as InternalServerError33
|
|
14020
14010
|
} from "@goweekdays/utils";
|
|
14021
14011
|
import Joi59 from "joi";
|
|
14022
14012
|
function useFileController() {
|
|
@@ -14031,10 +14021,10 @@ function useFileController() {
|
|
|
14031
14021
|
res.json({ message: "Successfully uploaded file", id });
|
|
14032
14022
|
return;
|
|
14033
14023
|
} catch (error) {
|
|
14034
|
-
if (error instanceof
|
|
14024
|
+
if (error instanceof AppError33) {
|
|
14035
14025
|
next(error);
|
|
14036
14026
|
} else {
|
|
14037
|
-
next(new
|
|
14027
|
+
next(new InternalServerError33(error));
|
|
14038
14028
|
}
|
|
14039
14029
|
}
|
|
14040
14030
|
}
|
|
@@ -14050,10 +14040,10 @@ function useFileController() {
|
|
|
14050
14040
|
res.json({ message });
|
|
14051
14041
|
return;
|
|
14052
14042
|
} catch (error2) {
|
|
14053
|
-
if (error2 instanceof
|
|
14043
|
+
if (error2 instanceof AppError33) {
|
|
14054
14044
|
next(error2);
|
|
14055
14045
|
} else {
|
|
14056
|
-
next(new
|
|
14046
|
+
next(new InternalServerError33(error2));
|
|
14057
14047
|
}
|
|
14058
14048
|
}
|
|
14059
14049
|
}
|
|
@@ -14065,9 +14055,9 @@ function useFileController() {
|
|
|
14065
14055
|
|
|
14066
14056
|
// src/resources/options/option.repository.ts
|
|
14067
14057
|
import {
|
|
14068
|
-
AppError as
|
|
14058
|
+
AppError as AppError34,
|
|
14069
14059
|
BadRequestError as BadRequestError69,
|
|
14070
|
-
InternalServerError as
|
|
14060
|
+
InternalServerError as InternalServerError34,
|
|
14071
14061
|
logger as logger38,
|
|
14072
14062
|
makeCacheKey as makeCacheKey22,
|
|
14073
14063
|
paginate as paginate19,
|
|
@@ -14207,10 +14197,10 @@ function useOptionRepo(namespace_collection) {
|
|
|
14207
14197
|
});
|
|
14208
14198
|
return result;
|
|
14209
14199
|
} catch (error) {
|
|
14210
|
-
if (error instanceof
|
|
14200
|
+
if (error instanceof AppError34) {
|
|
14211
14201
|
throw error;
|
|
14212
14202
|
} else {
|
|
14213
|
-
throw new
|
|
14203
|
+
throw new InternalServerError34("Failed to get job post.");
|
|
14214
14204
|
}
|
|
14215
14205
|
}
|
|
14216
14206
|
}
|
|
@@ -14374,13 +14364,13 @@ import { BadRequestError as BadRequestError74, logger as logger40 } from "@gowee
|
|
|
14374
14364
|
|
|
14375
14365
|
// src/resources/job-post/job.post.repository.ts
|
|
14376
14366
|
import {
|
|
14377
|
-
AppError as
|
|
14367
|
+
AppError as AppError35,
|
|
14378
14368
|
BadRequestError as BadRequestError72,
|
|
14379
14369
|
useRepo as useRepo24,
|
|
14380
14370
|
makeCacheKey as makeCacheKey23,
|
|
14381
14371
|
paginate as paginate20,
|
|
14382
14372
|
logger as logger39,
|
|
14383
|
-
InternalServerError as
|
|
14373
|
+
InternalServerError as InternalServerError35
|
|
14384
14374
|
} from "@goweekdays/utils";
|
|
14385
14375
|
import { ObjectId as ObjectId39 } from "mongodb";
|
|
14386
14376
|
function useJobPostRepo() {
|
|
@@ -14555,7 +14545,7 @@ function useJobPostRepo() {
|
|
|
14555
14545
|
});
|
|
14556
14546
|
return data;
|
|
14557
14547
|
} catch (error) {
|
|
14558
|
-
throw new
|
|
14548
|
+
throw new InternalServerError35(
|
|
14559
14549
|
"Internal server error, failed to retrieve job posts."
|
|
14560
14550
|
);
|
|
14561
14551
|
}
|
|
@@ -14593,10 +14583,10 @@ function useJobPostRepo() {
|
|
|
14593
14583
|
});
|
|
14594
14584
|
return result;
|
|
14595
14585
|
} catch (error) {
|
|
14596
|
-
if (error instanceof
|
|
14586
|
+
if (error instanceof AppError35) {
|
|
14597
14587
|
throw error;
|
|
14598
14588
|
} else {
|
|
14599
|
-
throw new
|
|
14589
|
+
throw new InternalServerError35("Failed to get job post.");
|
|
14600
14590
|
}
|
|
14601
14591
|
}
|
|
14602
14592
|
}
|
|
@@ -14618,7 +14608,7 @@ function useJobPostRepo() {
|
|
|
14618
14608
|
repo.delCachedData();
|
|
14619
14609
|
return "Successfully updated job post.";
|
|
14620
14610
|
} catch (error2) {
|
|
14621
|
-
throw new
|
|
14611
|
+
throw new InternalServerError35("Failed to update job post.");
|
|
14622
14612
|
}
|
|
14623
14613
|
}
|
|
14624
14614
|
async function deleteById(_id, session) {
|
|
@@ -14642,7 +14632,7 @@ function useJobPostRepo() {
|
|
|
14642
14632
|
repo.delCachedData();
|
|
14643
14633
|
return "Successfully deleted job post.";
|
|
14644
14634
|
} catch (error) {
|
|
14645
|
-
throw new
|
|
14635
|
+
throw new InternalServerError35("Failed to delete job post.");
|
|
14646
14636
|
}
|
|
14647
14637
|
}
|
|
14648
14638
|
async function updateStatusById(_id, status2) {
|
|
@@ -14667,10 +14657,10 @@ function useJobPostRepo() {
|
|
|
14667
14657
|
repo.delCachedData();
|
|
14668
14658
|
return "Successfully updated job post status.";
|
|
14669
14659
|
} catch (error) {
|
|
14670
|
-
if (error instanceof
|
|
14660
|
+
if (error instanceof AppError35) {
|
|
14671
14661
|
throw error;
|
|
14672
14662
|
}
|
|
14673
|
-
throw new
|
|
14663
|
+
throw new InternalServerError35("Failed to update job post status.");
|
|
14674
14664
|
}
|
|
14675
14665
|
}
|
|
14676
14666
|
return {
|
|
@@ -14687,9 +14677,9 @@ function useJobPostRepo() {
|
|
|
14687
14677
|
|
|
14688
14678
|
// src/resources/job-post/job.post.service.ts
|
|
14689
14679
|
import {
|
|
14690
|
-
AppError as
|
|
14680
|
+
AppError as AppError36,
|
|
14691
14681
|
BadRequestError as BadRequestError73,
|
|
14692
|
-
InternalServerError as
|
|
14682
|
+
InternalServerError as InternalServerError36,
|
|
14693
14683
|
useAtlas as useAtlas11
|
|
14694
14684
|
} from "@goweekdays/utils";
|
|
14695
14685
|
import Joi63 from "joi";
|
|
@@ -14707,7 +14697,7 @@ function useJobPostService() {
|
|
|
14707
14697
|
async function add(value) {
|
|
14708
14698
|
const session = useAtlas11.getClient()?.startSession();
|
|
14709
14699
|
if (!session) {
|
|
14710
|
-
throw new
|
|
14700
|
+
throw new InternalServerError36("Failed to start database session.");
|
|
14711
14701
|
}
|
|
14712
14702
|
try {
|
|
14713
14703
|
session.startTransaction();
|
|
@@ -14735,10 +14725,10 @@ function useJobPostService() {
|
|
|
14735
14725
|
return "Successfully created job post.";
|
|
14736
14726
|
} catch (error) {
|
|
14737
14727
|
await session.abortTransaction();
|
|
14738
|
-
if (error instanceof
|
|
14728
|
+
if (error instanceof AppError36) {
|
|
14739
14729
|
throw error;
|
|
14740
14730
|
}
|
|
14741
|
-
throw new
|
|
14731
|
+
throw new InternalServerError36("Failed to create job post.");
|
|
14742
14732
|
} finally {
|
|
14743
14733
|
await session.endSession();
|
|
14744
14734
|
}
|
|
@@ -14752,10 +14742,10 @@ function useJobPostService() {
|
|
|
14752
14742
|
await _deleteById(id);
|
|
14753
14743
|
return "Successfully deleted job post.";
|
|
14754
14744
|
} catch (error2) {
|
|
14755
|
-
if (error2 instanceof
|
|
14745
|
+
if (error2 instanceof AppError36) {
|
|
14756
14746
|
throw error2;
|
|
14757
14747
|
} else {
|
|
14758
|
-
throw new
|
|
14748
|
+
throw new InternalServerError36("Failed to delete job post.");
|
|
14759
14749
|
}
|
|
14760
14750
|
}
|
|
14761
14751
|
}
|
|
@@ -14782,10 +14772,10 @@ function useJobPostService() {
|
|
|
14782
14772
|
await _updateStatusById(id, newStatus);
|
|
14783
14773
|
return "Successfully updated job post status.";
|
|
14784
14774
|
} catch (error) {
|
|
14785
|
-
if (error instanceof
|
|
14775
|
+
if (error instanceof AppError36) {
|
|
14786
14776
|
throw error;
|
|
14787
14777
|
}
|
|
14788
|
-
throw new
|
|
14778
|
+
throw new InternalServerError36("Failed to update job post status.");
|
|
14789
14779
|
}
|
|
14790
14780
|
}
|
|
14791
14781
|
return {
|
|
@@ -15434,7 +15424,7 @@ function modelJobProfileCert(data) {
|
|
|
15434
15424
|
|
|
15435
15425
|
// src/resources/job-profile/job.profile.repository.ts
|
|
15436
15426
|
import {
|
|
15437
|
-
AppError as
|
|
15427
|
+
AppError as AppError37,
|
|
15438
15428
|
BadRequestError as BadRequestError77,
|
|
15439
15429
|
logger as logger41,
|
|
15440
15430
|
makeCacheKey as makeCacheKey24,
|
|
@@ -15465,7 +15455,7 @@ function useJobProfileRepo() {
|
|
|
15465
15455
|
repo.delCachedData();
|
|
15466
15456
|
return res.insertedId;
|
|
15467
15457
|
} catch (error2) {
|
|
15468
|
-
if (error2 instanceof
|
|
15458
|
+
if (error2 instanceof AppError37) {
|
|
15469
15459
|
throw error2;
|
|
15470
15460
|
}
|
|
15471
15461
|
throw new BadRequestError77(
|
|
@@ -15517,7 +15507,7 @@ function useJobProfileRepo() {
|
|
|
15517
15507
|
});
|
|
15518
15508
|
return data;
|
|
15519
15509
|
} catch (error) {
|
|
15520
|
-
if (error instanceof
|
|
15510
|
+
if (error instanceof AppError37) {
|
|
15521
15511
|
throw error;
|
|
15522
15512
|
}
|
|
15523
15513
|
throw new BadRequestError77(`Failed to get job profiles: ${error.message}`);
|
|
@@ -15556,7 +15546,7 @@ function useJobProfileRepo() {
|
|
|
15556
15546
|
});
|
|
15557
15547
|
return data;
|
|
15558
15548
|
} catch (error2) {
|
|
15559
|
-
if (error2 instanceof
|
|
15549
|
+
if (error2 instanceof AppError37) {
|
|
15560
15550
|
throw error2;
|
|
15561
15551
|
}
|
|
15562
15552
|
throw new BadRequestError77(
|
|
@@ -15585,7 +15575,7 @@ function useJobProfileRepo() {
|
|
|
15585
15575
|
repo.delCachedData();
|
|
15586
15576
|
return "Successfully updated job profile contact info.";
|
|
15587
15577
|
} catch (error2) {
|
|
15588
|
-
if (error2 instanceof
|
|
15578
|
+
if (error2 instanceof AppError37) {
|
|
15589
15579
|
throw error2;
|
|
15590
15580
|
}
|
|
15591
15581
|
throw new BadRequestError77(
|
|
@@ -15611,7 +15601,7 @@ function useJobProfileRepo() {
|
|
|
15611
15601
|
repo.delCachedData();
|
|
15612
15602
|
return "Successfully updated job profile summary.";
|
|
15613
15603
|
} catch (error2) {
|
|
15614
|
-
if (error2 instanceof
|
|
15604
|
+
if (error2 instanceof AppError37) {
|
|
15615
15605
|
throw error2;
|
|
15616
15606
|
}
|
|
15617
15607
|
throw new BadRequestError77(
|
|
@@ -15640,7 +15630,7 @@ function useJobProfileRepo() {
|
|
|
15640
15630
|
repo.delCachedData();
|
|
15641
15631
|
return "Successfully updated job profile personal info.";
|
|
15642
15632
|
} catch (error2) {
|
|
15643
|
-
if (error2 instanceof
|
|
15633
|
+
if (error2 instanceof AppError37) {
|
|
15644
15634
|
throw error2;
|
|
15645
15635
|
}
|
|
15646
15636
|
throw new BadRequestError77(
|
|
@@ -15670,7 +15660,7 @@ function useJobProfileRepo() {
|
|
|
15670
15660
|
repo.delCachedData();
|
|
15671
15661
|
return "Successfully added job profile work experience.";
|
|
15672
15662
|
} catch (error2) {
|
|
15673
|
-
if (error2 instanceof
|
|
15663
|
+
if (error2 instanceof AppError37) {
|
|
15674
15664
|
throw error2;
|
|
15675
15665
|
}
|
|
15676
15666
|
throw new BadRequestError77(
|
|
@@ -15699,7 +15689,7 @@ function useJobProfileRepo() {
|
|
|
15699
15689
|
repo.delCachedData();
|
|
15700
15690
|
return "Successfully updated job profile work experience.";
|
|
15701
15691
|
} catch (error2) {
|
|
15702
|
-
if (error2 instanceof
|
|
15692
|
+
if (error2 instanceof AppError37) {
|
|
15703
15693
|
throw error2;
|
|
15704
15694
|
}
|
|
15705
15695
|
throw new BadRequestError77(
|
|
@@ -15739,7 +15729,7 @@ function useJobProfileRepo() {
|
|
|
15739
15729
|
repo.delCachedData();
|
|
15740
15730
|
return "Successfully deleted job profile work experience.";
|
|
15741
15731
|
} catch (error2) {
|
|
15742
|
-
if (error2 instanceof
|
|
15732
|
+
if (error2 instanceof AppError37) {
|
|
15743
15733
|
throw error2;
|
|
15744
15734
|
}
|
|
15745
15735
|
throw new BadRequestError77(
|
|
@@ -15769,7 +15759,7 @@ function useJobProfileRepo() {
|
|
|
15769
15759
|
repo.delCachedData();
|
|
15770
15760
|
return "Successfully added job profile education.";
|
|
15771
15761
|
} catch (error2) {
|
|
15772
|
-
if (error2 instanceof
|
|
15762
|
+
if (error2 instanceof AppError37) {
|
|
15773
15763
|
throw error2;
|
|
15774
15764
|
}
|
|
15775
15765
|
throw new BadRequestError77(
|
|
@@ -15798,7 +15788,7 @@ function useJobProfileRepo() {
|
|
|
15798
15788
|
repo.delCachedData();
|
|
15799
15789
|
return "Successfully updated job profile education.";
|
|
15800
15790
|
} catch (error2) {
|
|
15801
|
-
if (error2 instanceof
|
|
15791
|
+
if (error2 instanceof AppError37) {
|
|
15802
15792
|
throw error2;
|
|
15803
15793
|
}
|
|
15804
15794
|
throw new BadRequestError77(
|
|
@@ -15838,7 +15828,7 @@ function useJobProfileRepo() {
|
|
|
15838
15828
|
repo.delCachedData();
|
|
15839
15829
|
return "Successfully deleted job profile education.";
|
|
15840
15830
|
} catch (error2) {
|
|
15841
|
-
if (error2 instanceof
|
|
15831
|
+
if (error2 instanceof AppError37) {
|
|
15842
15832
|
throw error2;
|
|
15843
15833
|
}
|
|
15844
15834
|
throw new BadRequestError77(
|
|
@@ -15868,7 +15858,7 @@ function useJobProfileRepo() {
|
|
|
15868
15858
|
repo.delCachedData();
|
|
15869
15859
|
return "Successfully added job profile skill.";
|
|
15870
15860
|
} catch (error2) {
|
|
15871
|
-
if (error2 instanceof
|
|
15861
|
+
if (error2 instanceof AppError37) {
|
|
15872
15862
|
throw error2;
|
|
15873
15863
|
}
|
|
15874
15864
|
throw new BadRequestError77(
|
|
@@ -15897,7 +15887,7 @@ function useJobProfileRepo() {
|
|
|
15897
15887
|
repo.delCachedData();
|
|
15898
15888
|
return "Successfully updated job profile skill.";
|
|
15899
15889
|
} catch (error2) {
|
|
15900
|
-
if (error2 instanceof
|
|
15890
|
+
if (error2 instanceof AppError37) {
|
|
15901
15891
|
throw error2;
|
|
15902
15892
|
}
|
|
15903
15893
|
throw new BadRequestError77(
|
|
@@ -15937,7 +15927,7 @@ function useJobProfileRepo() {
|
|
|
15937
15927
|
repo.delCachedData();
|
|
15938
15928
|
return "Successfully deleted job profile skill.";
|
|
15939
15929
|
} catch (error2) {
|
|
15940
|
-
if (error2 instanceof
|
|
15930
|
+
if (error2 instanceof AppError37) {
|
|
15941
15931
|
throw error2;
|
|
15942
15932
|
}
|
|
15943
15933
|
throw new BadRequestError77(
|
|
@@ -15966,7 +15956,7 @@ function useJobProfileRepo() {
|
|
|
15966
15956
|
repo.delCachedData();
|
|
15967
15957
|
return "Successfully updated job profile additionalInfo.";
|
|
15968
15958
|
} catch (error2) {
|
|
15969
|
-
if (error2 instanceof
|
|
15959
|
+
if (error2 instanceof AppError37) {
|
|
15970
15960
|
throw error2;
|
|
15971
15961
|
}
|
|
15972
15962
|
throw new BadRequestError77(
|
|
@@ -15996,7 +15986,7 @@ function useJobProfileRepo() {
|
|
|
15996
15986
|
repo.delCachedData();
|
|
15997
15987
|
return "Successfully added job profile language.";
|
|
15998
15988
|
} catch (error2) {
|
|
15999
|
-
if (error2 instanceof
|
|
15989
|
+
if (error2 instanceof AppError37) {
|
|
16000
15990
|
throw error2;
|
|
16001
15991
|
}
|
|
16002
15992
|
throw new BadRequestError77(
|
|
@@ -16025,7 +16015,7 @@ function useJobProfileRepo() {
|
|
|
16025
16015
|
repo.delCachedData();
|
|
16026
16016
|
return "Successfully updated job profile language.";
|
|
16027
16017
|
} catch (error2) {
|
|
16028
|
-
if (error2 instanceof
|
|
16018
|
+
if (error2 instanceof AppError37) {
|
|
16029
16019
|
throw error2;
|
|
16030
16020
|
}
|
|
16031
16021
|
throw new BadRequestError77(
|
|
@@ -16065,7 +16055,7 @@ function useJobProfileRepo() {
|
|
|
16065
16055
|
repo.delCachedData();
|
|
16066
16056
|
return "Successfully deleted job profile language.";
|
|
16067
16057
|
} catch (error2) {
|
|
16068
|
-
if (error2 instanceof
|
|
16058
|
+
if (error2 instanceof AppError37) {
|
|
16069
16059
|
throw error2;
|
|
16070
16060
|
}
|
|
16071
16061
|
throw new BadRequestError77(
|
|
@@ -16095,7 +16085,7 @@ function useJobProfileRepo() {
|
|
|
16095
16085
|
repo.delCachedData();
|
|
16096
16086
|
return "Successfully added job profile certification.";
|
|
16097
16087
|
} catch (error2) {
|
|
16098
|
-
if (error2 instanceof
|
|
16088
|
+
if (error2 instanceof AppError37) {
|
|
16099
16089
|
throw error2;
|
|
16100
16090
|
}
|
|
16101
16091
|
throw new BadRequestError77(
|
|
@@ -16124,7 +16114,7 @@ function useJobProfileRepo() {
|
|
|
16124
16114
|
repo.delCachedData();
|
|
16125
16115
|
return "Successfully updated job profile certification.";
|
|
16126
16116
|
} catch (error2) {
|
|
16127
|
-
if (error2 instanceof
|
|
16117
|
+
if (error2 instanceof AppError37) {
|
|
16128
16118
|
throw error2;
|
|
16129
16119
|
}
|
|
16130
16120
|
throw new BadRequestError77(
|
|
@@ -16164,7 +16154,7 @@ function useJobProfileRepo() {
|
|
|
16164
16154
|
repo.delCachedData();
|
|
16165
16155
|
return "Successfully deleted job profile certification.";
|
|
16166
16156
|
} catch (error2) {
|
|
16167
|
-
if (error2 instanceof
|
|
16157
|
+
if (error2 instanceof AppError37) {
|
|
16168
16158
|
throw error2;
|
|
16169
16159
|
}
|
|
16170
16160
|
throw new BadRequestError77(
|
|
@@ -16201,14 +16191,14 @@ function useJobProfileRepo() {
|
|
|
16201
16191
|
}
|
|
16202
16192
|
|
|
16203
16193
|
// src/resources/job-profile/job.profile.controller.ts
|
|
16204
|
-
import { AppError as
|
|
16194
|
+
import { AppError as AppError39, BadRequestError as BadRequestError79, NotFoundError as NotFoundError5 } from "@goweekdays/utils";
|
|
16205
16195
|
import Joi69 from "joi";
|
|
16206
16196
|
|
|
16207
16197
|
// src/resources/job-profile/job.profile.service.ts
|
|
16208
16198
|
import {
|
|
16209
|
-
AppError as
|
|
16199
|
+
AppError as AppError38,
|
|
16210
16200
|
BadRequestError as BadRequestError78,
|
|
16211
|
-
InternalServerError as
|
|
16201
|
+
InternalServerError as InternalServerError37,
|
|
16212
16202
|
useAtlas as useAtlas12
|
|
16213
16203
|
} from "@goweekdays/utils";
|
|
16214
16204
|
import Joi68 from "joi";
|
|
@@ -16231,7 +16221,7 @@ function useJobPostProfileSvc() {
|
|
|
16231
16221
|
}
|
|
16232
16222
|
const session = useAtlas12.getClient()?.startSession();
|
|
16233
16223
|
if (!session) {
|
|
16234
|
-
throw new
|
|
16224
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16235
16225
|
}
|
|
16236
16226
|
try {
|
|
16237
16227
|
session.startTransaction();
|
|
@@ -16252,10 +16242,10 @@ function useJobPostProfileSvc() {
|
|
|
16252
16242
|
return "Successfully updated contact info.";
|
|
16253
16243
|
} catch (error2) {
|
|
16254
16244
|
await session.abortTransaction();
|
|
16255
|
-
if (error2 instanceof
|
|
16245
|
+
if (error2 instanceof AppError38) {
|
|
16256
16246
|
throw error2;
|
|
16257
16247
|
}
|
|
16258
|
-
throw new
|
|
16248
|
+
throw new InternalServerError37("Failed to update contact info.");
|
|
16259
16249
|
} finally {
|
|
16260
16250
|
await session.endSession();
|
|
16261
16251
|
}
|
|
@@ -16270,7 +16260,7 @@ function useJobPostProfileSvc() {
|
|
|
16270
16260
|
}
|
|
16271
16261
|
const session = useAtlas12.getClient()?.startSession();
|
|
16272
16262
|
if (!session) {
|
|
16273
|
-
throw new
|
|
16263
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16274
16264
|
}
|
|
16275
16265
|
try {
|
|
16276
16266
|
session.startTransaction();
|
|
@@ -16285,10 +16275,10 @@ function useJobPostProfileSvc() {
|
|
|
16285
16275
|
return "Successfully updated personal info.";
|
|
16286
16276
|
} catch (error2) {
|
|
16287
16277
|
await session.abortTransaction();
|
|
16288
|
-
if (error2 instanceof
|
|
16278
|
+
if (error2 instanceof AppError38) {
|
|
16289
16279
|
throw error2;
|
|
16290
16280
|
}
|
|
16291
|
-
throw new
|
|
16281
|
+
throw new InternalServerError37("Failed to update personal info.");
|
|
16292
16282
|
} finally {
|
|
16293
16283
|
await session.endSession();
|
|
16294
16284
|
}
|
|
@@ -16300,7 +16290,7 @@ function useJobPostProfileSvc() {
|
|
|
16300
16290
|
}
|
|
16301
16291
|
const session = useAtlas12.getClient()?.startSession();
|
|
16302
16292
|
if (!session) {
|
|
16303
|
-
throw new
|
|
16293
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16304
16294
|
}
|
|
16305
16295
|
try {
|
|
16306
16296
|
session.startTransaction();
|
|
@@ -16323,10 +16313,10 @@ function useJobPostProfileSvc() {
|
|
|
16323
16313
|
return "Successfully added work experience.";
|
|
16324
16314
|
} catch (error2) {
|
|
16325
16315
|
await session.abortTransaction();
|
|
16326
|
-
if (error2 instanceof
|
|
16316
|
+
if (error2 instanceof AppError38) {
|
|
16327
16317
|
throw error2;
|
|
16328
16318
|
}
|
|
16329
|
-
throw new
|
|
16319
|
+
throw new InternalServerError37("Failed to add work experience.");
|
|
16330
16320
|
} finally {
|
|
16331
16321
|
await session.endSession();
|
|
16332
16322
|
}
|
|
@@ -16338,7 +16328,7 @@ function useJobPostProfileSvc() {
|
|
|
16338
16328
|
}
|
|
16339
16329
|
const session = useAtlas12.getClient()?.startSession();
|
|
16340
16330
|
if (!session) {
|
|
16341
|
-
throw new
|
|
16331
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16342
16332
|
}
|
|
16343
16333
|
try {
|
|
16344
16334
|
session.startTransaction();
|
|
@@ -16361,10 +16351,10 @@ function useJobPostProfileSvc() {
|
|
|
16361
16351
|
return "Successfully updated work experience.";
|
|
16362
16352
|
} catch (error2) {
|
|
16363
16353
|
await session.abortTransaction();
|
|
16364
|
-
if (error2 instanceof
|
|
16354
|
+
if (error2 instanceof AppError38) {
|
|
16365
16355
|
throw error2;
|
|
16366
16356
|
}
|
|
16367
|
-
throw new
|
|
16357
|
+
throw new InternalServerError37("Failed to update work experience.");
|
|
16368
16358
|
} finally {
|
|
16369
16359
|
await session.endSession();
|
|
16370
16360
|
}
|
|
@@ -16376,7 +16366,7 @@ function useJobPostProfileSvc() {
|
|
|
16376
16366
|
}
|
|
16377
16367
|
const session = useAtlas12.getClient()?.startSession();
|
|
16378
16368
|
if (!session) {
|
|
16379
|
-
throw new
|
|
16369
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16380
16370
|
}
|
|
16381
16371
|
try {
|
|
16382
16372
|
session.startTransaction();
|
|
@@ -16395,10 +16385,10 @@ function useJobPostProfileSvc() {
|
|
|
16395
16385
|
return "Successfully added education.";
|
|
16396
16386
|
} catch (error2) {
|
|
16397
16387
|
await session.abortTransaction();
|
|
16398
|
-
if (error2 instanceof
|
|
16388
|
+
if (error2 instanceof AppError38) {
|
|
16399
16389
|
throw error2;
|
|
16400
16390
|
}
|
|
16401
|
-
throw new
|
|
16391
|
+
throw new InternalServerError37("Failed to add education.");
|
|
16402
16392
|
} finally {
|
|
16403
16393
|
await session.endSession();
|
|
16404
16394
|
}
|
|
@@ -16410,7 +16400,7 @@ function useJobPostProfileSvc() {
|
|
|
16410
16400
|
}
|
|
16411
16401
|
const session = useAtlas12.getClient()?.startSession();
|
|
16412
16402
|
if (!session) {
|
|
16413
|
-
throw new
|
|
16403
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16414
16404
|
}
|
|
16415
16405
|
try {
|
|
16416
16406
|
session.startTransaction();
|
|
@@ -16429,10 +16419,10 @@ function useJobPostProfileSvc() {
|
|
|
16429
16419
|
return "Successfully updated education.";
|
|
16430
16420
|
} catch (error2) {
|
|
16431
16421
|
await session.abortTransaction();
|
|
16432
|
-
if (error2 instanceof
|
|
16422
|
+
if (error2 instanceof AppError38) {
|
|
16433
16423
|
throw error2;
|
|
16434
16424
|
}
|
|
16435
|
-
throw new
|
|
16425
|
+
throw new InternalServerError37("Failed to update education.");
|
|
16436
16426
|
} finally {
|
|
16437
16427
|
await session.endSession();
|
|
16438
16428
|
}
|
|
@@ -16488,7 +16478,7 @@ function useJobProfileCtrl() {
|
|
|
16488
16478
|
res.json({ message });
|
|
16489
16479
|
return;
|
|
16490
16480
|
} catch (error2) {
|
|
16491
|
-
if (error2 instanceof
|
|
16481
|
+
if (error2 instanceof AppError39) {
|
|
16492
16482
|
next(error2);
|
|
16493
16483
|
return;
|
|
16494
16484
|
}
|
|
@@ -16518,7 +16508,7 @@ function useJobProfileCtrl() {
|
|
|
16518
16508
|
res.json(data);
|
|
16519
16509
|
return;
|
|
16520
16510
|
} catch (error2) {
|
|
16521
|
-
if (error2 instanceof
|
|
16511
|
+
if (error2 instanceof AppError39) {
|
|
16522
16512
|
next(error2);
|
|
16523
16513
|
return;
|
|
16524
16514
|
}
|
|
@@ -16541,7 +16531,7 @@ function useJobProfileCtrl() {
|
|
|
16541
16531
|
res.json(data);
|
|
16542
16532
|
return;
|
|
16543
16533
|
} catch (error2) {
|
|
16544
|
-
if (error2 instanceof
|
|
16534
|
+
if (error2 instanceof AppError39) {
|
|
16545
16535
|
next(error2);
|
|
16546
16536
|
return;
|
|
16547
16537
|
}
|
|
@@ -16563,7 +16553,7 @@ function useJobProfileCtrl() {
|
|
|
16563
16553
|
res.json({ message });
|
|
16564
16554
|
return;
|
|
16565
16555
|
} catch (error2) {
|
|
16566
|
-
if (error2 instanceof
|
|
16556
|
+
if (error2 instanceof AppError39) {
|
|
16567
16557
|
next(error2);
|
|
16568
16558
|
return;
|
|
16569
16559
|
}
|
|
@@ -16587,7 +16577,7 @@ function useJobProfileCtrl() {
|
|
|
16587
16577
|
res.json({ message });
|
|
16588
16578
|
return;
|
|
16589
16579
|
} catch (error2) {
|
|
16590
|
-
if (error2 instanceof
|
|
16580
|
+
if (error2 instanceof AppError39) {
|
|
16591
16581
|
next(error2);
|
|
16592
16582
|
return;
|
|
16593
16583
|
}
|
|
@@ -16611,7 +16601,7 @@ function useJobProfileCtrl() {
|
|
|
16611
16601
|
res.json({ message });
|
|
16612
16602
|
return;
|
|
16613
16603
|
} catch (error2) {
|
|
16614
|
-
if (error2 instanceof
|
|
16604
|
+
if (error2 instanceof AppError39) {
|
|
16615
16605
|
next(error2);
|
|
16616
16606
|
return;
|
|
16617
16607
|
}
|
|
@@ -16637,7 +16627,7 @@ function useJobProfileCtrl() {
|
|
|
16637
16627
|
res.json({ message });
|
|
16638
16628
|
return;
|
|
16639
16629
|
} catch (error2) {
|
|
16640
|
-
if (error2 instanceof
|
|
16630
|
+
if (error2 instanceof AppError39) {
|
|
16641
16631
|
next(error2);
|
|
16642
16632
|
return;
|
|
16643
16633
|
}
|
|
@@ -16661,7 +16651,7 @@ function useJobProfileCtrl() {
|
|
|
16661
16651
|
res.json({ message });
|
|
16662
16652
|
return;
|
|
16663
16653
|
} catch (error2) {
|
|
16664
|
-
if (error2 instanceof
|
|
16654
|
+
if (error2 instanceof AppError39) {
|
|
16665
16655
|
next(error2);
|
|
16666
16656
|
return;
|
|
16667
16657
|
}
|
|
@@ -16687,7 +16677,7 @@ function useJobProfileCtrl() {
|
|
|
16687
16677
|
res.json({ message });
|
|
16688
16678
|
return;
|
|
16689
16679
|
} catch (error2) {
|
|
16690
|
-
if (error2 instanceof
|
|
16680
|
+
if (error2 instanceof AppError39) {
|
|
16691
16681
|
next(error2);
|
|
16692
16682
|
return;
|
|
16693
16683
|
}
|
|
@@ -16711,7 +16701,7 @@ function useJobProfileCtrl() {
|
|
|
16711
16701
|
res.json({ message });
|
|
16712
16702
|
return;
|
|
16713
16703
|
} catch (error2) {
|
|
16714
|
-
if (error2 instanceof
|
|
16704
|
+
if (error2 instanceof AppError39) {
|
|
16715
16705
|
next(error2);
|
|
16716
16706
|
return;
|
|
16717
16707
|
}
|
|
@@ -16731,7 +16721,7 @@ function useJobProfileCtrl() {
|
|
|
16731
16721
|
res.json({ message });
|
|
16732
16722
|
return;
|
|
16733
16723
|
} catch (error2) {
|
|
16734
|
-
if (error2 instanceof
|
|
16724
|
+
if (error2 instanceof AppError39) {
|
|
16735
16725
|
next(error2);
|
|
16736
16726
|
return;
|
|
16737
16727
|
}
|
|
@@ -16751,7 +16741,7 @@ function useJobProfileCtrl() {
|
|
|
16751
16741
|
res.json({ message });
|
|
16752
16742
|
return;
|
|
16753
16743
|
} catch (error2) {
|
|
16754
|
-
if (error2 instanceof
|
|
16744
|
+
if (error2 instanceof AppError39) {
|
|
16755
16745
|
next(error2);
|
|
16756
16746
|
return;
|
|
16757
16747
|
}
|
|
@@ -16771,7 +16761,7 @@ function useJobProfileCtrl() {
|
|
|
16771
16761
|
res.json({ message });
|
|
16772
16762
|
return;
|
|
16773
16763
|
} catch (error2) {
|
|
16774
|
-
if (error2 instanceof
|
|
16764
|
+
if (error2 instanceof AppError39) {
|
|
16775
16765
|
next(error2);
|
|
16776
16766
|
return;
|
|
16777
16767
|
}
|
|
@@ -16791,7 +16781,7 @@ function useJobProfileCtrl() {
|
|
|
16791
16781
|
res.json({ message });
|
|
16792
16782
|
return;
|
|
16793
16783
|
} catch (error2) {
|
|
16794
|
-
if (error2 instanceof
|
|
16784
|
+
if (error2 instanceof AppError39) {
|
|
16795
16785
|
next(error2);
|
|
16796
16786
|
return;
|
|
16797
16787
|
}
|
|
@@ -16811,7 +16801,7 @@ function useJobProfileCtrl() {
|
|
|
16811
16801
|
res.json({ message });
|
|
16812
16802
|
return;
|
|
16813
16803
|
} catch (error2) {
|
|
16814
|
-
if (error2 instanceof
|
|
16804
|
+
if (error2 instanceof AppError39) {
|
|
16815
16805
|
next(error2);
|
|
16816
16806
|
return;
|
|
16817
16807
|
}
|
|
@@ -16834,7 +16824,7 @@ function useJobProfileCtrl() {
|
|
|
16834
16824
|
res.json({ message });
|
|
16835
16825
|
return;
|
|
16836
16826
|
} catch (error2) {
|
|
16837
|
-
if (error2 instanceof
|
|
16827
|
+
if (error2 instanceof AppError39) {
|
|
16838
16828
|
next(error2);
|
|
16839
16829
|
return;
|
|
16840
16830
|
}
|
|
@@ -16858,7 +16848,7 @@ function useJobProfileCtrl() {
|
|
|
16858
16848
|
res.json({ message });
|
|
16859
16849
|
return;
|
|
16860
16850
|
} catch (error2) {
|
|
16861
|
-
if (error2 instanceof
|
|
16851
|
+
if (error2 instanceof AppError39) {
|
|
16862
16852
|
next(error2);
|
|
16863
16853
|
return;
|
|
16864
16854
|
}
|
|
@@ -16878,7 +16868,7 @@ function useJobProfileCtrl() {
|
|
|
16878
16868
|
res.json({ message });
|
|
16879
16869
|
return;
|
|
16880
16870
|
} catch (error2) {
|
|
16881
|
-
if (error2 instanceof
|
|
16871
|
+
if (error2 instanceof AppError39) {
|
|
16882
16872
|
next(error2);
|
|
16883
16873
|
return;
|
|
16884
16874
|
}
|
|
@@ -16898,7 +16888,7 @@ function useJobProfileCtrl() {
|
|
|
16898
16888
|
res.json({ message });
|
|
16899
16889
|
return;
|
|
16900
16890
|
} catch (error2) {
|
|
16901
|
-
if (error2 instanceof
|
|
16891
|
+
if (error2 instanceof AppError39) {
|
|
16902
16892
|
next(error2);
|
|
16903
16893
|
return;
|
|
16904
16894
|
}
|
|
@@ -16918,7 +16908,7 @@ function useJobProfileCtrl() {
|
|
|
16918
16908
|
res.json({ message });
|
|
16919
16909
|
return;
|
|
16920
16910
|
} catch (error2) {
|
|
16921
|
-
if (error2 instanceof
|
|
16911
|
+
if (error2 instanceof AppError39) {
|
|
16922
16912
|
next(error2);
|
|
16923
16913
|
return;
|
|
16924
16914
|
}
|
|
@@ -16940,7 +16930,7 @@ function useJobProfileCtrl() {
|
|
|
16940
16930
|
res.json({ message });
|
|
16941
16931
|
return;
|
|
16942
16932
|
} catch (error2) {
|
|
16943
|
-
if (error2 instanceof
|
|
16933
|
+
if (error2 instanceof AppError39) {
|
|
16944
16934
|
next(error2);
|
|
16945
16935
|
return;
|
|
16946
16936
|
}
|
|
@@ -16962,7 +16952,7 @@ function useJobProfileCtrl() {
|
|
|
16962
16952
|
res.json({ message });
|
|
16963
16953
|
return;
|
|
16964
16954
|
} catch (error2) {
|
|
16965
|
-
if (error2 instanceof
|
|
16955
|
+
if (error2 instanceof AppError39) {
|
|
16966
16956
|
next(error2);
|
|
16967
16957
|
return;
|
|
16968
16958
|
}
|
|
@@ -16999,7 +16989,7 @@ function useJobProfileCtrl() {
|
|
|
16999
16989
|
|
|
17000
16990
|
// src/resources/job-summary/job.summary.service.ts
|
|
17001
16991
|
import Joi70 from "joi";
|
|
17002
|
-
import { AppError as
|
|
16992
|
+
import { AppError as AppError40, BadRequestError as BadRequestError80 } from "@goweekdays/utils";
|
|
17003
16993
|
function useJobSummarySvc() {
|
|
17004
16994
|
const repo = useJobSummaryRepo();
|
|
17005
16995
|
async function getByOrg(org) {
|
|
@@ -17014,7 +17004,7 @@ function useJobSummarySvc() {
|
|
|
17014
17004
|
}
|
|
17015
17005
|
return await repo.getByOrg(org);
|
|
17016
17006
|
} catch (error2) {
|
|
17017
|
-
if (error2 instanceof
|
|
17007
|
+
if (error2 instanceof AppError40) {
|
|
17018
17008
|
throw error2;
|
|
17019
17009
|
}
|
|
17020
17010
|
throw new BadRequestError80("Failed to get job summary by org.");
|
|
@@ -17449,7 +17439,7 @@ function useBusinessProfileRepo() {
|
|
|
17449
17439
|
}
|
|
17450
17440
|
|
|
17451
17441
|
// src/resources/finance-profile/finance.profile.controller.ts
|
|
17452
|
-
import { AppError as
|
|
17442
|
+
import { AppError as AppError41, BadRequestError as BadRequestError84 } from "@goweekdays/utils";
|
|
17453
17443
|
function useBusinessProfileCtrl() {
|
|
17454
17444
|
const repo = useBusinessProfileRepo();
|
|
17455
17445
|
async function add(req, res, next) {
|
|
@@ -17469,7 +17459,7 @@ function useBusinessProfileCtrl() {
|
|
|
17469
17459
|
res.json({ message: "Business profile created successfully" });
|
|
17470
17460
|
return;
|
|
17471
17461
|
} catch (error2) {
|
|
17472
|
-
if (error2 instanceof
|
|
17462
|
+
if (error2 instanceof AppError41) {
|
|
17473
17463
|
next(error2);
|
|
17474
17464
|
return;
|
|
17475
17465
|
}
|
|
@@ -17703,13 +17693,13 @@ function modelTax(data) {
|
|
|
17703
17693
|
|
|
17704
17694
|
// src/resources/finance-tax/tax.repository.ts
|
|
17705
17695
|
import {
|
|
17706
|
-
AppError as
|
|
17696
|
+
AppError as AppError42,
|
|
17707
17697
|
BadRequestError as BadRequestError86,
|
|
17708
17698
|
useRepo as useRepo27,
|
|
17709
17699
|
makeCacheKey as makeCacheKey26,
|
|
17710
17700
|
paginate as paginate22,
|
|
17711
17701
|
logger as logger43,
|
|
17712
|
-
InternalServerError as
|
|
17702
|
+
InternalServerError as InternalServerError38
|
|
17713
17703
|
} from "@goweekdays/utils";
|
|
17714
17704
|
import { ObjectId as ObjectId45 } from "mongodb";
|
|
17715
17705
|
import Joi75 from "joi";
|
|
@@ -17873,7 +17863,7 @@ function useTaxRepo() {
|
|
|
17873
17863
|
});
|
|
17874
17864
|
return data;
|
|
17875
17865
|
} catch (error) {
|
|
17876
|
-
throw new
|
|
17866
|
+
throw new InternalServerError38(
|
|
17877
17867
|
"Internal server error, failed to retrieve taxes."
|
|
17878
17868
|
);
|
|
17879
17869
|
}
|
|
@@ -17911,10 +17901,10 @@ function useTaxRepo() {
|
|
|
17911
17901
|
});
|
|
17912
17902
|
return result;
|
|
17913
17903
|
} catch (error) {
|
|
17914
|
-
if (error instanceof
|
|
17904
|
+
if (error instanceof AppError42) {
|
|
17915
17905
|
throw error;
|
|
17916
17906
|
} else {
|
|
17917
|
-
throw new
|
|
17907
|
+
throw new InternalServerError38("Failed to get tax.");
|
|
17918
17908
|
}
|
|
17919
17909
|
}
|
|
17920
17910
|
}
|
|
@@ -17940,7 +17930,7 @@ function useTaxRepo() {
|
|
|
17940
17930
|
repo.delCachedData();
|
|
17941
17931
|
return "Successfully updated tax.";
|
|
17942
17932
|
} catch (error2) {
|
|
17943
|
-
throw new
|
|
17933
|
+
throw new InternalServerError38("Failed to update tax.");
|
|
17944
17934
|
}
|
|
17945
17935
|
}
|
|
17946
17936
|
async function deleteById(_id, session) {
|
|
@@ -17964,7 +17954,7 @@ function useTaxRepo() {
|
|
|
17964
17954
|
repo.delCachedData();
|
|
17965
17955
|
return "Successfully deleted tax.";
|
|
17966
17956
|
} catch (error) {
|
|
17967
|
-
throw new
|
|
17957
|
+
throw new InternalServerError38("Failed to delete tax.");
|
|
17968
17958
|
}
|
|
17969
17959
|
}
|
|
17970
17960
|
async function updateStatusById(_id, status2) {
|
|
@@ -17989,10 +17979,10 @@ function useTaxRepo() {
|
|
|
17989
17979
|
repo.delCachedData();
|
|
17990
17980
|
return "Successfully updated tax status.";
|
|
17991
17981
|
} catch (error) {
|
|
17992
|
-
if (error instanceof
|
|
17982
|
+
if (error instanceof AppError42) {
|
|
17993
17983
|
throw error;
|
|
17994
17984
|
}
|
|
17995
|
-
throw new
|
|
17985
|
+
throw new InternalServerError38("Failed to update tax status.");
|
|
17996
17986
|
}
|
|
17997
17987
|
}
|
|
17998
17988
|
return {
|
|
@@ -18287,13 +18277,13 @@ function modelChartOfAccount(data) {
|
|
|
18287
18277
|
|
|
18288
18278
|
// src/resources/finance-account/chart-of-account.repository.ts
|
|
18289
18279
|
import {
|
|
18290
|
-
AppError as
|
|
18280
|
+
AppError as AppError43,
|
|
18291
18281
|
BadRequestError as BadRequestError88,
|
|
18292
18282
|
useRepo as useRepo28,
|
|
18293
18283
|
makeCacheKey as makeCacheKey27,
|
|
18294
18284
|
paginate as paginate23,
|
|
18295
18285
|
logger as logger45,
|
|
18296
|
-
InternalServerError as
|
|
18286
|
+
InternalServerError as InternalServerError39
|
|
18297
18287
|
} from "@goweekdays/utils";
|
|
18298
18288
|
import { ObjectId as ObjectId47 } from "mongodb";
|
|
18299
18289
|
import Joi78 from "joi";
|
|
@@ -18505,7 +18495,7 @@ function useChartOfAccountRepo() {
|
|
|
18505
18495
|
});
|
|
18506
18496
|
return data;
|
|
18507
18497
|
} catch (error) {
|
|
18508
|
-
throw new
|
|
18498
|
+
throw new InternalServerError39(
|
|
18509
18499
|
"Internal server error, failed to retrieve chart of accounts."
|
|
18510
18500
|
);
|
|
18511
18501
|
}
|
|
@@ -18543,10 +18533,10 @@ function useChartOfAccountRepo() {
|
|
|
18543
18533
|
});
|
|
18544
18534
|
return result;
|
|
18545
18535
|
} catch (error) {
|
|
18546
|
-
if (error instanceof
|
|
18536
|
+
if (error instanceof AppError43) {
|
|
18547
18537
|
throw error;
|
|
18548
18538
|
} else {
|
|
18549
|
-
throw new
|
|
18539
|
+
throw new InternalServerError39("Failed to get chart of account.");
|
|
18550
18540
|
}
|
|
18551
18541
|
}
|
|
18552
18542
|
}
|
|
@@ -18571,7 +18561,7 @@ function useChartOfAccountRepo() {
|
|
|
18571
18561
|
repo.delCachedData();
|
|
18572
18562
|
return "Successfully updated chart of account.";
|
|
18573
18563
|
} catch (error2) {
|
|
18574
|
-
throw new
|
|
18564
|
+
throw new InternalServerError39("Failed to update chart of account.");
|
|
18575
18565
|
}
|
|
18576
18566
|
}
|
|
18577
18567
|
async function deleteById(_id, session) {
|
|
@@ -18595,7 +18585,7 @@ function useChartOfAccountRepo() {
|
|
|
18595
18585
|
repo.delCachedData();
|
|
18596
18586
|
return "Successfully archived chart of account.";
|
|
18597
18587
|
} catch (error) {
|
|
18598
|
-
throw new
|
|
18588
|
+
throw new InternalServerError39("Failed to archive chart of account.");
|
|
18599
18589
|
}
|
|
18600
18590
|
}
|
|
18601
18591
|
async function updateStatusById(_id, status2) {
|
|
@@ -18620,10 +18610,10 @@ function useChartOfAccountRepo() {
|
|
|
18620
18610
|
repo.delCachedData();
|
|
18621
18611
|
return "Successfully updated chart of account status.";
|
|
18622
18612
|
} catch (error) {
|
|
18623
|
-
if (error instanceof
|
|
18613
|
+
if (error instanceof AppError43) {
|
|
18624
18614
|
throw error;
|
|
18625
18615
|
}
|
|
18626
|
-
throw new
|
|
18616
|
+
throw new InternalServerError39(
|
|
18627
18617
|
"Failed to update chart of account status."
|
|
18628
18618
|
);
|
|
18629
18619
|
}
|
|
@@ -18639,7 +18629,7 @@ function useChartOfAccountRepo() {
|
|
|
18639
18629
|
});
|
|
18640
18630
|
return count;
|
|
18641
18631
|
} catch (error2) {
|
|
18642
|
-
throw new
|
|
18632
|
+
throw new InternalServerError39(
|
|
18643
18633
|
"Failed to count chart of accounts by path."
|
|
18644
18634
|
);
|
|
18645
18635
|
}
|
|
@@ -18667,7 +18657,7 @@ function useChartOfAccountRepo() {
|
|
|
18667
18657
|
repo.delCachedData();
|
|
18668
18658
|
return "Successfully updated children count.";
|
|
18669
18659
|
} catch (error2) {
|
|
18670
|
-
throw new
|
|
18660
|
+
throw new InternalServerError39("Failed to update children count.");
|
|
18671
18661
|
}
|
|
18672
18662
|
}
|
|
18673
18663
|
async function getTrialBalance(options) {
|
|
@@ -18794,7 +18784,7 @@ function useChartOfAccountRepo() {
|
|
|
18794
18784
|
level: "error",
|
|
18795
18785
|
message: `Error in getTrialBalance: ${error}`
|
|
18796
18786
|
});
|
|
18797
|
-
throw new
|
|
18787
|
+
throw new InternalServerError39("Failed to get trial balance.");
|
|
18798
18788
|
}
|
|
18799
18789
|
}
|
|
18800
18790
|
async function getBalanceSheet(options) {
|
|
@@ -18903,7 +18893,7 @@ function useChartOfAccountRepo() {
|
|
|
18903
18893
|
level: "error",
|
|
18904
18894
|
message: `Error in getBalanceSheet: ${error}`
|
|
18905
18895
|
});
|
|
18906
|
-
throw new
|
|
18896
|
+
throw new InternalServerError39("Failed to get balance sheet data.");
|
|
18907
18897
|
}
|
|
18908
18898
|
}
|
|
18909
18899
|
return {
|
|
@@ -19514,9 +19504,9 @@ function modelAccountBalance(value) {
|
|
|
19514
19504
|
|
|
19515
19505
|
// src/resources/finance-account-balance/finance.account.balance.repository.ts
|
|
19516
19506
|
import {
|
|
19517
|
-
AppError as
|
|
19507
|
+
AppError as AppError44,
|
|
19518
19508
|
BadRequestError as BadRequestError92,
|
|
19519
|
-
InternalServerError as
|
|
19509
|
+
InternalServerError as InternalServerError40,
|
|
19520
19510
|
makeCacheKey as makeCacheKey28,
|
|
19521
19511
|
paginate as paginate24,
|
|
19522
19512
|
logger as logger47,
|
|
@@ -19563,11 +19553,11 @@ function useAccountBalanceRepo() {
|
|
|
19563
19553
|
repo.delCachedData();
|
|
19564
19554
|
return res.insertedId;
|
|
19565
19555
|
} catch (error) {
|
|
19566
|
-
if (error instanceof
|
|
19556
|
+
if (error instanceof AppError44) {
|
|
19567
19557
|
throw error;
|
|
19568
19558
|
}
|
|
19569
19559
|
logger47.log({ level: "error", message: error.message });
|
|
19570
|
-
throw new
|
|
19560
|
+
throw new InternalServerError40("Failed to add account balance.");
|
|
19571
19561
|
}
|
|
19572
19562
|
}
|
|
19573
19563
|
async function getAll(options) {
|
|
@@ -19627,10 +19617,10 @@ function useAccountBalanceRepo() {
|
|
|
19627
19617
|
});
|
|
19628
19618
|
return data;
|
|
19629
19619
|
} catch (error) {
|
|
19630
|
-
if (error instanceof
|
|
19620
|
+
if (error instanceof AppError44) {
|
|
19631
19621
|
throw error;
|
|
19632
19622
|
}
|
|
19633
|
-
throw new
|
|
19623
|
+
throw new InternalServerError40("Failed to get account balances.");
|
|
19634
19624
|
}
|
|
19635
19625
|
}
|
|
19636
19626
|
async function getById(_id) {
|
|
@@ -19663,10 +19653,10 @@ function useAccountBalanceRepo() {
|
|
|
19663
19653
|
});
|
|
19664
19654
|
return result;
|
|
19665
19655
|
} catch (error) {
|
|
19666
|
-
if (error instanceof
|
|
19656
|
+
if (error instanceof AppError44) {
|
|
19667
19657
|
throw error;
|
|
19668
19658
|
}
|
|
19669
|
-
throw new
|
|
19659
|
+
throw new InternalServerError40("Failed to get account balance.");
|
|
19670
19660
|
}
|
|
19671
19661
|
}
|
|
19672
19662
|
async function getByAccount(options) {
|
|
@@ -19719,10 +19709,10 @@ function useAccountBalanceRepo() {
|
|
|
19719
19709
|
}
|
|
19720
19710
|
return result;
|
|
19721
19711
|
} catch (error) {
|
|
19722
|
-
if (error instanceof
|
|
19712
|
+
if (error instanceof AppError44) {
|
|
19723
19713
|
throw error;
|
|
19724
19714
|
}
|
|
19725
|
-
throw new
|
|
19715
|
+
throw new InternalServerError40("Failed to get account balance.");
|
|
19726
19716
|
}
|
|
19727
19717
|
}
|
|
19728
19718
|
async function getYearBalancesByAccount(options) {
|
|
@@ -19744,10 +19734,10 @@ function useAccountBalanceRepo() {
|
|
|
19744
19734
|
{ sort: { "period.fiscalMonth": 1 } }
|
|
19745
19735
|
).toArray();
|
|
19746
19736
|
} catch (error) {
|
|
19747
|
-
if (error instanceof
|
|
19737
|
+
if (error instanceof AppError44) {
|
|
19748
19738
|
throw error;
|
|
19749
19739
|
}
|
|
19750
|
-
throw new
|
|
19740
|
+
throw new InternalServerError40("Failed to get account balances by year.");
|
|
19751
19741
|
}
|
|
19752
19742
|
}
|
|
19753
19743
|
async function updateById(account, org, fiscalYear, fiscalMonth, options, session) {
|
|
@@ -19789,7 +19779,7 @@ function useAccountBalanceRepo() {
|
|
|
19789
19779
|
repo.delCachedData();
|
|
19790
19780
|
return "Successfully updated account balance.";
|
|
19791
19781
|
} catch (error2) {
|
|
19792
|
-
throw new
|
|
19782
|
+
throw new InternalServerError40("Failed to update account balance.");
|
|
19793
19783
|
}
|
|
19794
19784
|
}
|
|
19795
19785
|
async function deleteById(_id, session) {
|
|
@@ -19803,7 +19793,7 @@ function useAccountBalanceRepo() {
|
|
|
19803
19793
|
repo.delCachedData();
|
|
19804
19794
|
return "Successfully deleted account balance.";
|
|
19805
19795
|
} catch (error) {
|
|
19806
|
-
throw new
|
|
19796
|
+
throw new InternalServerError40("Failed to delete account balance.");
|
|
19807
19797
|
}
|
|
19808
19798
|
}
|
|
19809
19799
|
return {
|
|
@@ -19961,12 +19951,12 @@ function modelJournal(data) {
|
|
|
19961
19951
|
|
|
19962
19952
|
// src/resources/finance-journal/finance.journal.repository.ts
|
|
19963
19953
|
import {
|
|
19964
|
-
AppError as
|
|
19954
|
+
AppError as AppError45,
|
|
19965
19955
|
BadRequestError as BadRequestError94,
|
|
19966
19956
|
makeCacheKey as makeCacheKey29,
|
|
19967
19957
|
paginate as paginate25,
|
|
19968
19958
|
logger as logger48,
|
|
19969
|
-
InternalServerError as
|
|
19959
|
+
InternalServerError as InternalServerError41,
|
|
19970
19960
|
useRepo as useRepo30
|
|
19971
19961
|
} from "@goweekdays/utils";
|
|
19972
19962
|
import { ObjectId as ObjectId51 } from "mongodb";
|
|
@@ -20130,10 +20120,10 @@ function useJournalRepo() {
|
|
|
20130
20120
|
});
|
|
20131
20121
|
return result;
|
|
20132
20122
|
} catch (error) {
|
|
20133
|
-
if (error instanceof
|
|
20123
|
+
if (error instanceof AppError45) {
|
|
20134
20124
|
throw error;
|
|
20135
20125
|
} else {
|
|
20136
|
-
throw new
|
|
20126
|
+
throw new InternalServerError41("Failed to get journal.");
|
|
20137
20127
|
}
|
|
20138
20128
|
}
|
|
20139
20129
|
}
|
|
@@ -20187,7 +20177,7 @@ function useJournalRepo() {
|
|
|
20187
20177
|
repo.delCachedData();
|
|
20188
20178
|
return "Successfully updated journal entry.";
|
|
20189
20179
|
} catch (error2) {
|
|
20190
|
-
throw new
|
|
20180
|
+
throw new InternalServerError41("Failed to update journal.");
|
|
20191
20181
|
}
|
|
20192
20182
|
}
|
|
20193
20183
|
async function deleteById(_id, session) {
|
|
@@ -20210,7 +20200,7 @@ function useJournalRepo() {
|
|
|
20210
20200
|
repo.delCachedData();
|
|
20211
20201
|
return "Successfully voided journal.";
|
|
20212
20202
|
} catch (error) {
|
|
20213
|
-
throw new
|
|
20203
|
+
throw new InternalServerError41("Failed to void journal.");
|
|
20214
20204
|
}
|
|
20215
20205
|
}
|
|
20216
20206
|
async function updateStatusById(_id, status2, session) {
|
|
@@ -20239,10 +20229,10 @@ function useJournalRepo() {
|
|
|
20239
20229
|
repo.delCachedData();
|
|
20240
20230
|
return "Successfully updated journal status.";
|
|
20241
20231
|
} catch (error) {
|
|
20242
|
-
if (error instanceof
|
|
20232
|
+
if (error instanceof AppError45) {
|
|
20243
20233
|
throw error;
|
|
20244
20234
|
}
|
|
20245
|
-
throw new
|
|
20235
|
+
throw new InternalServerError41("Failed to update journal status.");
|
|
20246
20236
|
}
|
|
20247
20237
|
}
|
|
20248
20238
|
async function existsByTransactionId(org, transactionId) {
|
|
@@ -20354,14 +20344,14 @@ function modelJournalLine(data) {
|
|
|
20354
20344
|
|
|
20355
20345
|
// src/resources/finance-journal-line/finance.journal.line.repository.ts
|
|
20356
20346
|
import {
|
|
20357
|
-
AppError as
|
|
20347
|
+
AppError as AppError46,
|
|
20358
20348
|
BadRequestError as BadRequestError96,
|
|
20359
20349
|
useAtlas as useAtlas14,
|
|
20360
20350
|
useCache as useCache3,
|
|
20361
20351
|
makeCacheKey as makeCacheKey30,
|
|
20362
20352
|
paginate as paginate26,
|
|
20363
20353
|
logger as logger49,
|
|
20364
|
-
InternalServerError as
|
|
20354
|
+
InternalServerError as InternalServerError42
|
|
20365
20355
|
} from "@goweekdays/utils";
|
|
20366
20356
|
import { ObjectId as ObjectId53 } from "mongodb";
|
|
20367
20357
|
import Joi86 from "joi";
|
|
@@ -20529,10 +20519,10 @@ function useJournalLineRepo() {
|
|
|
20529
20519
|
});
|
|
20530
20520
|
return result;
|
|
20531
20521
|
} catch (error) {
|
|
20532
|
-
if (error instanceof
|
|
20522
|
+
if (error instanceof AppError46) {
|
|
20533
20523
|
throw error;
|
|
20534
20524
|
} else {
|
|
20535
|
-
throw new
|
|
20525
|
+
throw new InternalServerError42("Failed to get journal line.");
|
|
20536
20526
|
}
|
|
20537
20527
|
}
|
|
20538
20528
|
}
|
|
@@ -20568,10 +20558,10 @@ function useJournalLineRepo() {
|
|
|
20568
20558
|
});
|
|
20569
20559
|
return result;
|
|
20570
20560
|
} catch (error) {
|
|
20571
|
-
if (error instanceof
|
|
20561
|
+
if (error instanceof AppError46) {
|
|
20572
20562
|
throw error;
|
|
20573
20563
|
} else {
|
|
20574
|
-
throw new
|
|
20564
|
+
throw new InternalServerError42("Failed to get journal line.");
|
|
20575
20565
|
}
|
|
20576
20566
|
}
|
|
20577
20567
|
}
|
|
@@ -20600,7 +20590,7 @@ function useJournalLineRepo() {
|
|
|
20600
20590
|
delCachedData();
|
|
20601
20591
|
return "Successfully updated journal line.";
|
|
20602
20592
|
} catch (error2) {
|
|
20603
|
-
throw new
|
|
20593
|
+
throw new InternalServerError42("Failed to update journal line.");
|
|
20604
20594
|
}
|
|
20605
20595
|
}
|
|
20606
20596
|
async function deleteById(_id, session) {
|
|
@@ -20614,7 +20604,7 @@ function useJournalLineRepo() {
|
|
|
20614
20604
|
delCachedData();
|
|
20615
20605
|
return "Successfully deleted journal line.";
|
|
20616
20606
|
} catch (error) {
|
|
20617
|
-
throw new
|
|
20607
|
+
throw new InternalServerError42("Failed to delete journal line.");
|
|
20618
20608
|
}
|
|
20619
20609
|
}
|
|
20620
20610
|
async function updateBalanceById(_id, balance, session) {
|
|
@@ -20631,7 +20621,7 @@ function useJournalLineRepo() {
|
|
|
20631
20621
|
);
|
|
20632
20622
|
delCachedData();
|
|
20633
20623
|
} catch (error) {
|
|
20634
|
-
throw new
|
|
20624
|
+
throw new InternalServerError42("Failed to update journal line balance.");
|
|
20635
20625
|
}
|
|
20636
20626
|
}
|
|
20637
20627
|
async function updateStatusByJournal(journalEntry, status2, session) {
|
|
@@ -20664,7 +20654,7 @@ function useJournalLineRepo() {
|
|
|
20664
20654
|
delCachedData();
|
|
20665
20655
|
return `Successfully updated journal line statuses to ${status2}.`;
|
|
20666
20656
|
} catch (error2) {
|
|
20667
|
-
throw new
|
|
20657
|
+
throw new InternalServerError42("Failed to update journal line statuses.");
|
|
20668
20658
|
}
|
|
20669
20659
|
}
|
|
20670
20660
|
return {
|
|
@@ -20682,9 +20672,9 @@ function useJournalLineRepo() {
|
|
|
20682
20672
|
|
|
20683
20673
|
// src/resources/finance-journal/finance.journal.service.ts
|
|
20684
20674
|
import {
|
|
20685
|
-
AppError as
|
|
20675
|
+
AppError as AppError50,
|
|
20686
20676
|
BadRequestError as BadRequestError105,
|
|
20687
|
-
InternalServerError as
|
|
20677
|
+
InternalServerError as InternalServerError46,
|
|
20688
20678
|
NotFoundError as NotFoundError7,
|
|
20689
20679
|
useAtlas as useAtlas16
|
|
20690
20680
|
} from "@goweekdays/utils";
|
|
@@ -20901,14 +20891,14 @@ function modelJournalLog(value) {
|
|
|
20901
20891
|
|
|
20902
20892
|
// src/resources/finance-journal-log/finance.journal.log.repository.ts
|
|
20903
20893
|
import {
|
|
20904
|
-
AppError as
|
|
20894
|
+
AppError as AppError47,
|
|
20905
20895
|
BadRequestError as BadRequestError99,
|
|
20906
20896
|
useAtlas as useAtlas15,
|
|
20907
20897
|
useCache as useCache4,
|
|
20908
20898
|
makeCacheKey as makeCacheKey31,
|
|
20909
20899
|
paginate as paginate27,
|
|
20910
20900
|
logger as logger50,
|
|
20911
|
-
InternalServerError as
|
|
20901
|
+
InternalServerError as InternalServerError43
|
|
20912
20902
|
} from "@goweekdays/utils";
|
|
20913
20903
|
import { ObjectId as ObjectId55 } from "mongodb";
|
|
20914
20904
|
import Joi88 from "joi";
|
|
@@ -21085,10 +21075,10 @@ function useJournalLogRepo() {
|
|
|
21085
21075
|
});
|
|
21086
21076
|
return result;
|
|
21087
21077
|
} catch (error) {
|
|
21088
|
-
if (error instanceof
|
|
21078
|
+
if (error instanceof AppError47) {
|
|
21089
21079
|
throw error;
|
|
21090
21080
|
} else {
|
|
21091
|
-
throw new
|
|
21081
|
+
throw new InternalServerError43("Failed to get journal log.");
|
|
21092
21082
|
}
|
|
21093
21083
|
}
|
|
21094
21084
|
}
|
|
@@ -21198,12 +21188,12 @@ function modelJournalTransaction(data) {
|
|
|
21198
21188
|
|
|
21199
21189
|
// src/resources/finance-journal-transaction/finance.journal.transaction.repository.ts
|
|
21200
21190
|
import {
|
|
21201
|
-
AppError as
|
|
21191
|
+
AppError as AppError48,
|
|
21202
21192
|
BadRequestError as BadRequestError102,
|
|
21203
21193
|
makeCacheKey as makeCacheKey32,
|
|
21204
21194
|
paginate as paginate28,
|
|
21205
21195
|
logger as logger52,
|
|
21206
|
-
InternalServerError as
|
|
21196
|
+
InternalServerError as InternalServerError44,
|
|
21207
21197
|
useRepo as useRepo31
|
|
21208
21198
|
} from "@goweekdays/utils";
|
|
21209
21199
|
import { ObjectId as ObjectId57 } from "mongodb";
|
|
@@ -21358,10 +21348,10 @@ function useJournalTransactionRepo() {
|
|
|
21358
21348
|
});
|
|
21359
21349
|
return result;
|
|
21360
21350
|
} catch (error) {
|
|
21361
|
-
if (error instanceof
|
|
21351
|
+
if (error instanceof AppError48) {
|
|
21362
21352
|
throw error;
|
|
21363
21353
|
} else {
|
|
21364
|
-
throw new
|
|
21354
|
+
throw new InternalServerError44("Failed to get journal transaction.");
|
|
21365
21355
|
}
|
|
21366
21356
|
}
|
|
21367
21357
|
}
|
|
@@ -21404,7 +21394,7 @@ function useJournalTransactionRepo() {
|
|
|
21404
21394
|
repo.delCachedData();
|
|
21405
21395
|
return "Successfully updated journal transaction.";
|
|
21406
21396
|
} catch (error2) {
|
|
21407
|
-
throw new
|
|
21397
|
+
throw new InternalServerError44("Failed to update journal transaction.");
|
|
21408
21398
|
}
|
|
21409
21399
|
}
|
|
21410
21400
|
async function deleteById(_id, session) {
|
|
@@ -21418,7 +21408,7 @@ function useJournalTransactionRepo() {
|
|
|
21418
21408
|
repo.delCachedData();
|
|
21419
21409
|
return "Successfully deleted journal transaction.";
|
|
21420
21410
|
} catch (error) {
|
|
21421
|
-
throw new
|
|
21411
|
+
throw new InternalServerError44("Failed to delete journal transaction.");
|
|
21422
21412
|
}
|
|
21423
21413
|
}
|
|
21424
21414
|
return {
|
|
@@ -21433,9 +21423,9 @@ function useJournalTransactionRepo() {
|
|
|
21433
21423
|
|
|
21434
21424
|
// src/resources/finance-journal-transaction/finance.journal.transaction.service.ts
|
|
21435
21425
|
import {
|
|
21436
|
-
AppError as
|
|
21426
|
+
AppError as AppError49,
|
|
21437
21427
|
BadRequestError as BadRequestError103,
|
|
21438
|
-
InternalServerError as
|
|
21428
|
+
InternalServerError as InternalServerError45,
|
|
21439
21429
|
NotFoundError as NotFoundError6
|
|
21440
21430
|
} from "@goweekdays/utils";
|
|
21441
21431
|
import Joi91 from "joi";
|
|
@@ -21475,10 +21465,10 @@ function useJournalTransactionService() {
|
|
|
21475
21465
|
const id = await _add(value);
|
|
21476
21466
|
return id;
|
|
21477
21467
|
} catch (error2) {
|
|
21478
|
-
if (error2 instanceof
|
|
21468
|
+
if (error2 instanceof AppError49) {
|
|
21479
21469
|
throw error2;
|
|
21480
21470
|
}
|
|
21481
|
-
throw new
|
|
21471
|
+
throw new InternalServerError45(
|
|
21482
21472
|
`Failed to create journal transaction: ${error2.message}`
|
|
21483
21473
|
);
|
|
21484
21474
|
}
|
|
@@ -21502,10 +21492,10 @@ function useJournalTransactionService() {
|
|
|
21502
21492
|
try {
|
|
21503
21493
|
return await _updateById(_id, options);
|
|
21504
21494
|
} catch (error2) {
|
|
21505
|
-
if (error2 instanceof
|
|
21495
|
+
if (error2 instanceof AppError49) {
|
|
21506
21496
|
throw error2;
|
|
21507
21497
|
}
|
|
21508
|
-
throw new
|
|
21498
|
+
throw new InternalServerError45(
|
|
21509
21499
|
`Failed to update journal transaction: ${error2.message}`
|
|
21510
21500
|
);
|
|
21511
21501
|
}
|
|
@@ -21755,10 +21745,10 @@ function useJournalService() {
|
|
|
21755
21745
|
return "Journal entry created successfully.";
|
|
21756
21746
|
} catch (error2) {
|
|
21757
21747
|
await session.abortTransaction();
|
|
21758
|
-
if (error2 instanceof
|
|
21748
|
+
if (error2 instanceof AppError50) {
|
|
21759
21749
|
throw error2;
|
|
21760
21750
|
}
|
|
21761
|
-
throw new
|
|
21751
|
+
throw new InternalServerError46(
|
|
21762
21752
|
`Failed to create general journal: ${error2.message}`
|
|
21763
21753
|
);
|
|
21764
21754
|
} finally {
|
|
@@ -22030,10 +22020,10 @@ function useJournalService() {
|
|
|
22030
22020
|
return "Journal entry status updated successfully.";
|
|
22031
22021
|
} catch (error2) {
|
|
22032
22022
|
await session.abortTransaction();
|
|
22033
|
-
if (error2 instanceof
|
|
22023
|
+
if (error2 instanceof AppError50) {
|
|
22034
22024
|
throw error2;
|
|
22035
22025
|
}
|
|
22036
|
-
throw new
|
|
22026
|
+
throw new InternalServerError46(
|
|
22037
22027
|
`Failed to update general journal status: ${error2.message}`
|
|
22038
22028
|
);
|
|
22039
22029
|
} finally {
|
|
@@ -22242,10 +22232,10 @@ function useJournalService() {
|
|
|
22242
22232
|
return "Journal entry updated successfully.";
|
|
22243
22233
|
} catch (error2) {
|
|
22244
22234
|
await session.abortTransaction();
|
|
22245
|
-
if (error2 instanceof
|
|
22235
|
+
if (error2 instanceof AppError50) {
|
|
22246
22236
|
throw error2;
|
|
22247
22237
|
}
|
|
22248
|
-
throw new
|
|
22238
|
+
throw new InternalServerError46(
|
|
22249
22239
|
`Failed to update general journal: ${error2.message}`
|
|
22250
22240
|
);
|
|
22251
22241
|
} finally {
|