@goweekdays/core 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c754908: Billing ledger initial release
8
+
3
9
  ## 2.6.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -391,7 +391,8 @@ declare function useOrgRepo(): {
391
391
  value: string;
392
392
  }, session?: ClientSession) => Promise<string>;
393
393
  deleteById: (_id: string | ObjectId) => Promise<string>;
394
- getByName: (name: string) => Promise<TOrg>;
394
+ getByName: (name: string) => Promise<TOrg | null>;
395
+ getByEmail: (email: string) => Promise<TOrg | null>;
395
396
  updateById: (_id: string | ObjectId, options: Pick<TOrg, "name" | "description" | "email" | "contact">) => Promise<void>;
396
397
  };
397
398
 
@@ -402,6 +403,7 @@ declare function useOrgService(): {
402
403
  org: string;
403
404
  paypalOrderLink: any;
404
405
  }>;
406
+ addWithVerification: (id: string) => Promise<string>;
405
407
  };
406
408
 
407
409
  declare function useOrgController(): {
@@ -643,6 +645,10 @@ type TVerificationMetadata = {
643
645
  referralCode?: string;
644
646
  org?: string | ObjectId;
645
647
  orgName?: string;
648
+ contact?: string;
649
+ seats?: number;
650
+ createdBy?: string | ObjectId;
651
+ amount?: number;
646
652
  };
647
653
  type TVerification = {
648
654
  _id?: ObjectId;
@@ -716,6 +722,11 @@ declare function useVerificationService(): {
716
722
  }) => Promise<bson.ObjectId>;
717
723
  cancelInviteMember: (id: string) => Promise<string>;
718
724
  forgetPassword: (email: string) => Promise<string>;
725
+ orgSetupFee: (value: TOrg & {
726
+ seats: number;
727
+ }) => Promise<{
728
+ paypalOrderLink: any;
729
+ }>;
719
730
  };
720
731
 
