@7365admin1/core 3.32.2-staging.58 → 3.32.2-staging.59

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/dist/index.d.ts CHANGED
@@ -6935,6 +6935,7 @@ declare function useRedDotPaymentController(): {
6935
6935
  createPayment: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
6936
6936
  getPaymentByReference: (req: Request, res: Response, next: NextFunction) => Promise<void>;
6937
6937
  updateStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
6938
+ getPaidBills: (req: Request, res: Response, next: NextFunction) => Promise<void>;
6938
6939
  };
6939
6940
 
6940
6941
  interface IDirectPayment extends IBaseModel {
package/dist/index.js CHANGED
@@ -65662,7 +65662,8 @@ function useRedDotPaymentController() {
65662
65662
  const {
65663
65663
  createPayment: _createPayment,
65664
65664
  updateStatus: _updateStatus,
65665
- getPaymentByReference: _getPaymentByReference
65665
+ getPaymentByReference: _getPaymentByReference,
65666
+ getPaidBills: _getPaidBills
65666
65667
  } = useRedDotPaymentRepo();
65667
65668
  const redirectPaymentTransaction = async (req, res) => {
65668
65669
  try {
@@ -65777,12 +65778,36 @@ function useRedDotPaymentController() {
65777
65778
  return;
65778
65779
  }
65779
65780
  }
65781
+ async function getPaidBills(req, res, next) {
65782
+ const schema2 = import_joi127.default.object({
65783
+ unitId: import_joi127.default.string().hex().length(24).required(),
65784
+ page: import_joi127.default.number().integer().min(1).default(1),
65785
+ limit: import_joi127.default.number().integer().min(1).max(100).default(10),
65786
+ search: import_joi127.default.string().trim().allow("").default(""),
65787
+ month: import_joi127.default.string().pattern(/^(0?[1-9]|1[0-2])$/).allow("").optional(),
65788
+ year: import_joi127.default.string().pattern(/^\d{4}$/).allow("").optional()
65789
+ });
65790
+ const { error, value } = schema2.validate({ ...req.params, ...req.query });
65791
+ if (error) {
65792
+ next(new import_node_server_utils226.BadRequestError(error.message));
65793
+ return;
65794
+ }
65795
+ try {
65796
+ const bills = await _getPaidBills(value);
65797
+ res.json({ data: bills });
65798
+ return;
65799
+ } catch (error2) {
65800
+ next(error2);
65801
+ return;
65802
+ }
65803
+ }
65780
65804
  return {
65781
65805
  redirectPaymentTransaction,
65782
65806
  enquirePaymentTransaction,
65783
65807
  createPayment,
65784
65808
  getPaymentByReference,
65785
- updateStatus
65809
+ updateStatus,
65810
+ getPaidBills
65786
65811
  };
65787
65812
  }
65788
65813