@goweekdays/core 2.15.4 → 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 +12 -0
- package/dist/index.js +37 -74
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +268 -304
- 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";
|
|
@@ -10985,19 +10986,6 @@ function useOrgService() {
|
|
|
10985
10986
|
},
|
|
10986
10987
|
session
|
|
10987
10988
|
);
|
|
10988
|
-
await addJobStatusConfig(
|
|
10989
|
-
{
|
|
10990
|
-
org: String(org),
|
|
10991
|
-
statusTransitions: DEFAULT_JOB_STATUS_SETUP
|
|
10992
|
-
},
|
|
10993
|
-
session
|
|
10994
|
-
);
|
|
10995
|
-
await addJobSummary(
|
|
10996
|
-
{
|
|
10997
|
-
org: String(org)
|
|
10998
|
-
},
|
|
10999
|
-
session
|
|
11000
|
-
);
|
|
11001
10989
|
await useCustomerRepo().add(
|
|
11002
10990
|
{
|
|
11003
10991
|
org: String(org),
|
|
@@ -11018,22 +11006,23 @@ function useOrgService() {
|
|
|
11018
11006
|
},
|
|
11019
11007
|
filePath
|
|
11020
11008
|
});
|
|
11021
|
-
mailer.sendMail({
|
|
11009
|
+
await mailer.sendMail({
|
|
11022
11010
|
to: verification.email,
|
|
11023
11011
|
subject: "Welcome to GoWeekdays - Your Organization is Ready",
|
|
11024
11012
|
from: `"GoWeekdays" <support@goweekdays.com>`,
|
|
11025
11013
|
html: emailContent
|
|
11026
|
-
}).catch((error2) => {
|
|
11027
|
-
logger28.log({
|
|
11028
|
-
level: "error",
|
|
11029
|
-
message: `Error sending user invite email: ${error2}`
|
|
11030
|
-
});
|
|
11031
11014
|
});
|
|
11032
11015
|
await session?.commitTransaction();
|
|
11033
11016
|
return "Successfully created organization with verification.";
|
|
11034
11017
|
} catch (error2) {
|
|
11035
11018
|
await session?.abortTransaction();
|
|
11036
|
-
|
|
11019
|
+
if (error2 instanceof AppError26) {
|
|
11020
|
+
throw error2;
|
|
11021
|
+
} else {
|
|
11022
|
+
throw new InternalServerError26(
|
|
11023
|
+
"Failed to create organization with verification."
|
|
11024
|
+
);
|
|
11025
|
+
}
|
|
11037
11026
|
} finally {
|
|
11038
11027
|
await session?.endSession();
|
|
11039
11028
|
}
|
|
@@ -11122,19 +11111,6 @@ function useOrgService() {
|
|
|
11122
11111
|
},
|
|
11123
11112
|
session
|
|
11124
11113
|
);
|
|
11125
|
-
await addJobStatusConfig(
|
|
11126
|
-
{
|
|
11127
|
-
org: String(org),
|
|
11128
|
-
statusTransitions: DEFAULT_JOB_STATUS_SETUP
|
|
11129
|
-
},
|
|
11130
|
-
session
|
|
11131
|
-
);
|
|
11132
|
-
await addJobSummary(
|
|
11133
|
-
{
|
|
11134
|
-
org: String(org)
|
|
11135
|
-
},
|
|
11136
|
-
session
|
|
11137
|
-
);
|
|
11138
11114
|
await useCustomerRepo().add(
|
|
11139
11115
|
{
|
|
11140
11116
|
org: String(org),
|
|
@@ -11155,22 +11131,23 @@ function useOrgService() {
|
|
|
11155
11131
|
},
|
|
11156
11132
|
filePath
|
|
11157
11133
|
});
|
|
11158
|
-
mailer.sendMail({
|
|
11134
|
+
await mailer.sendMail({
|
|
11159
11135
|
to: verification.email,
|
|
11160
11136
|
subject: "Welcome to GoWeekdays - Your Organization is Ready",
|
|
11161
11137
|
from: `"GoWeekdays" <support@goweekdays.com>`,
|
|
11162
11138
|
html: emailContent
|
|
11163
|
-
}).catch((error2) => {
|
|
11164
|
-
logger28.log({
|
|
11165
|
-
level: "error",
|
|
11166
|
-
message: `Error sending user invite email: ${error2}`
|
|
11167
|
-
});
|
|
11168
11139
|
});
|
|
11169
11140
|
await session?.commitTransaction();
|
|
11170
11141
|
return "Successfully created organization with verification.";
|
|
11171
11142
|
} catch (error2) {
|
|
11172
11143
|
await session?.abortTransaction();
|
|
11173
|
-
|
|
11144
|
+
if (error2 instanceof AppError26) {
|
|
11145
|
+
throw error2;
|
|
11146
|
+
} else {
|
|
11147
|
+
throw new InternalServerError26(
|
|
11148
|
+
"Failed to create organization with verification."
|
|
11149
|
+
);
|
|
11150
|
+
}
|
|
11174
11151
|
} finally {
|
|
11175
11152
|
await session?.endSession();
|
|
11176
11153
|
}
|
|
@@ -11481,10 +11458,10 @@ function useUserService() {
|
|
|
11481
11458
|
});
|
|
11482
11459
|
return insertedId;
|
|
11483
11460
|
} catch (error) {
|
|
11484
|
-
if (error instanceof
|
|
11461
|
+
if (error instanceof AppError27) {
|
|
11485
11462
|
throw error;
|
|
11486
11463
|
} else {
|
|
11487
|
-
throw new
|
|
11464
|
+
throw new InternalServerError27(`Error creating user: ${error}`);
|
|
11488
11465
|
}
|
|
11489
11466
|
}
|
|
11490
11467
|
}
|
|
@@ -11561,10 +11538,10 @@ function useUserService() {
|
|
|
11561
11538
|
return userId;
|
|
11562
11539
|
} catch (error) {
|
|
11563
11540
|
await session?.abortTransaction();
|
|
11564
|
-
if (error instanceof
|
|
11541
|
+
if (error instanceof AppError27) {
|
|
11565
11542
|
throw error;
|
|
11566
11543
|
} else {
|
|
11567
|
-
throw new
|
|
11544
|
+
throw new InternalServerError27("Failed to create user by invite.");
|
|
11568
11545
|
}
|
|
11569
11546
|
} finally {
|
|
11570
11547
|
session?.endSession();
|
|
@@ -11630,11 +11607,11 @@ function useUserService() {
|
|
|
11630
11607
|
try {
|
|
11631
11608
|
hashedPassword = await hashPassword(value.newPassword);
|
|
11632
11609
|
} catch (error) {
|
|
11633
|
-
throw new
|
|
11610
|
+
throw new InternalServerError27(`Error hashing password: ${error}`);
|
|
11634
11611
|
}
|
|
11635
11612
|
const session = useAtlas5.getClient()?.startSession();
|
|
11636
11613
|
if (!session) {
|
|
11637
|
-
throw new
|
|
11614
|
+
throw new InternalServerError27("Failed to start database session.");
|
|
11638
11615
|
}
|
|
11639
11616
|
try {
|
|
11640
11617
|
session.startTransaction();
|
|
@@ -11661,10 +11638,10 @@ function useUserService() {
|
|
|
11661
11638
|
return "Successfully reset password.";
|
|
11662
11639
|
} catch (error) {
|
|
11663
11640
|
await session.abortTransaction();
|
|
11664
|
-
if (error instanceof
|
|
11641
|
+
if (error instanceof AppError27) {
|
|
11665
11642
|
throw error;
|
|
11666
11643
|
}
|
|
11667
|
-
throw new
|
|
11644
|
+
throw new InternalServerError27("Failed to reset password.");
|
|
11668
11645
|
}
|
|
11669
11646
|
}
|
|
11670
11647
|
const { updateName: updateMemberName } = useMemberRepo();
|
|
@@ -11782,9 +11759,9 @@ function useUserService() {
|
|
|
11782
11759
|
|
|
11783
11760
|
// src/resources/user/user.controller.ts
|
|
11784
11761
|
import {
|
|
11785
|
-
AppError as
|
|
11762
|
+
AppError as AppError28,
|
|
11786
11763
|
BadRequestError as BadRequestError57,
|
|
11787
|
-
InternalServerError as
|
|
11764
|
+
InternalServerError as InternalServerError28
|
|
11788
11765
|
} from "@goweekdays/utils";
|
|
11789
11766
|
import Joi53 from "joi";
|
|
11790
11767
|
function useUserController() {
|
|
@@ -11929,10 +11906,10 @@ function useUserController() {
|
|
|
11929
11906
|
res.json({ message: "Successfully updated profile picture." });
|
|
11930
11907
|
return;
|
|
11931
11908
|
} catch (error2) {
|
|
11932
|
-
if (error2 instanceof
|
|
11909
|
+
if (error2 instanceof AppError28) {
|
|
11933
11910
|
next(error2);
|
|
11934
11911
|
} else {
|
|
11935
|
-
next(new
|
|
11912
|
+
next(new InternalServerError28(error2));
|
|
11936
11913
|
}
|
|
11937
11914
|
}
|
|
11938
11915
|
}
|
|
@@ -12068,16 +12045,11 @@ function useVerificationService() {
|
|
|
12068
12045
|
},
|
|
12069
12046
|
filePath: filePath2
|
|
12070
12047
|
});
|
|
12071
|
-
mailer.sendMail({
|
|
12048
|
+
await mailer.sendMail({
|
|
12072
12049
|
to: email,
|
|
12073
12050
|
subject: "Member Invite",
|
|
12074
12051
|
html: emailContent2,
|
|
12075
12052
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12076
|
-
}).catch((error) => {
|
|
12077
|
-
logger30.log({
|
|
12078
|
-
level: "error",
|
|
12079
|
-
message: `Error sending user invite email: ${error}`
|
|
12080
|
-
});
|
|
12081
12053
|
});
|
|
12082
12054
|
return res2;
|
|
12083
12055
|
}
|
|
@@ -12090,20 +12062,19 @@ function useVerificationService() {
|
|
|
12090
12062
|
},
|
|
12091
12063
|
filePath
|
|
12092
12064
|
});
|
|
12093
|
-
mailer.sendMail({
|
|
12065
|
+
await mailer.sendMail({
|
|
12094
12066
|
to: email,
|
|
12095
12067
|
subject: "User Invite",
|
|
12096
12068
|
html: emailContent,
|
|
12097
12069
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12098
|
-
}).catch((error) => {
|
|
12099
|
-
logger30.log({
|
|
12100
|
-
level: "error",
|
|
12101
|
-
message: `Error sending user invite email: ${error}`
|
|
12102
|
-
});
|
|
12103
12070
|
});
|
|
12104
12071
|
return res;
|
|
12105
12072
|
} catch (error) {
|
|
12106
|
-
|
|
12073
|
+
if (error instanceof AppError29) {
|
|
12074
|
+
throw error;
|
|
12075
|
+
} else {
|
|
12076
|
+
throw new InternalServerError29("Failed to create user invitation.");
|
|
12077
|
+
}
|
|
12107
12078
|
}
|
|
12108
12079
|
}
|
|
12109
12080
|
async function createForgetPassword(email) {
|
|
@@ -12125,20 +12096,19 @@ function useVerificationService() {
|
|
|
12125
12096
|
},
|
|
12126
12097
|
filePath
|
|
12127
12098
|
});
|
|
12128
|
-
mailer.sendMail({
|
|
12099
|
+
await mailer.sendMail({
|
|
12129
12100
|
to: email,
|
|
12130
12101
|
subject: "Forget Password",
|
|
12131
12102
|
from: `"GoWeekdays" <support@goweekdays.com>`,
|
|
12132
12103
|
html: emailContent
|
|
12133
|
-
}).catch((error) => {
|
|
12134
|
-
logger30.log({
|
|
12135
|
-
level: "error",
|
|
12136
|
-
message: `Error sending forget password email: ${error}`
|
|
12137
|
-
});
|
|
12138
12104
|
});
|
|
12139
12105
|
return "Successfully created a link to reset password. Please check your email.";
|
|
12140
12106
|
} catch (error) {
|
|
12141
|
-
|
|
12107
|
+
if (error instanceof AppError29) {
|
|
12108
|
+
throw error;
|
|
12109
|
+
} else {
|
|
12110
|
+
throw new InternalServerError29("Failed to create forget password link.");
|
|
12111
|
+
}
|
|
12142
12112
|
}
|
|
12143
12113
|
}
|
|
12144
12114
|
async function getById(id) {
|
|
@@ -12274,7 +12244,7 @@ function useVerificationService() {
|
|
|
12274
12244
|
try {
|
|
12275
12245
|
await updateStatusById(id, "cancelled");
|
|
12276
12246
|
} catch (error) {
|
|
12277
|
-
throw new
|
|
12247
|
+
throw new InternalServerError29(
|
|
12278
12248
|
`Error cancelling user invitation: ${error}`
|
|
12279
12249
|
);
|
|
12280
12250
|
}
|
|
@@ -12315,20 +12285,19 @@ function useVerificationService() {
|
|
|
12315
12285
|
},
|
|
12316
12286
|
filePath
|
|
12317
12287
|
});
|
|
12318
|
-
mailer.sendMail({
|
|
12288
|
+
await mailer.sendMail({
|
|
12319
12289
|
to: email,
|
|
12320
12290
|
subject: "Sign Up Verification",
|
|
12321
12291
|
html: emailContent,
|
|
12322
12292
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12323
|
-
}).catch((error) => {
|
|
12324
|
-
logger30.log({
|
|
12325
|
-
level: "error",
|
|
12326
|
-
message: `Error sending user invite email: ${error}`
|
|
12327
|
-
});
|
|
12328
12293
|
});
|
|
12329
12294
|
return res;
|
|
12330
12295
|
} catch (error) {
|
|
12331
|
-
|
|
12296
|
+
if (error instanceof AppError29) {
|
|
12297
|
+
throw error;
|
|
12298
|
+
} else {
|
|
12299
|
+
throw new InternalServerError29("Failed to create sign up verification.");
|
|
12300
|
+
}
|
|
12332
12301
|
}
|
|
12333
12302
|
}
|
|
12334
12303
|
const { getByOrg } = useSubscriptionRepo();
|
|
@@ -12407,16 +12376,11 @@ function useVerificationService() {
|
|
|
12407
12376
|
},
|
|
12408
12377
|
filePath: filePath2
|
|
12409
12378
|
});
|
|
12410
|
-
mailer.sendMail({
|
|
12379
|
+
await mailer.sendMail({
|
|
12411
12380
|
to: value.email,
|
|
12412
12381
|
subject: "Member Invite",
|
|
12413
12382
|
html: emailContent2,
|
|
12414
12383
|
from: `"GoWeekdays" <support@goweekdays.com>`
|
|
12415
|
-
}).catch((error2) => {
|
|
12416
|
-
logger30.log({
|
|
12417
|
-
level: "error",
|
|
12418
|
-
message: `Error sending user invite email: ${error2}`
|
|
12419
|
-
});
|
|
12420
12384
|
});
|
|
12421
12385
|
return verificationId2;
|
|
12422
12386
|
}
|
|
@@ -12429,7 +12393,7 @@ function useVerificationService() {
|
|
|
12429
12393
|
},
|
|
12430
12394
|
filePath
|
|
12431
12395
|
});
|
|
12432
|
-
mailer.sendMail({
|
|
12396
|
+
await mailer.sendMail({
|
|
12433
12397
|
to: value.email,
|
|
12434
12398
|
subject: "User Invite",
|
|
12435
12399
|
html: emailContent,
|
|
@@ -12442,10 +12406,10 @@ function useVerificationService() {
|
|
|
12442
12406
|
});
|
|
12443
12407
|
return verificationId;
|
|
12444
12408
|
} catch (error2) {
|
|
12445
|
-
if (error2 instanceof
|
|
12409
|
+
if (error2 instanceof AppError29) {
|
|
12446
12410
|
throw error2;
|
|
12447
12411
|
} else {
|
|
12448
|
-
throw new
|
|
12412
|
+
throw new InternalServerError29("Failed to invite member.");
|
|
12449
12413
|
}
|
|
12450
12414
|
}
|
|
12451
12415
|
}
|
|
@@ -12468,10 +12432,10 @@ function useVerificationService() {
|
|
|
12468
12432
|
await _updateStatusById(id, "cancelled");
|
|
12469
12433
|
return "Successfully cancelled the invitation.";
|
|
12470
12434
|
} catch (error2) {
|
|
12471
|
-
if (error2 instanceof
|
|
12435
|
+
if (error2 instanceof AppError29) {
|
|
12472
12436
|
throw error2;
|
|
12473
12437
|
} else {
|
|
12474
|
-
throw new
|
|
12438
|
+
throw new InternalServerError29("Failed to cancel the invitation.");
|
|
12475
12439
|
}
|
|
12476
12440
|
}
|
|
12477
12441
|
}
|
|
@@ -12509,10 +12473,10 @@ function useVerificationService() {
|
|
|
12509
12473
|
});
|
|
12510
12474
|
return "Successfully created a link to reset password. Please check your email.";
|
|
12511
12475
|
} catch (error2) {
|
|
12512
|
-
if (error2 instanceof
|
|
12476
|
+
if (error2 instanceof AppError29) {
|
|
12513
12477
|
throw error2;
|
|
12514
12478
|
} else {
|
|
12515
|
-
throw new
|
|
12479
|
+
throw new InternalServerError29(
|
|
12516
12480
|
"Failed to process forget password request."
|
|
12517
12481
|
);
|
|
12518
12482
|
}
|
|
@@ -12570,10 +12534,10 @@ function useVerificationService() {
|
|
|
12570
12534
|
message: `Error processing organization setup fee: ${error}`
|
|
12571
12535
|
});
|
|
12572
12536
|
await session?.abortTransaction();
|
|
12573
|
-
if (error instanceof
|
|
12537
|
+
if (error instanceof AppError29) {
|
|
12574
12538
|
throw error;
|
|
12575
12539
|
}
|
|
12576
|
-
throw new
|
|
12540
|
+
throw new InternalServerError29(
|
|
12577
12541
|
"Failed to process organization setup fee."
|
|
12578
12542
|
);
|
|
12579
12543
|
} finally {
|
|
@@ -12630,10 +12594,10 @@ function useVerificationService() {
|
|
|
12630
12594
|
message: `Error inviting organization: ${error2}`
|
|
12631
12595
|
});
|
|
12632
12596
|
await session?.abortTransaction();
|
|
12633
|
-
if (error2 instanceof
|
|
12597
|
+
if (error2 instanceof AppError29) {
|
|
12634
12598
|
throw error2;
|
|
12635
12599
|
}
|
|
12636
|
-
throw new
|
|
12600
|
+
throw new InternalServerError29(
|
|
12637
12601
|
"Failed to process organization setup fee."
|
|
12638
12602
|
);
|
|
12639
12603
|
} finally {
|
|
@@ -12689,10 +12653,10 @@ function useAuthController() {
|
|
|
12689
12653
|
level: "error",
|
|
12690
12654
|
message: `Error during login: ${error2.message}`
|
|
12691
12655
|
});
|
|
12692
|
-
if (error2 instanceof
|
|
12656
|
+
if (error2 instanceof AppError30) {
|
|
12693
12657
|
next(error2);
|
|
12694
12658
|
} else {
|
|
12695
|
-
next(new
|
|
12659
|
+
next(new InternalServerError30("An unexpected error occurred"));
|
|
12696
12660
|
}
|
|
12697
12661
|
return;
|
|
12698
12662
|
}
|
|
@@ -12707,10 +12671,10 @@ function useAuthController() {
|
|
|
12707
12671
|
await useAuthService().logout(user);
|
|
12708
12672
|
res.json({ message: "Logged out successfully" });
|
|
12709
12673
|
} catch (error) {
|
|
12710
|
-
if (error instanceof
|
|
12674
|
+
if (error instanceof AppError30) {
|
|
12711
12675
|
next(error);
|
|
12712
12676
|
} else {
|
|
12713
|
-
next(new
|
|
12677
|
+
next(new InternalServerError30("An unexpected error occurred"));
|
|
12714
12678
|
}
|
|
12715
12679
|
}
|
|
12716
12680
|
}
|
|
@@ -12838,9 +12802,9 @@ function MBuildingUnit(value) {
|
|
|
12838
12802
|
|
|
12839
12803
|
// src/resources/building/building.repository.ts
|
|
12840
12804
|
import {
|
|
12841
|
-
AppError as
|
|
12805
|
+
AppError as AppError31,
|
|
12842
12806
|
BadRequestError as BadRequestError61,
|
|
12843
|
-
InternalServerError as
|
|
12807
|
+
InternalServerError as InternalServerError31,
|
|
12844
12808
|
logger as logger33,
|
|
12845
12809
|
makeCacheKey as makeCacheKey19,
|
|
12846
12810
|
paginate as paginate17,
|
|
@@ -12872,7 +12836,7 @@ function useBuildingRepo() {
|
|
|
12872
12836
|
level: "error",
|
|
12873
12837
|
message: error.message
|
|
12874
12838
|
});
|
|
12875
|
-
if (error instanceof
|
|
12839
|
+
if (error instanceof AppError31) {
|
|
12876
12840
|
throw error;
|
|
12877
12841
|
} else {
|
|
12878
12842
|
const isDuplicated = error.message.includes("duplicate");
|
|
@@ -12902,7 +12866,7 @@ function useBuildingRepo() {
|
|
|
12902
12866
|
level: "error",
|
|
12903
12867
|
message: error.message
|
|
12904
12868
|
});
|
|
12905
|
-
if (error instanceof
|
|
12869
|
+
if (error instanceof AppError31) {
|
|
12906
12870
|
throw error;
|
|
12907
12871
|
} else {
|
|
12908
12872
|
throw new Error("Failed to update building.");
|
|
@@ -13014,10 +12978,10 @@ function useBuildingRepo() {
|
|
|
13014
12978
|
});
|
|
13015
12979
|
return result;
|
|
13016
12980
|
} catch (error) {
|
|
13017
|
-
if (error instanceof
|
|
12981
|
+
if (error instanceof AppError31) {
|
|
13018
12982
|
throw error;
|
|
13019
12983
|
} else {
|
|
13020
|
-
throw new
|
|
12984
|
+
throw new InternalServerError31("Failed to get building.");
|
|
13021
12985
|
}
|
|
13022
12986
|
}
|
|
13023
12987
|
}
|
|
@@ -13039,10 +13003,10 @@ function useBuildingRepo() {
|
|
|
13039
13003
|
level: "error",
|
|
13040
13004
|
message: error.message
|
|
13041
13005
|
});
|
|
13042
|
-
if (error instanceof
|
|
13006
|
+
if (error instanceof AppError31) {
|
|
13043
13007
|
throw error;
|
|
13044
13008
|
} else {
|
|
13045
|
-
throw new
|
|
13009
|
+
throw new InternalServerError31("Failed to delete building.");
|
|
13046
13010
|
}
|
|
13047
13011
|
}
|
|
13048
13012
|
}
|
|
@@ -13061,9 +13025,9 @@ import { BadRequestError as BadRequestError63, NotFoundError as NotFoundError4,
|
|
|
13061
13025
|
|
|
13062
13026
|
// src/resources/building/building-unit.repository.ts
|
|
13063
13027
|
import {
|
|
13064
|
-
AppError as
|
|
13028
|
+
AppError as AppError32,
|
|
13065
13029
|
BadRequestError as BadRequestError62,
|
|
13066
|
-
InternalServerError as
|
|
13030
|
+
InternalServerError as InternalServerError32,
|
|
13067
13031
|
logger as logger34,
|
|
13068
13032
|
makeCacheKey as makeCacheKey20,
|
|
13069
13033
|
paginate as paginate18,
|
|
@@ -13109,7 +13073,7 @@ function useBuildingUnitRepo() {
|
|
|
13109
13073
|
level: "error",
|
|
13110
13074
|
message: error.message
|
|
13111
13075
|
});
|
|
13112
|
-
if (error instanceof
|
|
13076
|
+
if (error instanceof AppError32) {
|
|
13113
13077
|
throw error;
|
|
13114
13078
|
} else {
|
|
13115
13079
|
throw new Error("Failed to create building unit.");
|
|
@@ -13139,7 +13103,7 @@ function useBuildingUnitRepo() {
|
|
|
13139
13103
|
level: "error",
|
|
13140
13104
|
message: error2.message
|
|
13141
13105
|
});
|
|
13142
|
-
if (error2 instanceof
|
|
13106
|
+
if (error2 instanceof AppError32) {
|
|
13143
13107
|
throw error2;
|
|
13144
13108
|
} else {
|
|
13145
13109
|
throw new Error("Failed to create building unit.");
|
|
@@ -13169,7 +13133,7 @@ function useBuildingUnitRepo() {
|
|
|
13169
13133
|
level: "error",
|
|
13170
13134
|
message: error2.message
|
|
13171
13135
|
});
|
|
13172
|
-
if (error2 instanceof
|
|
13136
|
+
if (error2 instanceof AppError32) {
|
|
13173
13137
|
throw error2;
|
|
13174
13138
|
} else {
|
|
13175
13139
|
throw new Error("Failed to update building unit.");
|
|
@@ -13296,10 +13260,10 @@ function useBuildingUnitRepo() {
|
|
|
13296
13260
|
});
|
|
13297
13261
|
return result;
|
|
13298
13262
|
} catch (error) {
|
|
13299
|
-
if (error instanceof
|
|
13263
|
+
if (error instanceof AppError32) {
|
|
13300
13264
|
throw error;
|
|
13301
13265
|
} else {
|
|
13302
|
-
throw new
|
|
13266
|
+
throw new InternalServerError32("Failed to get building unit.");
|
|
13303
13267
|
}
|
|
13304
13268
|
}
|
|
13305
13269
|
}
|
|
@@ -13340,10 +13304,10 @@ function useBuildingUnitRepo() {
|
|
|
13340
13304
|
});
|
|
13341
13305
|
return result;
|
|
13342
13306
|
} catch (error) {
|
|
13343
|
-
if (error instanceof
|
|
13307
|
+
if (error instanceof AppError32) {
|
|
13344
13308
|
throw error;
|
|
13345
13309
|
} else {
|
|
13346
|
-
throw new
|
|
13310
|
+
throw new InternalServerError32("Failed to get building unit.");
|
|
13347
13311
|
}
|
|
13348
13312
|
}
|
|
13349
13313
|
}
|
|
@@ -13382,10 +13346,10 @@ function useBuildingUnitRepo() {
|
|
|
13382
13346
|
});
|
|
13383
13347
|
return result;
|
|
13384
13348
|
} catch (error) {
|
|
13385
|
-
if (error instanceof
|
|
13349
|
+
if (error instanceof AppError32) {
|
|
13386
13350
|
throw error;
|
|
13387
13351
|
} else {
|
|
13388
|
-
throw new
|
|
13352
|
+
throw new InternalServerError32("Failed to get building unit.");
|
|
13389
13353
|
}
|
|
13390
13354
|
}
|
|
13391
13355
|
}
|
|
@@ -13408,7 +13372,7 @@ function useBuildingUnitRepo() {
|
|
|
13408
13372
|
level: "error",
|
|
13409
13373
|
message: error.message
|
|
13410
13374
|
});
|
|
13411
|
-
if (error instanceof
|
|
13375
|
+
if (error instanceof AppError32) {
|
|
13412
13376
|
throw error;
|
|
13413
13377
|
} else {
|
|
13414
13378
|
throw new Error("Failed to deleted room/facility.");
|
|
@@ -14040,9 +14004,9 @@ function useFileService() {
|
|
|
14040
14004
|
|
|
14041
14005
|
// src/resources/file/file.controller.ts
|
|
14042
14006
|
import {
|
|
14043
|
-
AppError as
|
|
14007
|
+
AppError as AppError33,
|
|
14044
14008
|
BadRequestError as BadRequestError67,
|
|
14045
|
-
InternalServerError as
|
|
14009
|
+
InternalServerError as InternalServerError33
|
|
14046
14010
|
} from "@goweekdays/utils";
|
|
14047
14011
|
import Joi59 from "joi";
|
|
14048
14012
|
function useFileController() {
|
|
@@ -14057,10 +14021,10 @@ function useFileController() {
|
|
|
14057
14021
|
res.json({ message: "Successfully uploaded file", id });
|
|
14058
14022
|
return;
|
|
14059
14023
|
} catch (error) {
|
|
14060
|
-
if (error instanceof
|
|
14024
|
+
if (error instanceof AppError33) {
|
|
14061
14025
|
next(error);
|
|
14062
14026
|
} else {
|
|
14063
|
-
next(new
|
|
14027
|
+
next(new InternalServerError33(error));
|
|
14064
14028
|
}
|
|
14065
14029
|
}
|
|
14066
14030
|
}
|
|
@@ -14076,10 +14040,10 @@ function useFileController() {
|
|
|
14076
14040
|
res.json({ message });
|
|
14077
14041
|
return;
|
|
14078
14042
|
} catch (error2) {
|
|
14079
|
-
if (error2 instanceof
|
|
14043
|
+
if (error2 instanceof AppError33) {
|
|
14080
14044
|
next(error2);
|
|
14081
14045
|
} else {
|
|
14082
|
-
next(new
|
|
14046
|
+
next(new InternalServerError33(error2));
|
|
14083
14047
|
}
|
|
14084
14048
|
}
|
|
14085
14049
|
}
|
|
@@ -14091,9 +14055,9 @@ function useFileController() {
|
|
|
14091
14055
|
|
|
14092
14056
|
// src/resources/options/option.repository.ts
|
|
14093
14057
|
import {
|
|
14094
|
-
AppError as
|
|
14058
|
+
AppError as AppError34,
|
|
14095
14059
|
BadRequestError as BadRequestError69,
|
|
14096
|
-
InternalServerError as
|
|
14060
|
+
InternalServerError as InternalServerError34,
|
|
14097
14061
|
logger as logger38,
|
|
14098
14062
|
makeCacheKey as makeCacheKey22,
|
|
14099
14063
|
paginate as paginate19,
|
|
@@ -14233,10 +14197,10 @@ function useOptionRepo(namespace_collection) {
|
|
|
14233
14197
|
});
|
|
14234
14198
|
return result;
|
|
14235
14199
|
} catch (error) {
|
|
14236
|
-
if (error instanceof
|
|
14200
|
+
if (error instanceof AppError34) {
|
|
14237
14201
|
throw error;
|
|
14238
14202
|
} else {
|
|
14239
|
-
throw new
|
|
14203
|
+
throw new InternalServerError34("Failed to get job post.");
|
|
14240
14204
|
}
|
|
14241
14205
|
}
|
|
14242
14206
|
}
|
|
@@ -14400,13 +14364,13 @@ import { BadRequestError as BadRequestError74, logger as logger40 } from "@gowee
|
|
|
14400
14364
|
|
|
14401
14365
|
// src/resources/job-post/job.post.repository.ts
|
|
14402
14366
|
import {
|
|
14403
|
-
AppError as
|
|
14367
|
+
AppError as AppError35,
|
|
14404
14368
|
BadRequestError as BadRequestError72,
|
|
14405
14369
|
useRepo as useRepo24,
|
|
14406
14370
|
makeCacheKey as makeCacheKey23,
|
|
14407
14371
|
paginate as paginate20,
|
|
14408
14372
|
logger as logger39,
|
|
14409
|
-
InternalServerError as
|
|
14373
|
+
InternalServerError as InternalServerError35
|
|
14410
14374
|
} from "@goweekdays/utils";
|
|
14411
14375
|
import { ObjectId as ObjectId39 } from "mongodb";
|
|
14412
14376
|
function useJobPostRepo() {
|
|
@@ -14581,7 +14545,7 @@ function useJobPostRepo() {
|
|
|
14581
14545
|
});
|
|
14582
14546
|
return data;
|
|
14583
14547
|
} catch (error) {
|
|
14584
|
-
throw new
|
|
14548
|
+
throw new InternalServerError35(
|
|
14585
14549
|
"Internal server error, failed to retrieve job posts."
|
|
14586
14550
|
);
|
|
14587
14551
|
}
|
|
@@ -14619,10 +14583,10 @@ function useJobPostRepo() {
|
|
|
14619
14583
|
});
|
|
14620
14584
|
return result;
|
|
14621
14585
|
} catch (error) {
|
|
14622
|
-
if (error instanceof
|
|
14586
|
+
if (error instanceof AppError35) {
|
|
14623
14587
|
throw error;
|
|
14624
14588
|
} else {
|
|
14625
|
-
throw new
|
|
14589
|
+
throw new InternalServerError35("Failed to get job post.");
|
|
14626
14590
|
}
|
|
14627
14591
|
}
|
|
14628
14592
|
}
|
|
@@ -14644,7 +14608,7 @@ function useJobPostRepo() {
|
|
|
14644
14608
|
repo.delCachedData();
|
|
14645
14609
|
return "Successfully updated job post.";
|
|
14646
14610
|
} catch (error2) {
|
|
14647
|
-
throw new
|
|
14611
|
+
throw new InternalServerError35("Failed to update job post.");
|
|
14648
14612
|
}
|
|
14649
14613
|
}
|
|
14650
14614
|
async function deleteById(_id, session) {
|
|
@@ -14668,7 +14632,7 @@ function useJobPostRepo() {
|
|
|
14668
14632
|
repo.delCachedData();
|
|
14669
14633
|
return "Successfully deleted job post.";
|
|
14670
14634
|
} catch (error) {
|
|
14671
|
-
throw new
|
|
14635
|
+
throw new InternalServerError35("Failed to delete job post.");
|
|
14672
14636
|
}
|
|
14673
14637
|
}
|
|
14674
14638
|
async function updateStatusById(_id, status2) {
|
|
@@ -14693,10 +14657,10 @@ function useJobPostRepo() {
|
|
|
14693
14657
|
repo.delCachedData();
|
|
14694
14658
|
return "Successfully updated job post status.";
|
|
14695
14659
|
} catch (error) {
|
|
14696
|
-
if (error instanceof
|
|
14660
|
+
if (error instanceof AppError35) {
|
|
14697
14661
|
throw error;
|
|
14698
14662
|
}
|
|
14699
|
-
throw new
|
|
14663
|
+
throw new InternalServerError35("Failed to update job post status.");
|
|
14700
14664
|
}
|
|
14701
14665
|
}
|
|
14702
14666
|
return {
|
|
@@ -14713,9 +14677,9 @@ function useJobPostRepo() {
|
|
|
14713
14677
|
|
|
14714
14678
|
// src/resources/job-post/job.post.service.ts
|
|
14715
14679
|
import {
|
|
14716
|
-
AppError as
|
|
14680
|
+
AppError as AppError36,
|
|
14717
14681
|
BadRequestError as BadRequestError73,
|
|
14718
|
-
InternalServerError as
|
|
14682
|
+
InternalServerError as InternalServerError36,
|
|
14719
14683
|
useAtlas as useAtlas11
|
|
14720
14684
|
} from "@goweekdays/utils";
|
|
14721
14685
|
import Joi63 from "joi";
|
|
@@ -14733,7 +14697,7 @@ function useJobPostService() {
|
|
|
14733
14697
|
async function add(value) {
|
|
14734
14698
|
const session = useAtlas11.getClient()?.startSession();
|
|
14735
14699
|
if (!session) {
|
|
14736
|
-
throw new
|
|
14700
|
+
throw new InternalServerError36("Failed to start database session.");
|
|
14737
14701
|
}
|
|
14738
14702
|
try {
|
|
14739
14703
|
session.startTransaction();
|
|
@@ -14761,10 +14725,10 @@ function useJobPostService() {
|
|
|
14761
14725
|
return "Successfully created job post.";
|
|
14762
14726
|
} catch (error) {
|
|
14763
14727
|
await session.abortTransaction();
|
|
14764
|
-
if (error instanceof
|
|
14728
|
+
if (error instanceof AppError36) {
|
|
14765
14729
|
throw error;
|
|
14766
14730
|
}
|
|
14767
|
-
throw new
|
|
14731
|
+
throw new InternalServerError36("Failed to create job post.");
|
|
14768
14732
|
} finally {
|
|
14769
14733
|
await session.endSession();
|
|
14770
14734
|
}
|
|
@@ -14778,10 +14742,10 @@ function useJobPostService() {
|
|
|
14778
14742
|
await _deleteById(id);
|
|
14779
14743
|
return "Successfully deleted job post.";
|
|
14780
14744
|
} catch (error2) {
|
|
14781
|
-
if (error2 instanceof
|
|
14745
|
+
if (error2 instanceof AppError36) {
|
|
14782
14746
|
throw error2;
|
|
14783
14747
|
} else {
|
|
14784
|
-
throw new
|
|
14748
|
+
throw new InternalServerError36("Failed to delete job post.");
|
|
14785
14749
|
}
|
|
14786
14750
|
}
|
|
14787
14751
|
}
|
|
@@ -14808,10 +14772,10 @@ function useJobPostService() {
|
|
|
14808
14772
|
await _updateStatusById(id, newStatus);
|
|
14809
14773
|
return "Successfully updated job post status.";
|
|
14810
14774
|
} catch (error) {
|
|
14811
|
-
if (error instanceof
|
|
14775
|
+
if (error instanceof AppError36) {
|
|
14812
14776
|
throw error;
|
|
14813
14777
|
}
|
|
14814
|
-
throw new
|
|
14778
|
+
throw new InternalServerError36("Failed to update job post status.");
|
|
14815
14779
|
}
|
|
14816
14780
|
}
|
|
14817
14781
|
return {
|
|
@@ -15460,7 +15424,7 @@ function modelJobProfileCert(data) {
|
|
|
15460
15424
|
|
|
15461
15425
|
// src/resources/job-profile/job.profile.repository.ts
|
|
15462
15426
|
import {
|
|
15463
|
-
AppError as
|
|
15427
|
+
AppError as AppError37,
|
|
15464
15428
|
BadRequestError as BadRequestError77,
|
|
15465
15429
|
logger as logger41,
|
|
15466
15430
|
makeCacheKey as makeCacheKey24,
|
|
@@ -15491,7 +15455,7 @@ function useJobProfileRepo() {
|
|
|
15491
15455
|
repo.delCachedData();
|
|
15492
15456
|
return res.insertedId;
|
|
15493
15457
|
} catch (error2) {
|
|
15494
|
-
if (error2 instanceof
|
|
15458
|
+
if (error2 instanceof AppError37) {
|
|
15495
15459
|
throw error2;
|
|
15496
15460
|
}
|
|
15497
15461
|
throw new BadRequestError77(
|
|
@@ -15543,7 +15507,7 @@ function useJobProfileRepo() {
|
|
|
15543
15507
|
});
|
|
15544
15508
|
return data;
|
|
15545
15509
|
} catch (error) {
|
|
15546
|
-
if (error instanceof
|
|
15510
|
+
if (error instanceof AppError37) {
|
|
15547
15511
|
throw error;
|
|
15548
15512
|
}
|
|
15549
15513
|
throw new BadRequestError77(`Failed to get job profiles: ${error.message}`);
|
|
@@ -15582,7 +15546,7 @@ function useJobProfileRepo() {
|
|
|
15582
15546
|
});
|
|
15583
15547
|
return data;
|
|
15584
15548
|
} catch (error2) {
|
|
15585
|
-
if (error2 instanceof
|
|
15549
|
+
if (error2 instanceof AppError37) {
|
|
15586
15550
|
throw error2;
|
|
15587
15551
|
}
|
|
15588
15552
|
throw new BadRequestError77(
|
|
@@ -15611,7 +15575,7 @@ function useJobProfileRepo() {
|
|
|
15611
15575
|
repo.delCachedData();
|
|
15612
15576
|
return "Successfully updated job profile contact info.";
|
|
15613
15577
|
} catch (error2) {
|
|
15614
|
-
if (error2 instanceof
|
|
15578
|
+
if (error2 instanceof AppError37) {
|
|
15615
15579
|
throw error2;
|
|
15616
15580
|
}
|
|
15617
15581
|
throw new BadRequestError77(
|
|
@@ -15637,7 +15601,7 @@ function useJobProfileRepo() {
|
|
|
15637
15601
|
repo.delCachedData();
|
|
15638
15602
|
return "Successfully updated job profile summary.";
|
|
15639
15603
|
} catch (error2) {
|
|
15640
|
-
if (error2 instanceof
|
|
15604
|
+
if (error2 instanceof AppError37) {
|
|
15641
15605
|
throw error2;
|
|
15642
15606
|
}
|
|
15643
15607
|
throw new BadRequestError77(
|
|
@@ -15666,7 +15630,7 @@ function useJobProfileRepo() {
|
|
|
15666
15630
|
repo.delCachedData();
|
|
15667
15631
|
return "Successfully updated job profile personal info.";
|
|
15668
15632
|
} catch (error2) {
|
|
15669
|
-
if (error2 instanceof
|
|
15633
|
+
if (error2 instanceof AppError37) {
|
|
15670
15634
|
throw error2;
|
|
15671
15635
|
}
|
|
15672
15636
|
throw new BadRequestError77(
|
|
@@ -15696,7 +15660,7 @@ function useJobProfileRepo() {
|
|
|
15696
15660
|
repo.delCachedData();
|
|
15697
15661
|
return "Successfully added job profile work experience.";
|
|
15698
15662
|
} catch (error2) {
|
|
15699
|
-
if (error2 instanceof
|
|
15663
|
+
if (error2 instanceof AppError37) {
|
|
15700
15664
|
throw error2;
|
|
15701
15665
|
}
|
|
15702
15666
|
throw new BadRequestError77(
|
|
@@ -15725,7 +15689,7 @@ function useJobProfileRepo() {
|
|
|
15725
15689
|
repo.delCachedData();
|
|
15726
15690
|
return "Successfully updated job profile work experience.";
|
|
15727
15691
|
} catch (error2) {
|
|
15728
|
-
if (error2 instanceof
|
|
15692
|
+
if (error2 instanceof AppError37) {
|
|
15729
15693
|
throw error2;
|
|
15730
15694
|
}
|
|
15731
15695
|
throw new BadRequestError77(
|
|
@@ -15765,7 +15729,7 @@ function useJobProfileRepo() {
|
|
|
15765
15729
|
repo.delCachedData();
|
|
15766
15730
|
return "Successfully deleted job profile work experience.";
|
|
15767
15731
|
} catch (error2) {
|
|
15768
|
-
if (error2 instanceof
|
|
15732
|
+
if (error2 instanceof AppError37) {
|
|
15769
15733
|
throw error2;
|
|
15770
15734
|
}
|
|
15771
15735
|
throw new BadRequestError77(
|
|
@@ -15795,7 +15759,7 @@ function useJobProfileRepo() {
|
|
|
15795
15759
|
repo.delCachedData();
|
|
15796
15760
|
return "Successfully added job profile education.";
|
|
15797
15761
|
} catch (error2) {
|
|
15798
|
-
if (error2 instanceof
|
|
15762
|
+
if (error2 instanceof AppError37) {
|
|
15799
15763
|
throw error2;
|
|
15800
15764
|
}
|
|
15801
15765
|
throw new BadRequestError77(
|
|
@@ -15824,7 +15788,7 @@ function useJobProfileRepo() {
|
|
|
15824
15788
|
repo.delCachedData();
|
|
15825
15789
|
return "Successfully updated job profile education.";
|
|
15826
15790
|
} catch (error2) {
|
|
15827
|
-
if (error2 instanceof
|
|
15791
|
+
if (error2 instanceof AppError37) {
|
|
15828
15792
|
throw error2;
|
|
15829
15793
|
}
|
|
15830
15794
|
throw new BadRequestError77(
|
|
@@ -15864,7 +15828,7 @@ function useJobProfileRepo() {
|
|
|
15864
15828
|
repo.delCachedData();
|
|
15865
15829
|
return "Successfully deleted job profile education.";
|
|
15866
15830
|
} catch (error2) {
|
|
15867
|
-
if (error2 instanceof
|
|
15831
|
+
if (error2 instanceof AppError37) {
|
|
15868
15832
|
throw error2;
|
|
15869
15833
|
}
|
|
15870
15834
|
throw new BadRequestError77(
|
|
@@ -15894,7 +15858,7 @@ function useJobProfileRepo() {
|
|
|
15894
15858
|
repo.delCachedData();
|
|
15895
15859
|
return "Successfully added job profile skill.";
|
|
15896
15860
|
} catch (error2) {
|
|
15897
|
-
if (error2 instanceof
|
|
15861
|
+
if (error2 instanceof AppError37) {
|
|
15898
15862
|
throw error2;
|
|
15899
15863
|
}
|
|
15900
15864
|
throw new BadRequestError77(
|
|
@@ -15923,7 +15887,7 @@ function useJobProfileRepo() {
|
|
|
15923
15887
|
repo.delCachedData();
|
|
15924
15888
|
return "Successfully updated job profile skill.";
|
|
15925
15889
|
} catch (error2) {
|
|
15926
|
-
if (error2 instanceof
|
|
15890
|
+
if (error2 instanceof AppError37) {
|
|
15927
15891
|
throw error2;
|
|
15928
15892
|
}
|
|
15929
15893
|
throw new BadRequestError77(
|
|
@@ -15963,7 +15927,7 @@ function useJobProfileRepo() {
|
|
|
15963
15927
|
repo.delCachedData();
|
|
15964
15928
|
return "Successfully deleted job profile skill.";
|
|
15965
15929
|
} catch (error2) {
|
|
15966
|
-
if (error2 instanceof
|
|
15930
|
+
if (error2 instanceof AppError37) {
|
|
15967
15931
|
throw error2;
|
|
15968
15932
|
}
|
|
15969
15933
|
throw new BadRequestError77(
|
|
@@ -15992,7 +15956,7 @@ function useJobProfileRepo() {
|
|
|
15992
15956
|
repo.delCachedData();
|
|
15993
15957
|
return "Successfully updated job profile additionalInfo.";
|
|
15994
15958
|
} catch (error2) {
|
|
15995
|
-
if (error2 instanceof
|
|
15959
|
+
if (error2 instanceof AppError37) {
|
|
15996
15960
|
throw error2;
|
|
15997
15961
|
}
|
|
15998
15962
|
throw new BadRequestError77(
|
|
@@ -16022,7 +15986,7 @@ function useJobProfileRepo() {
|
|
|
16022
15986
|
repo.delCachedData();
|
|
16023
15987
|
return "Successfully added job profile language.";
|
|
16024
15988
|
} catch (error2) {
|
|
16025
|
-
if (error2 instanceof
|
|
15989
|
+
if (error2 instanceof AppError37) {
|
|
16026
15990
|
throw error2;
|
|
16027
15991
|
}
|
|
16028
15992
|
throw new BadRequestError77(
|
|
@@ -16051,7 +16015,7 @@ function useJobProfileRepo() {
|
|
|
16051
16015
|
repo.delCachedData();
|
|
16052
16016
|
return "Successfully updated job profile language.";
|
|
16053
16017
|
} catch (error2) {
|
|
16054
|
-
if (error2 instanceof
|
|
16018
|
+
if (error2 instanceof AppError37) {
|
|
16055
16019
|
throw error2;
|
|
16056
16020
|
}
|
|
16057
16021
|
throw new BadRequestError77(
|
|
@@ -16091,7 +16055,7 @@ function useJobProfileRepo() {
|
|
|
16091
16055
|
repo.delCachedData();
|
|
16092
16056
|
return "Successfully deleted job profile language.";
|
|
16093
16057
|
} catch (error2) {
|
|
16094
|
-
if (error2 instanceof
|
|
16058
|
+
if (error2 instanceof AppError37) {
|
|
16095
16059
|
throw error2;
|
|
16096
16060
|
}
|
|
16097
16061
|
throw new BadRequestError77(
|
|
@@ -16121,7 +16085,7 @@ function useJobProfileRepo() {
|
|
|
16121
16085
|
repo.delCachedData();
|
|
16122
16086
|
return "Successfully added job profile certification.";
|
|
16123
16087
|
} catch (error2) {
|
|
16124
|
-
if (error2 instanceof
|
|
16088
|
+
if (error2 instanceof AppError37) {
|
|
16125
16089
|
throw error2;
|
|
16126
16090
|
}
|
|
16127
16091
|
throw new BadRequestError77(
|
|
@@ -16150,7 +16114,7 @@ function useJobProfileRepo() {
|
|
|
16150
16114
|
repo.delCachedData();
|
|
16151
16115
|
return "Successfully updated job profile certification.";
|
|
16152
16116
|
} catch (error2) {
|
|
16153
|
-
if (error2 instanceof
|
|
16117
|
+
if (error2 instanceof AppError37) {
|
|
16154
16118
|
throw error2;
|
|
16155
16119
|
}
|
|
16156
16120
|
throw new BadRequestError77(
|
|
@@ -16190,7 +16154,7 @@ function useJobProfileRepo() {
|
|
|
16190
16154
|
repo.delCachedData();
|
|
16191
16155
|
return "Successfully deleted job profile certification.";
|
|
16192
16156
|
} catch (error2) {
|
|
16193
|
-
if (error2 instanceof
|
|
16157
|
+
if (error2 instanceof AppError37) {
|
|
16194
16158
|
throw error2;
|
|
16195
16159
|
}
|
|
16196
16160
|
throw new BadRequestError77(
|
|
@@ -16227,14 +16191,14 @@ function useJobProfileRepo() {
|
|
|
16227
16191
|
}
|
|
16228
16192
|
|
|
16229
16193
|
// src/resources/job-profile/job.profile.controller.ts
|
|
16230
|
-
import { AppError as
|
|
16194
|
+
import { AppError as AppError39, BadRequestError as BadRequestError79, NotFoundError as NotFoundError5 } from "@goweekdays/utils";
|
|
16231
16195
|
import Joi69 from "joi";
|
|
16232
16196
|
|
|
16233
16197
|
// src/resources/job-profile/job.profile.service.ts
|
|
16234
16198
|
import {
|
|
16235
|
-
AppError as
|
|
16199
|
+
AppError as AppError38,
|
|
16236
16200
|
BadRequestError as BadRequestError78,
|
|
16237
|
-
InternalServerError as
|
|
16201
|
+
InternalServerError as InternalServerError37,
|
|
16238
16202
|
useAtlas as useAtlas12
|
|
16239
16203
|
} from "@goweekdays/utils";
|
|
16240
16204
|
import Joi68 from "joi";
|
|
@@ -16257,7 +16221,7 @@ function useJobPostProfileSvc() {
|
|
|
16257
16221
|
}
|
|
16258
16222
|
const session = useAtlas12.getClient()?.startSession();
|
|
16259
16223
|
if (!session) {
|
|
16260
|
-
throw new
|
|
16224
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16261
16225
|
}
|
|
16262
16226
|
try {
|
|
16263
16227
|
session.startTransaction();
|
|
@@ -16278,10 +16242,10 @@ function useJobPostProfileSvc() {
|
|
|
16278
16242
|
return "Successfully updated contact info.";
|
|
16279
16243
|
} catch (error2) {
|
|
16280
16244
|
await session.abortTransaction();
|
|
16281
|
-
if (error2 instanceof
|
|
16245
|
+
if (error2 instanceof AppError38) {
|
|
16282
16246
|
throw error2;
|
|
16283
16247
|
}
|
|
16284
|
-
throw new
|
|
16248
|
+
throw new InternalServerError37("Failed to update contact info.");
|
|
16285
16249
|
} finally {
|
|
16286
16250
|
await session.endSession();
|
|
16287
16251
|
}
|
|
@@ -16296,7 +16260,7 @@ function useJobPostProfileSvc() {
|
|
|
16296
16260
|
}
|
|
16297
16261
|
const session = useAtlas12.getClient()?.startSession();
|
|
16298
16262
|
if (!session) {
|
|
16299
|
-
throw new
|
|
16263
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16300
16264
|
}
|
|
16301
16265
|
try {
|
|
16302
16266
|
session.startTransaction();
|
|
@@ -16311,10 +16275,10 @@ function useJobPostProfileSvc() {
|
|
|
16311
16275
|
return "Successfully updated personal info.";
|
|
16312
16276
|
} catch (error2) {
|
|
16313
16277
|
await session.abortTransaction();
|
|
16314
|
-
if (error2 instanceof
|
|
16278
|
+
if (error2 instanceof AppError38) {
|
|
16315
16279
|
throw error2;
|
|
16316
16280
|
}
|
|
16317
|
-
throw new
|
|
16281
|
+
throw new InternalServerError37("Failed to update personal info.");
|
|
16318
16282
|
} finally {
|
|
16319
16283
|
await session.endSession();
|
|
16320
16284
|
}
|
|
@@ -16326,7 +16290,7 @@ function useJobPostProfileSvc() {
|
|
|
16326
16290
|
}
|
|
16327
16291
|
const session = useAtlas12.getClient()?.startSession();
|
|
16328
16292
|
if (!session) {
|
|
16329
|
-
throw new
|
|
16293
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16330
16294
|
}
|
|
16331
16295
|
try {
|
|
16332
16296
|
session.startTransaction();
|
|
@@ -16349,10 +16313,10 @@ function useJobPostProfileSvc() {
|
|
|
16349
16313
|
return "Successfully added work experience.";
|
|
16350
16314
|
} catch (error2) {
|
|
16351
16315
|
await session.abortTransaction();
|
|
16352
|
-
if (error2 instanceof
|
|
16316
|
+
if (error2 instanceof AppError38) {
|
|
16353
16317
|
throw error2;
|
|
16354
16318
|
}
|
|
16355
|
-
throw new
|
|
16319
|
+
throw new InternalServerError37("Failed to add work experience.");
|
|
16356
16320
|
} finally {
|
|
16357
16321
|
await session.endSession();
|
|
16358
16322
|
}
|
|
@@ -16364,7 +16328,7 @@ function useJobPostProfileSvc() {
|
|
|
16364
16328
|
}
|
|
16365
16329
|
const session = useAtlas12.getClient()?.startSession();
|
|
16366
16330
|
if (!session) {
|
|
16367
|
-
throw new
|
|
16331
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16368
16332
|
}
|
|
16369
16333
|
try {
|
|
16370
16334
|
session.startTransaction();
|
|
@@ -16387,10 +16351,10 @@ function useJobPostProfileSvc() {
|
|
|
16387
16351
|
return "Successfully updated work experience.";
|
|
16388
16352
|
} catch (error2) {
|
|
16389
16353
|
await session.abortTransaction();
|
|
16390
|
-
if (error2 instanceof
|
|
16354
|
+
if (error2 instanceof AppError38) {
|
|
16391
16355
|
throw error2;
|
|
16392
16356
|
}
|
|
16393
|
-
throw new
|
|
16357
|
+
throw new InternalServerError37("Failed to update work experience.");
|
|
16394
16358
|
} finally {
|
|
16395
16359
|
await session.endSession();
|
|
16396
16360
|
}
|
|
@@ -16402,7 +16366,7 @@ function useJobPostProfileSvc() {
|
|
|
16402
16366
|
}
|
|
16403
16367
|
const session = useAtlas12.getClient()?.startSession();
|
|
16404
16368
|
if (!session) {
|
|
16405
|
-
throw new
|
|
16369
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16406
16370
|
}
|
|
16407
16371
|
try {
|
|
16408
16372
|
session.startTransaction();
|
|
@@ -16421,10 +16385,10 @@ function useJobPostProfileSvc() {
|
|
|
16421
16385
|
return "Successfully added education.";
|
|
16422
16386
|
} catch (error2) {
|
|
16423
16387
|
await session.abortTransaction();
|
|
16424
|
-
if (error2 instanceof
|
|
16388
|
+
if (error2 instanceof AppError38) {
|
|
16425
16389
|
throw error2;
|
|
16426
16390
|
}
|
|
16427
|
-
throw new
|
|
16391
|
+
throw new InternalServerError37("Failed to add education.");
|
|
16428
16392
|
} finally {
|
|
16429
16393
|
await session.endSession();
|
|
16430
16394
|
}
|
|
@@ -16436,7 +16400,7 @@ function useJobPostProfileSvc() {
|
|
|
16436
16400
|
}
|
|
16437
16401
|
const session = useAtlas12.getClient()?.startSession();
|
|
16438
16402
|
if (!session) {
|
|
16439
|
-
throw new
|
|
16403
|
+
throw new InternalServerError37("Failed to start database session.");
|
|
16440
16404
|
}
|
|
16441
16405
|
try {
|
|
16442
16406
|
session.startTransaction();
|
|
@@ -16455,10 +16419,10 @@ function useJobPostProfileSvc() {
|
|
|
16455
16419
|
return "Successfully updated education.";
|
|
16456
16420
|
} catch (error2) {
|
|
16457
16421
|
await session.abortTransaction();
|
|
16458
|
-
if (error2 instanceof
|
|
16422
|
+
if (error2 instanceof AppError38) {
|
|
16459
16423
|
throw error2;
|
|
16460
16424
|
}
|
|
16461
|
-
throw new
|
|
16425
|
+
throw new InternalServerError37("Failed to update education.");
|
|
16462
16426
|
} finally {
|
|
16463
16427
|
await session.endSession();
|
|
16464
16428
|
}
|
|
@@ -16514,7 +16478,7 @@ function useJobProfileCtrl() {
|
|
|
16514
16478
|
res.json({ message });
|
|
16515
16479
|
return;
|
|
16516
16480
|
} catch (error2) {
|
|
16517
|
-
if (error2 instanceof
|
|
16481
|
+
if (error2 instanceof AppError39) {
|
|
16518
16482
|
next(error2);
|
|
16519
16483
|
return;
|
|
16520
16484
|
}
|
|
@@ -16544,7 +16508,7 @@ function useJobProfileCtrl() {
|
|
|
16544
16508
|
res.json(data);
|
|
16545
16509
|
return;
|
|
16546
16510
|
} catch (error2) {
|
|
16547
|
-
if (error2 instanceof
|
|
16511
|
+
if (error2 instanceof AppError39) {
|
|
16548
16512
|
next(error2);
|
|
16549
16513
|
return;
|
|
16550
16514
|
}
|
|
@@ -16567,7 +16531,7 @@ function useJobProfileCtrl() {
|
|
|
16567
16531
|
res.json(data);
|
|
16568
16532
|
return;
|
|
16569
16533
|
} catch (error2) {
|
|
16570
|
-
if (error2 instanceof
|
|
16534
|
+
if (error2 instanceof AppError39) {
|
|
16571
16535
|
next(error2);
|
|
16572
16536
|
return;
|
|
16573
16537
|
}
|
|
@@ -16589,7 +16553,7 @@ function useJobProfileCtrl() {
|
|
|
16589
16553
|
res.json({ message });
|
|
16590
16554
|
return;
|
|
16591
16555
|
} catch (error2) {
|
|
16592
|
-
if (error2 instanceof
|
|
16556
|
+
if (error2 instanceof AppError39) {
|
|
16593
16557
|
next(error2);
|
|
16594
16558
|
return;
|
|
16595
16559
|
}
|
|
@@ -16613,7 +16577,7 @@ function useJobProfileCtrl() {
|
|
|
16613
16577
|
res.json({ message });
|
|
16614
16578
|
return;
|
|
16615
16579
|
} catch (error2) {
|
|
16616
|
-
if (error2 instanceof
|
|
16580
|
+
if (error2 instanceof AppError39) {
|
|
16617
16581
|
next(error2);
|
|
16618
16582
|
return;
|
|
16619
16583
|
}
|
|
@@ -16637,7 +16601,7 @@ function useJobProfileCtrl() {
|
|
|
16637
16601
|
res.json({ message });
|
|
16638
16602
|
return;
|
|
16639
16603
|
} catch (error2) {
|
|
16640
|
-
if (error2 instanceof
|
|
16604
|
+
if (error2 instanceof AppError39) {
|
|
16641
16605
|
next(error2);
|
|
16642
16606
|
return;
|
|
16643
16607
|
}
|
|
@@ -16663,7 +16627,7 @@ function useJobProfileCtrl() {
|
|
|
16663
16627
|
res.json({ message });
|
|
16664
16628
|
return;
|
|
16665
16629
|
} catch (error2) {
|
|
16666
|
-
if (error2 instanceof
|
|
16630
|
+
if (error2 instanceof AppError39) {
|
|
16667
16631
|
next(error2);
|
|
16668
16632
|
return;
|
|
16669
16633
|
}
|
|
@@ -16687,7 +16651,7 @@ function useJobProfileCtrl() {
|
|
|
16687
16651
|
res.json({ message });
|
|
16688
16652
|
return;
|
|
16689
16653
|
} catch (error2) {
|
|
16690
|
-
if (error2 instanceof
|
|
16654
|
+
if (error2 instanceof AppError39) {
|
|
16691
16655
|
next(error2);
|
|
16692
16656
|
return;
|
|
16693
16657
|
}
|
|
@@ -16713,7 +16677,7 @@ function useJobProfileCtrl() {
|
|
|
16713
16677
|
res.json({ message });
|
|
16714
16678
|
return;
|
|
16715
16679
|
} catch (error2) {
|
|
16716
|
-
if (error2 instanceof
|
|
16680
|
+
if (error2 instanceof AppError39) {
|
|
16717
16681
|
next(error2);
|
|
16718
16682
|
return;
|
|
16719
16683
|
}
|
|
@@ -16737,7 +16701,7 @@ function useJobProfileCtrl() {
|
|
|
16737
16701
|
res.json({ message });
|
|
16738
16702
|
return;
|
|
16739
16703
|
} catch (error2) {
|
|
16740
|
-
if (error2 instanceof
|
|
16704
|
+
if (error2 instanceof AppError39) {
|
|
16741
16705
|
next(error2);
|
|
16742
16706
|
return;
|
|
16743
16707
|
}
|
|
@@ -16757,7 +16721,7 @@ function useJobProfileCtrl() {
|
|
|
16757
16721
|
res.json({ message });
|
|
16758
16722
|
return;
|
|
16759
16723
|
} catch (error2) {
|
|
16760
|
-
if (error2 instanceof
|
|
16724
|
+
if (error2 instanceof AppError39) {
|
|
16761
16725
|
next(error2);
|
|
16762
16726
|
return;
|
|
16763
16727
|
}
|
|
@@ -16777,7 +16741,7 @@ function useJobProfileCtrl() {
|
|
|
16777
16741
|
res.json({ message });
|
|
16778
16742
|
return;
|
|
16779
16743
|
} catch (error2) {
|
|
16780
|
-
if (error2 instanceof
|
|
16744
|
+
if (error2 instanceof AppError39) {
|
|
16781
16745
|
next(error2);
|
|
16782
16746
|
return;
|
|
16783
16747
|
}
|
|
@@ -16797,7 +16761,7 @@ function useJobProfileCtrl() {
|
|
|
16797
16761
|
res.json({ message });
|
|
16798
16762
|
return;
|
|
16799
16763
|
} catch (error2) {
|
|
16800
|
-
if (error2 instanceof
|
|
16764
|
+
if (error2 instanceof AppError39) {
|
|
16801
16765
|
next(error2);
|
|
16802
16766
|
return;
|
|
16803
16767
|
}
|
|
@@ -16817,7 +16781,7 @@ function useJobProfileCtrl() {
|
|
|
16817
16781
|
res.json({ message });
|
|
16818
16782
|
return;
|
|
16819
16783
|
} catch (error2) {
|
|
16820
|
-
if (error2 instanceof
|
|
16784
|
+
if (error2 instanceof AppError39) {
|
|
16821
16785
|
next(error2);
|
|
16822
16786
|
return;
|
|
16823
16787
|
}
|
|
@@ -16837,7 +16801,7 @@ function useJobProfileCtrl() {
|
|
|
16837
16801
|
res.json({ message });
|
|
16838
16802
|
return;
|
|
16839
16803
|
} catch (error2) {
|
|
16840
|
-
if (error2 instanceof
|
|
16804
|
+
if (error2 instanceof AppError39) {
|
|
16841
16805
|
next(error2);
|
|
16842
16806
|
return;
|
|
16843
16807
|
}
|
|
@@ -16860,7 +16824,7 @@ function useJobProfileCtrl() {
|
|
|
16860
16824
|
res.json({ message });
|
|
16861
16825
|
return;
|
|
16862
16826
|
} catch (error2) {
|
|
16863
|
-
if (error2 instanceof
|
|
16827
|
+
if (error2 instanceof AppError39) {
|
|
16864
16828
|
next(error2);
|
|
16865
16829
|
return;
|
|
16866
16830
|
}
|
|
@@ -16884,7 +16848,7 @@ function useJobProfileCtrl() {
|
|
|
16884
16848
|
res.json({ message });
|
|
16885
16849
|
return;
|
|
16886
16850
|
} catch (error2) {
|
|
16887
|
-
if (error2 instanceof
|
|
16851
|
+
if (error2 instanceof AppError39) {
|
|
16888
16852
|
next(error2);
|
|
16889
16853
|
return;
|
|
16890
16854
|
}
|
|
@@ -16904,7 +16868,7 @@ function useJobProfileCtrl() {
|
|
|
16904
16868
|
res.json({ message });
|
|
16905
16869
|
return;
|
|
16906
16870
|
} catch (error2) {
|
|
16907
|
-
if (error2 instanceof
|
|
16871
|
+
if (error2 instanceof AppError39) {
|
|
16908
16872
|
next(error2);
|
|
16909
16873
|
return;
|
|
16910
16874
|
}
|
|
@@ -16924,7 +16888,7 @@ function useJobProfileCtrl() {
|
|
|
16924
16888
|
res.json({ message });
|
|
16925
16889
|
return;
|
|
16926
16890
|
} catch (error2) {
|
|
16927
|
-
if (error2 instanceof
|
|
16891
|
+
if (error2 instanceof AppError39) {
|
|
16928
16892
|
next(error2);
|
|
16929
16893
|
return;
|
|
16930
16894
|
}
|
|
@@ -16944,7 +16908,7 @@ function useJobProfileCtrl() {
|
|
|
16944
16908
|
res.json({ message });
|
|
16945
16909
|
return;
|
|
16946
16910
|
} catch (error2) {
|
|
16947
|
-
if (error2 instanceof
|
|
16911
|
+
if (error2 instanceof AppError39) {
|
|
16948
16912
|
next(error2);
|
|
16949
16913
|
return;
|
|
16950
16914
|
}
|
|
@@ -16966,7 +16930,7 @@ function useJobProfileCtrl() {
|
|
|
16966
16930
|
res.json({ message });
|
|
16967
16931
|
return;
|
|
16968
16932
|
} catch (error2) {
|
|
16969
|
-
if (error2 instanceof
|
|
16933
|
+
if (error2 instanceof AppError39) {
|
|
16970
16934
|
next(error2);
|
|
16971
16935
|
return;
|
|
16972
16936
|
}
|
|
@@ -16988,7 +16952,7 @@ function useJobProfileCtrl() {
|
|
|
16988
16952
|
res.json({ message });
|
|
16989
16953
|
return;
|
|
16990
16954
|
} catch (error2) {
|
|
16991
|
-
if (error2 instanceof
|
|
16955
|
+
if (error2 instanceof AppError39) {
|
|
16992
16956
|
next(error2);
|
|
16993
16957
|
return;
|
|
16994
16958
|
}
|
|
@@ -17025,7 +16989,7 @@ function useJobProfileCtrl() {
|
|
|
17025
16989
|
|
|
17026
16990
|
// src/resources/job-summary/job.summary.service.ts
|
|
17027
16991
|
import Joi70 from "joi";
|
|
17028
|
-
import { AppError as
|
|
16992
|
+
import { AppError as AppError40, BadRequestError as BadRequestError80 } from "@goweekdays/utils";
|
|
17029
16993
|
function useJobSummarySvc() {
|
|
17030
16994
|
const repo = useJobSummaryRepo();
|
|
17031
16995
|
async function getByOrg(org) {
|
|
@@ -17040,7 +17004,7 @@ function useJobSummarySvc() {
|
|
|
17040
17004
|
}
|
|
17041
17005
|
return await repo.getByOrg(org);
|
|
17042
17006
|
} catch (error2) {
|
|
17043
|
-
if (error2 instanceof
|
|
17007
|
+
if (error2 instanceof AppError40) {
|
|
17044
17008
|
throw error2;
|
|
17045
17009
|
}
|
|
17046
17010
|
throw new BadRequestError80("Failed to get job summary by org.");
|
|
@@ -17475,7 +17439,7 @@ function useBusinessProfileRepo() {
|
|
|
17475
17439
|
}
|
|
17476
17440
|
|
|
17477
17441
|
// src/resources/finance-profile/finance.profile.controller.ts
|
|
17478
|
-
import { AppError as
|
|
17442
|
+
import { AppError as AppError41, BadRequestError as BadRequestError84 } from "@goweekdays/utils";
|
|
17479
17443
|
function useBusinessProfileCtrl() {
|
|
17480
17444
|
const repo = useBusinessProfileRepo();
|
|
17481
17445
|
async function add(req, res, next) {
|
|
@@ -17495,7 +17459,7 @@ function useBusinessProfileCtrl() {
|
|
|
17495
17459
|
res.json({ message: "Business profile created successfully" });
|
|
17496
17460
|
return;
|
|
17497
17461
|
} catch (error2) {
|
|
17498
|
-
if (error2 instanceof
|
|
17462
|
+
if (error2 instanceof AppError41) {
|
|
17499
17463
|
next(error2);
|
|
17500
17464
|
return;
|
|
17501
17465
|
}
|
|
@@ -17729,13 +17693,13 @@ function modelTax(data) {
|
|
|
17729
17693
|
|
|
17730
17694
|
// src/resources/finance-tax/tax.repository.ts
|
|
17731
17695
|
import {
|
|
17732
|
-
AppError as
|
|
17696
|
+
AppError as AppError42,
|
|
17733
17697
|
BadRequestError as BadRequestError86,
|
|
17734
17698
|
useRepo as useRepo27,
|
|
17735
17699
|
makeCacheKey as makeCacheKey26,
|
|
17736
17700
|
paginate as paginate22,
|
|
17737
17701
|
logger as logger43,
|
|
17738
|
-
InternalServerError as
|
|
17702
|
+
InternalServerError as InternalServerError38
|
|
17739
17703
|
} from "@goweekdays/utils";
|
|
17740
17704
|
import { ObjectId as ObjectId45 } from "mongodb";
|
|
17741
17705
|
import Joi75 from "joi";
|
|
@@ -17899,7 +17863,7 @@ function useTaxRepo() {
|
|
|
17899
17863
|
});
|
|
17900
17864
|
return data;
|
|
17901
17865
|
} catch (error) {
|
|
17902
|
-
throw new
|
|
17866
|
+
throw new InternalServerError38(
|
|
17903
17867
|
"Internal server error, failed to retrieve taxes."
|
|
17904
17868
|
);
|
|
17905
17869
|
}
|
|
@@ -17937,10 +17901,10 @@ function useTaxRepo() {
|
|
|
17937
17901
|
});
|
|
17938
17902
|
return result;
|
|
17939
17903
|
} catch (error) {
|
|
17940
|
-
if (error instanceof
|
|
17904
|
+
if (error instanceof AppError42) {
|
|
17941
17905
|
throw error;
|
|
17942
17906
|
} else {
|
|
17943
|
-
throw new
|
|
17907
|
+
throw new InternalServerError38("Failed to get tax.");
|
|
17944
17908
|
}
|
|
17945
17909
|
}
|
|
17946
17910
|
}
|
|
@@ -17966,7 +17930,7 @@ function useTaxRepo() {
|
|
|
17966
17930
|
repo.delCachedData();
|
|
17967
17931
|
return "Successfully updated tax.";
|
|
17968
17932
|
} catch (error2) {
|
|
17969
|
-
throw new
|
|
17933
|
+
throw new InternalServerError38("Failed to update tax.");
|
|
17970
17934
|
}
|
|
17971
17935
|
}
|
|
17972
17936
|
async function deleteById(_id, session) {
|
|
@@ -17990,7 +17954,7 @@ function useTaxRepo() {
|
|
|
17990
17954
|
repo.delCachedData();
|
|
17991
17955
|
return "Successfully deleted tax.";
|
|
17992
17956
|
} catch (error) {
|
|
17993
|
-
throw new
|
|
17957
|
+
throw new InternalServerError38("Failed to delete tax.");
|
|
17994
17958
|
}
|
|
17995
17959
|
}
|
|
17996
17960
|
async function updateStatusById(_id, status2) {
|
|
@@ -18015,10 +17979,10 @@ function useTaxRepo() {
|
|
|
18015
17979
|
repo.delCachedData();
|
|
18016
17980
|
return "Successfully updated tax status.";
|
|
18017
17981
|
} catch (error) {
|
|
18018
|
-
if (error instanceof
|
|
17982
|
+
if (error instanceof AppError42) {
|
|
18019
17983
|
throw error;
|
|
18020
17984
|
}
|
|
18021
|
-
throw new
|
|
17985
|
+
throw new InternalServerError38("Failed to update tax status.");
|
|
18022
17986
|
}
|
|
18023
17987
|
}
|
|
18024
17988
|
return {
|
|
@@ -18313,13 +18277,13 @@ function modelChartOfAccount(data) {
|
|
|
18313
18277
|
|
|
18314
18278
|
// src/resources/finance-account/chart-of-account.repository.ts
|
|
18315
18279
|
import {
|
|
18316
|
-
AppError as
|
|
18280
|
+
AppError as AppError43,
|
|
18317
18281
|
BadRequestError as BadRequestError88,
|
|
18318
18282
|
useRepo as useRepo28,
|
|
18319
18283
|
makeCacheKey as makeCacheKey27,
|
|
18320
18284
|
paginate as paginate23,
|
|
18321
18285
|
logger as logger45,
|
|
18322
|
-
InternalServerError as
|
|
18286
|
+
InternalServerError as InternalServerError39
|
|
18323
18287
|
} from "@goweekdays/utils";
|
|
18324
18288
|
import { ObjectId as ObjectId47 } from "mongodb";
|
|
18325
18289
|
import Joi78 from "joi";
|
|
@@ -18531,7 +18495,7 @@ function useChartOfAccountRepo() {
|
|
|
18531
18495
|
});
|
|
18532
18496
|
return data;
|
|
18533
18497
|
} catch (error) {
|
|
18534
|
-
throw new
|
|
18498
|
+
throw new InternalServerError39(
|
|
18535
18499
|
"Internal server error, failed to retrieve chart of accounts."
|
|
18536
18500
|
);
|
|
18537
18501
|
}
|
|
@@ -18569,10 +18533,10 @@ function useChartOfAccountRepo() {
|
|
|
18569
18533
|
});
|
|
18570
18534
|
return result;
|
|
18571
18535
|
} catch (error) {
|
|
18572
|
-
if (error instanceof
|
|
18536
|
+
if (error instanceof AppError43) {
|
|
18573
18537
|
throw error;
|
|
18574
18538
|
} else {
|
|
18575
|
-
throw new
|
|
18539
|
+
throw new InternalServerError39("Failed to get chart of account.");
|
|
18576
18540
|
}
|
|
18577
18541
|
}
|
|
18578
18542
|
}
|
|
@@ -18597,7 +18561,7 @@ function useChartOfAccountRepo() {
|
|
|
18597
18561
|
repo.delCachedData();
|
|
18598
18562
|
return "Successfully updated chart of account.";
|
|
18599
18563
|
} catch (error2) {
|
|
18600
|
-
throw new
|
|
18564
|
+
throw new InternalServerError39("Failed to update chart of account.");
|
|
18601
18565
|
}
|
|
18602
18566
|
}
|
|
18603
18567
|
async function deleteById(_id, session) {
|
|
@@ -18621,7 +18585,7 @@ function useChartOfAccountRepo() {
|
|
|
18621
18585
|
repo.delCachedData();
|
|
18622
18586
|
return "Successfully archived chart of account.";
|
|
18623
18587
|
} catch (error) {
|
|
18624
|
-
throw new
|
|
18588
|
+
throw new InternalServerError39("Failed to archive chart of account.");
|
|
18625
18589
|
}
|
|
18626
18590
|
}
|
|
18627
18591
|
async function updateStatusById(_id, status2) {
|
|
@@ -18646,10 +18610,10 @@ function useChartOfAccountRepo() {
|
|
|
18646
18610
|
repo.delCachedData();
|
|
18647
18611
|
return "Successfully updated chart of account status.";
|
|
18648
18612
|
} catch (error) {
|
|
18649
|
-
if (error instanceof
|
|
18613
|
+
if (error instanceof AppError43) {
|
|
18650
18614
|
throw error;
|
|
18651
18615
|
}
|
|
18652
|
-
throw new
|
|
18616
|
+
throw new InternalServerError39(
|
|
18653
18617
|
"Failed to update chart of account status."
|
|
18654
18618
|
);
|
|
18655
18619
|
}
|
|
@@ -18665,7 +18629,7 @@ function useChartOfAccountRepo() {
|
|
|
18665
18629
|
});
|
|
18666
18630
|
return count;
|
|
18667
18631
|
} catch (error2) {
|
|
18668
|
-
throw new
|
|
18632
|
+
throw new InternalServerError39(
|
|
18669
18633
|
"Failed to count chart of accounts by path."
|
|
18670
18634
|
);
|
|
18671
18635
|
}
|
|
@@ -18693,7 +18657,7 @@ function useChartOfAccountRepo() {
|
|
|
18693
18657
|
repo.delCachedData();
|
|
18694
18658
|
return "Successfully updated children count.";
|
|
18695
18659
|
} catch (error2) {
|
|
18696
|
-
throw new
|
|
18660
|
+
throw new InternalServerError39("Failed to update children count.");
|
|
18697
18661
|
}
|
|
18698
18662
|
}
|
|
18699
18663
|
async function getTrialBalance(options) {
|
|
@@ -18820,7 +18784,7 @@ function useChartOfAccountRepo() {
|
|
|
18820
18784
|
level: "error",
|
|
18821
18785
|
message: `Error in getTrialBalance: ${error}`
|
|
18822
18786
|
});
|
|
18823
|
-
throw new
|
|
18787
|
+
throw new InternalServerError39("Failed to get trial balance.");
|
|
18824
18788
|
}
|
|
18825
18789
|
}
|
|
18826
18790
|
async function getBalanceSheet(options) {
|
|
@@ -18929,7 +18893,7 @@ function useChartOfAccountRepo() {
|
|
|
18929
18893
|
level: "error",
|
|
18930
18894
|
message: `Error in getBalanceSheet: ${error}`
|
|
18931
18895
|
});
|
|
18932
|
-
throw new
|
|
18896
|
+
throw new InternalServerError39("Failed to get balance sheet data.");
|
|
18933
18897
|
}
|
|
18934
18898
|
}
|
|
18935
18899
|
return {
|
|
@@ -19540,9 +19504,9 @@ function modelAccountBalance(value) {
|
|
|
19540
19504
|
|
|
19541
19505
|
// src/resources/finance-account-balance/finance.account.balance.repository.ts
|
|
19542
19506
|
import {
|
|
19543
|
-
AppError as
|
|
19507
|
+
AppError as AppError44,
|
|
19544
19508
|
BadRequestError as BadRequestError92,
|
|
19545
|
-
InternalServerError as
|
|
19509
|
+
InternalServerError as InternalServerError40,
|
|
19546
19510
|
makeCacheKey as makeCacheKey28,
|
|
19547
19511
|
paginate as paginate24,
|
|
19548
19512
|
logger as logger47,
|
|
@@ -19589,11 +19553,11 @@ function useAccountBalanceRepo() {
|
|
|
19589
19553
|
repo.delCachedData();
|
|
19590
19554
|
return res.insertedId;
|
|
19591
19555
|
} catch (error) {
|
|
19592
|
-
if (error instanceof
|
|
19556
|
+
if (error instanceof AppError44) {
|
|
19593
19557
|
throw error;
|
|
19594
19558
|
}
|
|
19595
19559
|
logger47.log({ level: "error", message: error.message });
|
|
19596
|
-
throw new
|
|
19560
|
+
throw new InternalServerError40("Failed to add account balance.");
|
|
19597
19561
|
}
|
|
19598
19562
|
}
|
|
19599
19563
|
async function getAll(options) {
|
|
@@ -19653,10 +19617,10 @@ function useAccountBalanceRepo() {
|
|
|
19653
19617
|
});
|
|
19654
19618
|
return data;
|
|
19655
19619
|
} catch (error) {
|
|
19656
|
-
if (error instanceof
|
|
19620
|
+
if (error instanceof AppError44) {
|
|
19657
19621
|
throw error;
|
|
19658
19622
|
}
|
|
19659
|
-
throw new
|
|
19623
|
+
throw new InternalServerError40("Failed to get account balances.");
|
|
19660
19624
|
}
|
|
19661
19625
|
}
|
|
19662
19626
|
async function getById(_id) {
|
|
@@ -19689,10 +19653,10 @@ function useAccountBalanceRepo() {
|
|
|
19689
19653
|
});
|
|
19690
19654
|
return result;
|
|
19691
19655
|
} catch (error) {
|
|
19692
|
-
if (error instanceof
|
|
19656
|
+
if (error instanceof AppError44) {
|
|
19693
19657
|
throw error;
|
|
19694
19658
|
}
|
|
19695
|
-
throw new
|
|
19659
|
+
throw new InternalServerError40("Failed to get account balance.");
|
|
19696
19660
|
}
|
|
19697
19661
|
}
|
|
19698
19662
|
async function getByAccount(options) {
|
|
@@ -19745,10 +19709,10 @@ function useAccountBalanceRepo() {
|
|
|
19745
19709
|
}
|
|
19746
19710
|
return result;
|
|
19747
19711
|
} catch (error) {
|
|
19748
|
-
if (error instanceof
|
|
19712
|
+
if (error instanceof AppError44) {
|
|
19749
19713
|
throw error;
|
|
19750
19714
|
}
|
|
19751
|
-
throw new
|
|
19715
|
+
throw new InternalServerError40("Failed to get account balance.");
|
|
19752
19716
|
}
|
|
19753
19717
|
}
|
|
19754
19718
|
async function getYearBalancesByAccount(options) {
|
|
@@ -19770,10 +19734,10 @@ function useAccountBalanceRepo() {
|
|
|
19770
19734
|
{ sort: { "period.fiscalMonth": 1 } }
|
|
19771
19735
|
).toArray();
|
|
19772
19736
|
} catch (error) {
|
|
19773
|
-
if (error instanceof
|
|
19737
|
+
if (error instanceof AppError44) {
|
|
19774
19738
|
throw error;
|
|
19775
19739
|
}
|
|
19776
|
-
throw new
|
|
19740
|
+
throw new InternalServerError40("Failed to get account balances by year.");
|
|
19777
19741
|
}
|
|
19778
19742
|
}
|
|
19779
19743
|
async function updateById(account, org, fiscalYear, fiscalMonth, options, session) {
|
|
@@ -19815,7 +19779,7 @@ function useAccountBalanceRepo() {
|
|
|
19815
19779
|
repo.delCachedData();
|
|
19816
19780
|
return "Successfully updated account balance.";
|
|
19817
19781
|
} catch (error2) {
|
|
19818
|
-
throw new
|
|
19782
|
+
throw new InternalServerError40("Failed to update account balance.");
|
|
19819
19783
|
}
|
|
19820
19784
|
}
|
|
19821
19785
|
async function deleteById(_id, session) {
|
|
@@ -19829,7 +19793,7 @@ function useAccountBalanceRepo() {
|
|
|
19829
19793
|
repo.delCachedData();
|
|
19830
19794
|
return "Successfully deleted account balance.";
|
|
19831
19795
|
} catch (error) {
|
|
19832
|
-
throw new
|
|
19796
|
+
throw new InternalServerError40("Failed to delete account balance.");
|
|
19833
19797
|
}
|
|
19834
19798
|
}
|
|
19835
19799
|
return {
|
|
@@ -19987,12 +19951,12 @@ function modelJournal(data) {
|
|
|
19987
19951
|
|
|
19988
19952
|
// src/resources/finance-journal/finance.journal.repository.ts
|
|
19989
19953
|
import {
|
|
19990
|
-
AppError as
|
|
19954
|
+
AppError as AppError45,
|
|
19991
19955
|
BadRequestError as BadRequestError94,
|
|
19992
19956
|
makeCacheKey as makeCacheKey29,
|
|
19993
19957
|
paginate as paginate25,
|
|
19994
19958
|
logger as logger48,
|
|
19995
|
-
InternalServerError as
|
|
19959
|
+
InternalServerError as InternalServerError41,
|
|
19996
19960
|
useRepo as useRepo30
|
|
19997
19961
|
} from "@goweekdays/utils";
|
|
19998
19962
|
import { ObjectId as ObjectId51 } from "mongodb";
|
|
@@ -20156,10 +20120,10 @@ function useJournalRepo() {
|
|
|
20156
20120
|
});
|
|
20157
20121
|
return result;
|
|
20158
20122
|
} catch (error) {
|
|
20159
|
-
if (error instanceof
|
|
20123
|
+
if (error instanceof AppError45) {
|
|
20160
20124
|
throw error;
|
|
20161
20125
|
} else {
|
|
20162
|
-
throw new
|
|
20126
|
+
throw new InternalServerError41("Failed to get journal.");
|
|
20163
20127
|
}
|
|
20164
20128
|
}
|
|
20165
20129
|
}
|
|
@@ -20213,7 +20177,7 @@ function useJournalRepo() {
|
|
|
20213
20177
|
repo.delCachedData();
|
|
20214
20178
|
return "Successfully updated journal entry.";
|
|
20215
20179
|
} catch (error2) {
|
|
20216
|
-
throw new
|
|
20180
|
+
throw new InternalServerError41("Failed to update journal.");
|
|
20217
20181
|
}
|
|
20218
20182
|
}
|
|
20219
20183
|
async function deleteById(_id, session) {
|
|
@@ -20236,7 +20200,7 @@ function useJournalRepo() {
|
|
|
20236
20200
|
repo.delCachedData();
|
|
20237
20201
|
return "Successfully voided journal.";
|
|
20238
20202
|
} catch (error) {
|
|
20239
|
-
throw new
|
|
20203
|
+
throw new InternalServerError41("Failed to void journal.");
|
|
20240
20204
|
}
|
|
20241
20205
|
}
|
|
20242
20206
|
async function updateStatusById(_id, status2, session) {
|
|
@@ -20265,10 +20229,10 @@ function useJournalRepo() {
|
|
|
20265
20229
|
repo.delCachedData();
|
|
20266
20230
|
return "Successfully updated journal status.";
|
|
20267
20231
|
} catch (error) {
|
|
20268
|
-
if (error instanceof
|
|
20232
|
+
if (error instanceof AppError45) {
|
|
20269
20233
|
throw error;
|
|
20270
20234
|
}
|
|
20271
|
-
throw new
|
|
20235
|
+
throw new InternalServerError41("Failed to update journal status.");
|
|
20272
20236
|
}
|
|
20273
20237
|
}
|
|
20274
20238
|
async function existsByTransactionId(org, transactionId) {
|
|
@@ -20380,14 +20344,14 @@ function modelJournalLine(data) {
|
|
|
20380
20344
|
|
|
20381
20345
|
// src/resources/finance-journal-line/finance.journal.line.repository.ts
|
|
20382
20346
|
import {
|
|
20383
|
-
AppError as
|
|
20347
|
+
AppError as AppError46,
|
|
20384
20348
|
BadRequestError as BadRequestError96,
|
|
20385
20349
|
useAtlas as useAtlas14,
|
|
20386
20350
|
useCache as useCache3,
|
|
20387
20351
|
makeCacheKey as makeCacheKey30,
|
|
20388
20352
|
paginate as paginate26,
|
|
20389
20353
|
logger as logger49,
|
|
20390
|
-
InternalServerError as
|
|
20354
|
+
InternalServerError as InternalServerError42
|
|
20391
20355
|
} from "@goweekdays/utils";
|
|
20392
20356
|
import { ObjectId as ObjectId53 } from "mongodb";
|
|
20393
20357
|
import Joi86 from "joi";
|
|
@@ -20555,10 +20519,10 @@ function useJournalLineRepo() {
|
|
|
20555
20519
|
});
|
|
20556
20520
|
return result;
|
|
20557
20521
|
} catch (error) {
|
|
20558
|
-
if (error instanceof
|
|
20522
|
+
if (error instanceof AppError46) {
|
|
20559
20523
|
throw error;
|
|
20560
20524
|
} else {
|
|
20561
|
-
throw new
|
|
20525
|
+
throw new InternalServerError42("Failed to get journal line.");
|
|
20562
20526
|
}
|
|
20563
20527
|
}
|
|
20564
20528
|
}
|
|
@@ -20594,10 +20558,10 @@ function useJournalLineRepo() {
|
|
|
20594
20558
|
});
|
|
20595
20559
|
return result;
|
|
20596
20560
|
} catch (error) {
|
|
20597
|
-
if (error instanceof
|
|
20561
|
+
if (error instanceof AppError46) {
|
|
20598
20562
|
throw error;
|
|
20599
20563
|
} else {
|
|
20600
|
-
throw new
|
|
20564
|
+
throw new InternalServerError42("Failed to get journal line.");
|
|
20601
20565
|
}
|
|
20602
20566
|
}
|
|
20603
20567
|
}
|
|
@@ -20626,7 +20590,7 @@ function useJournalLineRepo() {
|
|
|
20626
20590
|
delCachedData();
|
|
20627
20591
|
return "Successfully updated journal line.";
|
|
20628
20592
|
} catch (error2) {
|
|
20629
|
-
throw new
|
|
20593
|
+
throw new InternalServerError42("Failed to update journal line.");
|
|
20630
20594
|
}
|
|
20631
20595
|
}
|
|
20632
20596
|
async function deleteById(_id, session) {
|
|
@@ -20640,7 +20604,7 @@ function useJournalLineRepo() {
|
|
|
20640
20604
|
delCachedData();
|
|
20641
20605
|
return "Successfully deleted journal line.";
|
|
20642
20606
|
} catch (error) {
|
|
20643
|
-
throw new
|
|
20607
|
+
throw new InternalServerError42("Failed to delete journal line.");
|
|
20644
20608
|
}
|
|
20645
20609
|
}
|
|
20646
20610
|
async function updateBalanceById(_id, balance, session) {
|
|
@@ -20657,7 +20621,7 @@ function useJournalLineRepo() {
|
|
|
20657
20621
|
);
|
|
20658
20622
|
delCachedData();
|
|
20659
20623
|
} catch (error) {
|
|
20660
|
-
throw new
|
|
20624
|
+
throw new InternalServerError42("Failed to update journal line balance.");
|
|
20661
20625
|
}
|
|
20662
20626
|
}
|
|
20663
20627
|
async function updateStatusByJournal(journalEntry, status2, session) {
|
|
@@ -20690,7 +20654,7 @@ function useJournalLineRepo() {
|
|
|
20690
20654
|
delCachedData();
|
|
20691
20655
|
return `Successfully updated journal line statuses to ${status2}.`;
|
|
20692
20656
|
} catch (error2) {
|
|
20693
|
-
throw new
|
|
20657
|
+
throw new InternalServerError42("Failed to update journal line statuses.");
|
|
20694
20658
|
}
|
|
20695
20659
|
}
|
|
20696
20660
|
return {
|
|
@@ -20708,9 +20672,9 @@ function useJournalLineRepo() {
|
|
|
20708
20672
|
|
|
20709
20673
|
// src/resources/finance-journal/finance.journal.service.ts
|
|
20710
20674
|
import {
|
|
20711
|
-
AppError as
|
|
20675
|
+
AppError as AppError50,
|
|
20712
20676
|
BadRequestError as BadRequestError105,
|
|
20713
|
-
InternalServerError as
|
|
20677
|
+
InternalServerError as InternalServerError46,
|
|
20714
20678
|
NotFoundError as NotFoundError7,
|
|
20715
20679
|
useAtlas as useAtlas16
|
|
20716
20680
|
} from "@goweekdays/utils";
|
|
@@ -20927,14 +20891,14 @@ function modelJournalLog(value) {
|
|
|
20927
20891
|
|
|
20928
20892
|
// src/resources/finance-journal-log/finance.journal.log.repository.ts
|
|
20929
20893
|
import {
|
|
20930
|
-
AppError as
|
|
20894
|
+
AppError as AppError47,
|
|
20931
20895
|
BadRequestError as BadRequestError99,
|
|
20932
20896
|
useAtlas as useAtlas15,
|
|
20933
20897
|
useCache as useCache4,
|
|
20934
20898
|
makeCacheKey as makeCacheKey31,
|
|
20935
20899
|
paginate as paginate27,
|
|
20936
20900
|
logger as logger50,
|
|
20937
|
-
InternalServerError as
|
|
20901
|
+
InternalServerError as InternalServerError43
|
|
20938
20902
|
} from "@goweekdays/utils";
|
|
20939
20903
|
import { ObjectId as ObjectId55 } from "mongodb";
|
|
20940
20904
|
import Joi88 from "joi";
|
|
@@ -21111,10 +21075,10 @@ function useJournalLogRepo() {
|
|
|
21111
21075
|
});
|
|
21112
21076
|
return result;
|
|
21113
21077
|
} catch (error) {
|
|
21114
|
-
if (error instanceof
|
|
21078
|
+
if (error instanceof AppError47) {
|
|
21115
21079
|
throw error;
|
|
21116
21080
|
} else {
|
|
21117
|
-
throw new
|
|
21081
|
+
throw new InternalServerError43("Failed to get journal log.");
|
|
21118
21082
|
}
|
|
21119
21083
|
}
|
|
21120
21084
|
}
|
|
@@ -21224,12 +21188,12 @@ function modelJournalTransaction(data) {
|
|
|
21224
21188
|
|
|
21225
21189
|
// src/resources/finance-journal-transaction/finance.journal.transaction.repository.ts
|
|
21226
21190
|
import {
|
|
21227
|
-
AppError as
|
|
21191
|
+
AppError as AppError48,
|
|
21228
21192
|
BadRequestError as BadRequestError102,
|
|
21229
21193
|
makeCacheKey as makeCacheKey32,
|
|
21230
21194
|
paginate as paginate28,
|
|
21231
21195
|
logger as logger52,
|
|
21232
|
-
InternalServerError as
|
|
21196
|
+
InternalServerError as InternalServerError44,
|
|
21233
21197
|
useRepo as useRepo31
|
|
21234
21198
|
} from "@goweekdays/utils";
|
|
21235
21199
|
import { ObjectId as ObjectId57 } from "mongodb";
|
|
@@ -21384,10 +21348,10 @@ function useJournalTransactionRepo() {
|
|
|
21384
21348
|
});
|
|
21385
21349
|
return result;
|
|
21386
21350
|
} catch (error) {
|
|
21387
|
-
if (error instanceof
|
|
21351
|
+
if (error instanceof AppError48) {
|
|
21388
21352
|
throw error;
|
|
21389
21353
|
} else {
|
|
21390
|
-
throw new
|
|
21354
|
+
throw new InternalServerError44("Failed to get journal transaction.");
|
|
21391
21355
|
}
|
|
21392
21356
|
}
|
|
21393
21357
|
}
|
|
@@ -21430,7 +21394,7 @@ function useJournalTransactionRepo() {
|
|
|
21430
21394
|
repo.delCachedData();
|
|
21431
21395
|
return "Successfully updated journal transaction.";
|
|
21432
21396
|
} catch (error2) {
|
|
21433
|
-
throw new
|
|
21397
|
+
throw new InternalServerError44("Failed to update journal transaction.");
|
|
21434
21398
|
}
|
|
21435
21399
|
}
|
|
21436
21400
|
async function deleteById(_id, session) {
|
|
@@ -21444,7 +21408,7 @@ function useJournalTransactionRepo() {
|
|
|
21444
21408
|
repo.delCachedData();
|
|
21445
21409
|
return "Successfully deleted journal transaction.";
|
|
21446
21410
|
} catch (error) {
|
|
21447
|
-
throw new
|
|
21411
|
+
throw new InternalServerError44("Failed to delete journal transaction.");
|
|
21448
21412
|
}
|
|
21449
21413
|
}
|
|
21450
21414
|
return {
|
|
@@ -21459,9 +21423,9 @@ function useJournalTransactionRepo() {
|
|
|
21459
21423
|
|
|
21460
21424
|
// src/resources/finance-journal-transaction/finance.journal.transaction.service.ts
|
|
21461
21425
|
import {
|
|
21462
|
-
AppError as
|
|
21426
|
+
AppError as AppError49,
|
|
21463
21427
|
BadRequestError as BadRequestError103,
|
|
21464
|
-
InternalServerError as
|
|
21428
|
+
InternalServerError as InternalServerError45,
|
|
21465
21429
|
NotFoundError as NotFoundError6
|
|
21466
21430
|
} from "@goweekdays/utils";
|
|
21467
21431
|
import Joi91 from "joi";
|
|
@@ -21501,10 +21465,10 @@ function useJournalTransactionService() {
|
|
|
21501
21465
|
const id = await _add(value);
|
|
21502
21466
|
return id;
|
|
21503
21467
|
} catch (error2) {
|
|
21504
|
-
if (error2 instanceof
|
|
21468
|
+
if (error2 instanceof AppError49) {
|
|
21505
21469
|
throw error2;
|
|
21506
21470
|
}
|
|
21507
|
-
throw new
|
|
21471
|
+
throw new InternalServerError45(
|
|
21508
21472
|
`Failed to create journal transaction: ${error2.message}`
|
|
21509
21473
|
);
|
|
21510
21474
|
}
|
|
@@ -21528,10 +21492,10 @@ function useJournalTransactionService() {
|
|
|
21528
21492
|
try {
|
|
21529
21493
|
return await _updateById(_id, options);
|
|
21530
21494
|
} catch (error2) {
|
|
21531
|
-
if (error2 instanceof
|
|
21495
|
+
if (error2 instanceof AppError49) {
|
|
21532
21496
|
throw error2;
|
|
21533
21497
|
}
|
|
21534
|
-
throw new
|
|
21498
|
+
throw new InternalServerError45(
|
|
21535
21499
|
`Failed to update journal transaction: ${error2.message}`
|
|
21536
21500
|
);
|
|
21537
21501
|
}
|
|
@@ -21781,10 +21745,10 @@ function useJournalService() {
|
|
|
21781
21745
|
return "Journal entry created successfully.";
|
|
21782
21746
|
} catch (error2) {
|
|
21783
21747
|
await session.abortTransaction();
|
|
21784
|
-
if (error2 instanceof
|
|
21748
|
+
if (error2 instanceof AppError50) {
|
|
21785
21749
|
throw error2;
|
|
21786
21750
|
}
|
|
21787
|
-
throw new
|
|
21751
|
+
throw new InternalServerError46(
|
|
21788
21752
|
`Failed to create general journal: ${error2.message}`
|
|
21789
21753
|
);
|
|
21790
21754
|
} finally {
|
|
@@ -22056,10 +22020,10 @@ function useJournalService() {
|
|
|
22056
22020
|
return "Journal entry status updated successfully.";
|
|
22057
22021
|
} catch (error2) {
|
|
22058
22022
|
await session.abortTransaction();
|
|
22059
|
-
if (error2 instanceof
|
|
22023
|
+
if (error2 instanceof AppError50) {
|
|
22060
22024
|
throw error2;
|
|
22061
22025
|
}
|
|
22062
|
-
throw new
|
|
22026
|
+
throw new InternalServerError46(
|
|
22063
22027
|
`Failed to update general journal status: ${error2.message}`
|
|
22064
22028
|
);
|
|
22065
22029
|
} finally {
|
|
@@ -22268,10 +22232,10 @@ function useJournalService() {
|
|
|
22268
22232
|
return "Journal entry updated successfully.";
|
|
22269
22233
|
} catch (error2) {
|
|
22270
22234
|
await session.abortTransaction();
|
|
22271
|
-
if (error2 instanceof
|
|
22235
|
+
if (error2 instanceof AppError50) {
|
|
22272
22236
|
throw error2;
|
|
22273
22237
|
}
|
|
22274
|
-
throw new
|
|
22238
|
+
throw new InternalServerError46(
|
|
22275
22239
|
`Failed to update general journal: ${error2.message}`
|
|
22276
22240
|
);
|
|
22277
22241
|
} finally {
|