@7365admin1/core 3.41.1 → 3.42.1

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,29 @@
1
1
  # @iservice365/core
2
2
 
3
+ ## 3.42.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 87c073f: Make the "an invitation is already waiting" check actually find the invitation
8
+
9
+ The duplicate-invitation guard added with the existing-provider invite fix never
10
+ fired. Invitations are written with `metadata.siteId` as an ObjectId, but the
11
+ lookup searched for the site id as the plain string it arrived as on the request,
12
+ and MongoDB does not treat the two as equal. The query therefore always came back
13
+ empty: a property manager could send the same service provider a second, third
14
+ and fourth invitation for the same site while the first was still valid, and each
15
+ one produced another email and another pending row for them to chase.
16
+
17
+ The lookup now matches either form, so older records that hold the string are
18
+ still found. Nothing else changes: the refusal message and the status code are
19
+ the ones already shipped.
20
+
21
+ ## 3.42.0
22
+
23
+ ### Minor Changes
24
+
25
+ - ff7b915: release changes in payment api
26
+
3
27
  ## 3.41.1
4
28
 
5
29
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1613,7 +1613,7 @@ declare function useServiceProviderRepo(): {
1613
1613
  siteId?: string | ObjectId | undefined;
1614
1614
  orgId?: string | ObjectId | undefined;
1615
1615
  serviceProviderOrgId?: string | ObjectId | undefined;
1616
- }) => Promise<{} | null>;
1616
+ }) => Promise<{}>;
1617
1617
  updateStatusById: (_id: string | ObjectId, status: string) => Promise<mongodb.UpdateResult<bson.Document>>;
1618
1618
  };
1619
1619
 
@@ -1621,6 +1621,7 @@ declare function useServiceProviderController(): {
1621
1621
  createServiceProvider: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1622
1622
  getServiceProviders: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1623
1623
  getByProviderOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1624
+ getByEmail: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1624
1625
  getServiceProviderNames: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1625
1626
  getServiceProviderTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
1626
1627
  getServiceProviderById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -2605,6 +2606,7 @@ declare function useCustomerSiteRepo(): {
2605
2606
  name: string;
2606
2607
  org: string | ObjectId;
2607
2608
  }) => Promise<TCustomerSite[]>;
2609
+ countActiveByOrgAndSite: (org: string | ObjectId, site: string | ObjectId) => Promise<number>;
2608
2610
  getBySiteAsServiceProvider: (site: string | ObjectId) => Promise<{} | undefined>;
2609
2611
  getById: (id: string | ObjectId) => Promise<mongodb.WithId<bson.Document>>;
2610
2612
  updateCustomerSiteById: (id: string | ObjectId, payload: Partial<TCustomerSite>, session?: ClientSession) => Promise<mongodb.WithId<bson.Document>>;
@@ -2613,7 +2615,7 @@ declare function useCustomerSiteRepo(): {
2613
2615
 
2614
2616
  declare function useCustomerSiteService(): {
2615
2617
  add: (value: TCustomerSite) => Promise<string>;
2616
- addViaInvite: (invite: string) => Promise<string>;
2618
+ addViaInvite: (invite: string) => Promise<"This site is already on your list." | "Invite accepted, successfully added site.">;
2617
2619
  updateCusSiteById: (customerSiteId: string, payload: Partial<TCustomerSite>) => Promise<mongodb.WithId<bson.Document>>;
2618
2620
  };
2619
2621
 
@@ -6907,6 +6909,9 @@ declare function useRedDotPaymentController(): {
6907
6909
  redirectPaymentTransaction: (req: Request, res: Response) => Promise<Response<any, Record<string, any>>>;
6908
6910
  enquirePaymentTransaction: (req: Request, res: Response) => Promise<Response<any, Record<string, any>>>;
6909
6911
  createPayment: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
6912
+ getPaymentByReference: (req: Request, res: Response, next: NextFunction) => Promise<void>;
6913
+ updateStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
6914
+ getPaidBills: (req: Request, res: Response, next: NextFunction) => Promise<void>;
6910
6915
  };
6911
6916
 
6912
6917
  interface IDirectPayment extends IBaseModel {
@@ -6945,6 +6950,8 @@ declare const useRedDotPaymentSvc: () => {
6945
6950
  type TBillingItems = {
6946
6951
  _id: ObjectId | string;
6947
6952
  name: string;
6953
+ amount: number;
6954
+ referenceNumber: string;
6948
6955
  };
6949
6956
  type TBillingPayments = {
6950
6957
  _id?: ObjectId;
@@ -6967,11 +6974,27 @@ type TBillingPayments = {
6967
6974
 
6968
6975
  declare const useRedDotPaymentRepo: () => {
6969
6976
  paySingleUnitBill: (refId: string, payload: Partial<TUnitBilling>) => Promise<mongodb.WithId<bson.Document> | null>;
6970
- createPayment: (type: string, payload: Partial<TBillingPayments>, session?: ClientSession) => Promise<ObjectId | undefined>;
6977
+ createPayment: (type: string, payload: Partial<TBillingPayments>, session?: ClientSession) => Promise<string | undefined>;
6971
6978
  payMultipleUnitBill: (refId: string[], payload: Partial<TUnitBilling>) => Promise<{
6972
6979
  message: string;
6973
6980
  remainingBalance: number;
6974
6981
  }>;
6982
+ getPaidBills: ({ search, page, limit, sort, month, year, unitId, }: {
6983
+ search?: string | undefined;
6984
+ page?: number | undefined;
6985
+ limit?: number | undefined;
6986
+ sort?: Record<string, any> | undefined;
6987
+ month?: string | undefined;
6988
+ year?: string | undefined;
6989
+ unitId: string | ObjectId;
6990
+ }, session?: ClientSession) => Promise<{
6991
+ items: any[];
6992
+ pages: number;
6993
+ pageRange: string;
6994
+ }>;
6995
+ createIndexes: () => Promise<void>;
6996
+ getPaymentByReference: (referenceNumber: string, session?: ClientSession) => Promise<TBillingPayments>;
6997
+ updateStatus: (referenceNumber: string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
6975
6998
  };
6976
6999
 
6977
7000
  declare enum VerificationType {
@@ -7058,6 +7081,7 @@ declare function useVerificationRepoV2(): {
7058
7081
  updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
7059
7082
  countPendingOrgInvites: (orgId: string | ObjectId) => Promise<number>;
7060
7083
  getPendingVerificationByEmail: (email: string) => Promise<TVerificationV2 | null>;
7084
+ getPendingServiceProviderInvite: (email: string, siteId: string) => Promise<TVerificationV2 | null>;
7061
7085
  updateVerificationCodeById: (_id: string | ObjectId, verificationCode: string, expireAt: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
7062
7086
  completePendingInvites: ({ email, orgId, siteId, app, session, }: {
7063
7087
  email: string;