@connect-plus-online/ogabai-integrations 0.0.95 → 0.0.97
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.cjs.js +16 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.esm.js +16 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -546,11 +546,12 @@ function createEntityIntegration(config) {
|
|
|
546
546
|
}
|
|
547
547
|
function createListIntegration(config) {
|
|
548
548
|
var _a;
|
|
549
|
+
const pluralKey = config.key.endsWith("y") ? `${config.key.slice(0, -1)}ies` : `${config.key}s`;
|
|
549
550
|
return {
|
|
550
|
-
responseFields: [
|
|
551
|
+
responseFields: [pluralKey, "total"],
|
|
551
552
|
nestedFields: {
|
|
552
553
|
...(_a = config.nested) != null ? _a : {},
|
|
553
|
-
[
|
|
554
|
+
[pluralKey]: config.fields
|
|
554
555
|
}
|
|
555
556
|
};
|
|
556
557
|
}
|
|
@@ -584,7 +585,7 @@ var userAccountIntegration = createStandardEntityIntegration({
|
|
|
584
585
|
}
|
|
585
586
|
});
|
|
586
587
|
var userAccountListIntegration = createListIntegration({
|
|
587
|
-
key:
|
|
588
|
+
key: ENTITY,
|
|
588
589
|
fields: userAccountQuery,
|
|
589
590
|
nested: {
|
|
590
591
|
userAccount: userAccountQuery,
|
|
@@ -730,7 +731,7 @@ var subscriptionPlanFeatureDefinitionIntegration = createStandardEntityIntegrati
|
|
|
730
731
|
fields: subscriptionPlanFeatureDefinitionQuery
|
|
731
732
|
});
|
|
732
733
|
var subscriptionPlanFeatureDefinitionListIntegration = createListIntegration({
|
|
733
|
-
key:
|
|
734
|
+
key: ENTITY2,
|
|
734
735
|
fields: subscriptionPlanFeatureDefinitionQuery
|
|
735
736
|
});
|
|
736
737
|
var subscriptionPlanFeatureDefinitionDeleteIntegration = createDeleteIntegration(ENTITY2);
|
|
@@ -745,7 +746,7 @@ var subscriptionPlanIntegration = createStandardEntityIntegration({
|
|
|
745
746
|
}
|
|
746
747
|
});
|
|
747
748
|
var subscriptionPlanListIntegration = createListIntegration({
|
|
748
|
-
key:
|
|
749
|
+
key: ENTITY3,
|
|
749
750
|
fields: subscriptionPlanQuery,
|
|
750
751
|
nested: {
|
|
751
752
|
features: subscriptionPlanFeatureQuery
|
|
@@ -785,7 +786,7 @@ var subscriptionPlanFeatureBehaviourIntegration = createStandardEntityIntegratio
|
|
|
785
786
|
fields: subscriptionPlanFeatureBehaviourQuery
|
|
786
787
|
});
|
|
787
788
|
var subscriptionPlanFeatureBehaviourListIntegration = createListIntegration({
|
|
788
|
-
key:
|
|
789
|
+
key: ENTITY4,
|
|
789
790
|
fields: subscriptionPlanFeatureBehaviourQuery
|
|
790
791
|
});
|
|
791
792
|
var subscriptionPlanFeatureBehaviourDeleteIntegration = createDeleteIntegration(ENTITY4);
|
|
@@ -797,7 +798,7 @@ var subscriptionTrialIntegration = createStandardEntityIntegration({
|
|
|
797
798
|
fields: subscriptionTrialQuery
|
|
798
799
|
});
|
|
799
800
|
var subscriptionTrialListIntegration = createListIntegration({
|
|
800
|
-
key:
|
|
801
|
+
key: ENTITY5,
|
|
801
802
|
fields: subscriptionTrialQuery
|
|
802
803
|
});
|
|
803
804
|
var subscriptionTrialDeleteIntegration = createDeleteIntegration(ENTITY5);
|
|
@@ -1791,7 +1792,7 @@ var userRoleIntegration = createStandardEntityIntegration({
|
|
|
1791
1792
|
}
|
|
1792
1793
|
});
|
|
1793
1794
|
var userRoleListIntegration = createListIntegration({
|
|
1794
|
-
key:
|
|
1795
|
+
key: ENTITY6,
|
|
1795
1796
|
fields: userRoleQuery,
|
|
1796
1797
|
nested: {
|
|
1797
1798
|
privileges: privilegeQuery
|
|
@@ -1892,7 +1893,7 @@ var customerIntegration = createStandardEntityIntegration({
|
|
|
1892
1893
|
}
|
|
1893
1894
|
});
|
|
1894
1895
|
var customerListIntegration = createListIntegration({
|
|
1895
|
-
key:
|
|
1896
|
+
key: ENTITY7,
|
|
1896
1897
|
fields: customerQuery,
|
|
1897
1898
|
nested: {
|
|
1898
1899
|
customerStoreBalance: customerStoreBalanceQuery
|
|
@@ -3576,7 +3577,7 @@ var expenseCategoryIntegration = createStandardEntityIntegration({
|
|
|
3576
3577
|
}
|
|
3577
3578
|
});
|
|
3578
3579
|
var expenseCategoryListIntegration = createListIntegration({
|
|
3579
|
-
key:
|
|
3580
|
+
key: ENTITY8,
|
|
3580
3581
|
fields: expenseCategoryQuery,
|
|
3581
3582
|
nested: {
|
|
3582
3583
|
features: expenseCategoryQuery
|
|
@@ -3594,7 +3595,7 @@ var expenseIntegration = createStandardEntityIntegration({
|
|
|
3594
3595
|
}
|
|
3595
3596
|
});
|
|
3596
3597
|
var expenseListIntegration = createListIntegration({
|
|
3597
|
-
key:
|
|
3598
|
+
key: ENTITY9,
|
|
3598
3599
|
fields: expenseQuery,
|
|
3599
3600
|
nested: {
|
|
3600
3601
|
features: expenseQuery
|
|
@@ -3674,7 +3675,7 @@ var createExpenseCategoryService = (client) => ({
|
|
|
3674
3675
|
defaultNestedFields: {}
|
|
3675
3676
|
}
|
|
3676
3677
|
),
|
|
3677
|
-
|
|
3678
|
+
getExpenseCategories: createOperationExecutor(
|
|
3678
3679
|
client,
|
|
3679
3680
|
"getExpenseCategories",
|
|
3680
3681
|
{
|
|
@@ -3814,7 +3815,7 @@ var createExpenseDispenseService = (client) => {
|
|
|
3814
3815
|
});
|
|
3815
3816
|
},
|
|
3816
3817
|
dispenseExpense: async (req) => {
|
|
3817
|
-
const { amountPaid, narration, createdById, expenseId, paymentType } = req.expenseDispense;
|
|
3818
|
+
const { amountPaid, narration, createdById, expenseId, paymentType, platform = "pos" } = req.expenseDispense;
|
|
3818
3819
|
const expenseRes = await expenseService.getExpense({
|
|
3819
3820
|
expense: {
|
|
3820
3821
|
id: expenseId
|
|
@@ -3859,7 +3860,8 @@ var createExpenseDispenseService = (client) => {
|
|
|
3859
3860
|
amountPaid: expense.amount,
|
|
3860
3861
|
narration: expense.narration || "Approved expense dispense",
|
|
3861
3862
|
createdById: expense.createdById,
|
|
3862
|
-
paymentType: expense.paymentType
|
|
3863
|
+
paymentType: expense.paymentType,
|
|
3864
|
+
platform: "pos"
|
|
3863
3865
|
}
|
|
3864
3866
|
});
|
|
3865
3867
|
await expenseService.updateExpense({
|