@goweekdays/core 2.9.0 → 2.10.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.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d140abc: Add promo usage tracking
8
+
3
9
  ## 2.9.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -343,6 +343,7 @@ declare function useMemberRepo(): {
343
343
  }, session?: ClientSession) => Promise<string>;
344
344
  updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<string>;
345
345
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
346
+ updateStatusByOrg: (org: string | ObjectId, status: string, session?: ClientSession) => Promise<string>;
346
347
  };
347
348
 
348
349
  declare function useMemberController(): {
@@ -365,6 +366,7 @@ type TOrg = {
365
366
  email: string;
366
367
  contact?: string;
367
368
  createdBy: string | ObjectId;
369
+ promoCode?: string;
368
370
  status?: string;
369
371
  createdAt?: string | Date;
370
372
  updatedAt?: string | Date;
@@ -420,8 +422,7 @@ declare function useOrgController(): {
420
422
  type TPromo = {
421
423
  _id?: ObjectId;
422
424
  code: string;
423
- description?: string;
424
- type: "flat" | "fixed" | "tiered";
425
+ type: "flat" | "fixed" | "volume";
425
426
  flatRate?: number;
426
427
  fixedRate?: number;
427
428
  tiers?: Array<{
@@ -430,11 +431,12 @@ type TPromo = {
430
431
  rate: number;
431
432
  }>;
432
433
  currency: string;
433
- startDate: Date | string;
434
+ startDate?: Date | string;
434
435
  endDate?: Date | string;
435
- assignedTo?: string | ObjectId;
436
- status: "active" | "inactive" | "expired";
437
- assignedAt?: Date | string;
436
+ apps?: string[];
437
+ seats?: number;
438
+ usage?: number;
439
+ status?: "active" | "inactive" | "expired";
438
440
  createdAt?: Date | string;
439
441
  updatedAt?: Date | string;
440
442
  deletedAt?: Date | string;
@@ -453,9 +455,19 @@ declare function usePromoRepo(): {
453
455
  }) => Promise<TPaginate<TPromo>>;
454
456
  getByCode: (code: string) => Promise<TPromo | null>;
455
457
  getById: (_id: string | ObjectId) => Promise<TPromo | null>;
458
+ updateById: (_id: string | ObjectId, options: Pick<TPromo, "code" | "apps" | "type" | "flatRate" | "fixedRate" | "tiers" | "currency" | "startDate" | "endDate" | "seats" | "usage">) => Promise<string>;
456
459
  deleteById: (_id: string | ObjectId) => Promise<string>;
457
460
  };
458
461
 
462
+ declare function usePromoController(): {
463
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
464
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
465
+ getByCode: (req: Request, res: Response, next: NextFunction) => Promise<void>;
466
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
467
+ updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
468
+ deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
469
+ };
470
+
459
471
  type TRole = {
460
472
  _id?: ObjectId;
461
473
  id?: string | ObjectId;
@@ -1085,6 +1097,7 @@ declare function useJobPostController(): {
1085
1097
  getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1086
1098
  updateById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1087
1099
  deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1100
+ updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1088
1101
  };
1089
1102
 
1090
1103
  declare function useJobPostRepo(): {
@@ -1113,6 +1126,7 @@ declare function useJobPostRepo(): {
1113
1126
  getById: (_id: string | ObjectId) => Promise<TJobPost>;
1114
1127
  updateById: (_id: string | ObjectId, options: Pick<TJobPost, "title" | "setup" | "location" | "type" | "description">) => Promise<string>;
1115
1128
  deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
1129
+ updateStatusById: (_id: string | ObjectId, status: string) => Promise<string>;
1116
1130
  };
1117
1131
 
1118
1132
  declare function useJobPostService(): {
@@ -1203,4 +1217,4 @@ declare const XENDIT_BASE_URL: string;
1203
1217
  declare const DOMAIN: string;
1204
1218
  declare const APP_ORG: string;
1205
1219
 
1206
- 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, PaypalWebhookHeaders, 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, schemaJobPostUpdate, schemaLedgerBill, schemaLedgerBillingSummary, 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, usePaypalService, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, usePlanController, usePlanRepo, usePlanService, usePromoRepo, useRoleController, useRoleRepo, useRoleService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
1220
+ 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, PaypalWebhookHeaders, 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, schemaJobPostUpdate, schemaLedgerBill, schemaLedgerBillingSummary, 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, usePaypalService, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, usePlanController, usePlanRepo, usePlanService, usePromoController, usePromoRepo, useRoleController, useRoleRepo, useRoleService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useSubscriptionTransactionController, useSubscriptionTransactionRepo, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };