@dascompany/product 4.1.6 → 4.1.8

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/SQL.json CHANGED
@@ -98,7 +98,7 @@
98
98
  "files": {
99
99
  "select": "SELECT * FROM files.files",
100
100
  "selectId": "SELECT id FROM files.files ",
101
- "selectForConnection": "SELECT id, name, catalog, type, sequence FROM files.files JOIN files.file_connections ON file_id = id",
101
+ "selectForConnection": "SELECT id, name, catalog, type, sequence, alt, title FROM files.files JOIN files.file_connections ON file_id = id",
102
102
  "insert": "INSERT INTO files.files( id, name, orginal_name, catalog, size_kb, type, alt, title, created_at ) VALUES ( $id::BIGINT, $name::TEXT, $orginal_name::TEXT, $catalog::TEXT, $size_kb::BIGINT, $type::TEXT, $alt::TEXT, $title::TEXT, now() )",
103
103
  "update": "UPDATE files.files SET name = $name::TEXT, orginal_name = $orginal_name::TEXT, catalog = $catalog::TEXT, size_kb = $size_kb::BIGINT, type = $type::TEXT, alt = $alt::TEXT, title = $title::TEXT WHERE id = $id::BIGINT ",
104
104
  "count": "SELECT COUNT(*) AS total_rows FROM files.files",
@@ -2,6 +2,7 @@ import { ParameterType, QueryOptions } from "@dascompany/database";
2
2
  import DatabaseConnection from "../../DatabaseConnection";
3
3
  import PaymentMethodReader from "./PaymentMethodReader";
4
4
  import PaymentStatusesReader from "./PaymentStatusesReader";
5
+ import createQueryOptionsForId from "../../utils/createQueryOptionsForId";
5
6
  export default class PaymentDetailsReader {
6
7
  static async get(queryOptions) {
7
8
  const paymentDetails = await DatabaseConnection.getInstance().paymentDetails.select(queryOptions);
@@ -9,26 +10,20 @@ export default class PaymentDetailsReader {
9
10
  }
10
11
  static async correctPaymentDetails(paymentDetails) {
11
12
  const id = paymentDetails.id;
12
- const queryOptionsForPaymentMethod = new QueryOptions();
13
- queryOptionsForPaymentMethod.setWhere([{
14
- name: 'id',
15
- type: ParameterType.bigint,
16
- value: paymentDetails.payment_method_id
17
- }]);
13
+ const queryOptionsForPaymentMethod = createQueryOptionsForId(paymentDetails.payment_method_id);
14
+ const paymentMethod = await PaymentMethodReader.get(queryOptionsForPaymentMethod);
18
15
  const queryOptionsForPaymentStatus = new QueryOptions();
19
16
  queryOptionsForPaymentStatus.setWhere([{
20
17
  name: 'payment_details_id',
21
18
  type: ParameterType.bigint,
22
19
  value: paymentDetails.id
23
20
  }]);
24
- const [paymentMethod, statuses] = await Promise.all([
25
- PaymentMethodReader.get(queryOptionsForPaymentMethod),
26
- PaymentStatusesReader.getAll(queryOptionsForPaymentStatus)
27
- ]);
21
+ const statuses = await PaymentStatusesReader.getAll(queryOptionsForPaymentStatus);
28
22
  return {
29
23
  id,
30
24
  paymentMethod,
31
25
  statuses,
26
+ paymentOrderId: paymentDetails.payment_order_id
32
27
  };
33
28
  }
34
29
  }
@@ -3,4 +3,5 @@ export default interface PaymentDetailsI {
3
3
  id: string;
4
4
  paymentMethod: PaymentMethodI;
5
5
  statuses: any[];
6
+ paymentOrderId: any;
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "4.1.6",
3
+ "version": "4.1.8",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",