721
732
  declare function useVerificationController(): {
@@ -728,6 +739,7 @@ declare function useVerificationController(): {
728
739
  signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
729
740
  cancelInviteMember: (req: Request, res: Response, next: NextFunction) => Promise<void>;
730
741
  forgetPassword: (req: Request, res: Response, next: NextFunction) => Promise<void>;
742
+ orgSetupFee: (req: Request, res: Response, next: NextFunction) => Promise<void>;
731
743
  };
732
744
 
733
745
  type TPlan = {
@@ -997,6 +1009,75 @@ declare function usePermissionGroupController(): {
997
1009
  updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
998
1010
  };
999
1011
 
1012
+ type TJobPost = {
1013
+ _id?: ObjectId;
1014
+ org: ObjectId | string;
1015
+ title: string;
1016
+ setup: string;
1017
+ location: string;
1018
+ type: string;
1019
+ description: string;
1020
+ status?: string;
1021
+ createdAt?: Date;
1022
+ updatedAt?: Date;
1023
+ deletedAt?: Date;
1024
+ };
1025
+ declare const schemaJobPost: Joi.ObjectSchema<any>;
1026
+ declare function modelJobPost(value: TJobPost): TJobPost;
1027
+
1028
+ declare function useJobPostController(): {
1029
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1030
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1031
+ };
1032
+
1033
+ declare function useJobPostRepo(): {
1034
+ createIndexes: () => Promise<string>;
1035
+ add: (value: TJobPost, session?: ClientSession) => Promise<ObjectId>;
1036
+ deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
1037
+ };
1038
+
1039
+ declare function useJobPostService(): {
1040
+ deleteById: (id: string) => Promise<string>;
1041
+ };
1042
+
1043
+ type TLedgerBill = {
1044
+ _id?: ObjectId;
1045
+ org: string | ObjectId;
1046
+ type: "setup-fee" | "subscription";
1047
+ description: string;
1048
+ amount: number;
1049
+ currency: string;
1050
+ status: "pending" | "completed" | "overdue";
1051
+ billingFrom?: string | Date;
1052
+ billingTo?: string | Date;
1053
+ paidAt?: string | Date;
1054
+ dueDate?: string | Date;
1055
+ createdAt?: string | Date;
1056
+ };
1057
+ declare const ledgerBillTypes: string[];
1058
+ declare const ledgerBillStatuses: string[];
1059
+ declare const schemaLedgerBill: Joi.ObjectSchema<any>;
1060
+ declare function modelLedgerBill(value: TLedgerBill): TLedgerBill;
1061
+
1062
+ declare function useLedgerBillingRepo(): {
1063
+ delCachedData: () => void;
1064
+ createIndexes: () => Promise<string>;
1065
+ add: (value: TLedgerBill, session?: ClientSession) => Promise<ObjectId>;
1066
+ getAll: ({ org, search, page, limit, status, }?: {
1067
+ org?: string | undefined;
1068
+ search?: string | undefined;
1069
+ page?: number | undefined;
1070
+ limit?: number | undefined;
1071
+ status?: string | undefined;
1072
+ }) => Promise<Record<string, any>>;
1073
+ getById: (_id: string | ObjectId) => Promise<TLedgerBill | null>;
1074
+ };
1075
+
1076
+ declare function useLedgerBillingController(): {
1077
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1078
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1079
+ };
1080
+
1000
1081
  declare const MONGO_URI: string;
1001
1082
  declare const MONGO_DB: string;
1002
1083
  declare const PORT: number;
@@ -1036,4 +1117,4 @@ declare const XENDIT_BASE_URL: string;
1036
1117
  declare const DOMAIN: string;
1037
1118
  declare const APP_ORG: string;
1038
1119
 
1039
- export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, APP_ORG, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MBuilding, MBuildingUnit, MFile, MONGO_DB, MONGO_URI, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TApp, TBuilding, TBuildingUnit, TCounter, TFile, TMember, TOrg, TPermission, TPermissionGroup, TPlan, TPromo, TRole, TSubscription, TSubscriptionTransaction, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, currencies, isDev, modelApp, modelMember, modelOrg, modelPermission, modelPermissionGroup, modelPlan, modelPromo, modelRole, modelSubscription, modelSubscriptionTransaction, modelUser, modelVerification, schemaApp, schemaAppUpdate, schemaBuilding, schemaBuildingUnit, schemaInviteMember, schemaMember, schemaMemberRole, schemaMemberStatus, schemaOrg, schemaOrgAdd, schemaOrgUpdate, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaPlan, schemaPromo, schemaRole, schemaRoleUpdate, schemaSubscription, schemaSubscriptionSeats, schemaSubscriptionTransaction, schemaSubscriptionUpdate, schemaUpdateOptions, schemaUser, schemaVerification, transactionSchema, useAppController, useAppRepo, useAppService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useCounterModel, useCounterRepo, useFileController, useFileRepo, useFileService, useGitHubService, useMemberController, useMemberRepo, useOrgController, useOrgRepo, useOrgService, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, usePlanController, usePlanRepo, usePlanService, usePromoRepo, useRoleController, useRoleRepo, useRoleService, useSubscriptionController, useSubscriptionRepo, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
1120
+ export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, APP_ORG, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MBuilding, MBuildingUnit, MFile, MONGO_DB, MONGO_URI, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TApp, TBuilding, TBuildingUnit, TCounter, TFile, TJobPost, TLedgerBill, TMember, TOrg, TPermission, TPermissionGroup, TPlan, TPromo, TRole, TSubscription, TSubscriptionTransaction, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, currencies, isDev, ledgerBillStatuses, ledgerBillTypes, modelApp, modelJobPost, modelLedgerBill, modelMember, modelOrg, modelPermission, modelPermissionGroup, modelPlan, modelPromo, modelRole, modelSubscription, modelSubscriptionTransaction, modelUser, modelVerification, schemaApp, schemaAppUpdate, schemaBuilding, schemaBuildingUnit, schemaInviteMember, schemaJobPost, schemaLedgerBill, schemaMember, schemaMemberRole, schemaMemberStatus, schemaOrg, schemaOrgAdd, schemaOrgUpdate, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaPlan, schemaPromo, schemaRole, schemaRoleUpdate, schemaSubscription, schemaSubscriptionSeats, schemaSubscriptionTransaction, schemaSubscriptionUpdate, schemaUpdateOptions, schemaUser, schemaVerification, transactionSchema, useAppController, useAppRepo, useAppService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useCounterModel, useCounterRepo, useFileController, useFileRepo, useFileService, useGitHubService, useJobPostController, useJobPostRepo, useJobPostService, useLedgerBillingController, useLedgerBillingRepo, useMemberController, useMemberRepo, useOrgController, useOrgRepo, useOrgService, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, usePlanController, usePlanRepo, usePlanService, usePromoRepo, useRoleController, useRoleRepo, useRoleService, useSubscriptionController, useSubscriptionRepo, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };