@zauru-sdk/graphql 1.0.81 → 1.0.83

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.
@@ -77,7 +77,9 @@ export declare const getSuggestedPricesStringQuery: (config?: {
77
77
  withItemCategories: boolean;
78
78
  onlyCurrent: boolean;
79
79
  }) => string;
80
- export declare const getPaymentTermsStringQuery = "\nquery getPaymentTerms {\n payment_terms {\n active\n id\n memo\n name\n }\n}\n";
80
+ export declare const getPaymentTermsStringQuery: (config?: {
81
+ includeDiscounts: boolean;
82
+ }) => string;
81
83
  export declare const getPaymentMethodsStringQuery: (config: {
82
84
  onlyActives: boolean;
83
85
  }) => string;
@@ -1148,16 +1148,27 @@ query getSuggestedPrices {
1148
1148
  }
1149
1149
  `;
1150
1150
  exports.getSuggestedPricesStringQuery = getSuggestedPricesStringQuery;
1151
- exports.getPaymentTermsStringQuery = `
1151
+ const getPaymentTermsStringQuery = (config = { includeDiscounts: false }) => `
1152
1152
  query getPaymentTerms {
1153
1153
  payment_terms {
1154
1154
  active
1155
1155
  id
1156
1156
  memo
1157
1157
  name
1158
+ ${config.includeDiscounts
1159
+ ? `allowed_discounts {
1160
+ discount {
1161
+ id
1162
+ name
1163
+ percent
1164
+ amount
1165
+ }
1166
+ }`
1167
+ : ""}
1158
1168
  }
1159
1169
  }
1160
1170
  `;
1171
+ exports.getPaymentTermsStringQuery = getPaymentTermsStringQuery;
1161
1172
  const getPaymentMethodsStringQuery = (config) => {
1162
1173
  const conditions = [];
1163
1174
  if (config.onlyActives) {
@@ -1148,16 +1148,27 @@ query getSuggestedPrices {
1148
1148
  }
1149
1149
  `;
1150
1150
  exports.getSuggestedPricesStringQuery = getSuggestedPricesStringQuery;
1151
- exports.getPaymentTermsStringQuery = `
1151
+ const getPaymentTermsStringQuery = (config = { includeDiscounts: false }) => `
1152
1152
  query getPaymentTerms {
1153
1153
  payment_terms {
1154
1154
  active
1155
1155
  id
1156
1156
  memo
1157
1157
  name
1158
+ ${config.includeDiscounts
1159
+ ? `allowed_discounts {
1160
+ discount {
1161
+ id
1162
+ name
1163
+ percent
1164
+ amount
1165
+ }
1166
+ }`
1167
+ : ""}
1158
1168
  }
1159
1169
  }
1160
1170
  `;
1171
+ exports.getPaymentTermsStringQuery = getPaymentTermsStringQuery;
1161
1172
  const getPaymentMethodsStringQuery = (config) => {
1162
1173
  const conditions = [];
1163
1174
  if (config.onlyActives) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/graphql",
3
- "version": "1.0.81",
3
+ "version": "1.0.83",
4
4
  "description": "Queries de uso común para las aplicación de Zauru.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -22,5 +22,5 @@
22
22
  "devDependencies": {
23
23
  "typescript": "^5.1.6"
24
24
  },
25
- "gitHead": "24f4eeb19473bf56b1681e21ca5d7db831429c4a"
25
+ "gitHead": "ee7c5a89327913cc2cb8755e215014e236e8799d"
26
26
  }