@connect-plus-online/ogabai-integrations 0.0.67 → 0.0.69
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 +2024 -1908
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +77 -8
- package/dist/index.d.ts +77 -8
- package/dist/index.esm.js +2021 -1909
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -557,454 +557,541 @@ var userAccountListIntegration = createListIntegration({
|
|
|
557
557
|
});
|
|
558
558
|
var userAccountDeleteIntegration = createDeleteIntegration(ENTITY);
|
|
559
559
|
|
|
560
|
-
// src/services/
|
|
561
|
-
var
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
"restockCounts",
|
|
577
|
-
"saleCounts",
|
|
578
|
-
"stockValue",
|
|
579
|
-
"transactionCounts"
|
|
580
|
-
];
|
|
581
|
-
var getUserDashStatsResponseNestedFields = {
|
|
582
|
-
productCounts: productCountsQuery,
|
|
583
|
-
restockCounts: restockCountsQuery,
|
|
584
|
-
saleCounts: saleCountsQuery,
|
|
585
|
-
transactionCounts: transactionCountsQuery
|
|
586
|
-
};
|
|
587
|
-
var getUserResponse = [
|
|
588
|
-
"user"
|
|
589
|
-
];
|
|
590
|
-
var _getUserResponseNestedFields = {
|
|
591
|
-
address: addressQuery
|
|
592
|
-
};
|
|
593
|
-
var getUserResponseNestedFields = {
|
|
594
|
-
user: userQuery,
|
|
595
|
-
..._getUserResponseNestedFields
|
|
596
|
-
};
|
|
597
|
-
var getUsersResponse = [
|
|
598
|
-
"users"
|
|
599
|
-
];
|
|
600
|
-
var getUsersResponseNestedFields = {
|
|
601
|
-
users: userQuery,
|
|
602
|
-
..._getUserResponseNestedFields
|
|
603
|
-
};
|
|
604
|
-
var updateUserResponse = [
|
|
605
|
-
"uploadImageResponse",
|
|
606
|
-
"user"
|
|
607
|
-
];
|
|
608
|
-
var updateUserResponseNestedFields = {
|
|
609
|
-
uploadImageResponse: ["fileUrl", "url"],
|
|
610
|
-
user: userQuery
|
|
560
|
+
// src/services/subscription/schemas/paystack.schema.ts
|
|
561
|
+
var paystackSchema = {
|
|
562
|
+
paystackInitializeSubscription: (query) => `
|
|
563
|
+
mutation paystackInitializeSubscription($userId: String!, $planId: String!, $subscriptionFrequencyType: SubscriptionFrequencyTypeEnum!) {
|
|
564
|
+
paystackInitializeSubscription(userId: $userId, planId: $planId, subscriptionFrequencyType: $subscriptionFrequencyType) {
|
|
565
|
+
${query}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
`,
|
|
569
|
+
paystackInitializePayment: (query) => `
|
|
570
|
+
mutation paystackInitializePayment($userId: String!) {
|
|
571
|
+
paystackInitializePayment(userId: $userId) {
|
|
572
|
+
${query}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
`
|
|
611
576
|
};
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
"
|
|
616
|
-
"
|
|
617
|
-
"
|
|
577
|
+
|
|
578
|
+
// src/services/subscription/types/paystack.ts
|
|
579
|
+
var paystackInitializePaymentResponse = [
|
|
580
|
+
"accessCode",
|
|
581
|
+
"authorizationUrl",
|
|
582
|
+
"reference"
|
|
618
583
|
];
|
|
619
|
-
var
|
|
620
|
-
stores: storeQuery,
|
|
621
|
-
userSetting: userSettingQuery,
|
|
622
|
-
...userAccountListIntegration.nestedFields,
|
|
623
|
-
...getUserResponseNestedFields,
|
|
624
|
-
...getAccountResponseNestedFields
|
|
625
|
-
};
|
|
584
|
+
var paystackInitializeSubscriptionResponse = paystackInitializePaymentResponse;
|
|
626
585
|
|
|
627
|
-
// src/services/
|
|
628
|
-
var
|
|
629
|
-
|
|
630
|
-
async getUserTypeCounts(fetchFields, option) {
|
|
631
|
-
var _a, _b, _c;
|
|
632
|
-
const res = await client.request(
|
|
633
|
-
user_schema_default.getUserTypeCounts(
|
|
634
|
-
gqlQueryStringBuilder(
|
|
635
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserTypeCountsResponse,
|
|
636
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserTypeCountsResponseNestedFields
|
|
637
|
-
)
|
|
638
|
-
),
|
|
639
|
-
{},
|
|
640
|
-
option
|
|
641
|
-
);
|
|
642
|
-
return (_c = res.data) == null ? void 0 : _c.getUserTypeCounts;
|
|
643
|
-
},
|
|
644
|
-
async getMonthlyUserStatsByYear(input, fetchFields, option) {
|
|
645
|
-
var _a, _b, _c;
|
|
646
|
-
const res = await client.request(
|
|
647
|
-
user_schema_default.getMonthlyUserStatsByYear(
|
|
648
|
-
gqlQueryStringBuilder(
|
|
649
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getMonthlyUserStatsByYearResponse,
|
|
650
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getMonthlyUserStatsByYearResponseNestedFields
|
|
651
|
-
)
|
|
652
|
-
),
|
|
653
|
-
input,
|
|
654
|
-
option
|
|
655
|
-
);
|
|
656
|
-
return (_c = res.data) == null ? void 0 : _c.getMonthlyUserStatsByYear;
|
|
657
|
-
},
|
|
658
|
-
// user dashboard stats
|
|
659
|
-
async getUserDashStats(input, fetchFields, option) {
|
|
586
|
+
// src/services/subscription/paystack.service.ts
|
|
587
|
+
var createPaystackService = (client) => ({
|
|
588
|
+
async paystackInitializeSubscription(input, fetchFields, option) {
|
|
660
589
|
var _a, _b, _c;
|
|
661
590
|
const res = await client.request(
|
|
662
|
-
|
|
663
|
-
gqlQueryStringBuilder(
|
|
664
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserDashStatsResponse,
|
|
665
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserDashStatsResponseNestedFields
|
|
666
|
-
)
|
|
667
|
-
),
|
|
668
|
-
input,
|
|
669
|
-
option
|
|
670
|
-
);
|
|
671
|
-
return (_c = res.data) == null ? void 0 : _c.getUserDashStats;
|
|
672
|
-
},
|
|
673
|
-
async me(fetchFields, option) {
|
|
674
|
-
var _a, _b;
|
|
675
|
-
return client.request(
|
|
676
|
-
user_schema_default.me(
|
|
677
|
-
gqlQueryStringBuilder(
|
|
678
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : meResponse,
|
|
679
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : meResponseNestedFields
|
|
680
|
-
)
|
|
681
|
-
),
|
|
682
|
-
{},
|
|
683
|
-
option
|
|
684
|
-
);
|
|
685
|
-
},
|
|
686
|
-
async getUser(input, fetchFields, option) {
|
|
687
|
-
var _a, _b;
|
|
688
|
-
return client.request(
|
|
689
|
-
user_schema_default.getUser(
|
|
690
|
-
gqlQueryStringBuilder(
|
|
691
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserResponse,
|
|
692
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserResponseNestedFields
|
|
693
|
-
)
|
|
694
|
-
),
|
|
695
|
-
input,
|
|
696
|
-
option
|
|
697
|
-
);
|
|
698
|
-
},
|
|
699
|
-
async getUsers(input, fetchFields, option) {
|
|
700
|
-
var _a, _b;
|
|
701
|
-
return client.request(
|
|
702
|
-
user_schema_default.getUsers(
|
|
591
|
+
paystackSchema.paystackInitializeSubscription(
|
|
703
592
|
gqlQueryStringBuilder(
|
|
704
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
705
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUsersResponseNestedFields
|
|
593
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : paystackInitializeSubscriptionResponse
|
|
706
594
|
)
|
|
707
595
|
),
|
|
708
596
|
input,
|
|
709
597
|
option
|
|
710
598
|
);
|
|
599
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.paystackInitializeSubscription) != null ? _c : null;
|
|
711
600
|
},
|
|
712
|
-
async
|
|
601
|
+
async paystackInitializePayment(input, fetchFields, option) {
|
|
713
602
|
var _a, _b;
|
|
714
|
-
|
|
715
|
-
|
|
603
|
+
const res = await client.request(
|
|
604
|
+
paystackSchema.paystackInitializePayment(
|
|
716
605
|
gqlQueryStringBuilder(
|
|
717
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
718
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateUserResponseNestedFields
|
|
606
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : paystackInitializePaymentResponse
|
|
719
607
|
)
|
|
720
608
|
),
|
|
721
609
|
input,
|
|
722
610
|
option
|
|
723
611
|
);
|
|
612
|
+
return (_b = res.data) == null ? void 0 : _b.paystackInitializePayment;
|
|
724
613
|
}
|
|
725
614
|
});
|
|
726
615
|
|
|
727
|
-
// src/services/
|
|
728
|
-
var
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
`,
|
|
736
|
-
// change pin
|
|
737
|
-
changePin: (query) => `
|
|
738
|
-
mutation changePin($userId: String!, $oldPin: String!, $newPin: String!) {
|
|
739
|
-
changePin(userId: $userId, oldPin: $oldPin, newPin: $newPin) {
|
|
740
|
-
${query}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
`,
|
|
744
|
-
checkRegistration: (query) => `
|
|
745
|
-
query checkRegistration($phone: String!) {
|
|
746
|
-
checkRegistration(phone: $phone) {
|
|
747
|
-
${query}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
`,
|
|
751
|
-
login: (query) => `
|
|
752
|
-
mutation login($phone: String!, $pin: String!, $userType: UserTypeEnum) {
|
|
753
|
-
login(phone: $phone, pin: $pin, userType: $userType) {
|
|
754
|
-
${query}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
`,
|
|
758
|
-
signUp: (query) => `
|
|
759
|
-
mutation signUp($firstName: String!, $lastName: String!, $phone: String!, $pin: String!, $storeName: String!, $storeLocation: String, $email: String, $userType: UserTypeEnum) {
|
|
760
|
-
signUp( firstName: $firstName, lastName: $lastName, phone: $phone, pin: $pin, storeName: $storeName, storeLocation: $storeLocation, email: $email, userType: $userType) {
|
|
761
|
-
${query}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
`,
|
|
765
|
-
resetPin: (query) => `
|
|
766
|
-
mutation resetPin($phone: String!, $pin: String!) {
|
|
767
|
-
resetPin(phone: $phone, pin: $pin) {
|
|
768
|
-
${query}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
`,
|
|
772
|
-
sendOTP: (query) => `
|
|
773
|
-
mutation sendOTP($phone: String!) {
|
|
774
|
-
sendOTP(phone: $phone) {
|
|
775
|
-
${query}
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
`,
|
|
779
|
-
verifyOTP: (query) => `
|
|
780
|
-
mutation verifyOTP($phone: String!, $otp: String!) {
|
|
781
|
-
verifyOTP(phone: $phone, otp: $otp) {
|
|
782
|
-
${query}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
`,
|
|
786
|
-
updateTxPin: (mutation) => `
|
|
787
|
-
mutation updateTxPin($userId: String!, $pin: String!, $oldPin: String!) {
|
|
788
|
-
updateTxPin(userId: $userId, pin: $pin, oldPin: $oldPin) {
|
|
789
|
-
${mutation}
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
`
|
|
793
|
-
};
|
|
794
|
-
|
|
795
|
-
// src/services/user/types/auth.type.ts
|
|
796
|
-
var authenticateWithStoreResponse = [
|
|
797
|
-
"accessToken"
|
|
616
|
+
// src/services/subscription/subscription.entity.ts
|
|
617
|
+
var subscriptionPlanFeatureBehaviourQuery = [
|
|
618
|
+
"id",
|
|
619
|
+
"createdAt",
|
|
620
|
+
"description",
|
|
621
|
+
"shortname",
|
|
622
|
+
"subscriptionPlanFeatureKey",
|
|
623
|
+
"title"
|
|
798
624
|
];
|
|
799
|
-
var
|
|
800
|
-
"
|
|
625
|
+
var subscriptionQuery = [
|
|
626
|
+
"cancelAtPeriodEnd",
|
|
627
|
+
"canceledAt",
|
|
628
|
+
"createdAt",
|
|
629
|
+
"currency",
|
|
630
|
+
"currentPeriodEnd",
|
|
631
|
+
"currentPeriodStart",
|
|
632
|
+
"defaultPaymentMethodId",
|
|
633
|
+
"id",
|
|
634
|
+
"price",
|
|
635
|
+
"subscriptionPlanId",
|
|
636
|
+
"subscriptionStatus",
|
|
637
|
+
"trialEnd",
|
|
638
|
+
"updatedAt",
|
|
639
|
+
"userId",
|
|
640
|
+
"version"
|
|
801
641
|
];
|
|
802
|
-
var
|
|
803
|
-
"
|
|
642
|
+
var subscriptionPlanFeatureQuery = [
|
|
643
|
+
"id",
|
|
644
|
+
"title",
|
|
645
|
+
"description",
|
|
646
|
+
"createdAt",
|
|
647
|
+
"limitValue",
|
|
648
|
+
"accessValue",
|
|
649
|
+
"behaviourIds",
|
|
650
|
+
"subscriptionPlanFeatureKey",
|
|
651
|
+
"featureStatus",
|
|
652
|
+
"meta",
|
|
653
|
+
"planId"
|
|
804
654
|
];
|
|
805
|
-
var
|
|
806
|
-
"
|
|
655
|
+
var subscriptionPlanQuery = [
|
|
656
|
+
"id",
|
|
657
|
+
"code",
|
|
658
|
+
"title",
|
|
659
|
+
"description",
|
|
660
|
+
"currency",
|
|
661
|
+
"period",
|
|
662
|
+
"trialDays",
|
|
663
|
+
"subscriptionPlanStatus",
|
|
664
|
+
"createdAt",
|
|
665
|
+
"updatedAt",
|
|
666
|
+
"features",
|
|
667
|
+
"monthlyPlanPrice",
|
|
668
|
+
"annuallyPlanPrice"
|
|
807
669
|
];
|
|
808
|
-
|
|
809
|
-
|
|
670
|
+
|
|
671
|
+
// src/services/subscription/types/subscription-plan-feature.type.ts
|
|
672
|
+
var getSubscriptionPlanFeatureResponse = [
|
|
673
|
+
"subscriptionPlanFeature"
|
|
810
674
|
];
|
|
811
|
-
var
|
|
812
|
-
|
|
813
|
-
|
|
675
|
+
var _getSubscriptionPlanFeatureResponseNestedFields = {};
|
|
676
|
+
var getSubscriptionPlanFeatureResponseNestedFields = {
|
|
677
|
+
..._getSubscriptionPlanFeatureResponseNestedFields,
|
|
678
|
+
subscriptionPlanFeature: subscriptionPlanFeatureQuery
|
|
679
|
+
};
|
|
680
|
+
var getSubscriptionPlanFeaturesResponse = [
|
|
681
|
+
"subscriptionPlanFeatures",
|
|
682
|
+
"total"
|
|
814
683
|
];
|
|
815
|
-
var
|
|
816
|
-
|
|
684
|
+
var getSubscriptionPlanFeaturesResponseNestedFields = {
|
|
685
|
+
..._getSubscriptionPlanFeatureResponseNestedFields,
|
|
686
|
+
subscriptionPlanFeatures: subscriptionPlanFeatureQuery
|
|
687
|
+
};
|
|
688
|
+
var addSubscriptionPlanFeatureResponse = getSubscriptionPlanFeatureResponse;
|
|
689
|
+
var addSubscriptionPlanFeatureResponseNestedFields = getSubscriptionPlanFeatureResponseNestedFields;
|
|
690
|
+
var updateSubscriptionPlanFeatureResponse = getSubscriptionPlanFeatureResponse;
|
|
691
|
+
var updateSubscriptionPlanFeatureResponseNestedFields = getSubscriptionPlanFeatureResponseNestedFields;
|
|
692
|
+
var removeSubscriptionPlanFeatureResponse = [
|
|
693
|
+
"subscriptionPlanFeatureId"
|
|
817
694
|
];
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
695
|
+
|
|
696
|
+
// src/services/subscription/types/subscription-plan.type.ts
|
|
697
|
+
var getSubscriptionPlanResponse = [
|
|
698
|
+
"subscriptionPlan"
|
|
821
699
|
];
|
|
822
|
-
var
|
|
823
|
-
|
|
824
|
-
|
|
700
|
+
var _getSubscriptionPlanResponseNestedFields = {
|
|
701
|
+
features: subscriptionPlanFeatureQuery
|
|
702
|
+
};
|
|
703
|
+
var getSubscriptionPlanResponseNestedFields = {
|
|
704
|
+
..._getSubscriptionPlanResponseNestedFields,
|
|
705
|
+
subscriptionPlan: subscriptionPlanQuery
|
|
706
|
+
};
|
|
707
|
+
var getSubscriptionPlansResponse = [
|
|
708
|
+
"subscriptionPlans",
|
|
709
|
+
"total"
|
|
710
|
+
];
|
|
711
|
+
var getSubscriptionPlansResponseNestedFields = {
|
|
712
|
+
..._getSubscriptionPlanResponseNestedFields,
|
|
713
|
+
subscriptionPlans: subscriptionPlanQuery
|
|
714
|
+
};
|
|
715
|
+
var addSubscriptionPlanResponse = getSubscriptionPlanResponse;
|
|
716
|
+
var addSubscriptionPlanResponseNestedFields = getSubscriptionPlanResponseNestedFields;
|
|
717
|
+
var updateSubscriptionPlanResponse = getSubscriptionPlanResponse;
|
|
718
|
+
var updateSubscriptionPlanResponseNestedFields = getSubscriptionPlanResponseNestedFields;
|
|
719
|
+
var removeSubscriptionPlanResponse = [
|
|
720
|
+
"subscriptionPlanId"
|
|
825
721
|
];
|
|
826
722
|
|
|
827
|
-
// src/services/
|
|
828
|
-
var
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
723
|
+
// src/services/subscription/types/subscription.type.ts
|
|
724
|
+
var getSubscriptionResponse = [
|
|
725
|
+
"subscription"
|
|
726
|
+
];
|
|
727
|
+
var _getSubscriptionResponseNestedFields = {};
|
|
728
|
+
var getSubscriptionResponseNestedFields = {
|
|
729
|
+
..._getSubscriptionResponseNestedFields,
|
|
730
|
+
subscription: subscriptionQuery
|
|
731
|
+
};
|
|
732
|
+
var getSubscriptionsResponse = [
|
|
733
|
+
"subscriptions",
|
|
734
|
+
"total"
|
|
735
|
+
];
|
|
736
|
+
var getSubscriptionsResponseNestedFields = {
|
|
737
|
+
..._getSubscriptionResponseNestedFields,
|
|
738
|
+
subscriptions: subscriptionQuery
|
|
739
|
+
};
|
|
740
|
+
var addSubscriptionResponse = getSubscriptionResponse;
|
|
741
|
+
var addSubscriptionResponseNestedFields = getSubscriptionResponseNestedFields;
|
|
742
|
+
var updateSubscriptionResponse = getSubscriptionResponse;
|
|
743
|
+
var updateSubscriptionResponseNestedFields = getSubscriptionResponseNestedFields;
|
|
744
|
+
var removeSubscriptionResponse = [
|
|
745
|
+
"subscriptionId"
|
|
746
|
+
];
|
|
747
|
+
|
|
748
|
+
// src/services/subscription/types/subscription-plan-feature-behaviour.type.ts
|
|
749
|
+
var ENTITY2 = "subscriptionPlanFeatureBehaviour";
|
|
750
|
+
var subscriptionPlanFeatureBehaviourIntegration = createStandardEntityIntegration({
|
|
751
|
+
key: ENTITY2,
|
|
752
|
+
fields: subscriptionPlanFeatureBehaviourQuery
|
|
753
|
+
});
|
|
754
|
+
var subscriptionPlanFeatureBehaviourListIntegration = createListIntegration({
|
|
755
|
+
key: "subscriptionPlanFeatureBehaviours",
|
|
756
|
+
fields: subscriptionPlanFeatureBehaviourQuery
|
|
757
|
+
});
|
|
758
|
+
var subscriptionPlanFeatureBehaviourDeleteIntegration = createDeleteIntegration(ENTITY2);
|
|
759
|
+
|
|
760
|
+
// src/services/subscription/schemas/subscription-plan-feature.schema.ts
|
|
761
|
+
var subscriptionPlanFeatureSchema = {
|
|
762
|
+
getSubscriptionPlanFeature: (query) => `
|
|
763
|
+
query getSubscriptionPlanFeature($subscriptionPlanFeature: SubscriptionPlanFeatureInput!) {
|
|
764
|
+
getSubscriptionPlanFeature(subscriptionPlanFeature: $subscriptionPlanFeature) {
|
|
765
|
+
${query}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
`,
|
|
769
|
+
getSubscriptionPlanFeatures: (query) => `
|
|
770
|
+
query getSubscriptionPlanFeatures($search: String, $subscriptionPlanFeatureIds: [String], $subscriptionPlanFeature: SubscriptionPlanFeatureInput, $limit: Int!, $skip: Int!) {
|
|
771
|
+
getSubscriptionPlanFeatures(search: $search, subscriptionPlanFeatureIds: $subscriptionPlanFeatureIds, subscriptionPlanFeature: $subscriptionPlanFeature, limit: $limit, skip: $skip) {
|
|
772
|
+
${query}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
`,
|
|
776
|
+
addSubscriptionPlanFeature: (query) => `
|
|
777
|
+
mutation addSubscriptionPlanFeature($subscriptionPlanFeature: SubscriptionPlanFeatureInput!) {
|
|
778
|
+
addSubscriptionPlanFeature(subscriptionPlanFeature: $subscriptionPlanFeature) {
|
|
779
|
+
${query}
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
`,
|
|
783
|
+
updateSubscriptionPlanFeature: (query) => `
|
|
784
|
+
mutation updateSubscriptionPlanFeature($subscriptionPlanFeatureId: String!, $subscriptionPlanFeature: SubscriptionPlanFeatureInput!) {
|
|
785
|
+
updateSubscriptionPlanFeature(subscriptionPlanFeatureId: $subcriptionPlanFeatureId, subscriptionPlanFeature: $subscriptionPlanFeature) {
|
|
786
|
+
${query}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
`,
|
|
790
|
+
removeSubscriptionPlanFeature: (query) => `
|
|
791
|
+
mutation removeSubscriptionPlanFeature($subscriptionPlanFeatureId: String!) {
|
|
792
|
+
removeSubscriptionPlanFeature(subscriptionPlanFeatureId: $subcriptionPlanFeatureId) {
|
|
793
|
+
${query}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
`
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
// src/services/subscription/subscription-plan-feature.service.ts
|
|
800
|
+
var createSubscriptionPlanFeatureService = (client) => ({
|
|
801
|
+
async removeSubscriptionPlanFeature(input, fetchFields, option) {
|
|
802
|
+
var _a, _b, _c;
|
|
803
|
+
const res = await client.request(
|
|
804
|
+
subscriptionPlanFeatureSchema.removeSubscriptionPlanFeature(
|
|
857
805
|
gqlQueryStringBuilder(
|
|
858
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
806
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeSubscriptionPlanFeatureResponse
|
|
859
807
|
)
|
|
860
808
|
),
|
|
861
809
|
input,
|
|
862
810
|
option
|
|
863
811
|
);
|
|
812
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeSubscriptionPlanFeature) != null ? _c : null;
|
|
864
813
|
},
|
|
865
|
-
async
|
|
866
|
-
var _a;
|
|
867
|
-
|
|
868
|
-
|
|
814
|
+
async updateSubscriptionPlanFeature(input, fetchFields, option) {
|
|
815
|
+
var _a, _b, _c, _d;
|
|
816
|
+
const res = await client.request(
|
|
817
|
+
subscriptionPlanFeatureSchema.updateSubscriptionPlanFeature(
|
|
869
818
|
gqlQueryStringBuilder(
|
|
870
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
819
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateSubscriptionPlanFeatureResponse,
|
|
820
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateSubscriptionPlanFeatureResponseNestedFields
|
|
871
821
|
)
|
|
872
822
|
),
|
|
873
823
|
input,
|
|
874
824
|
option
|
|
875
825
|
);
|
|
826
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateSubscriptionPlanFeature) != null ? _d : null;
|
|
876
827
|
},
|
|
877
|
-
async
|
|
878
|
-
var _a;
|
|
879
|
-
|
|
880
|
-
|
|
828
|
+
async addSubscriptionPlanFeature(input, fetchFields, option) {
|
|
829
|
+
var _a, _b, _c, _d;
|
|
830
|
+
const res = await client.request(
|
|
831
|
+
subscriptionPlanFeatureSchema.addSubscriptionPlanFeature(
|
|
881
832
|
gqlQueryStringBuilder(
|
|
882
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
833
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addSubscriptionPlanFeatureResponse,
|
|
834
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addSubscriptionPlanFeatureResponseNestedFields
|
|
883
835
|
)
|
|
884
836
|
),
|
|
885
837
|
input,
|
|
886
838
|
option
|
|
887
839
|
);
|
|
840
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addSubscriptionPlanFeature) != null ? _d : null;
|
|
888
841
|
},
|
|
889
|
-
async
|
|
890
|
-
var _a;
|
|
891
|
-
|
|
892
|
-
|
|
842
|
+
async getSubscriptionPlanFeature(input, fetchFields, option) {
|
|
843
|
+
var _a, _b, _c, _d;
|
|
844
|
+
const res = await client.request(
|
|
845
|
+
subscriptionPlanFeatureSchema.getSubscriptionPlanFeature(
|
|
893
846
|
gqlQueryStringBuilder(
|
|
894
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
847
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlanFeatureResponse,
|
|
848
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlanFeatureResponseNestedFields
|
|
895
849
|
)
|
|
896
850
|
),
|
|
897
851
|
input,
|
|
898
852
|
option
|
|
899
853
|
);
|
|
854
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlanFeature) != null ? _d : null;
|
|
900
855
|
},
|
|
901
|
-
async
|
|
902
|
-
var _a;
|
|
903
|
-
|
|
904
|
-
|
|
856
|
+
async getSubscriptionPlanFeatures(input, fetchFields, option) {
|
|
857
|
+
var _a, _b, _c, _d;
|
|
858
|
+
const res = await client.request(
|
|
859
|
+
subscriptionPlanFeatureSchema.getSubscriptionPlanFeatures(
|
|
905
860
|
gqlQueryStringBuilder(
|
|
906
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
861
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlanFeaturesResponse,
|
|
862
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlanFeaturesResponseNestedFields
|
|
907
863
|
)
|
|
908
864
|
),
|
|
909
865
|
input,
|
|
910
866
|
option
|
|
911
867
|
);
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
868
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlanFeatures) != null ? _d : null;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// src/services/subscription/schemas/subscription-plan.schema.ts
|
|
873
|
+
var subscriptionPlanSchema = {
|
|
874
|
+
getSubscriptionPlan: (query) => `
|
|
875
|
+
query getSubscriptionPlan($subscriptionPlan: SubscriptionPlanInput!) {
|
|
876
|
+
getSubscriptionPlan(subscriptionPlan: $subscriptionPlan) {
|
|
877
|
+
${query}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
`,
|
|
881
|
+
getSubscriptionPlans: (query) => `
|
|
882
|
+
query getSubscriptionPlans($search: String, $subscriptionPlanIds: [String], $subscriptionPlan: SubscriptionPlanInput, $limit: Int!, $skip: Int!) {
|
|
883
|
+
getSubscriptionPlans(search: $search, subscriptionPlanIds: $subscriptionPlanIds, subscriptionPlan: $subscriptionPlan, limit: $limit, skip: $skip) {
|
|
884
|
+
${query}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
`,
|
|
888
|
+
addSubscriptionPlan: (query) => `
|
|
889
|
+
mutation addSubscriptionPlan($subscriptionPlan: SubscriptionPlanInput!) {
|
|
890
|
+
addSubscriptionPlan(subscriptionPlan: $subscriptionPlan) {
|
|
891
|
+
${query}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
`,
|
|
895
|
+
updateSubscriptionPlan: (query) => `
|
|
896
|
+
mutation updateSubscriptionPlan($subscriptionPlanId: String!, $subscriptionPlan: SubscriptionPlanInput!) {
|
|
897
|
+
updateSubscriptionPlan(subscriptionPlanId: $subscriptionPlanId, subscriptionPlan: $subscriptionPlan) {
|
|
898
|
+
${query}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
`,
|
|
902
|
+
removeSubscriptionPlan: (query) => `
|
|
903
|
+
mutation removeSubscriptionPlan($subscriptionPlanId: String!) {
|
|
904
|
+
removeSubscriptionPlan(subscriptionPlanId: $subscriptionPlanId) {
|
|
905
|
+
${query}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
`
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
// src/services/subscription/subscription-plan.service.ts
|
|
912
|
+
var createSubscriptionPlanService = (client) => ({
|
|
913
|
+
async removeSubscriptionPlan(input, fetchFields, option) {
|
|
914
|
+
var _a, _b, _c;
|
|
915
|
+
const res = await client.request(
|
|
916
|
+
subscriptionPlanSchema.removeSubscriptionPlan(
|
|
917
917
|
gqlQueryStringBuilder(
|
|
918
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
918
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeSubscriptionPlanResponse
|
|
919
919
|
)
|
|
920
920
|
),
|
|
921
921
|
input,
|
|
922
922
|
option
|
|
923
923
|
);
|
|
924
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeSubscriptionPlan) != null ? _c : null;
|
|
924
925
|
},
|
|
925
|
-
async
|
|
926
|
-
var _a;
|
|
927
|
-
|
|
928
|
-
|
|
926
|
+
async updateSubscriptionPlan(input, fetchFields, option) {
|
|
927
|
+
var _a, _b, _c, _d;
|
|
928
|
+
const res = await client.request(
|
|
929
|
+
subscriptionPlanSchema.updateSubscriptionPlan(
|
|
929
930
|
gqlQueryStringBuilder(
|
|
930
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
931
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateSubscriptionPlanResponse,
|
|
932
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateSubscriptionPlanResponseNestedFields
|
|
933
|
+
)
|
|
934
|
+
),
|
|
935
|
+
input,
|
|
936
|
+
option
|
|
937
|
+
);
|
|
938
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateSubscriptionPlan) != null ? _d : null;
|
|
939
|
+
},
|
|
940
|
+
async addSubscriptionPlan(input, fetchFields, option) {
|
|
941
|
+
var _a, _b, _c, _d;
|
|
942
|
+
const res = await client.request(
|
|
943
|
+
subscriptionPlanSchema.addSubscriptionPlan(
|
|
944
|
+
gqlQueryStringBuilder(
|
|
945
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addSubscriptionPlanResponse,
|
|
946
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addSubscriptionPlanResponseNestedFields
|
|
947
|
+
)
|
|
948
|
+
),
|
|
949
|
+
input,
|
|
950
|
+
option
|
|
951
|
+
);
|
|
952
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addSubscriptionPlan) != null ? _d : null;
|
|
953
|
+
},
|
|
954
|
+
async getSubscriptionPlan(input, fetchFields, option) {
|
|
955
|
+
var _a, _b, _c, _d;
|
|
956
|
+
const res = await client.request(
|
|
957
|
+
subscriptionPlanSchema.getSubscriptionPlan(
|
|
958
|
+
gqlQueryStringBuilder(
|
|
959
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlanResponse,
|
|
960
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlanResponseNestedFields
|
|
961
|
+
)
|
|
962
|
+
),
|
|
963
|
+
input,
|
|
964
|
+
option
|
|
965
|
+
);
|
|
966
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlan) != null ? _d : null;
|
|
967
|
+
},
|
|
968
|
+
async getSubscriptionPlans(input, fetchFields, option) {
|
|
969
|
+
var _a, _b, _c, _d;
|
|
970
|
+
const res = await client.request(
|
|
971
|
+
subscriptionPlanSchema.getSubscriptionPlans(
|
|
972
|
+
gqlQueryStringBuilder(
|
|
973
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionPlansResponse,
|
|
974
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionPlansResponseNestedFields
|
|
931
975
|
)
|
|
932
976
|
),
|
|
933
977
|
input,
|
|
934
978
|
option
|
|
935
979
|
);
|
|
980
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptionPlans) != null ? _d : null;
|
|
936
981
|
}
|
|
937
982
|
});
|
|
938
983
|
|
|
939
|
-
// src/services/
|
|
940
|
-
var
|
|
941
|
-
|
|
942
|
-
query
|
|
943
|
-
|
|
984
|
+
// src/services/subscription/schemas/subscription.schema.ts
|
|
985
|
+
var subscriptionSchema = {
|
|
986
|
+
getSubscription: (query) => `
|
|
987
|
+
query getSubscription($subscription: SubscriptionInput!) {
|
|
988
|
+
getSubscription(subscription: $subscription) {
|
|
989
|
+
${query}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
`,
|
|
993
|
+
getSubscriptions: (query) => `
|
|
994
|
+
query getSubscriptions($search: String, $subscriptionIds: [String], $subscription: SubscriptionInput, $limit: Int!, $skip: Int!) {
|
|
995
|
+
getSubscriptions(search: $search, subscriptionIds: $subscriptionIds, subscription: $subscription, limit: $limit, skip: $skip) {
|
|
996
|
+
${query}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
`,
|
|
1000
|
+
addSubscription: (query) => `
|
|
1001
|
+
mutation addSubscription($subscription: SubscriptionInput!) {
|
|
1002
|
+
addSubscription(subscription: $subscription) {
|
|
1003
|
+
${query}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
`,
|
|
1007
|
+
updateSubscription: (query) => `
|
|
1008
|
+
mutation updateSubscription($subscriptionId: String!, $subscription: SubscriptionInput!) {
|
|
1009
|
+
updateSubscription(subscriptionId: $subcriptionId, subscription: $subscription) {
|
|
1010
|
+
${query}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
`,
|
|
1014
|
+
removeSubscription: (query) => `
|
|
1015
|
+
mutation removeSubscription($subscriptionId: String!) {
|
|
1016
|
+
removeSubscription(subscriptionId: $subcriptionId) {
|
|
944
1017
|
${query}
|
|
945
1018
|
}
|
|
946
1019
|
}
|
|
947
1020
|
`
|
|
948
1021
|
};
|
|
949
1022
|
|
|
950
|
-
// src/services/
|
|
951
|
-
var
|
|
952
|
-
|
|
953
|
-
notification: notificationQuery,
|
|
954
|
-
userNotifications: userNotificationQuery
|
|
955
|
-
};
|
|
956
|
-
|
|
957
|
-
// src/services/user/user-notification.service.ts
|
|
958
|
-
var createUserNotificationService = (client) => ({
|
|
959
|
-
async getUserNotifications(input, fetchFields, option) {
|
|
1023
|
+
// src/services/subscription/subscription.service.ts
|
|
1024
|
+
var createSubscriptionService = (client) => ({
|
|
1025
|
+
async removeSubscription(input, fetchFields, option) {
|
|
960
1026
|
var _a, _b, _c;
|
|
961
1027
|
const res = await client.request(
|
|
962
|
-
|
|
1028
|
+
subscriptionSchema.removeSubscription(
|
|
963
1029
|
gqlQueryStringBuilder(
|
|
964
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
965
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserNotificationsResponseNestedFields
|
|
1030
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeSubscriptionResponse
|
|
966
1031
|
)
|
|
967
1032
|
),
|
|
968
1033
|
input,
|
|
969
1034
|
option
|
|
970
1035
|
);
|
|
971
|
-
return (_c = res.data) == null ? void 0 : _c
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
|
|
975
|
-
// src/services/user/schemas/user-account.schema.ts
|
|
976
|
-
var userAccountSchema = {
|
|
977
|
-
get: {
|
|
978
|
-
operation: "query",
|
|
979
|
-
name: "getUserAccount",
|
|
980
|
-
variables: "($userAccount: UserAccountInput!)",
|
|
981
|
-
field: "(userAccount: $userAccount)"
|
|
1036
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeSubscription) != null ? _c : null;
|
|
982
1037
|
},
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1038
|
+
async updateSubscription(input, fetchFields, option) {
|
|
1039
|
+
var _a, _b, _c, _d;
|
|
1040
|
+
const res = await client.request(
|
|
1041
|
+
subscriptionSchema.updateSubscription(
|
|
1042
|
+
gqlQueryStringBuilder(
|
|
1043
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateSubscriptionResponse,
|
|
1044
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateSubscriptionResponseNestedFields
|
|
1045
|
+
)
|
|
1046
|
+
),
|
|
1047
|
+
input,
|
|
1048
|
+
option
|
|
1049
|
+
);
|
|
1050
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateSubscription) != null ? _d : null;
|
|
988
1051
|
},
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1052
|
+
async addSubscription(input, fetchFields, option) {
|
|
1053
|
+
var _a, _b, _c, _d;
|
|
1054
|
+
const res = await client.request(
|
|
1055
|
+
subscriptionSchema.addSubscription(
|
|
1056
|
+
gqlQueryStringBuilder(
|
|
1057
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addSubscriptionResponse,
|
|
1058
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addSubscriptionResponseNestedFields
|
|
1059
|
+
)
|
|
1060
|
+
),
|
|
1061
|
+
input,
|
|
1062
|
+
option
|
|
1063
|
+
);
|
|
1064
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addSubscription) != null ? _d : null;
|
|
994
1065
|
},
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1066
|
+
async getSubscription(input, fetchFields, option) {
|
|
1067
|
+
var _a, _b, _c, _d;
|
|
1068
|
+
const res = await client.request(
|
|
1069
|
+
subscriptionSchema.getSubscription(
|
|
1070
|
+
gqlQueryStringBuilder(
|
|
1071
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionResponse,
|
|
1072
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionResponseNestedFields
|
|
1073
|
+
)
|
|
1074
|
+
),
|
|
1075
|
+
input,
|
|
1076
|
+
option
|
|
1077
|
+
);
|
|
1078
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscription) != null ? _d : null;
|
|
1000
1079
|
},
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1080
|
+
async getSubscriptions(input, fetchFields, option) {
|
|
1081
|
+
var _a, _b, _c, _d;
|
|
1082
|
+
const res = await client.request(
|
|
1083
|
+
subscriptionSchema.getSubscriptions(
|
|
1084
|
+
gqlQueryStringBuilder(
|
|
1085
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSubscriptionsResponse,
|
|
1086
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSubscriptionsResponseNestedFields
|
|
1087
|
+
)
|
|
1088
|
+
),
|
|
1089
|
+
input,
|
|
1090
|
+
option
|
|
1091
|
+
);
|
|
1092
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSubscriptions) != null ? _d : null;
|
|
1006
1093
|
}
|
|
1007
|
-
};
|
|
1094
|
+
});
|
|
1008
1095
|
|
|
1009
1096
|
// src/helpers/service.factory.ts
|
|
1010
1097
|
function createOperationExecutor(client, key, config) {
|
|
@@ -1041,2189 +1128,2214 @@ function buildSchema({
|
|
|
1041
1128
|
`.trim();
|
|
1042
1129
|
}
|
|
1043
1130
|
|
|
1044
|
-
// src/services/
|
|
1045
|
-
var
|
|
1046
|
-
createUserAccount: createOperationExecutor(
|
|
1047
|
-
client,
|
|
1048
|
-
"createUserAccount",
|
|
1049
|
-
{
|
|
1050
|
-
schema: buildSchema(userAccountSchema.create),
|
|
1051
|
-
defaultRootFields: [...userAccountIntegration.create.responseFields, "pin"],
|
|
1052
|
-
defaultNestedFields: userAccountIntegration.create.nestedFields
|
|
1053
|
-
}
|
|
1054
|
-
),
|
|
1055
|
-
updateUserAccount: createOperationExecutor(
|
|
1056
|
-
client,
|
|
1057
|
-
"updateUserAccount",
|
|
1058
|
-
{
|
|
1059
|
-
schema: buildSchema(userAccountSchema.update),
|
|
1060
|
-
defaultRootFields: userAccountIntegration.update.responseFields,
|
|
1061
|
-
defaultNestedFields: userAccountIntegration.update.nestedFields
|
|
1062
|
-
}
|
|
1063
|
-
),
|
|
1064
|
-
getUserAccount: createOperationExecutor(
|
|
1065
|
-
client,
|
|
1066
|
-
"getUserAccount",
|
|
1067
|
-
{
|
|
1068
|
-
schema: buildSchema(userAccountSchema.get),
|
|
1069
|
-
defaultRootFields: userAccountIntegration.get.responseFields,
|
|
1070
|
-
defaultNestedFields: userAccountIntegration.get.nestedFields
|
|
1071
|
-
}
|
|
1072
|
-
),
|
|
1073
|
-
removeUserAccount: createOperationExecutor(
|
|
1074
|
-
client,
|
|
1075
|
-
"removeUserAccount",
|
|
1076
|
-
{
|
|
1077
|
-
schema: buildSchema(userAccountSchema.delete),
|
|
1078
|
-
defaultRootFields: userAccountDeleteIntegration.responseFields,
|
|
1079
|
-
defaultNestedFields: {}
|
|
1080
|
-
}
|
|
1081
|
-
),
|
|
1082
|
-
getUserAccounts: createOperationExecutor(
|
|
1083
|
-
client,
|
|
1084
|
-
"getUserAccounts",
|
|
1085
|
-
{
|
|
1086
|
-
schema: buildSchema(userAccountSchema.list),
|
|
1087
|
-
defaultRootFields: [...userAccountListIntegration.responseFields],
|
|
1088
|
-
defaultNestedFields: userAccountListIntegration.nestedFields
|
|
1089
|
-
}
|
|
1090
|
-
)
|
|
1091
|
-
});
|
|
1092
|
-
|
|
1093
|
-
// src/services/user/types/user-role.type.ts
|
|
1094
|
-
var ENTITY2 = "userRole";
|
|
1095
|
-
var userRoleIntegration = createStandardEntityIntegration({
|
|
1096
|
-
key: ENTITY2,
|
|
1097
|
-
fields: userRoleQuery,
|
|
1098
|
-
nested: {
|
|
1099
|
-
privileges: privilegeQuery
|
|
1100
|
-
}
|
|
1101
|
-
});
|
|
1102
|
-
var userRoleListIntegration = createListIntegration({
|
|
1103
|
-
key: "userRoles",
|
|
1104
|
-
fields: userRoleQuery,
|
|
1105
|
-
nested: {
|
|
1106
|
-
privileges: privilegeQuery
|
|
1107
|
-
}
|
|
1108
|
-
});
|
|
1109
|
-
var userRoleDeleteIntegration = createDeleteIntegration(ENTITY2);
|
|
1110
|
-
|
|
1111
|
-
// src/services/user/schemas/user-role.schema.ts
|
|
1112
|
-
var userRoleSchema = {
|
|
1113
|
-
get: {
|
|
1114
|
-
operation: "query",
|
|
1115
|
-
name: "getUserRole",
|
|
1116
|
-
variables: "($userRole: UserRoleInput!)",
|
|
1117
|
-
field: "(userRole: $userRole)"
|
|
1118
|
-
},
|
|
1119
|
-
list: {
|
|
1120
|
-
operation: "query",
|
|
1121
|
-
name: "getUserRoles",
|
|
1122
|
-
variables: "($limit: Int!, $skip: Int!, $search: String, $userRole: UserRoleInput, $userRoleIds: [String])",
|
|
1123
|
-
field: "(limit: $limit, skip: $skip, search: $search, userRole: $userRole, userRoleIds: $userRoleIds)"
|
|
1124
|
-
},
|
|
1125
|
-
create: {
|
|
1126
|
-
operation: "mutation",
|
|
1127
|
-
name: "createUserRole",
|
|
1128
|
-
variables: "($userRole: UserRoleInput!)",
|
|
1129
|
-
field: "(userRole: $userRole)"
|
|
1130
|
-
},
|
|
1131
|
-
update: {
|
|
1132
|
-
operation: "mutation",
|
|
1133
|
-
name: "updateUserRole",
|
|
1134
|
-
variables: "($userRoleId: String!, $userRole: UserRoleInput!)",
|
|
1135
|
-
field: "(userRoleId: $userRoleId, userRole: $userRole)"
|
|
1136
|
-
},
|
|
1137
|
-
delete: {
|
|
1138
|
-
operation: "mutation",
|
|
1139
|
-
name: "removeUserRole",
|
|
1140
|
-
variables: "($userRoleId: String!)",
|
|
1141
|
-
field: "(userRoleId: $userRoleId)"
|
|
1142
|
-
}
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
// src/services/user/user-role.service.ts
|
|
1146
|
-
var createUserRoleService = (client) => ({
|
|
1147
|
-
createUserRole: createOperationExecutor(
|
|
1148
|
-
client,
|
|
1149
|
-
"createUserRole",
|
|
1150
|
-
{
|
|
1151
|
-
schema: buildSchema(userRoleSchema.create),
|
|
1152
|
-
defaultRootFields: userRoleIntegration.create.responseFields,
|
|
1153
|
-
defaultNestedFields: userRoleIntegration.create.nestedFields
|
|
1154
|
-
}
|
|
1155
|
-
),
|
|
1156
|
-
updateUserRole: createOperationExecutor(
|
|
1157
|
-
client,
|
|
1158
|
-
"updateUserRole",
|
|
1159
|
-
{
|
|
1160
|
-
schema: buildSchema(userRoleSchema.update),
|
|
1161
|
-
defaultRootFields: userRoleIntegration.update.responseFields,
|
|
1162
|
-
defaultNestedFields: userRoleIntegration.update.nestedFields
|
|
1163
|
-
}
|
|
1164
|
-
),
|
|
1165
|
-
getUserRole: createOperationExecutor(
|
|
1166
|
-
client,
|
|
1167
|
-
"getUserRole",
|
|
1168
|
-
{
|
|
1169
|
-
schema: buildSchema(userRoleSchema.get),
|
|
1170
|
-
defaultRootFields: userRoleIntegration.get.responseFields,
|
|
1171
|
-
defaultNestedFields: userRoleIntegration.get.nestedFields
|
|
1172
|
-
}
|
|
1173
|
-
),
|
|
1174
|
-
removeUserRole: createOperationExecutor(
|
|
1175
|
-
client,
|
|
1176
|
-
"removeUserRole",
|
|
1177
|
-
{
|
|
1178
|
-
schema: buildSchema(userRoleSchema.delete),
|
|
1179
|
-
defaultRootFields: userRoleDeleteIntegration.responseFields,
|
|
1180
|
-
defaultNestedFields: {}
|
|
1181
|
-
}
|
|
1182
|
-
),
|
|
1183
|
-
getUserRoles: createOperationExecutor(
|
|
1184
|
-
client,
|
|
1185
|
-
"getUserRoles",
|
|
1186
|
-
{
|
|
1187
|
-
schema: buildSchema(userRoleSchema.list),
|
|
1188
|
-
defaultRootFields: [...userRoleListIntegration.responseFields],
|
|
1189
|
-
defaultNestedFields: userRoleListIntegration.nestedFields
|
|
1190
|
-
}
|
|
1191
|
-
)
|
|
1192
|
-
});
|
|
1193
|
-
|
|
1194
|
-
// src/services/user/types/application-feature.type.ts
|
|
1195
|
-
var ENTITY3 = "applicationFeature";
|
|
1196
|
-
var applicationFeatureIntegration = createStandardEntityIntegration({
|
|
1197
|
-
key: ENTITY3,
|
|
1198
|
-
fields: applicationFeatureQuery
|
|
1199
|
-
});
|
|
1200
|
-
var applicationFeatureListIntegration = createListIntegration({
|
|
1201
|
-
key: "applicationFeatures",
|
|
1202
|
-
fields: applicationFeatureQuery
|
|
1203
|
-
});
|
|
1204
|
-
var applicationFeatureDeleteIntegration = createDeleteIntegration(ENTITY3);
|
|
1205
|
-
|
|
1206
|
-
// src/services/user/schemas/application-feature.schema.ts
|
|
1207
|
-
var applicationFeatureSchema = {
|
|
1131
|
+
// src/services/subscription/schemas/subscription-plan-feature-behaviour.ts
|
|
1132
|
+
var subscriptionPlanFeatureBehaviourSchema = {
|
|
1208
1133
|
get: {
|
|
1209
1134
|
operation: "query",
|
|
1210
|
-
name: "
|
|
1211
|
-
variables: "($
|
|
1212
|
-
field: "(
|
|
1135
|
+
name: "getSubscriptionPlanFeatureBehaviour",
|
|
1136
|
+
variables: "($subscriptionPlanFeatureBehaviour: SubscriptionPlanFeatureBehaviourInput!)",
|
|
1137
|
+
field: "(subscriptionPlanFeatureBehaviour: $subscriptionPlanFeatureBehaviour)"
|
|
1213
1138
|
},
|
|
1214
1139
|
list: {
|
|
1215
1140
|
operation: "query",
|
|
1216
|
-
name: "
|
|
1217
|
-
variables: "($limit: Int!, $skip: Int!, $search: String, $
|
|
1218
|
-
field: "(limit: $limit, skip: $skip, search: $search,
|
|
1141
|
+
name: "getSubscriptionPlanFeatureBehaviours",
|
|
1142
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $subscriptionPlanFeatureBehaviour: SubscriptionPlanFeatureBehaviourInput, $subscriptionPlanFeatureBehaviourIds: [String])",
|
|
1143
|
+
field: "(limit: $limit, skip: $skip, search: $search, subscriptionPlanFeatureBehaviour: $subscriptionPlanFeatureBehaviour, subscriptionPlanFeatureBehaviourIds: $subscriptionPlanFeatureBehaviourIds)"
|
|
1219
1144
|
},
|
|
1220
1145
|
create: {
|
|
1221
1146
|
operation: "mutation",
|
|
1222
|
-
name: "
|
|
1223
|
-
variables: "($
|
|
1224
|
-
field: "(
|
|
1147
|
+
name: "createSubscriptionPlanFeatureBehaviour",
|
|
1148
|
+
variables: "($subscriptionPlanFeatureBehaviour: SubscriptionPlanFeatureBehaviourInput!)",
|
|
1149
|
+
field: "(subscriptionPlanFeatureBehaviour: $subscriptionPlanFeatureBehaviour)"
|
|
1225
1150
|
},
|
|
1226
1151
|
update: {
|
|
1227
1152
|
operation: "mutation",
|
|
1228
|
-
name: "
|
|
1229
|
-
variables: "($
|
|
1230
|
-
field: "(
|
|
1153
|
+
name: "updateSubscriptionPlanFeatureBehaviour",
|
|
1154
|
+
variables: "($subscriptionPlanFeatureBehaviourId: String!, $subscriptionPlanFeatureBehaviour: SubscriptionPlanFeatureBehaviourInput!)",
|
|
1155
|
+
field: "(subscriptionPlanFeatureBehaviourId: $subscriptionPlanFeatureBehaviourId, subscriptionPlanFeatureBehaviour: $subscriptionPlanFeatureBehaviour)"
|
|
1231
1156
|
},
|
|
1232
1157
|
delete: {
|
|
1233
1158
|
operation: "mutation",
|
|
1234
|
-
name: "
|
|
1235
|
-
variables: "($
|
|
1236
|
-
field: "(
|
|
1159
|
+
name: "removeSubscriptionPlanFeatureBehaviour",
|
|
1160
|
+
variables: "($subscriptionPlanFeatureBehaviourId: String!)",
|
|
1161
|
+
field: "(subscriptionPlanFeatureBehaviourId: $subscriptionPlanFeatureBehaviourId)"
|
|
1237
1162
|
}
|
|
1238
1163
|
};
|
|
1239
1164
|
|
|
1240
|
-
// src/services/
|
|
1241
|
-
var
|
|
1242
|
-
|
|
1165
|
+
// src/services/subscription/subscription-plan-feature-behaviour.service.ts
|
|
1166
|
+
var createSubscriptionPlanFeatureBehaviourService = (client) => ({
|
|
1167
|
+
createSubscriptionPlanFeatureBehaviour: createOperationExecutor(
|
|
1243
1168
|
client,
|
|
1244
|
-
"
|
|
1169
|
+
"createSubscriptionPlanFeatureBehaviour",
|
|
1245
1170
|
{
|
|
1246
|
-
schema: buildSchema(
|
|
1247
|
-
defaultRootFields:
|
|
1248
|
-
defaultNestedFields:
|
|
1171
|
+
schema: buildSchema(subscriptionPlanFeatureBehaviourSchema.create),
|
|
1172
|
+
defaultRootFields: subscriptionPlanFeatureBehaviourIntegration.create.responseFields,
|
|
1173
|
+
defaultNestedFields: subscriptionPlanFeatureBehaviourIntegration.create.nestedFields
|
|
1249
1174
|
}
|
|
1250
1175
|
),
|
|
1251
|
-
|
|
1176
|
+
updateSubscriptionPlanFeatureBehaviour: createOperationExecutor(
|
|
1252
1177
|
client,
|
|
1253
|
-
"
|
|
1178
|
+
"updateSubscriptionPlanFeatureBehaviour",
|
|
1254
1179
|
{
|
|
1255
|
-
schema: buildSchema(
|
|
1256
|
-
defaultRootFields:
|
|
1257
|
-
defaultNestedFields:
|
|
1180
|
+
schema: buildSchema(subscriptionPlanFeatureBehaviourSchema.update),
|
|
1181
|
+
defaultRootFields: subscriptionPlanFeatureBehaviourIntegration.update.responseFields,
|
|
1182
|
+
defaultNestedFields: subscriptionPlanFeatureBehaviourIntegration.update.nestedFields
|
|
1258
1183
|
}
|
|
1259
1184
|
),
|
|
1260
|
-
|
|
1185
|
+
getSubscriptionPlanFeatureBehaviour: createOperationExecutor(
|
|
1261
1186
|
client,
|
|
1262
|
-
"
|
|
1187
|
+
"getSubscriptionPlanFeatureBehaviour",
|
|
1263
1188
|
{
|
|
1264
|
-
schema: buildSchema(
|
|
1265
|
-
defaultRootFields:
|
|
1266
|
-
defaultNestedFields:
|
|
1189
|
+
schema: buildSchema(subscriptionPlanFeatureBehaviourSchema.get),
|
|
1190
|
+
defaultRootFields: subscriptionPlanFeatureBehaviourIntegration.get.responseFields,
|
|
1191
|
+
defaultNestedFields: subscriptionPlanFeatureBehaviourIntegration.get.nestedFields
|
|
1267
1192
|
}
|
|
1268
1193
|
),
|
|
1269
|
-
|
|
1194
|
+
removeSubscriptionPlanFeatureBehaviour: createOperationExecutor(
|
|
1270
1195
|
client,
|
|
1271
|
-
"
|
|
1196
|
+
"removeSubscriptionPlanFeatureBehaviour",
|
|
1272
1197
|
{
|
|
1273
|
-
schema: buildSchema(
|
|
1274
|
-
defaultRootFields:
|
|
1198
|
+
schema: buildSchema(subscriptionPlanFeatureBehaviourSchema.delete),
|
|
1199
|
+
defaultRootFields: subscriptionPlanFeatureBehaviourDeleteIntegration.responseFields,
|
|
1275
1200
|
defaultNestedFields: {}
|
|
1276
1201
|
}
|
|
1277
1202
|
),
|
|
1278
|
-
|
|
1203
|
+
getSubscriptionPlanFeatureBehaviours: createOperationExecutor(
|
|
1279
1204
|
client,
|
|
1280
|
-
"
|
|
1205
|
+
"getSubscriptionPlanFeatureBehaviours",
|
|
1281
1206
|
{
|
|
1282
|
-
schema: buildSchema(
|
|
1283
|
-
defaultRootFields: [...
|
|
1284
|
-
defaultNestedFields:
|
|
1207
|
+
schema: buildSchema(subscriptionPlanFeatureBehaviourSchema.list),
|
|
1208
|
+
defaultRootFields: [...subscriptionPlanFeatureBehaviourListIntegration.responseFields],
|
|
1209
|
+
defaultNestedFields: subscriptionPlanFeatureBehaviourListIntegration.nestedFields
|
|
1285
1210
|
}
|
|
1286
1211
|
)
|
|
1287
1212
|
});
|
|
1288
1213
|
|
|
1289
|
-
// src/services/
|
|
1290
|
-
var
|
|
1291
|
-
"
|
|
1214
|
+
// src/services/user/types/user.type.ts
|
|
1215
|
+
var getUserTypeCountsResponse = [
|
|
1216
|
+
"userTypeCounts"
|
|
1292
1217
|
];
|
|
1293
|
-
var
|
|
1294
|
-
|
|
1218
|
+
var getUserTypeCountsResponseNestedFields = {
|
|
1219
|
+
userTypeCounts: userTypeCountsQuery
|
|
1295
1220
|
};
|
|
1296
|
-
var
|
|
1297
|
-
"
|
|
1221
|
+
var getMonthlyUserStatsByYearResponse = [
|
|
1222
|
+
"monthlyUserStat"
|
|
1298
1223
|
];
|
|
1299
|
-
var
|
|
1300
|
-
|
|
1301
|
-
smallestPackage: packageQuery,
|
|
1302
|
-
category: categoryQuery,
|
|
1303
|
-
price: priceQuery,
|
|
1304
|
-
stocks: stockQuery,
|
|
1305
|
-
productAttributes: attributeQuery
|
|
1306
|
-
};
|
|
1307
|
-
var getProductResponseNestedFields = {
|
|
1308
|
-
product: productQuery,
|
|
1309
|
-
..._getProductResponseNestedFields
|
|
1224
|
+
var getMonthlyUserStatsByYearResponseNestedFields = {
|
|
1225
|
+
monthlyUserStat: monthlyUserStatQuery
|
|
1310
1226
|
};
|
|
1311
|
-
var
|
|
1312
|
-
"
|
|
1227
|
+
var getUserDashStatsResponse = [
|
|
1228
|
+
"outOfStockCount",
|
|
1229
|
+
"productCounts",
|
|
1230
|
+
"restockCounts",
|
|
1231
|
+
"saleCounts",
|
|
1232
|
+
"stockValue",
|
|
1233
|
+
"transactionCounts"
|
|
1313
1234
|
];
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1316
|
-
|
|
1235
|
+
var getUserDashStatsResponseNestedFields = {
|
|
1236
|
+
productCounts: productCountsQuery,
|
|
1237
|
+
restockCounts: restockCountsQuery,
|
|
1238
|
+
saleCounts: saleCountsQuery,
|
|
1239
|
+
transactionCounts: transactionCountsQuery
|
|
1317
1240
|
};
|
|
1318
|
-
var
|
|
1319
|
-
"
|
|
1241
|
+
var getUserResponse = [
|
|
1242
|
+
"user"
|
|
1320
1243
|
];
|
|
1321
|
-
var
|
|
1322
|
-
|
|
1323
|
-
..._getProductResponseNestedFields
|
|
1244
|
+
var _getUserResponseNestedFields = {
|
|
1245
|
+
address: addressQuery
|
|
1324
1246
|
};
|
|
1325
|
-
var
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
var searchProductNamesResponseNestedFields = {
|
|
1329
|
-
productNames: productNameQuery
|
|
1247
|
+
var getUserResponseNestedFields = {
|
|
1248
|
+
user: userQuery,
|
|
1249
|
+
..._getUserResponseNestedFields
|
|
1330
1250
|
};
|
|
1331
|
-
var
|
|
1332
|
-
"
|
|
1333
|
-
];
|
|
1334
|
-
var addProductResponseNestedFields = {
|
|
1335
|
-
product: productQuery,
|
|
1336
|
-
uploadImageResponse: ["fileUrl", "url"],
|
|
1337
|
-
..._getProductResponseNestedFields
|
|
1338
|
-
};
|
|
1339
|
-
var updateProductResponseFields = getProductResponseFields;
|
|
1340
|
-
var updateProductResponseNestedFields = getProductResponseNestedFields;
|
|
1341
|
-
var removeProductResponseFields = [
|
|
1342
|
-
"productId"
|
|
1343
|
-
];
|
|
1344
|
-
var searchCategoriesAndTemplateResponse = [
|
|
1345
|
-
"productCategories"
|
|
1346
|
-
];
|
|
1347
|
-
var searchCategoriesAndTemplateResponseNestedFields = {
|
|
1348
|
-
productCategories: categoryQuery
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
|
-
// src/services/inventory/types/package.type.ts
|
|
1352
|
-
var getPackageResponseFields = [
|
|
1353
|
-
"productPackage"
|
|
1354
|
-
];
|
|
1355
|
-
var _getPackageResponseNestedFields = {
|
|
1356
|
-
price: priceQuery,
|
|
1357
|
-
stocks: stockQuery
|
|
1358
|
-
};
|
|
1359
|
-
var getPackageResponseNestedFields = {
|
|
1360
|
-
productPackage: packageQuery,
|
|
1361
|
-
..._getPackageResponseNestedFields
|
|
1362
|
-
};
|
|
1363
|
-
var removePackageResponseFields = [
|
|
1364
|
-
"packageId"
|
|
1365
|
-
];
|
|
1366
|
-
var updatePackageResponseFields = getPackageResponseFields;
|
|
1367
|
-
var updatePackageResponseNestedFields = getPackageResponseNestedFields;
|
|
1368
|
-
var addPackagesResponseFields = [
|
|
1369
|
-
"productPackages"
|
|
1370
|
-
];
|
|
1371
|
-
var addPackagesResponseNestedFields = {
|
|
1372
|
-
productPackages: packageQuery,
|
|
1373
|
-
..._getPackageResponseNestedFields
|
|
1374
|
-
};
|
|
1375
|
-
var addPackageResponseFields = getPackageResponseFields;
|
|
1376
|
-
var addPackageResponseNestedFields = getPackageResponseNestedFields;
|
|
1377
|
-
var getPackagesResponseFields = [
|
|
1378
|
-
"productPackages",
|
|
1379
|
-
"uniqueProducts"
|
|
1380
|
-
];
|
|
1381
|
-
var getPackagesResponseNestedFields = {
|
|
1382
|
-
// productPackages: packageQuery, product already contained this
|
|
1383
|
-
uniqueProducts: productQuery,
|
|
1384
|
-
...getPackageResponseNestedFields,
|
|
1385
|
-
...getProductResponseNestedFields
|
|
1386
|
-
};
|
|
1387
|
-
|
|
1388
|
-
// src/services/inventory/types/price.type.ts
|
|
1389
|
-
var getPriceResponseFields = ["price"];
|
|
1390
|
-
var _getPriceResponseNestedFields = {};
|
|
1391
|
-
var getPriceResponseNestedFields = {
|
|
1392
|
-
price: priceQuery,
|
|
1393
|
-
..._getPriceResponseNestedFields
|
|
1394
|
-
};
|
|
1395
|
-
var getPricesResponseFields = ["prices"];
|
|
1396
|
-
var getPricesResponseNestedFields = {
|
|
1397
|
-
..._getPriceResponseNestedFields,
|
|
1398
|
-
prices: priceQuery
|
|
1399
|
-
};
|
|
1400
|
-
var addPriceResponseFields = getPriceResponseFields;
|
|
1401
|
-
var addPriceResponseNestedFields = getPriceResponseNestedFields;
|
|
1402
|
-
var updatePriceResponseFields = getPriceResponseFields;
|
|
1403
|
-
var updatePriceResponseNestedFields = getPriceResponseNestedFields;
|
|
1404
|
-
var removePriceResponseFields = [
|
|
1405
|
-
"priceId"
|
|
1406
|
-
];
|
|
1407
|
-
|
|
1408
|
-
// src/services/inventory/types/stock.type.ts
|
|
1409
|
-
var getStockResponse = [
|
|
1410
|
-
"stock"
|
|
1411
|
-
];
|
|
1412
|
-
var getStockResponseNestedFields = {
|
|
1413
|
-
stock: stockQuery
|
|
1414
|
-
};
|
|
1415
|
-
var getStocksResponse = [
|
|
1416
|
-
"stocks"
|
|
1251
|
+
var getUsersResponse = [
|
|
1252
|
+
"users"
|
|
1417
1253
|
];
|
|
1418
|
-
var
|
|
1419
|
-
|
|
1254
|
+
var getUsersResponseNestedFields = {
|
|
1255
|
+
users: userQuery,
|
|
1256
|
+
..._getUserResponseNestedFields
|
|
1420
1257
|
};
|
|
1421
|
-
var
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
var updateStockResponseNestedFields = getStockResponseNestedFields;
|
|
1425
|
-
var removeStockResponse = [
|
|
1426
|
-
"stockId"
|
|
1427
|
-
];
|
|
1428
|
-
|
|
1429
|
-
// src/services/inventory/types/store.type.ts
|
|
1430
|
-
var getStoreCountResponse = [
|
|
1431
|
-
"count"
|
|
1432
|
-
];
|
|
1433
|
-
var getStoreResponse = [
|
|
1434
|
-
"store"
|
|
1258
|
+
var updateUserResponse = [
|
|
1259
|
+
"uploadImageResponse",
|
|
1260
|
+
"user"
|
|
1435
1261
|
];
|
|
1436
|
-
var
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
var getStoreResponseNestedFields = {
|
|
1440
|
-
store: storeQuery,
|
|
1441
|
-
..._getStoreResponseNestedFields
|
|
1262
|
+
var updateUserResponseNestedFields = {
|
|
1263
|
+
uploadImageResponse: ["fileUrl", "url"],
|
|
1264
|
+
user: userQuery
|
|
1442
1265
|
};
|
|
1443
|
-
var
|
|
1444
|
-
"
|
|
1266
|
+
var meResponse = [
|
|
1267
|
+
"user",
|
|
1268
|
+
"account",
|
|
1269
|
+
"stores",
|
|
1270
|
+
"userSetting",
|
|
1271
|
+
"userAccounts",
|
|
1272
|
+
"subscription"
|
|
1445
1273
|
];
|
|
1446
|
-
var
|
|
1274
|
+
var meResponseNestedFields = {
|
|
1447
1275
|
stores: storeQuery,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
var updateStoreResponseNestedFields = getStoreResponseNestedFields;
|
|
1454
|
-
var removeStoreResponse = [
|
|
1455
|
-
"storeId"
|
|
1456
|
-
];
|
|
1457
|
-
|
|
1458
|
-
// src/services/inventory/types/store-category-product.type.ts
|
|
1459
|
-
var getStoreCategoryProductResponseFields = [
|
|
1460
|
-
"storeCategoryProduct"
|
|
1461
|
-
];
|
|
1462
|
-
var getStoreCategoryProductResponseNestedFields = {
|
|
1463
|
-
storeCategoryProduct: storeCategoryProductQuery
|
|
1464
|
-
};
|
|
1465
|
-
var getStoreCategoryProductsResponseFields = [
|
|
1466
|
-
"storeCategoryProducts"
|
|
1467
|
-
];
|
|
1468
|
-
var getStoreCategoryProductsResponseNestedFields = {
|
|
1469
|
-
storeCategoryProducts: storeCategoryProductQuery
|
|
1470
|
-
};
|
|
1471
|
-
var createStoreCategoryProductResponseFields = getStoreCategoryProductResponseFields;
|
|
1472
|
-
var createStoreCategoryProductResponseNestedFields = getStoreCategoryProductResponseNestedFields;
|
|
1473
|
-
var updateStoreCategoryProductResponseFields = getStoreCategoryProductResponseFields;
|
|
1474
|
-
var updateStoreCategoryProductResponseNestedFields = getStoreCategoryProductResponseNestedFields;
|
|
1475
|
-
var removeStoreCategoryProductResponseFields = [
|
|
1476
|
-
"storeCategoryProductId"
|
|
1477
|
-
];
|
|
1478
|
-
|
|
1479
|
-
// src/services/inventory/types/store-category.type.ts
|
|
1480
|
-
var getStoreCategoryResponseFields = [
|
|
1481
|
-
"storeCategory"
|
|
1482
|
-
];
|
|
1483
|
-
var getStoreCategoryResponseNestedFields = {
|
|
1484
|
-
storeCategory: storeCategoryQuery
|
|
1485
|
-
};
|
|
1486
|
-
var getStoreCategoriesResponseFields = [
|
|
1487
|
-
"storeCategories"
|
|
1488
|
-
];
|
|
1489
|
-
var getStoreCategoriesResponseNestedFields = {
|
|
1490
|
-
storeCategories: storeCategoryQuery
|
|
1491
|
-
};
|
|
1492
|
-
var createStoreCategoryResponseFields = getStoreCategoryResponseFields;
|
|
1493
|
-
var createStoreCategoryResponseNestedFields = getStoreCategoryResponseNestedFields;
|
|
1494
|
-
var updateStoreCategoryResponseFields = getStoreCategoryResponseFields;
|
|
1495
|
-
var updateStoreCategoryResponseNestedFields = getStoreCategoryResponseNestedFields;
|
|
1496
|
-
var removeStoreCategoryResponseFields = [
|
|
1497
|
-
"storeCategoryId"
|
|
1498
|
-
];
|
|
1499
|
-
|
|
1500
|
-
// src/services/inventory/schema/package.schema.ts
|
|
1501
|
-
var packageSchema = {
|
|
1502
|
-
getPackage: (query) => `
|
|
1503
|
-
query getPackage($productPackage: ProductPackageInput!, $template: Boolean) {
|
|
1504
|
-
getPackage(productPackage: $productPackage, template: $template) {
|
|
1505
|
-
${query}
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
`,
|
|
1509
|
-
getPackages: (query) => `
|
|
1510
|
-
query getPackages($productPackage: ProductPackageInput, $packageIds: [String], $search: String, $template: Boolean, $shouldGetFromAllStores: Boolean, $limit: Int, $skip: Int) {
|
|
1511
|
-
getPackages(productPackage: $productPackage, packageIds: $packageIds, search: $search, template: $template, shouldGetFromAllStores: $shouldGetFromAllStores, limit: $limit, skip: $skip) {
|
|
1512
|
-
${query}
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
`,
|
|
1516
|
-
addPackage: (query) => `
|
|
1517
|
-
mutation addPackage($productPackage: ProductPackageInput!, $template: Boolean) {
|
|
1518
|
-
addPackage(productPackage: $productPackage, template: $template) {
|
|
1519
|
-
${query}
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
`,
|
|
1523
|
-
addPackages: (query) => `
|
|
1524
|
-
mutation addPackages($productPackages: [ProductPackagesInput]!, $template: Boolean) {
|
|
1525
|
-
addPackages(productPackages: $productPackages, template: $template) {
|
|
1526
|
-
${query}
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
`,
|
|
1530
|
-
updatePackage: (query) => `
|
|
1531
|
-
mutation updatePackage($packageId: String!, $productPackage: ProductPackageInput!, $template: Boolean) {
|
|
1532
|
-
updatePackage(packageId: $packageId, productPackage: $productPackage, template: $template) {
|
|
1533
|
-
${query}
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
`,
|
|
1537
|
-
updatePackages: (query) => `
|
|
1538
|
-
mutation updatePackages($packages: [PackagesInput]) {
|
|
1539
|
-
updatePackages(packages: $packages) {
|
|
1540
|
-
${query}
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
`,
|
|
1544
|
-
removePackage: (query) => `
|
|
1545
|
-
mutation removePackage($packageId: String!, $template: Boolean) {
|
|
1546
|
-
removePackage(packageId: $packageId, template: $template) {
|
|
1547
|
-
${query}
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
`
|
|
1276
|
+
userSetting: userSettingQuery,
|
|
1277
|
+
...userAccountListIntegration.nestedFields,
|
|
1278
|
+
...getSubscriptionResponseNestedFields,
|
|
1279
|
+
...getUserResponseNestedFields,
|
|
1280
|
+
...getAccountResponseNestedFields
|
|
1551
1281
|
};
|
|
1552
1282
|
|
|
1553
|
-
// src/services/
|
|
1554
|
-
var
|
|
1555
|
-
|
|
1556
|
-
|
|
1283
|
+
// src/services/user/user.service.ts
|
|
1284
|
+
var createUserService = (client) => ({
|
|
1285
|
+
// admin dashboard stats
|
|
1286
|
+
async getUserTypeCounts(fetchFields, option) {
|
|
1287
|
+
var _a, _b, _c;
|
|
1557
1288
|
const res = await client.request(
|
|
1558
|
-
|
|
1289
|
+
user_schema_default.getUserTypeCounts(
|
|
1559
1290
|
gqlQueryStringBuilder(
|
|
1560
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1561
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
1291
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserTypeCountsResponse,
|
|
1292
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserTypeCountsResponseNestedFields
|
|
1562
1293
|
)
|
|
1563
1294
|
),
|
|
1564
|
-
|
|
1295
|
+
{},
|
|
1565
1296
|
option
|
|
1566
1297
|
);
|
|
1567
|
-
return (
|
|
1298
|
+
return (_c = res.data) == null ? void 0 : _c.getUserTypeCounts;
|
|
1568
1299
|
},
|
|
1569
|
-
async
|
|
1300
|
+
async getMonthlyUserStatsByYear(input, fetchFields, option) {
|
|
1570
1301
|
var _a, _b, _c;
|
|
1571
1302
|
const res = await client.request(
|
|
1572
|
-
|
|
1303
|
+
user_schema_default.getMonthlyUserStatsByYear(
|
|
1573
1304
|
gqlQueryStringBuilder(
|
|
1574
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1305
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getMonthlyUserStatsByYearResponse,
|
|
1306
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getMonthlyUserStatsByYearResponseNestedFields
|
|
1575
1307
|
)
|
|
1576
1308
|
),
|
|
1577
1309
|
input,
|
|
1578
1310
|
option
|
|
1579
1311
|
);
|
|
1580
|
-
return (_c =
|
|
1312
|
+
return (_c = res.data) == null ? void 0 : _c.getMonthlyUserStatsByYear;
|
|
1581
1313
|
},
|
|
1582
|
-
|
|
1583
|
-
|
|
1314
|
+
// user dashboard stats
|
|
1315
|
+
async getUserDashStats(input, fetchFields, option) {
|
|
1316
|
+
var _a, _b, _c;
|
|
1584
1317
|
const res = await client.request(
|
|
1585
|
-
|
|
1318
|
+
user_schema_default.getUserDashStats(
|
|
1586
1319
|
gqlQueryStringBuilder(
|
|
1587
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1588
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
1320
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserDashStatsResponse,
|
|
1321
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserDashStatsResponseNestedFields
|
|
1589
1322
|
)
|
|
1590
1323
|
),
|
|
1591
1324
|
input,
|
|
1592
1325
|
option
|
|
1593
1326
|
);
|
|
1594
|
-
return (
|
|
1327
|
+
return (_c = res.data) == null ? void 0 : _c.getUserDashStats;
|
|
1595
1328
|
},
|
|
1596
|
-
async
|
|
1597
|
-
var _a, _b
|
|
1598
|
-
|
|
1599
|
-
|
|
1329
|
+
async me(fetchFields, option) {
|
|
1330
|
+
var _a, _b;
|
|
1331
|
+
return client.request(
|
|
1332
|
+
user_schema_default.me(
|
|
1600
1333
|
gqlQueryStringBuilder(
|
|
1601
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1602
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
1334
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : meResponse,
|
|
1335
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : meResponseNestedFields
|
|
1336
|
+
)
|
|
1337
|
+
),
|
|
1338
|
+
{},
|
|
1339
|
+
option
|
|
1340
|
+
);
|
|
1341
|
+
},
|
|
1342
|
+
async getUser(input, fetchFields, option) {
|
|
1343
|
+
var _a, _b;
|
|
1344
|
+
return client.request(
|
|
1345
|
+
user_schema_default.getUser(
|
|
1346
|
+
gqlQueryStringBuilder(
|
|
1347
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserResponse,
|
|
1348
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserResponseNestedFields
|
|
1603
1349
|
)
|
|
1604
1350
|
),
|
|
1605
1351
|
input,
|
|
1606
1352
|
option
|
|
1607
1353
|
);
|
|
1608
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.addPackage) != null ? _d : null;
|
|
1609
1354
|
},
|
|
1610
|
-
async
|
|
1611
|
-
var _a, _b
|
|
1612
|
-
|
|
1613
|
-
|
|
1355
|
+
async getUsers(input, fetchFields, option) {
|
|
1356
|
+
var _a, _b;
|
|
1357
|
+
return client.request(
|
|
1358
|
+
user_schema_default.getUsers(
|
|
1614
1359
|
gqlQueryStringBuilder(
|
|
1615
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1616
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
1360
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUsersResponse,
|
|
1361
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUsersResponseNestedFields
|
|
1617
1362
|
)
|
|
1618
1363
|
),
|
|
1619
1364
|
input,
|
|
1620
1365
|
option
|
|
1621
1366
|
);
|
|
1622
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getPackage) != null ? _d : null;
|
|
1623
1367
|
},
|
|
1624
|
-
async
|
|
1625
|
-
var _a, _b
|
|
1626
|
-
|
|
1627
|
-
|
|
1368
|
+
async updateUser(input, fetchFields, option) {
|
|
1369
|
+
var _a, _b;
|
|
1370
|
+
return client.request(
|
|
1371
|
+
user_schema_default.updateUser(
|
|
1628
1372
|
gqlQueryStringBuilder(
|
|
1629
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1630
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
1373
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateUserResponse,
|
|
1374
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateUserResponseNestedFields
|
|
1631
1375
|
)
|
|
1632
1376
|
),
|
|
1633
1377
|
input,
|
|
1634
1378
|
option
|
|
1635
1379
|
);
|
|
1636
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getPackages) != null ? _d : null;
|
|
1637
1380
|
}
|
|
1638
1381
|
});
|
|
1639
1382
|
|
|
1640
|
-
// src/services/
|
|
1641
|
-
var
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1383
|
+
// src/services/user/schemas/auth.schema.ts
|
|
1384
|
+
var authSchema = {
|
|
1385
|
+
authenticateWithStore: (query) => `
|
|
1386
|
+
mutation authenticateWithStore($storeId: String!, $roleId: String!) {
|
|
1387
|
+
authenticateWithStore(storeId: $storeId, roleId: $roleId) {
|
|
1388
|
+
${query}
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
`,
|
|
1392
|
+
// change pin
|
|
1393
|
+
changePin: (query) => `
|
|
1394
|
+
mutation changePin($userId: String!, $oldPin: String!, $newPin: String!) {
|
|
1395
|
+
changePin(userId: $userId, oldPin: $oldPin, newPin: $newPin) {
|
|
1645
1396
|
${query}
|
|
1646
1397
|
}
|
|
1647
1398
|
}
|
|
1648
1399
|
`,
|
|
1649
|
-
|
|
1650
|
-
query
|
|
1651
|
-
|
|
1400
|
+
checkRegistration: (query) => `
|
|
1401
|
+
query checkRegistration($phone: String!) {
|
|
1402
|
+
checkRegistration(phone: $phone) {
|
|
1652
1403
|
${query}
|
|
1653
1404
|
}
|
|
1654
1405
|
}
|
|
1655
1406
|
`,
|
|
1656
|
-
|
|
1657
|
-
mutation
|
|
1658
|
-
|
|
1659
|
-
${
|
|
1407
|
+
login: (query) => `
|
|
1408
|
+
mutation login($phone: String!, $pin: String!, $userType: UserTypeEnum) {
|
|
1409
|
+
login(phone: $phone, pin: $pin, userType: $userType) {
|
|
1410
|
+
${query}
|
|
1660
1411
|
}
|
|
1661
1412
|
}
|
|
1662
1413
|
`,
|
|
1663
|
-
|
|
1664
|
-
mutation
|
|
1665
|
-
|
|
1666
|
-
${
|
|
1414
|
+
signUp: (query) => `
|
|
1415
|
+
mutation signUp($firstName: String!, $lastName: String!, $phone: String!, $pin: String!, $storeName: String!, $storeLocation: String, $email: String, $userType: UserTypeEnum) {
|
|
1416
|
+
signUp( firstName: $firstName, lastName: $lastName, phone: $phone, pin: $pin, storeName: $storeName, storeLocation: $storeLocation, email: $email, userType: $userType) {
|
|
1417
|
+
${query}
|
|
1667
1418
|
}
|
|
1668
1419
|
}
|
|
1669
1420
|
`,
|
|
1670
|
-
|
|
1671
|
-
mutation
|
|
1672
|
-
|
|
1421
|
+
resetPin: (query) => `
|
|
1422
|
+
mutation resetPin($phone: String!, $pin: String!) {
|
|
1423
|
+
resetPin(phone: $phone, pin: $pin) {
|
|
1424
|
+
${query}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
`,
|
|
1428
|
+
sendOTP: (query) => `
|
|
1429
|
+
mutation sendOTP($phone: String!) {
|
|
1430
|
+
sendOTP(phone: $phone) {
|
|
1431
|
+
${query}
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
`,
|
|
1435
|
+
verifyOTP: (query) => `
|
|
1436
|
+
mutation verifyOTP($phone: String!, $otp: String!) {
|
|
1437
|
+
verifyOTP(phone: $phone, otp: $otp) {
|
|
1438
|
+
${query}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
`,
|
|
1442
|
+
updateTxPin: (mutation) => `
|
|
1443
|
+
mutation updateTxPin($userId: String!, $pin: String!, $oldPin: String!) {
|
|
1444
|
+
updateTxPin(userId: $userId, pin: $pin, oldPin: $oldPin) {
|
|
1673
1445
|
${mutation}
|
|
1674
1446
|
}
|
|
1675
1447
|
}
|
|
1676
1448
|
`
|
|
1677
1449
|
};
|
|
1678
1450
|
|
|
1679
|
-
// src/services/
|
|
1680
|
-
var
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1451
|
+
// src/services/user/types/auth.type.ts
|
|
1452
|
+
var authenticateWithStoreResponse = [
|
|
1453
|
+
"accessToken"
|
|
1454
|
+
];
|
|
1455
|
+
var checkRegistrationResponse = [
|
|
1456
|
+
"isRegistered"
|
|
1457
|
+
];
|
|
1458
|
+
var changePinResponse = [
|
|
1459
|
+
"success"
|
|
1460
|
+
];
|
|
1461
|
+
var updateTxPinResponse = [
|
|
1462
|
+
"success"
|
|
1463
|
+
];
|
|
1464
|
+
var resetPinResponse = [
|
|
1465
|
+
"success"
|
|
1466
|
+
];
|
|
1467
|
+
var sendOTPResponse = [
|
|
1468
|
+
"successful",
|
|
1469
|
+
"otp"
|
|
1470
|
+
];
|
|
1471
|
+
var verifyOTPResponse = [
|
|
1472
|
+
"otpVerifiedAccessToken"
|
|
1473
|
+
];
|
|
1474
|
+
var loginResponse = [
|
|
1475
|
+
"accessToken",
|
|
1476
|
+
"userId"
|
|
1477
|
+
];
|
|
1478
|
+
var signUpResponse = [
|
|
1479
|
+
"accessToken",
|
|
1480
|
+
"userId"
|
|
1481
|
+
];
|
|
1482
|
+
|
|
1483
|
+
// src/services/user/auth.service.ts
|
|
1484
|
+
var createAuthService = (client) => ({
|
|
1485
|
+
async authenticateWithStore(input, fetchFields, option) {
|
|
1486
|
+
var _a;
|
|
1487
|
+
return client.request(
|
|
1488
|
+
authSchema.authenticateWithStore(
|
|
1685
1489
|
gqlQueryStringBuilder(
|
|
1686
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1687
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updatePriceResponseNestedFields
|
|
1490
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : authenticateWithStoreResponse
|
|
1688
1491
|
)
|
|
1689
1492
|
),
|
|
1690
1493
|
input,
|
|
1691
1494
|
option
|
|
1692
1495
|
);
|
|
1693
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.updatePrice) != null ? _d : null;
|
|
1694
1496
|
},
|
|
1695
|
-
async
|
|
1696
|
-
var _a
|
|
1697
|
-
|
|
1698
|
-
|
|
1497
|
+
async checkRegistration(input, fetchFields, option) {
|
|
1498
|
+
var _a;
|
|
1499
|
+
return client.request(
|
|
1500
|
+
authSchema.checkRegistration(
|
|
1699
1501
|
gqlQueryStringBuilder(
|
|
1700
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1502
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : checkRegistrationResponse
|
|
1701
1503
|
)
|
|
1702
1504
|
),
|
|
1703
1505
|
input,
|
|
1704
1506
|
option
|
|
1705
1507
|
);
|
|
1706
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.removePrice) != null ? _c : null;
|
|
1707
1508
|
},
|
|
1708
|
-
async
|
|
1709
|
-
var _a
|
|
1710
|
-
|
|
1711
|
-
|
|
1509
|
+
async changePin(input, fetchFields, option) {
|
|
1510
|
+
var _a;
|
|
1511
|
+
return client.request(
|
|
1512
|
+
authSchema.changePin(
|
|
1712
1513
|
gqlQueryStringBuilder(
|
|
1713
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1714
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addPriceResponseNestedFields
|
|
1514
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : changePinResponse
|
|
1715
1515
|
)
|
|
1716
1516
|
),
|
|
1717
1517
|
input,
|
|
1718
1518
|
option
|
|
1719
1519
|
);
|
|
1720
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.addPrice) != null ? _d : null;
|
|
1721
1520
|
},
|
|
1722
|
-
async
|
|
1723
|
-
var _a
|
|
1724
|
-
|
|
1725
|
-
|
|
1521
|
+
async updateTxPin(input, fetchFields, option) {
|
|
1522
|
+
var _a;
|
|
1523
|
+
return client.request(
|
|
1524
|
+
authSchema.updateTxPin(
|
|
1726
1525
|
gqlQueryStringBuilder(
|
|
1727
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1728
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getPriceResponseNestedFields
|
|
1526
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateTxPinResponse
|
|
1729
1527
|
)
|
|
1730
1528
|
),
|
|
1731
1529
|
input,
|
|
1732
1530
|
option
|
|
1733
1531
|
);
|
|
1734
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getPrice) != null ? _d : null;
|
|
1735
1532
|
},
|
|
1736
|
-
async
|
|
1737
|
-
var _a
|
|
1738
|
-
|
|
1739
|
-
|
|
1533
|
+
async verifyOTP(input, fetchFields, option) {
|
|
1534
|
+
var _a;
|
|
1535
|
+
return client.request(
|
|
1536
|
+
authSchema.verifyOTP(
|
|
1740
1537
|
gqlQueryStringBuilder(
|
|
1741
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
1742
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getPricesResponseNestedFields
|
|
1538
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : verifyOTPResponse
|
|
1743
1539
|
)
|
|
1744
1540
|
),
|
|
1745
1541
|
input,
|
|
1746
1542
|
option
|
|
1747
1543
|
);
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1544
|
+
},
|
|
1545
|
+
async sendOTP(input, fetchFields, option) {
|
|
1546
|
+
var _a;
|
|
1547
|
+
return client.request(
|
|
1548
|
+
authSchema.sendOTP(
|
|
1549
|
+
gqlQueryStringBuilder(
|
|
1550
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : sendOTPResponse
|
|
1551
|
+
)
|
|
1552
|
+
),
|
|
1553
|
+
input,
|
|
1554
|
+
option
|
|
1555
|
+
);
|
|
1556
|
+
},
|
|
1557
|
+
async resetPin(input, fetchFields, option) {
|
|
1558
|
+
var _a;
|
|
1559
|
+
return client.request(
|
|
1560
|
+
authSchema.resetPin(
|
|
1561
|
+
gqlQueryStringBuilder(
|
|
1562
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : resetPinResponse
|
|
1563
|
+
)
|
|
1564
|
+
),
|
|
1565
|
+
input,
|
|
1566
|
+
option
|
|
1567
|
+
);
|
|
1568
|
+
},
|
|
1569
|
+
async signUp(input, fetchFields, option) {
|
|
1570
|
+
var _a;
|
|
1571
|
+
return client.request(
|
|
1572
|
+
authSchema.signUp(
|
|
1573
|
+
gqlQueryStringBuilder(
|
|
1574
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : signUpResponse
|
|
1575
|
+
)
|
|
1576
|
+
),
|
|
1577
|
+
input,
|
|
1578
|
+
option
|
|
1579
|
+
);
|
|
1580
|
+
},
|
|
1581
|
+
async login(input, fetchFields, option) {
|
|
1582
|
+
var _a;
|
|
1583
|
+
return client.request(
|
|
1584
|
+
authSchema.login(
|
|
1585
|
+
gqlQueryStringBuilder(
|
|
1586
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : loginResponse
|
|
1587
|
+
)
|
|
1588
|
+
),
|
|
1589
|
+
input,
|
|
1590
|
+
option
|
|
1591
|
+
);
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
|
|
1595
|
+
// src/services/user/schemas/user-notification.schema.ts
|
|
1596
|
+
var userNotificationSchema = {
|
|
1597
|
+
getUserNotifications: (query) => `
|
|
1598
|
+
query getUserNotifications($search: String, $userNotification: UserNotificationInput, $userNotificationIds: [String], $limit: Int!, $skip: Int!) {
|
|
1599
|
+
getUserNotifications(search: $search, userNotification: $userNotification, userNotificationIds: $userNotificationIds, limit: $limit, skip: $skip) {
|
|
1600
|
+
${query}
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
`
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
// src/services/user/types/user-notification.type.ts
|
|
1607
|
+
var getUserNotificationsResponseFields = ["userNotifications"];
|
|
1608
|
+
var getUserNotificationsResponseNestedFields = {
|
|
1609
|
+
notification: notificationQuery,
|
|
1610
|
+
userNotifications: userNotificationQuery
|
|
1611
|
+
};
|
|
1612
|
+
|
|
1613
|
+
// src/services/user/user-notification.service.ts
|
|
1614
|
+
var createUserNotificationService = (client) => ({
|
|
1615
|
+
async getUserNotifications(input, fetchFields, option) {
|
|
1616
|
+
var _a, _b, _c;
|
|
1617
|
+
const res = await client.request(
|
|
1618
|
+
userNotificationSchema.getUserNotifications(
|
|
1619
|
+
gqlQueryStringBuilder(
|
|
1620
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getUserNotificationsResponseFields,
|
|
1621
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getUserNotificationsResponseNestedFields
|
|
1622
|
+
)
|
|
1623
|
+
),
|
|
1624
|
+
input,
|
|
1625
|
+
option
|
|
1626
|
+
);
|
|
1627
|
+
return (_c = res.data) == null ? void 0 : _c.getUserNotifications;
|
|
1628
|
+
}
|
|
1629
|
+
});
|
|
1630
|
+
|
|
1631
|
+
// src/services/user/schemas/user-account.schema.ts
|
|
1632
|
+
var userAccountSchema = {
|
|
1633
|
+
get: {
|
|
1634
|
+
operation: "query",
|
|
1635
|
+
name: "getUserAccount",
|
|
1636
|
+
variables: "($userAccount: UserAccountInput!)",
|
|
1637
|
+
field: "(userAccount: $userAccount)"
|
|
1638
|
+
},
|
|
1639
|
+
list: {
|
|
1640
|
+
operation: "query",
|
|
1641
|
+
name: "getUserAccounts",
|
|
1642
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $userAccount: UserAccountInput, $userAccountIds: [String])",
|
|
1643
|
+
field: "(limit: $limit, skip: $skip, search: $search, userAccount: $userAccount, userAccountIds: $userAccountIds)"
|
|
1644
|
+
},
|
|
1645
|
+
create: {
|
|
1646
|
+
operation: "mutation",
|
|
1647
|
+
name: "createUserAccount",
|
|
1648
|
+
variables: "($userAccount: UserAccountInput!)",
|
|
1649
|
+
field: "(userAccount: $userAccount)"
|
|
1650
|
+
},
|
|
1651
|
+
update: {
|
|
1652
|
+
operation: "mutation",
|
|
1653
|
+
name: "updateUserAccount",
|
|
1654
|
+
variables: "($userAccountId: String!, $userAccount: UserAccountInput!)",
|
|
1655
|
+
field: "(userAccountId: $userAccountId, userAccount: $userAccount)"
|
|
1656
|
+
},
|
|
1657
|
+
delete: {
|
|
1658
|
+
operation: "mutation",
|
|
1659
|
+
name: "removeUserAccount",
|
|
1660
|
+
variables: "($userAccountId: String!)",
|
|
1661
|
+
field: "(userAccountId: $userAccountId)"
|
|
1662
|
+
}
|
|
1663
|
+
};
|
|
1664
|
+
|
|
1665
|
+
// src/services/user/user-account.service.ts
|
|
1666
|
+
var createUserAccountService = (client) => ({
|
|
1667
|
+
createUserAccount: createOperationExecutor(
|
|
1668
|
+
client,
|
|
1669
|
+
"createUserAccount",
|
|
1670
|
+
{
|
|
1671
|
+
schema: buildSchema(userAccountSchema.create),
|
|
1672
|
+
defaultRootFields: [...userAccountIntegration.create.responseFields, "pin"],
|
|
1673
|
+
defaultNestedFields: userAccountIntegration.create.nestedFields
|
|
1674
|
+
}
|
|
1675
|
+
),
|
|
1676
|
+
updateUserAccount: createOperationExecutor(
|
|
1677
|
+
client,
|
|
1678
|
+
"updateUserAccount",
|
|
1679
|
+
{
|
|
1680
|
+
schema: buildSchema(userAccountSchema.update),
|
|
1681
|
+
defaultRootFields: userAccountIntegration.update.responseFields,
|
|
1682
|
+
defaultNestedFields: userAccountIntegration.update.nestedFields
|
|
1683
|
+
}
|
|
1684
|
+
),
|
|
1685
|
+
getUserAccount: createOperationExecutor(
|
|
1686
|
+
client,
|
|
1687
|
+
"getUserAccount",
|
|
1688
|
+
{
|
|
1689
|
+
schema: buildSchema(userAccountSchema.get),
|
|
1690
|
+
defaultRootFields: userAccountIntegration.get.responseFields,
|
|
1691
|
+
defaultNestedFields: userAccountIntegration.get.nestedFields
|
|
1692
|
+
}
|
|
1693
|
+
),
|
|
1694
|
+
removeUserAccount: createOperationExecutor(
|
|
1695
|
+
client,
|
|
1696
|
+
"removeUserAccount",
|
|
1697
|
+
{
|
|
1698
|
+
schema: buildSchema(userAccountSchema.delete),
|
|
1699
|
+
defaultRootFields: userAccountDeleteIntegration.responseFields,
|
|
1700
|
+
defaultNestedFields: {}
|
|
1701
|
+
}
|
|
1702
|
+
),
|
|
1703
|
+
getUserAccounts: createOperationExecutor(
|
|
1704
|
+
client,
|
|
1705
|
+
"getUserAccounts",
|
|
1706
|
+
{
|
|
1707
|
+
schema: buildSchema(userAccountSchema.list),
|
|
1708
|
+
defaultRootFields: [...userAccountListIntegration.responseFields],
|
|
1709
|
+
defaultNestedFields: userAccountListIntegration.nestedFields
|
|
1710
|
+
}
|
|
1711
|
+
)
|
|
1712
|
+
});
|
|
1713
|
+
|
|
1714
|
+
// src/services/user/types/user-role.type.ts
|
|
1715
|
+
var ENTITY3 = "userRole";
|
|
1716
|
+
var userRoleIntegration = createStandardEntityIntegration({
|
|
1717
|
+
key: ENTITY3,
|
|
1718
|
+
fields: userRoleQuery,
|
|
1719
|
+
nested: {
|
|
1720
|
+
privileges: privilegeQuery
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
var userRoleListIntegration = createListIntegration({
|
|
1724
|
+
key: "userRoles",
|
|
1725
|
+
fields: userRoleQuery,
|
|
1726
|
+
nested: {
|
|
1727
|
+
privileges: privilegeQuery
|
|
1728
|
+
}
|
|
1729
|
+
});
|
|
1730
|
+
var userRoleDeleteIntegration = createDeleteIntegration(ENTITY3);
|
|
1731
|
+
|
|
1732
|
+
// src/services/user/schemas/user-role.schema.ts
|
|
1733
|
+
var userRoleSchema = {
|
|
1734
|
+
get: {
|
|
1735
|
+
operation: "query",
|
|
1736
|
+
name: "getUserRole",
|
|
1737
|
+
variables: "($userRole: UserRoleInput!)",
|
|
1738
|
+
field: "(userRole: $userRole)"
|
|
1739
|
+
},
|
|
1740
|
+
list: {
|
|
1741
|
+
operation: "query",
|
|
1742
|
+
name: "getUserRoles",
|
|
1743
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $userRole: UserRoleInput, $userRoleIds: [String])",
|
|
1744
|
+
field: "(limit: $limit, skip: $skip, search: $search, userRole: $userRole, userRoleIds: $userRoleIds)"
|
|
1745
|
+
},
|
|
1746
|
+
create: {
|
|
1747
|
+
operation: "mutation",
|
|
1748
|
+
name: "createUserRole",
|
|
1749
|
+
variables: "($userRole: UserRoleInput!)",
|
|
1750
|
+
field: "(userRole: $userRole)"
|
|
1751
|
+
},
|
|
1752
|
+
update: {
|
|
1753
|
+
operation: "mutation",
|
|
1754
|
+
name: "updateUserRole",
|
|
1755
|
+
variables: "($userRoleId: String!, $userRole: UserRoleInput!)",
|
|
1756
|
+
field: "(userRoleId: $userRoleId, userRole: $userRole)"
|
|
1757
|
+
},
|
|
1758
|
+
delete: {
|
|
1759
|
+
operation: "mutation",
|
|
1760
|
+
name: "removeUserRole",
|
|
1761
|
+
variables: "($userRoleId: String!)",
|
|
1762
|
+
field: "(userRoleId: $userRoleId)"
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1765
|
+
|
|
1766
|
+
// src/services/user/user-role.service.ts
|
|
1767
|
+
var createUserRoleService = (client) => ({
|
|
1768
|
+
createUserRole: createOperationExecutor(
|
|
1769
|
+
client,
|
|
1770
|
+
"createUserRole",
|
|
1771
|
+
{
|
|
1772
|
+
schema: buildSchema(userRoleSchema.create),
|
|
1773
|
+
defaultRootFields: userRoleIntegration.create.responseFields,
|
|
1774
|
+
defaultNestedFields: userRoleIntegration.create.nestedFields
|
|
1775
|
+
}
|
|
1776
|
+
),
|
|
1777
|
+
updateUserRole: createOperationExecutor(
|
|
1778
|
+
client,
|
|
1779
|
+
"updateUserRole",
|
|
1780
|
+
{
|
|
1781
|
+
schema: buildSchema(userRoleSchema.update),
|
|
1782
|
+
defaultRootFields: userRoleIntegration.update.responseFields,
|
|
1783
|
+
defaultNestedFields: userRoleIntegration.update.nestedFields
|
|
1784
|
+
}
|
|
1785
|
+
),
|
|
1786
|
+
getUserRole: createOperationExecutor(
|
|
1787
|
+
client,
|
|
1788
|
+
"getUserRole",
|
|
1789
|
+
{
|
|
1790
|
+
schema: buildSchema(userRoleSchema.get),
|
|
1791
|
+
defaultRootFields: userRoleIntegration.get.responseFields,
|
|
1792
|
+
defaultNestedFields: userRoleIntegration.get.nestedFields
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
removeUserRole: createOperationExecutor(
|
|
1796
|
+
client,
|
|
1797
|
+
"removeUserRole",
|
|
1798
|
+
{
|
|
1799
|
+
schema: buildSchema(userRoleSchema.delete),
|
|
1800
|
+
defaultRootFields: userRoleDeleteIntegration.responseFields,
|
|
1801
|
+
defaultNestedFields: {}
|
|
1802
|
+
}
|
|
1803
|
+
),
|
|
1804
|
+
getUserRoles: createOperationExecutor(
|
|
1805
|
+
client,
|
|
1806
|
+
"getUserRoles",
|
|
1807
|
+
{
|
|
1808
|
+
schema: buildSchema(userRoleSchema.list),
|
|
1809
|
+
defaultRootFields: [...userRoleListIntegration.responseFields],
|
|
1810
|
+
defaultNestedFields: userRoleListIntegration.nestedFields
|
|
1811
|
+
}
|
|
1812
|
+
)
|
|
1813
|
+
});
|
|
1814
|
+
|
|
1815
|
+
// src/services/user/types/application-feature.type.ts
|
|
1816
|
+
var ENTITY4 = "applicationFeature";
|
|
1817
|
+
var applicationFeatureIntegration = createStandardEntityIntegration({
|
|
1818
|
+
key: ENTITY4,
|
|
1819
|
+
fields: applicationFeatureQuery
|
|
1820
|
+
});
|
|
1821
|
+
var applicationFeatureListIntegration = createListIntegration({
|
|
1822
|
+
key: "applicationFeatures",
|
|
1823
|
+
fields: applicationFeatureQuery
|
|
1824
|
+
});
|
|
1825
|
+
var applicationFeatureDeleteIntegration = createDeleteIntegration(ENTITY4);
|
|
1826
|
+
|
|
1827
|
+
// src/services/user/schemas/application-feature.schema.ts
|
|
1828
|
+
var applicationFeatureSchema = {
|
|
1829
|
+
get: {
|
|
1830
|
+
operation: "query",
|
|
1831
|
+
name: "getApplicationFeature",
|
|
1832
|
+
variables: "($applicationFeature: ApplicationFeatureInput!)",
|
|
1833
|
+
field: "(applicationFeature: $applicationFeature)"
|
|
1834
|
+
},
|
|
1835
|
+
list: {
|
|
1836
|
+
operation: "query",
|
|
1837
|
+
name: "getApplicationFeatures",
|
|
1838
|
+
variables: "($limit: Int!, $skip: Int!, $search: String, $applicationFeature: ApplicationFeatureInput, $applicationFeatureIds: [String])",
|
|
1839
|
+
field: "(limit: $limit, skip: $skip, search: $search, applicationFeature: $applicationFeature, applicationFeatureIds: $applicationFeatureIds)"
|
|
1840
|
+
},
|
|
1841
|
+
create: {
|
|
1842
|
+
operation: "mutation",
|
|
1843
|
+
name: "createApplicationFeature",
|
|
1844
|
+
variables: "($applicationFeature: ApplicationFeatureInput!)",
|
|
1845
|
+
field: "(applicationFeature: $applicationFeature)"
|
|
1846
|
+
},
|
|
1847
|
+
update: {
|
|
1848
|
+
operation: "mutation",
|
|
1849
|
+
name: "updateApplicationFeature",
|
|
1850
|
+
variables: "($applicationFeatureId: String!, $applicationFeature: ApplicationFeatureInput!)",
|
|
1851
|
+
field: "(applicationFeatureId: $applicationFeatureId, applicationFeature: $applicationFeature)"
|
|
1852
|
+
},
|
|
1853
|
+
delete: {
|
|
1854
|
+
operation: "mutation",
|
|
1855
|
+
name: "removeApplicationFeature",
|
|
1856
|
+
variables: "($applicationFeatureId: String!)",
|
|
1857
|
+
field: "(applicationFeatureId: $applicationFeatureId)"
|
|
1858
|
+
}
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1861
|
+
// src/services/user/application-feature.service.ts
|
|
1862
|
+
var createApplicationFeatureService = (client) => ({
|
|
1863
|
+
createApplicationFeature: createOperationExecutor(
|
|
1864
|
+
client,
|
|
1865
|
+
"createApplicationFeature",
|
|
1866
|
+
{
|
|
1867
|
+
schema: buildSchema(applicationFeatureSchema.create),
|
|
1868
|
+
defaultRootFields: applicationFeatureIntegration.create.responseFields,
|
|
1869
|
+
defaultNestedFields: applicationFeatureIntegration.create.nestedFields
|
|
1870
|
+
}
|
|
1871
|
+
),
|
|
1872
|
+
updateApplicationFeature: createOperationExecutor(
|
|
1873
|
+
client,
|
|
1874
|
+
"updateApplicationFeature",
|
|
1875
|
+
{
|
|
1876
|
+
schema: buildSchema(applicationFeatureSchema.update),
|
|
1877
|
+
defaultRootFields: applicationFeatureIntegration.update.responseFields,
|
|
1878
|
+
defaultNestedFields: applicationFeatureIntegration.update.nestedFields
|
|
1879
|
+
}
|
|
1880
|
+
),
|
|
1881
|
+
getApplicationFeature: createOperationExecutor(
|
|
1882
|
+
client,
|
|
1883
|
+
"getApplicationFeature",
|
|
1884
|
+
{
|
|
1885
|
+
schema: buildSchema(applicationFeatureSchema.get),
|
|
1886
|
+
defaultRootFields: applicationFeatureIntegration.get.responseFields,
|
|
1887
|
+
defaultNestedFields: applicationFeatureIntegration.get.nestedFields
|
|
1888
|
+
}
|
|
1889
|
+
),
|
|
1890
|
+
removeApplicationFeature: createOperationExecutor(
|
|
1891
|
+
client,
|
|
1892
|
+
"removeApplicationFeature",
|
|
1893
|
+
{
|
|
1894
|
+
schema: buildSchema(applicationFeatureSchema.delete),
|
|
1895
|
+
defaultRootFields: applicationFeatureDeleteIntegration.responseFields,
|
|
1896
|
+
defaultNestedFields: {}
|
|
1897
|
+
}
|
|
1898
|
+
),
|
|
1899
|
+
getApplicationFeatures: createOperationExecutor(
|
|
1900
|
+
client,
|
|
1901
|
+
"getApplicationFeatures",
|
|
1902
|
+
{
|
|
1903
|
+
schema: buildSchema(applicationFeatureSchema.list),
|
|
1904
|
+
defaultRootFields: [...applicationFeatureListIntegration.responseFields],
|
|
1905
|
+
defaultNestedFields: applicationFeatureListIntegration.nestedFields
|
|
1906
|
+
}
|
|
1907
|
+
)
|
|
1908
|
+
});
|
|
1909
|
+
|
|
1910
|
+
// src/services/inventory/types/product.type.ts
|
|
1911
|
+
var getCustomerProductCountsByIdsResponse = [
|
|
1912
|
+
"customersProductCounts"
|
|
1913
|
+
];
|
|
1914
|
+
var getCustomerProductCountsByIdsResponseNestedFields = {
|
|
1915
|
+
customersProductCounts: customersProductCountQuery
|
|
1916
|
+
};
|
|
1917
|
+
var getProductResponseFields = [
|
|
1918
|
+
"product"
|
|
1919
|
+
];
|
|
1920
|
+
var _getProductResponseNestedFields = {
|
|
1921
|
+
productPackages: packageQuery,
|
|
1922
|
+
smallestPackage: packageQuery,
|
|
1923
|
+
category: categoryQuery,
|
|
1924
|
+
price: priceQuery,
|
|
1925
|
+
stocks: stockQuery,
|
|
1926
|
+
productAttributes: attributeQuery
|
|
1927
|
+
};
|
|
1928
|
+
var getProductResponseNestedFields = {
|
|
1929
|
+
product: productQuery,
|
|
1930
|
+
..._getProductResponseNestedFields
|
|
1931
|
+
};
|
|
1932
|
+
var getProductsResponseFields = [
|
|
1933
|
+
"products"
|
|
1934
|
+
];
|
|
1935
|
+
var getProductsResponseNestedFields = {
|
|
1936
|
+
products: productQuery,
|
|
1937
|
+
..._getProductResponseNestedFields
|
|
1938
|
+
};
|
|
1939
|
+
var getProductByBarcodeResponse = [
|
|
1940
|
+
"Product"
|
|
1941
|
+
];
|
|
1942
|
+
var getProductByBarcodeResponseNestedFields = {
|
|
1943
|
+
Product: productQuery,
|
|
1944
|
+
..._getProductResponseNestedFields
|
|
1945
|
+
};
|
|
1946
|
+
var searchProductNamesResponse = [
|
|
1947
|
+
"productNames"
|
|
1948
|
+
];
|
|
1949
|
+
var searchProductNamesResponseNestedFields = {
|
|
1950
|
+
productNames: productNameQuery
|
|
1951
|
+
};
|
|
1952
|
+
var addProductResponseFields = [
|
|
1953
|
+
"product"
|
|
1954
|
+
];
|
|
1955
|
+
var addProductResponseNestedFields = {
|
|
1956
|
+
product: productQuery,
|
|
1957
|
+
uploadImageResponse: ["fileUrl", "url"],
|
|
1958
|
+
..._getProductResponseNestedFields
|
|
1959
|
+
};
|
|
1960
|
+
var updateProductResponseFields = getProductResponseFields;
|
|
1961
|
+
var updateProductResponseNestedFields = getProductResponseNestedFields;
|
|
1962
|
+
var removeProductResponseFields = [
|
|
1963
|
+
"productId"
|
|
1964
|
+
];
|
|
1965
|
+
var searchCategoriesAndTemplateResponse = [
|
|
1966
|
+
"productCategories"
|
|
1967
|
+
];
|
|
1968
|
+
var searchCategoriesAndTemplateResponseNestedFields = {
|
|
1969
|
+
productCategories: categoryQuery
|
|
1970
|
+
};
|
|
1971
|
+
|
|
1972
|
+
// src/services/inventory/types/package.type.ts
|
|
1973
|
+
var getPackageResponseFields = [
|
|
1974
|
+
"productPackage"
|
|
1975
|
+
];
|
|
1976
|
+
var _getPackageResponseNestedFields = {
|
|
1977
|
+
price: priceQuery,
|
|
1978
|
+
stocks: stockQuery
|
|
1979
|
+
};
|
|
1980
|
+
var getPackageResponseNestedFields = {
|
|
1981
|
+
productPackage: packageQuery,
|
|
1982
|
+
..._getPackageResponseNestedFields
|
|
1983
|
+
};
|
|
1984
|
+
var removePackageResponseFields = [
|
|
1985
|
+
"packageId"
|
|
1986
|
+
];
|
|
1987
|
+
var updatePackageResponseFields = getPackageResponseFields;
|
|
1988
|
+
var updatePackageResponseNestedFields = getPackageResponseNestedFields;
|
|
1989
|
+
var addPackagesResponseFields = [
|
|
1990
|
+
"productPackages"
|
|
1991
|
+
];
|
|
1992
|
+
var addPackagesResponseNestedFields = {
|
|
1993
|
+
productPackages: packageQuery,
|
|
1994
|
+
..._getPackageResponseNestedFields
|
|
1995
|
+
};
|
|
1996
|
+
var addPackageResponseFields = getPackageResponseFields;
|
|
1997
|
+
var addPackageResponseNestedFields = getPackageResponseNestedFields;
|
|
1998
|
+
var getPackagesResponseFields = [
|
|
1999
|
+
"productPackages",
|
|
2000
|
+
"uniqueProducts"
|
|
2001
|
+
];
|
|
2002
|
+
var getPackagesResponseNestedFields = {
|
|
2003
|
+
// productPackages: packageQuery, product already contained this
|
|
2004
|
+
uniqueProducts: productQuery,
|
|
2005
|
+
...getPackageResponseNestedFields,
|
|
2006
|
+
...getProductResponseNestedFields
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
// src/services/inventory/types/price.type.ts
|
|
2010
|
+
var getPriceResponseFields = ["price"];
|
|
2011
|
+
var _getPriceResponseNestedFields = {};
|
|
2012
|
+
var getPriceResponseNestedFields = {
|
|
2013
|
+
price: priceQuery,
|
|
2014
|
+
..._getPriceResponseNestedFields
|
|
2015
|
+
};
|
|
2016
|
+
var getPricesResponseFields = ["prices"];
|
|
2017
|
+
var getPricesResponseNestedFields = {
|
|
2018
|
+
..._getPriceResponseNestedFields,
|
|
2019
|
+
prices: priceQuery
|
|
2020
|
+
};
|
|
2021
|
+
var addPriceResponseFields = getPriceResponseFields;
|
|
2022
|
+
var addPriceResponseNestedFields = getPriceResponseNestedFields;
|
|
2023
|
+
var updatePriceResponseFields = getPriceResponseFields;
|
|
2024
|
+
var updatePriceResponseNestedFields = getPriceResponseNestedFields;
|
|
2025
|
+
var removePriceResponseFields = [
|
|
2026
|
+
"priceId"
|
|
2027
|
+
];
|
|
2028
|
+
|
|
2029
|
+
// src/services/inventory/types/stock.type.ts
|
|
2030
|
+
var getStockResponse = [
|
|
2031
|
+
"stock"
|
|
2032
|
+
];
|
|
2033
|
+
var getStockResponseNestedFields = {
|
|
2034
|
+
stock: stockQuery
|
|
2035
|
+
};
|
|
2036
|
+
var getStocksResponse = [
|
|
2037
|
+
"stocks"
|
|
2038
|
+
];
|
|
2039
|
+
var getStocksResponseNestedFields = {
|
|
2040
|
+
stocks: stockQuery
|
|
2041
|
+
};
|
|
2042
|
+
var addStockResponse = getStockResponse;
|
|
2043
|
+
var addStockResponseNestedFields = getStockResponseNestedFields;
|
|
2044
|
+
var updateStockResponse = getStockResponse;
|
|
2045
|
+
var updateStockResponseNestedFields = getStockResponseNestedFields;
|
|
2046
|
+
var removeStockResponse = [
|
|
2047
|
+
"stockId"
|
|
2048
|
+
];
|
|
2049
|
+
|
|
2050
|
+
// src/services/inventory/types/store.type.ts
|
|
2051
|
+
var getStoreCountResponse = [
|
|
2052
|
+
"count"
|
|
2053
|
+
];
|
|
2054
|
+
var getStoreResponse = [
|
|
2055
|
+
"store"
|
|
2056
|
+
];
|
|
2057
|
+
var _getStoreResponseNestedFields = {
|
|
2058
|
+
address: addressQuery
|
|
2059
|
+
};
|
|
2060
|
+
var getStoreResponseNestedFields = {
|
|
2061
|
+
store: storeQuery,
|
|
2062
|
+
..._getStoreResponseNestedFields
|
|
2063
|
+
};
|
|
2064
|
+
var getStoresResponse = [
|
|
2065
|
+
"stores"
|
|
2066
|
+
];
|
|
2067
|
+
var getStoresResponseNestedFields = {
|
|
2068
|
+
stores: storeQuery,
|
|
2069
|
+
address: addressQuery
|
|
2070
|
+
};
|
|
2071
|
+
var addStoreResponse = getStoreResponse;
|
|
2072
|
+
var addStoreResponseNestedFields = getStoreResponseNestedFields;
|
|
2073
|
+
var updateStoreResponse = getStoreResponse;
|
|
2074
|
+
var updateStoreResponseNestedFields = getStoreResponseNestedFields;
|
|
2075
|
+
var removeStoreResponse = [
|
|
2076
|
+
"storeId"
|
|
2077
|
+
];
|
|
2078
|
+
|
|
2079
|
+
// src/services/inventory/types/store-category-product.type.ts
|
|
2080
|
+
var getStoreCategoryProductResponseFields = [
|
|
2081
|
+
"storeCategoryProduct"
|
|
2082
|
+
];
|
|
2083
|
+
var getStoreCategoryProductResponseNestedFields = {
|
|
2084
|
+
storeCategoryProduct: storeCategoryProductQuery
|
|
2085
|
+
};
|
|
2086
|
+
var getStoreCategoryProductsResponseFields = [
|
|
2087
|
+
"storeCategoryProducts"
|
|
2088
|
+
];
|
|
2089
|
+
var getStoreCategoryProductsResponseNestedFields = {
|
|
2090
|
+
storeCategoryProducts: storeCategoryProductQuery
|
|
2091
|
+
};
|
|
2092
|
+
var createStoreCategoryProductResponseFields = getStoreCategoryProductResponseFields;
|
|
2093
|
+
var createStoreCategoryProductResponseNestedFields = getStoreCategoryProductResponseNestedFields;
|
|
2094
|
+
var updateStoreCategoryProductResponseFields = getStoreCategoryProductResponseFields;
|
|
2095
|
+
var updateStoreCategoryProductResponseNestedFields = getStoreCategoryProductResponseNestedFields;
|
|
2096
|
+
var removeStoreCategoryProductResponseFields = [
|
|
2097
|
+
"storeCategoryProductId"
|
|
2098
|
+
];
|
|
1751
2099
|
|
|
1752
|
-
// src/services/inventory/
|
|
1753
|
-
var
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
query
|
|
1777
|
-
|
|
1778
|
-
${query}
|
|
1779
|
-
}
|
|
1780
|
-
}
|
|
1781
|
-
`,
|
|
1782
|
-
getProductByBarcode: (query) => `
|
|
1783
|
-
query getProductByBarcode($barcode: String!, $fetchFromGS1IfNotFound: Boolean, $template: Boolean) {
|
|
1784
|
-
getProductByBarcode(barcode: $barcode, fetchFromGS1IfNotFound: $fetchFromGS1IfNotFound, template: $template) {
|
|
2100
|
+
// src/services/inventory/types/store-category.type.ts
|
|
2101
|
+
var getStoreCategoryResponseFields = [
|
|
2102
|
+
"storeCategory"
|
|
2103
|
+
];
|
|
2104
|
+
var getStoreCategoryResponseNestedFields = {
|
|
2105
|
+
storeCategory: storeCategoryQuery
|
|
2106
|
+
};
|
|
2107
|
+
var getStoreCategoriesResponseFields = [
|
|
2108
|
+
"storeCategories"
|
|
2109
|
+
];
|
|
2110
|
+
var getStoreCategoriesResponseNestedFields = {
|
|
2111
|
+
storeCategories: storeCategoryQuery
|
|
2112
|
+
};
|
|
2113
|
+
var createStoreCategoryResponseFields = getStoreCategoryResponseFields;
|
|
2114
|
+
var createStoreCategoryResponseNestedFields = getStoreCategoryResponseNestedFields;
|
|
2115
|
+
var updateStoreCategoryResponseFields = getStoreCategoryResponseFields;
|
|
2116
|
+
var updateStoreCategoryResponseNestedFields = getStoreCategoryResponseNestedFields;
|
|
2117
|
+
var removeStoreCategoryResponseFields = [
|
|
2118
|
+
"storeCategoryId"
|
|
2119
|
+
];
|
|
2120
|
+
|
|
2121
|
+
// src/services/inventory/schema/package.schema.ts
|
|
2122
|
+
var packageSchema = {
|
|
2123
|
+
getPackage: (query) => `
|
|
2124
|
+
query getPackage($productPackage: ProductPackageInput!, $template: Boolean) {
|
|
2125
|
+
getPackage(productPackage: $productPackage, template: $template) {
|
|
1785
2126
|
${query}
|
|
1786
2127
|
}
|
|
1787
2128
|
}
|
|
1788
2129
|
`,
|
|
1789
|
-
|
|
1790
|
-
query
|
|
1791
|
-
|
|
2130
|
+
getPackages: (query) => `
|
|
2131
|
+
query getPackages($productPackage: ProductPackageInput, $packageIds: [String], $search: String, $template: Boolean, $shouldGetFromAllStores: Boolean, $limit: Int, $skip: Int) {
|
|
2132
|
+
getPackages(productPackage: $productPackage, packageIds: $packageIds, search: $search, template: $template, shouldGetFromAllStores: $shouldGetFromAllStores, limit: $limit, skip: $skip) {
|
|
1792
2133
|
${query}
|
|
1793
2134
|
}
|
|
1794
2135
|
}
|
|
1795
2136
|
`,
|
|
1796
|
-
|
|
1797
|
-
mutation
|
|
1798
|
-
|
|
1799
|
-
${mutation}
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
`,
|
|
1803
|
-
updateProduct: (mutation) => `
|
|
1804
|
-
mutation updateProduct($productId: String!, $product: ProductInput!, $template: Boolean) {
|
|
1805
|
-
updateProduct(productId: $productId, product: $product, template: $template) {
|
|
1806
|
-
${mutation}
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
`,
|
|
1810
|
-
removeProduct: (mutation) => `
|
|
1811
|
-
mutation removeProduct($productId: String!, $template: Boolean) {
|
|
1812
|
-
removeProduct(productId: $productId, template: $template) {
|
|
1813
|
-
${mutation}
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
`
|
|
1817
|
-
};
|
|
1818
|
-
|
|
1819
|
-
// src/services/file/file.service.ts
|
|
1820
|
-
var createFileService = (client) => ({
|
|
1821
|
-
async uploadFile(formData) {
|
|
1822
|
-
const url = client["url"].replace("/graphql", "") + "/api/upload";
|
|
1823
|
-
const token = await client["tokenProvider"]();
|
|
1824
|
-
const headers = {
|
|
1825
|
-
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
1826
|
-
};
|
|
1827
|
-
const res = await fetch(url, {
|
|
1828
|
-
method: "POST",
|
|
1829
|
-
headers,
|
|
1830
|
-
body: formData
|
|
1831
|
-
// native FormData works fine
|
|
1832
|
-
});
|
|
1833
|
-
const text = await res.text();
|
|
1834
|
-
if (!res.ok) throw new Error(`File upload failed: ${res.status} - ${text}`);
|
|
1835
|
-
try {
|
|
1836
|
-
return JSON.parse(text);
|
|
1837
|
-
} catch (e) {
|
|
1838
|
-
return text;
|
|
1839
|
-
}
|
|
1840
|
-
}
|
|
1841
|
-
});
|
|
1842
|
-
|
|
1843
|
-
// src/services/inventory/product.service.ts
|
|
1844
|
-
var createProductService = (client) => ({
|
|
1845
|
-
async uploadProductImage(form) {
|
|
1846
|
-
const fileClient = createFileService(client);
|
|
1847
|
-
return (await fileClient.uploadFile(form)).product;
|
|
1848
|
-
},
|
|
1849
|
-
async getCustomerProductCountsByIds(input, fetchFields, option) {
|
|
1850
|
-
var _a, _b, _c, _d;
|
|
1851
|
-
const res = await client.request(
|
|
1852
|
-
productSchema.getCustomerProductCountsByIds(
|
|
1853
|
-
gqlQueryStringBuilder(
|
|
1854
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getCustomerProductCountsByIdsResponse,
|
|
1855
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getCustomerProductCountsByIdsResponseNestedFields
|
|
1856
|
-
)
|
|
1857
|
-
),
|
|
1858
|
-
input,
|
|
1859
|
-
option
|
|
1860
|
-
);
|
|
1861
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getCustomerProductCountsByIds) != null ? _d : null;
|
|
1862
|
-
},
|
|
1863
|
-
async searchCategoriesAndTemplate(input, fetchFields, option) {
|
|
1864
|
-
var _a, _b, _c, _d;
|
|
1865
|
-
const res = await client.request(
|
|
1866
|
-
productSchema.searchCategoriesAndTemplate(
|
|
1867
|
-
gqlQueryStringBuilder(
|
|
1868
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : searchCategoriesAndTemplateResponse,
|
|
1869
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : searchCategoriesAndTemplateResponseNestedFields
|
|
1870
|
-
)
|
|
1871
|
-
),
|
|
1872
|
-
input,
|
|
1873
|
-
option
|
|
1874
|
-
);
|
|
1875
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.searchCategoriesAndTemplate) != null ? _d : null;
|
|
1876
|
-
},
|
|
1877
|
-
async searchProductNames(input, fetchFields, option) {
|
|
1878
|
-
var _a, _b, _c, _d;
|
|
1879
|
-
const res = await client.request(
|
|
1880
|
-
productSchema.searchProductNames(
|
|
1881
|
-
gqlQueryStringBuilder(
|
|
1882
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : searchProductNamesResponse,
|
|
1883
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : searchProductNamesResponseNestedFields
|
|
1884
|
-
)
|
|
1885
|
-
),
|
|
1886
|
-
input,
|
|
1887
|
-
option
|
|
1888
|
-
);
|
|
1889
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.searchProductNames) != null ? _d : null;
|
|
1890
|
-
},
|
|
1891
|
-
async updateProduct(input, fetchFields, option) {
|
|
1892
|
-
var _a, _b, _c, _d;
|
|
1893
|
-
const res = await client.request(
|
|
1894
|
-
productSchema.updateProduct(
|
|
1895
|
-
gqlQueryStringBuilder(
|
|
1896
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateProductResponseFields,
|
|
1897
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateProductResponseNestedFields
|
|
1898
|
-
)
|
|
1899
|
-
),
|
|
1900
|
-
input,
|
|
1901
|
-
option
|
|
1902
|
-
);
|
|
1903
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.updateProduct) != null ? _d : null;
|
|
1904
|
-
},
|
|
1905
|
-
async removeProduct(input, fetchFields, option) {
|
|
1906
|
-
var _a, _b, _c;
|
|
1907
|
-
const res = await client.request(
|
|
1908
|
-
productSchema.removeProduct(
|
|
1909
|
-
gqlQueryStringBuilder(
|
|
1910
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeProductResponseFields
|
|
1911
|
-
)
|
|
1912
|
-
),
|
|
1913
|
-
input,
|
|
1914
|
-
option
|
|
1915
|
-
);
|
|
1916
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.removeProduct) != null ? _c : null;
|
|
1917
|
-
},
|
|
1918
|
-
async addProduct(input, fetchFields, option) {
|
|
1919
|
-
var _a, _b, _c, _d;
|
|
1920
|
-
const res = await client.request(
|
|
1921
|
-
productSchema.addProduct(
|
|
1922
|
-
gqlQueryStringBuilder(
|
|
1923
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addProductResponseFields,
|
|
1924
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addProductResponseNestedFields
|
|
1925
|
-
)
|
|
1926
|
-
),
|
|
1927
|
-
input,
|
|
1928
|
-
option
|
|
1929
|
-
);
|
|
1930
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.addProduct) != null ? _d : null;
|
|
1931
|
-
},
|
|
1932
|
-
async getProduct(input, fetchFields, option) {
|
|
1933
|
-
var _a, _b, _c, _d;
|
|
1934
|
-
const res = await client.request(
|
|
1935
|
-
productSchema.getProduct(
|
|
1936
|
-
gqlQueryStringBuilder(
|
|
1937
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getProductResponseFields,
|
|
1938
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getProductResponseNestedFields
|
|
1939
|
-
)
|
|
1940
|
-
),
|
|
1941
|
-
input,
|
|
1942
|
-
option
|
|
1943
|
-
);
|
|
1944
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getProduct) != null ? _d : null;
|
|
1945
|
-
},
|
|
1946
|
-
async getProducts(input, fetchFields, option) {
|
|
1947
|
-
var _a, _b, _c, _d;
|
|
1948
|
-
const res = await client.request(
|
|
1949
|
-
productSchema.getProducts(
|
|
1950
|
-
gqlQueryStringBuilder(
|
|
1951
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getProductsResponseFields,
|
|
1952
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getProductsResponseNestedFields
|
|
1953
|
-
)
|
|
1954
|
-
),
|
|
1955
|
-
input,
|
|
1956
|
-
option
|
|
1957
|
-
);
|
|
1958
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.getProducts) != null ? _d : null;
|
|
1959
|
-
}
|
|
1960
|
-
});
|
|
1961
|
-
|
|
1962
|
-
// src/services/inventory/schema/stock.schema.ts
|
|
1963
|
-
var stockSchema = {
|
|
1964
|
-
getStock: (query) => `
|
|
1965
|
-
query getStock($stock: StockInput!) {
|
|
1966
|
-
stock(stock: $stock) {
|
|
2137
|
+
addPackage: (query) => `
|
|
2138
|
+
mutation addPackage($productPackage: ProductPackageInput!, $template: Boolean) {
|
|
2139
|
+
addPackage(productPackage: $productPackage, template: $template) {
|
|
1967
2140
|
${query}
|
|
1968
2141
|
}
|
|
1969
2142
|
}
|
|
1970
2143
|
`,
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2144
|
+
addPackages: (query) => `
|
|
2145
|
+
mutation addPackages($productPackages: [ProductPackagesInput]!, $template: Boolean) {
|
|
2146
|
+
addPackages(productPackages: $productPackages, template: $template) {
|
|
1974
2147
|
${query}
|
|
1975
2148
|
}
|
|
1976
2149
|
}
|
|
1977
2150
|
`,
|
|
1978
|
-
|
|
1979
|
-
mutation
|
|
1980
|
-
|
|
1981
|
-
${
|
|
2151
|
+
updatePackage: (query) => `
|
|
2152
|
+
mutation updatePackage($packageId: String!, $productPackage: ProductPackageInput!, $template: Boolean) {
|
|
2153
|
+
updatePackage(packageId: $packageId, productPackage: $productPackage, template: $template) {
|
|
2154
|
+
${query}
|
|
1982
2155
|
}
|
|
1983
2156
|
}
|
|
1984
2157
|
`,
|
|
1985
|
-
|
|
1986
|
-
mutation
|
|
1987
|
-
|
|
1988
|
-
${
|
|
2158
|
+
updatePackages: (query) => `
|
|
2159
|
+
mutation updatePackages($packages: [PackagesInput]) {
|
|
2160
|
+
updatePackages(packages: $packages) {
|
|
2161
|
+
${query}
|
|
1989
2162
|
}
|
|
1990
2163
|
}
|
|
1991
2164
|
`,
|
|
1992
|
-
|
|
1993
|
-
mutation
|
|
1994
|
-
|
|
1995
|
-
${
|
|
2165
|
+
removePackage: (query) => `
|
|
2166
|
+
mutation removePackage($packageId: String!, $template: Boolean) {
|
|
2167
|
+
removePackage(packageId: $packageId, template: $template) {
|
|
2168
|
+
${query}
|
|
1996
2169
|
}
|
|
1997
2170
|
}
|
|
1998
2171
|
`
|
|
1999
2172
|
};
|
|
2000
2173
|
|
|
2001
|
-
// src/services/inventory/
|
|
2002
|
-
var
|
|
2003
|
-
async
|
|
2174
|
+
// src/services/inventory/package.service.ts
|
|
2175
|
+
var createPackageService = (client) => ({
|
|
2176
|
+
async updatePackage(input, fetchFields, option) {
|
|
2004
2177
|
var _a, _b, _c, _d;
|
|
2005
2178
|
const res = await client.request(
|
|
2006
|
-
|
|
2179
|
+
packageSchema.updatePackage(
|
|
2007
2180
|
gqlQueryStringBuilder(
|
|
2008
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2009
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2181
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updatePackageResponseFields,
|
|
2182
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updatePackageResponseNestedFields
|
|
2010
2183
|
)
|
|
2011
2184
|
),
|
|
2012
2185
|
input,
|
|
2013
2186
|
option
|
|
2014
2187
|
);
|
|
2015
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2188
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updatePackage) != null ? _d : null;
|
|
2016
2189
|
},
|
|
2017
|
-
async
|
|
2190
|
+
async removePackage(input, fetchFields, option) {
|
|
2018
2191
|
var _a, _b, _c;
|
|
2019
2192
|
const res = await client.request(
|
|
2020
|
-
|
|
2193
|
+
packageSchema.removePackage(
|
|
2021
2194
|
gqlQueryStringBuilder(
|
|
2022
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2195
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removePackageResponseFields
|
|
2023
2196
|
)
|
|
2024
2197
|
),
|
|
2025
2198
|
input,
|
|
2026
2199
|
option
|
|
2027
2200
|
);
|
|
2028
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.
|
|
2201
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removePackage) != null ? _c : null;
|
|
2029
2202
|
},
|
|
2030
|
-
async
|
|
2203
|
+
async addPackages(input, fetchFields, option) {
|
|
2031
2204
|
var _a, _b, _c, _d;
|
|
2032
2205
|
const res = await client.request(
|
|
2033
|
-
|
|
2206
|
+
packageSchema.addPackages(
|
|
2034
2207
|
gqlQueryStringBuilder(
|
|
2035
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2036
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2208
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addPackagesResponseFields,
|
|
2209
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addPackagesResponseNestedFields
|
|
2037
2210
|
)
|
|
2038
2211
|
),
|
|
2039
2212
|
input,
|
|
2040
2213
|
option
|
|
2041
2214
|
);
|
|
2042
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2215
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addPackages) != null ? _d : null;
|
|
2043
2216
|
},
|
|
2044
|
-
async
|
|
2217
|
+
async addPackage(input, fetchFields, option) {
|
|
2045
2218
|
var _a, _b, _c, _d;
|
|
2046
2219
|
const res = await client.request(
|
|
2047
|
-
|
|
2220
|
+
packageSchema.addPackage(
|
|
2048
2221
|
gqlQueryStringBuilder(
|
|
2049
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2050
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2222
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addPackageResponseFields,
|
|
2223
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addPackageResponseNestedFields
|
|
2051
2224
|
)
|
|
2052
2225
|
),
|
|
2053
2226
|
input,
|
|
2054
2227
|
option
|
|
2055
2228
|
);
|
|
2056
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2229
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addPackage) != null ? _d : null;
|
|
2057
2230
|
},
|
|
2058
|
-
async
|
|
2231
|
+
async getPackage(input, fetchFields, option) {
|
|
2059
2232
|
var _a, _b, _c, _d;
|
|
2060
2233
|
const res = await client.request(
|
|
2061
|
-
|
|
2234
|
+
packageSchema.getPackage(
|
|
2062
2235
|
gqlQueryStringBuilder(
|
|
2063
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2064
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2236
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getPackageResponseFields,
|
|
2237
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getPackageResponseNestedFields
|
|
2065
2238
|
)
|
|
2066
2239
|
),
|
|
2067
2240
|
input,
|
|
2068
2241
|
option
|
|
2069
2242
|
);
|
|
2070
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2243
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getPackage) != null ? _d : null;
|
|
2244
|
+
},
|
|
2245
|
+
async getPackages(input, fetchFields, option) {
|
|
2246
|
+
var _a, _b, _c, _d;
|
|
2247
|
+
const res = await client.request(
|
|
2248
|
+
packageSchema.getPackages(
|
|
2249
|
+
gqlQueryStringBuilder(
|
|
2250
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getPackagesResponseFields,
|
|
2251
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getPackagesResponseNestedFields
|
|
2252
|
+
)
|
|
2253
|
+
),
|
|
2254
|
+
input,
|
|
2255
|
+
option
|
|
2256
|
+
);
|
|
2257
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getPackages) != null ? _d : null;
|
|
2071
2258
|
}
|
|
2072
2259
|
});
|
|
2073
2260
|
|
|
2074
|
-
// src/services/inventory/schema/
|
|
2075
|
-
var
|
|
2076
|
-
|
|
2077
|
-
query
|
|
2078
|
-
|
|
2079
|
-
${query}
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
`,
|
|
2083
|
-
getStore: (query) => `
|
|
2084
|
-
query getStore($store: StoreInput!) {
|
|
2085
|
-
getStore(store: $store) {
|
|
2261
|
+
// src/services/inventory/schema/price.schema.ts
|
|
2262
|
+
var priceSchema = {
|
|
2263
|
+
getPrice: (query) => `
|
|
2264
|
+
query getPrice($price: PriceInput!) {
|
|
2265
|
+
price(price: $price) {
|
|
2086
2266
|
${query}
|
|
2087
2267
|
}
|
|
2088
2268
|
}
|
|
2089
2269
|
`,
|
|
2090
|
-
|
|
2091
|
-
query
|
|
2092
|
-
|
|
2270
|
+
getPrices: (query) => `
|
|
2271
|
+
query getPrices($price: PriceInput, $priceIds: [String], $limit: Int!, $skip: Int!) {
|
|
2272
|
+
prices(price: $price, priceIds: $priceIds, limit: $limit, skip: $skip) {
|
|
2093
2273
|
${query}
|
|
2094
2274
|
}
|
|
2095
2275
|
}
|
|
2096
2276
|
`,
|
|
2097
|
-
|
|
2098
|
-
mutation
|
|
2099
|
-
|
|
2277
|
+
addPrice: (mutation) => `
|
|
2278
|
+
mutation addPrice($price: PriceInput) {
|
|
2279
|
+
addPrice(price: $price) {
|
|
2100
2280
|
${mutation}
|
|
2101
2281
|
}
|
|
2102
2282
|
}
|
|
2103
2283
|
`,
|
|
2104
|
-
|
|
2105
|
-
mutation
|
|
2106
|
-
|
|
2284
|
+
updatePrice: (mutation) => `
|
|
2285
|
+
mutation updatePrice($priceId: String, $price: PriceInput) {
|
|
2286
|
+
updatePrice(priceId: $priceId, price: $price) {
|
|
2107
2287
|
${mutation}
|
|
2108
2288
|
}
|
|
2109
2289
|
}
|
|
2110
2290
|
`,
|
|
2111
|
-
|
|
2112
|
-
mutation
|
|
2113
|
-
|
|
2291
|
+
removePrice: (mutation) => `
|
|
2292
|
+
mutation removePrice($priceId: String!) {
|
|
2293
|
+
removePrice(priceId: $priceId) {
|
|
2114
2294
|
${mutation}
|
|
2115
2295
|
}
|
|
2116
2296
|
}
|
|
2117
2297
|
`
|
|
2118
2298
|
};
|
|
2119
2299
|
|
|
2120
|
-
// src/services/inventory/
|
|
2121
|
-
var
|
|
2122
|
-
async
|
|
2300
|
+
// src/services/inventory/price.service.ts
|
|
2301
|
+
var createPriceService = (client) => ({
|
|
2302
|
+
async updatePrice(input, fetchFields, option) {
|
|
2123
2303
|
var _a, _b, _c, _d;
|
|
2124
2304
|
const res = await client.request(
|
|
2125
|
-
|
|
2305
|
+
priceSchema.updatePrice(
|
|
2126
2306
|
gqlQueryStringBuilder(
|
|
2127
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2128
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2307
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updatePriceResponseFields,
|
|
2308
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updatePriceResponseNestedFields
|
|
2129
2309
|
)
|
|
2130
2310
|
),
|
|
2131
2311
|
input,
|
|
2132
2312
|
option
|
|
2133
2313
|
);
|
|
2134
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2314
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updatePrice) != null ? _d : null;
|
|
2135
2315
|
},
|
|
2136
|
-
async
|
|
2316
|
+
async removePrice(input, fetchFields, option) {
|
|
2137
2317
|
var _a, _b, _c;
|
|
2138
2318
|
const res = await client.request(
|
|
2139
|
-
|
|
2319
|
+
priceSchema.removePrice(
|
|
2140
2320
|
gqlQueryStringBuilder(
|
|
2141
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2321
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removePriceResponseFields
|
|
2142
2322
|
)
|
|
2143
2323
|
),
|
|
2144
2324
|
input,
|
|
2145
2325
|
option
|
|
2146
2326
|
);
|
|
2147
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.
|
|
2327
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removePrice) != null ? _c : null;
|
|
2148
2328
|
},
|
|
2149
|
-
async
|
|
2329
|
+
async addPrice(input, fetchFields, option) {
|
|
2150
2330
|
var _a, _b, _c, _d;
|
|
2151
2331
|
const res = await client.request(
|
|
2152
|
-
|
|
2153
|
-
gqlQueryStringBuilder(
|
|
2154
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addStoreResponse,
|
|
2155
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addStoreResponseNestedFields
|
|
2156
|
-
)
|
|
2157
|
-
),
|
|
2158
|
-
input,
|
|
2159
|
-
option
|
|
2160
|
-
);
|
|
2161
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.createStore) != null ? _d : null;
|
|
2162
|
-
},
|
|
2163
|
-
async getStoreCount(input, fetchFields, option) {
|
|
2164
|
-
var _a, _b, _c;
|
|
2165
|
-
const res = await client.request(
|
|
2166
|
-
storeSchema.getStoreCount(
|
|
2332
|
+
priceSchema.addPrice(
|
|
2167
2333
|
gqlQueryStringBuilder(
|
|
2168
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2334
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addPriceResponseFields,
|
|
2335
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addPriceResponseNestedFields
|
|
2169
2336
|
)
|
|
2170
2337
|
),
|
|
2171
2338
|
input,
|
|
2172
2339
|
option
|
|
2173
2340
|
);
|
|
2174
|
-
return (
|
|
2341
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addPrice) != null ? _d : null;
|
|
2175
2342
|
},
|
|
2176
|
-
async
|
|
2343
|
+
async getPrice(input, fetchFields, option) {
|
|
2177
2344
|
var _a, _b, _c, _d;
|
|
2178
2345
|
const res = await client.request(
|
|
2179
|
-
|
|
2346
|
+
priceSchema.getPrice(
|
|
2180
2347
|
gqlQueryStringBuilder(
|
|
2181
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2182
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2348
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getPriceResponseFields,
|
|
2349
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getPriceResponseNestedFields
|
|
2183
2350
|
)
|
|
2184
2351
|
),
|
|
2185
2352
|
input,
|
|
2186
2353
|
option
|
|
2187
2354
|
);
|
|
2188
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2355
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getPrice) != null ? _d : null;
|
|
2189
2356
|
},
|
|
2190
|
-
async
|
|
2357
|
+
async getPrices(input, fetchFields, option) {
|
|
2191
2358
|
var _a, _b, _c, _d;
|
|
2192
2359
|
const res = await client.request(
|
|
2193
|
-
|
|
2360
|
+
priceSchema.getPrices(
|
|
2194
2361
|
gqlQueryStringBuilder(
|
|
2195
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2196
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2362
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getPricesResponseFields,
|
|
2363
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getPricesResponseNestedFields
|
|
2197
2364
|
)
|
|
2198
2365
|
),
|
|
2199
2366
|
input,
|
|
2200
2367
|
option
|
|
2201
2368
|
);
|
|
2202
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2369
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getPrices) != null ? _d : null;
|
|
2370
|
+
}
|
|
2371
|
+
});
|
|
2372
|
+
|
|
2373
|
+
// src/services/inventory/schema/product.schema.ts
|
|
2374
|
+
var productSchema = {
|
|
2375
|
+
getCustomerProductCountsByIds: (query) => `
|
|
2376
|
+
query getCustomerProductCountsByIds($userIds: [String]!) {
|
|
2377
|
+
getCustomerProductCountsByIds(userIds: $userIds) {
|
|
2378
|
+
${query}
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
`,
|
|
2382
|
+
searchCategoriesAndTemplate: (query) => `
|
|
2383
|
+
query searchCategoriesAndTemplate($search: String, $shouldGetFromAllStores: Boolean){
|
|
2384
|
+
searchCategoriesAndTemplate(search: $search, shouldGetFromAllStores: $shouldGetFromAllStores) {
|
|
2385
|
+
${query}
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
`,
|
|
2389
|
+
getProduct: (query) => `
|
|
2390
|
+
query getProduct($product: ProductInput!, $template: Boolean) {
|
|
2391
|
+
getProduct(product: $product, template: $template) {
|
|
2392
|
+
${query}
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
`,
|
|
2396
|
+
getProducts: (query) => `
|
|
2397
|
+
query getProducts($product: ProductInput, $productIds: [String], $search: String, $limit: Int!, $skip: Int!, $template: Boolean, $shouldGetFromAllStores: Boolean) {
|
|
2398
|
+
getProducts(product: $product, productIds: $productIds, search: $search, limit: $limit, skip: $skip, template: $template, shouldGetFromAllStores: $shouldGetFromAllStores) {
|
|
2399
|
+
${query}
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
`,
|
|
2403
|
+
getProductByBarcode: (query) => `
|
|
2404
|
+
query getProductByBarcode($barcode: String!, $fetchFromGS1IfNotFound: Boolean, $template: Boolean) {
|
|
2405
|
+
getProductByBarcode(barcode: $barcode, fetchFromGS1IfNotFound: $fetchFromGS1IfNotFound, template: $template) {
|
|
2406
|
+
${query}
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
`,
|
|
2410
|
+
searchProductNames: (query) => `
|
|
2411
|
+
query searchProductNames($search: String!, $product: ProductInput, $limit: Int, $skip: Int, $template: Boolean) {
|
|
2412
|
+
searchProductNames(search: $search, product: $product, limit: $limit, skip: $skip, template: $template) {
|
|
2413
|
+
${query}
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
`,
|
|
2417
|
+
addProduct: (mutation) => `
|
|
2418
|
+
mutation addProduct($product: ProductInput!, $imageTypes: [String], $template: Boolean) {
|
|
2419
|
+
addProduct(product: $product, imageTypes: $imageTypes, template: $template) {
|
|
2420
|
+
${mutation}
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
`,
|
|
2424
|
+
updateProduct: (mutation) => `
|
|
2425
|
+
mutation updateProduct($productId: String!, $product: ProductInput!, $template: Boolean) {
|
|
2426
|
+
updateProduct(productId: $productId, product: $product, template: $template) {
|
|
2427
|
+
${mutation}
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
`,
|
|
2431
|
+
removeProduct: (mutation) => `
|
|
2432
|
+
mutation removeProduct($productId: String!, $template: Boolean) {
|
|
2433
|
+
removeProduct(productId: $productId, template: $template) {
|
|
2434
|
+
${mutation}
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
`
|
|
2438
|
+
};
|
|
2439
|
+
|
|
2440
|
+
// src/services/file/file.service.ts
|
|
2441
|
+
var createFileService = (client) => ({
|
|
2442
|
+
async uploadFile(formData) {
|
|
2443
|
+
const url = client["url"].replace("/graphql", "") + "/api/upload";
|
|
2444
|
+
const token = await client["tokenProvider"]();
|
|
2445
|
+
const headers = {
|
|
2446
|
+
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
2447
|
+
};
|
|
2448
|
+
const res = await fetch(url, {
|
|
2449
|
+
method: "POST",
|
|
2450
|
+
headers,
|
|
2451
|
+
body: formData
|
|
2452
|
+
// native FormData works fine
|
|
2453
|
+
});
|
|
2454
|
+
const text = await res.text();
|
|
2455
|
+
if (!res.ok) throw new Error(`File upload failed: ${res.status} - ${text}`);
|
|
2456
|
+
try {
|
|
2457
|
+
return JSON.parse(text);
|
|
2458
|
+
} catch (e) {
|
|
2459
|
+
return text;
|
|
2460
|
+
}
|
|
2203
2461
|
}
|
|
2204
2462
|
});
|
|
2205
2463
|
|
|
2206
|
-
// src/services/inventory/
|
|
2207
|
-
var
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
}
|
|
2214
|
-
`,
|
|
2215
|
-
updateStoreCategory: (query) => `
|
|
2216
|
-
mutation updateStoreCategory($storeCategoryId: String!, $storeCategory: StoreCategoryInput!) {
|
|
2217
|
-
updateStoreCategory(storeCategoryId: $storeCategoryId, storeCategory: $storeCategory) {
|
|
2218
|
-
${query}
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
`,
|
|
2222
|
-
removeStoreCategory: (query) => `
|
|
2223
|
-
mutation removeStoreCategory($storeCategoryId: String!) {
|
|
2224
|
-
removeStoreCategory(storeCategoryId: $storeCategoryId) {
|
|
2225
|
-
${query}
|
|
2226
|
-
}
|
|
2227
|
-
}
|
|
2228
|
-
`,
|
|
2229
|
-
// get
|
|
2230
|
-
getStoreCategory: (query) => `
|
|
2231
|
-
query getStoreCategory($storeCategory: StoreCategoryInput!) {
|
|
2232
|
-
getStoreCategory(storeCategory: $storeCategory) {
|
|
2233
|
-
${query}
|
|
2234
|
-
}
|
|
2235
|
-
}
|
|
2236
|
-
`,
|
|
2237
|
-
getStoreCategories: (query) => `
|
|
2238
|
-
query getStoreCategories($search: String, $storeCategory: StoreCategoryInput, $storeCategoryIds: [String], $limit: Int!, $skip: Int!) {
|
|
2239
|
-
getStoreCategories(search: $search, storeCategory: $storeCategory, storeCategoryIds: $storeCategoryIds, limit: $limit, skip: $skip) {
|
|
2240
|
-
${query}
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
`
|
|
2244
|
-
};
|
|
2245
|
-
|
|
2246
|
-
// src/services/inventory/store-category.service.ts
|
|
2247
|
-
var createStoreCategoryService = (client) => ({
|
|
2248
|
-
async getStoreCategories(input, fetchFields, option) {
|
|
2464
|
+
// src/services/inventory/product.service.ts
|
|
2465
|
+
var createProductService = (client) => ({
|
|
2466
|
+
async uploadProductImage(form) {
|
|
2467
|
+
const fileClient = createFileService(client);
|
|
2468
|
+
return (await fileClient.uploadFile(form)).product;
|
|
2469
|
+
},
|
|
2470
|
+
async getCustomerProductCountsByIds(input, fetchFields, option) {
|
|
2249
2471
|
var _a, _b, _c, _d;
|
|
2250
2472
|
const res = await client.request(
|
|
2251
|
-
|
|
2473
|
+
productSchema.getCustomerProductCountsByIds(
|
|
2252
2474
|
gqlQueryStringBuilder(
|
|
2253
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2254
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2475
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getCustomerProductCountsByIdsResponse,
|
|
2476
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getCustomerProductCountsByIdsResponseNestedFields
|
|
2255
2477
|
)
|
|
2256
2478
|
),
|
|
2257
2479
|
input,
|
|
2258
2480
|
option
|
|
2259
2481
|
);
|
|
2260
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2482
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getCustomerProductCountsByIds) != null ? _d : null;
|
|
2261
2483
|
},
|
|
2262
|
-
async
|
|
2484
|
+
async searchCategoriesAndTemplate(input, fetchFields, option) {
|
|
2263
2485
|
var _a, _b, _c, _d;
|
|
2264
2486
|
const res = await client.request(
|
|
2265
|
-
|
|
2487
|
+
productSchema.searchCategoriesAndTemplate(
|
|
2266
2488
|
gqlQueryStringBuilder(
|
|
2267
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2268
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2489
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : searchCategoriesAndTemplateResponse,
|
|
2490
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : searchCategoriesAndTemplateResponseNestedFields
|
|
2269
2491
|
)
|
|
2270
2492
|
),
|
|
2271
2493
|
input,
|
|
2272
2494
|
option
|
|
2273
2495
|
);
|
|
2274
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2496
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.searchCategoriesAndTemplate) != null ? _d : null;
|
|
2275
2497
|
},
|
|
2276
|
-
async
|
|
2498
|
+
async searchProductNames(input, fetchFields, option) {
|
|
2277
2499
|
var _a, _b, _c, _d;
|
|
2278
2500
|
const res = await client.request(
|
|
2279
|
-
|
|
2501
|
+
productSchema.searchProductNames(
|
|
2280
2502
|
gqlQueryStringBuilder(
|
|
2281
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2282
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2503
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : searchProductNamesResponse,
|
|
2504
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : searchProductNamesResponseNestedFields
|
|
2283
2505
|
)
|
|
2284
2506
|
),
|
|
2285
2507
|
input,
|
|
2286
2508
|
option
|
|
2287
2509
|
);
|
|
2288
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2510
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.searchProductNames) != null ? _d : null;
|
|
2289
2511
|
},
|
|
2290
|
-
async
|
|
2512
|
+
async updateProduct(input, fetchFields, option) {
|
|
2291
2513
|
var _a, _b, _c, _d;
|
|
2292
2514
|
const res = await client.request(
|
|
2293
|
-
|
|
2515
|
+
productSchema.updateProduct(
|
|
2294
2516
|
gqlQueryStringBuilder(
|
|
2295
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2296
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2517
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateProductResponseFields,
|
|
2518
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateProductResponseNestedFields
|
|
2297
2519
|
)
|
|
2298
2520
|
),
|
|
2299
2521
|
input,
|
|
2300
2522
|
option
|
|
2301
2523
|
);
|
|
2302
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2524
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateProduct) != null ? _d : null;
|
|
2303
2525
|
},
|
|
2304
|
-
async
|
|
2526
|
+
async removeProduct(input, fetchFields, option) {
|
|
2305
2527
|
var _a, _b, _c;
|
|
2306
2528
|
const res = await client.request(
|
|
2307
|
-
|
|
2308
|
-
gqlQueryStringBuilder(
|
|
2309
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeStoreCategoryResponseFields
|
|
2310
|
-
)
|
|
2311
|
-
),
|
|
2312
|
-
input,
|
|
2313
|
-
option
|
|
2314
|
-
);
|
|
2315
|
-
return (_c = (_b = res.data) == null ? void 0 : _b.removeStoreCategory) != null ? _c : null;
|
|
2316
|
-
}
|
|
2317
|
-
});
|
|
2318
|
-
|
|
2319
|
-
// src/services/inventory/schema/store-category-product.schema.ts
|
|
2320
|
-
var storeCategoryProductSchema = {
|
|
2321
|
-
createStoreCategoryProduct: (query) => `
|
|
2322
|
-
mutation createStoreCategoryProduct($storeCategoryProduct: StoreCategoryProductInput!) {
|
|
2323
|
-
createStoreCategoryProduct(storeCategoryProduct: $storeCategoryProduct) {
|
|
2324
|
-
${query}
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
`,
|
|
2328
|
-
updateStoreCategoryProduct: (query) => `
|
|
2329
|
-
mutation updateStoreCategoryProduct($storeCategoryProductId: String!, $storeCategoryProduct: StoreCategoryProductInput!) {
|
|
2330
|
-
updateStoreCategoryProduct(storeCategoryProductId: $storeCategoryProductId, storeCategoryProduct: $storeCategoryProduct) {
|
|
2331
|
-
${query}
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
2334
|
-
`,
|
|
2335
|
-
removeStoreCategoryProduct: (query) => `
|
|
2336
|
-
mutation removeStoreCategoryProduct($storeCategoryProductId: String!) {
|
|
2337
|
-
removeStoreCategoryProduct(storeCategoryProductId: $storeCategoryProductId) {
|
|
2338
|
-
${query}
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
`,
|
|
2342
|
-
// get
|
|
2343
|
-
getStoreCategoryProduct: (query) => `
|
|
2344
|
-
query getStoreCategoryProduct($storeCategoryProduct: StoreCategoryProductInput!) {
|
|
2345
|
-
getStoreCategoryProduct(storeCategoryProduct: $storeCategoryProduct) {
|
|
2346
|
-
${query}
|
|
2347
|
-
}
|
|
2348
|
-
}
|
|
2349
|
-
`,
|
|
2350
|
-
getStoreCategoryProducts: (query) => `
|
|
2351
|
-
query getStoreCategoryProducts($search: String, $storeCategoryProduct: StoreCategoryProductInput, $storeCategoryProductIds: [String], $limit: Int!, $skip: Int!) {
|
|
2352
|
-
getStoreCategoryProducts(search: $search, storeCategoryProduct: $storeCategoryProduct, storeCategoryProductIds: $storeCategoryProductIds, limit: $limit, skip: $skip) {
|
|
2353
|
-
${query}
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
`
|
|
2357
|
-
};
|
|
2358
|
-
|
|
2359
|
-
// src/services/inventory/store-category-product.service.ts
|
|
2360
|
-
var createStoreCategoryProductService = (client) => ({
|
|
2361
|
-
async getStoreCategoryProducts(input, fetchFields, option) {
|
|
2362
|
-
var _a, _b, _c, _d;
|
|
2363
|
-
const res = await client.request(
|
|
2364
|
-
storeCategoryProductSchema.getStoreCategoryProducts(
|
|
2529
|
+
productSchema.removeProduct(
|
|
2365
2530
|
gqlQueryStringBuilder(
|
|
2366
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2367
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoreCategoryProductsResponseNestedFields
|
|
2531
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeProductResponseFields
|
|
2368
2532
|
)
|
|
2369
2533
|
),
|
|
2370
2534
|
input,
|
|
2371
2535
|
option
|
|
2372
2536
|
);
|
|
2373
|
-
return (
|
|
2537
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeProduct) != null ? _c : null;
|
|
2374
2538
|
},
|
|
2375
|
-
async
|
|
2539
|
+
async addProduct(input, fetchFields, option) {
|
|
2376
2540
|
var _a, _b, _c, _d;
|
|
2377
2541
|
const res = await client.request(
|
|
2378
|
-
|
|
2542
|
+
productSchema.addProduct(
|
|
2379
2543
|
gqlQueryStringBuilder(
|
|
2380
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2381
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2544
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addProductResponseFields,
|
|
2545
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addProductResponseNestedFields
|
|
2382
2546
|
)
|
|
2383
2547
|
),
|
|
2384
2548
|
input,
|
|
2385
2549
|
option
|
|
2386
2550
|
);
|
|
2387
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2551
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addProduct) != null ? _d : null;
|
|
2388
2552
|
},
|
|
2389
|
-
async
|
|
2553
|
+
async getProduct(input, fetchFields, option) {
|
|
2390
2554
|
var _a, _b, _c, _d;
|
|
2391
2555
|
const res = await client.request(
|
|
2392
|
-
|
|
2556
|
+
productSchema.getProduct(
|
|
2393
2557
|
gqlQueryStringBuilder(
|
|
2394
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2395
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2558
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getProductResponseFields,
|
|
2559
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getProductResponseNestedFields
|
|
2396
2560
|
)
|
|
2397
2561
|
),
|
|
2398
2562
|
input,
|
|
2399
2563
|
option
|
|
2400
2564
|
);
|
|
2401
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2565
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getProduct) != null ? _d : null;
|
|
2402
2566
|
},
|
|
2403
|
-
async
|
|
2567
|
+
async getProducts(input, fetchFields, option) {
|
|
2404
2568
|
var _a, _b, _c, _d;
|
|
2405
2569
|
const res = await client.request(
|
|
2406
|
-
|
|
2570
|
+
productSchema.getProducts(
|
|
2407
2571
|
gqlQueryStringBuilder(
|
|
2408
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2409
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2572
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getProductsResponseFields,
|
|
2573
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getProductsResponseNestedFields
|
|
2410
2574
|
)
|
|
2411
2575
|
),
|
|
2412
2576
|
input,
|
|
2413
2577
|
option
|
|
2414
2578
|
);
|
|
2415
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
|
|
2579
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getProducts) != null ? _d : null;
|
|
2580
|
+
}
|
|
2581
|
+
});
|
|
2582
|
+
|
|
2583
|
+
// src/services/inventory/schema/stock.schema.ts
|
|
2584
|
+
var stockSchema = {
|
|
2585
|
+
getStock: (query) => `
|
|
2586
|
+
query getStock($stock: StockInput!) {
|
|
2587
|
+
stock(stock: $stock) {
|
|
2588
|
+
${query}
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
`,
|
|
2592
|
+
getStocks: (query) => `
|
|
2593
|
+
query getStocks($stock: StockInput, $stockIds: [String], $limit: Int!, $skip: Int!) {
|
|
2594
|
+
stocks(stock: $stock, stockIds: $stockIds, limit: $limit, skip: $skip) {
|
|
2595
|
+
${query}
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
`,
|
|
2599
|
+
addStock: (mutation) => `
|
|
2600
|
+
mutation addStock($stock: StockInput!) {
|
|
2601
|
+
addStock(stock: $stock) {
|
|
2602
|
+
${mutation}
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
`,
|
|
2606
|
+
updateStock: (mutation) => `
|
|
2607
|
+
mutation updateStock($stockId: String!, $stock: StockInput!) {
|
|
2608
|
+
updateStock(stockId: $stockId, stock: $stock) {
|
|
2609
|
+
${mutation}
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
`,
|
|
2613
|
+
removeStock: (mutation) => `
|
|
2614
|
+
mutation removeStock($stockId: String!) {
|
|
2615
|
+
removeStock(stockId: $stockId) {
|
|
2616
|
+
${mutation}
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
`
|
|
2620
|
+
};
|
|
2621
|
+
|
|
2622
|
+
// src/services/inventory/stock.service.ts
|
|
2623
|
+
var createStockService = (client) => ({
|
|
2624
|
+
async updateStock(input, fetchFields, option) {
|
|
2625
|
+
var _a, _b, _c, _d;
|
|
2419
2626
|
const res = await client.request(
|
|
2420
|
-
|
|
2627
|
+
stockSchema.updateStock(
|
|
2421
2628
|
gqlQueryStringBuilder(
|
|
2422
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2629
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateStockResponse,
|
|
2630
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateStockResponseNestedFields
|
|
2423
2631
|
)
|
|
2424
2632
|
),
|
|
2425
2633
|
input,
|
|
2426
2634
|
option
|
|
2427
2635
|
);
|
|
2428
|
-
return (
|
|
2429
|
-
}
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
// src/services/sales/schemas/order.schema.ts
|
|
2433
|
-
var orderSchema = {
|
|
2434
|
-
getOrder: (query) => `
|
|
2435
|
-
query getOrder($order: OrderInput) {
|
|
2436
|
-
getOrder(order: $order){
|
|
2437
|
-
${query}
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
`,
|
|
2441
|
-
getOrders: (query) => `
|
|
2442
|
-
query getOrders($orderIds: [String], $order: OrderInput, $limit: Int, $skip: Int){
|
|
2443
|
-
getOrders(orderIds: $orderIds, order: $order, limit: $limit, skip: $skip){
|
|
2444
|
-
${query}
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
|
-
`
|
|
2448
|
-
};
|
|
2449
|
-
|
|
2450
|
-
// src/services/sales/sale.entity.ts
|
|
2451
|
-
var transactionQuery = [
|
|
2452
|
-
"_id",
|
|
2453
|
-
"amountPaid",
|
|
2454
|
-
"amountTotal",
|
|
2455
|
-
"createdAt",
|
|
2456
|
-
"from",
|
|
2457
|
-
"fromWallet",
|
|
2458
|
-
"isCredit",
|
|
2459
|
-
"paymentDate",
|
|
2460
|
-
"paymentType",
|
|
2461
|
-
"platform",
|
|
2462
|
-
"saleIds",
|
|
2463
|
-
"saleStatus",
|
|
2464
|
-
"sales",
|
|
2465
|
-
"storeId",
|
|
2466
|
-
"to",
|
|
2467
|
-
"toWallet",
|
|
2468
|
-
"txStatus"
|
|
2469
|
-
];
|
|
2470
|
-
var orderQuery = [
|
|
2471
|
-
"_id",
|
|
2472
|
-
"createdAt",
|
|
2473
|
-
"orderStatus",
|
|
2474
|
-
"transactionId",
|
|
2475
|
-
"userId"
|
|
2476
|
-
];
|
|
2477
|
-
var saleQuery = [
|
|
2478
|
-
"_id",
|
|
2479
|
-
"amountTotal",
|
|
2480
|
-
"createdAt",
|
|
2481
|
-
"packageId",
|
|
2482
|
-
"productId",
|
|
2483
|
-
"quantity",
|
|
2484
|
-
"storeId"
|
|
2485
|
-
];
|
|
2486
|
-
|
|
2487
|
-
// src/services/sales/types/order.type.ts
|
|
2488
|
-
var getOrderResponse = ["order"];
|
|
2489
|
-
var getOrderResponseNestedFields = {
|
|
2490
|
-
order: orderQuery
|
|
2491
|
-
};
|
|
2492
|
-
var getOrdersResponse = ["orders"];
|
|
2493
|
-
var getOrdersResponseNestedFields = {
|
|
2494
|
-
orders: orderQuery
|
|
2495
|
-
};
|
|
2496
|
-
|
|
2497
|
-
// src/services/sales/order.service.ts
|
|
2498
|
-
var createOrderService = (client) => ({
|
|
2499
|
-
async getOrder(input, fetchFields, option) {
|
|
2500
|
-
var _a, _b, _c, _d;
|
|
2636
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateStock) != null ? _d : null;
|
|
2637
|
+
},
|
|
2638
|
+
async removeStock(input, fetchFields, option) {
|
|
2639
|
+
var _a, _b, _c;
|
|
2501
2640
|
const res = await client.request(
|
|
2502
|
-
|
|
2641
|
+
stockSchema.removeStock(
|
|
2503
2642
|
gqlQueryStringBuilder(
|
|
2504
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2505
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getOrderResponseNestedFields
|
|
2643
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeStockResponse
|
|
2506
2644
|
)
|
|
2507
2645
|
),
|
|
2508
2646
|
input,
|
|
2509
2647
|
option
|
|
2510
2648
|
);
|
|
2511
|
-
return (
|
|
2649
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeStock) != null ? _c : null;
|
|
2512
2650
|
},
|
|
2513
|
-
async
|
|
2651
|
+
async addStock(input, fetchFields, option) {
|
|
2514
2652
|
var _a, _b, _c, _d;
|
|
2515
2653
|
const res = await client.request(
|
|
2516
|
-
|
|
2654
|
+
stockSchema.addStock(
|
|
2517
2655
|
gqlQueryStringBuilder(
|
|
2518
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2519
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2656
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addStockResponse,
|
|
2657
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addStockResponseNestedFields
|
|
2520
2658
|
)
|
|
2521
2659
|
),
|
|
2522
2660
|
input,
|
|
2523
2661
|
option
|
|
2524
2662
|
);
|
|
2525
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2526
|
-
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
// src/services/sales/schemas/sale.schema.ts
|
|
2530
|
-
var saleSchema = {
|
|
2531
|
-
getSales: (query) => `
|
|
2532
|
-
query getSales($saleIds: [String], $saleFilter: SaleFilterInput, $ShouldGetFromAllStores: Boolean, $dateFilter: DateFilterInput, $limit: Int, $skip: Int) {
|
|
2533
|
-
getSales(saleIds: $saleIds, saleFilter: $saleFilter, ShouldGetFromAllStores: $ShouldGetFromAllStores, dateFilter: $dateFilter, limit: $limit, skip: $skip) {
|
|
2534
|
-
${query}
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
`,
|
|
2538
|
-
updateSale: (query) => `
|
|
2539
|
-
mutation updateSale($saleId: String!, $sale: SaleInput!) {
|
|
2540
|
-
updateSale(saleId: $saleId, sale: $sale) {
|
|
2541
|
-
${query}
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
`
|
|
2545
|
-
};
|
|
2546
|
-
|
|
2547
|
-
// src/services/sales/types/sale.type.ts
|
|
2548
|
-
var getSaleResponse = ["sale"];
|
|
2549
|
-
var _getSaleResponseNestedFields = {
|
|
2550
|
-
..._getProductResponseNestedFields
|
|
2551
|
-
};
|
|
2552
|
-
var getSaleResponseNestedFields = {
|
|
2553
|
-
sale: saleQuery,
|
|
2554
|
-
..._getSaleResponseNestedFields
|
|
2555
|
-
};
|
|
2556
|
-
var getSalesResponse = [
|
|
2557
|
-
"sales",
|
|
2558
|
-
"uniqueProducts"
|
|
2559
|
-
];
|
|
2560
|
-
var getSalesResponseNestedFields = {
|
|
2561
|
-
sales: saleQuery,
|
|
2562
|
-
uniqueProducts: productQuery,
|
|
2563
|
-
..._getSaleResponseNestedFields
|
|
2564
|
-
};
|
|
2565
|
-
var UpdateSaleResponse = ["sale"];
|
|
2566
|
-
var updateSaleResponseNestedFields = getSaleResponseNestedFields;
|
|
2567
|
-
|
|
2568
|
-
// src/services/sales/sale.service.ts
|
|
2569
|
-
var createSaleService = (client) => ({
|
|
2570
|
-
async updateSale(input, fetchFields, option) {
|
|
2663
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addStock) != null ? _d : null;
|
|
2664
|
+
},
|
|
2665
|
+
async getStock(input, fetchFields, option) {
|
|
2571
2666
|
var _a, _b, _c, _d;
|
|
2572
2667
|
const res = await client.request(
|
|
2573
|
-
|
|
2668
|
+
stockSchema.getStock(
|
|
2574
2669
|
gqlQueryStringBuilder(
|
|
2575
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2576
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2670
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStockResponse,
|
|
2671
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStockResponseNestedFields
|
|
2577
2672
|
)
|
|
2578
2673
|
),
|
|
2579
2674
|
input,
|
|
2580
2675
|
option
|
|
2581
2676
|
);
|
|
2582
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2677
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStock) != null ? _d : null;
|
|
2583
2678
|
},
|
|
2584
|
-
async
|
|
2679
|
+
async getStocks(input, fetchFields, option) {
|
|
2585
2680
|
var _a, _b, _c, _d;
|
|
2586
2681
|
const res = await client.request(
|
|
2587
|
-
|
|
2682
|
+
stockSchema.getStocks(
|
|
2588
2683
|
gqlQueryStringBuilder(
|
|
2589
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2590
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2684
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStocksResponse,
|
|
2685
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStocksResponseNestedFields
|
|
2591
2686
|
)
|
|
2592
2687
|
),
|
|
2593
2688
|
input,
|
|
2594
2689
|
option
|
|
2595
2690
|
);
|
|
2596
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2691
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStocks) != null ? _d : null;
|
|
2597
2692
|
}
|
|
2598
2693
|
});
|
|
2599
2694
|
|
|
2600
|
-
// src/services/
|
|
2601
|
-
var
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2644
|
-
"transactions",
|
|
2645
|
-
"uniqueProducts"
|
|
2646
|
-
];
|
|
2647
|
-
var _getTransactionsResponseNestedFields = {
|
|
2648
|
-
sales: saleQuery,
|
|
2649
|
-
uniqueProducts: productNameQuery,
|
|
2650
|
-
..._getProductResponseNestedFields
|
|
2651
|
-
};
|
|
2652
|
-
var getTransactionsResponseNestedFields = {
|
|
2653
|
-
transactions: transactionQuery,
|
|
2654
|
-
..._getTransactionsResponseNestedFields
|
|
2695
|
+
// src/services/inventory/schema/store.schema.ts
|
|
2696
|
+
var storeSchema = {
|
|
2697
|
+
getStoreCount: (query) => `
|
|
2698
|
+
query getStoreCount($store: StoreInput!) {
|
|
2699
|
+
getStoreCount(store: $store) {
|
|
2700
|
+
${query}
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
`,
|
|
2704
|
+
getStore: (query) => `
|
|
2705
|
+
query getStore($store: StoreInput!) {
|
|
2706
|
+
getStore(store: $store) {
|
|
2707
|
+
${query}
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
`,
|
|
2711
|
+
getStores: (query) => `
|
|
2712
|
+
query getStores($search: String, $store: StoreInput, $storeIds: [String], $limit: Int, $skip: Int) {
|
|
2713
|
+
getStores(search: $search, store: $store, storeIds: $storeIds, limit: $limit, skip: $skip) {
|
|
2714
|
+
${query}
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2717
|
+
`,
|
|
2718
|
+
createStore: (mutation) => `
|
|
2719
|
+
mutation createStore($store: StoreInput) {
|
|
2720
|
+
createStore(store: $store) {
|
|
2721
|
+
${mutation}
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
2724
|
+
`,
|
|
2725
|
+
updateStore: (mutation) => `
|
|
2726
|
+
mutation updateStore($storeId: String, $store: StoreInput) {
|
|
2727
|
+
updateStore(storeId: $storeId, store: $store) {
|
|
2728
|
+
${mutation}
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
`,
|
|
2732
|
+
deleteStore: (mutation) => `
|
|
2733
|
+
mutation deleteStore($storeId: String) {
|
|
2734
|
+
deleteStore(storeId: $storeId) {
|
|
2735
|
+
${mutation}
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
`
|
|
2655
2739
|
};
|
|
2656
|
-
var addTransactionResponse = getTransactionResponse;
|
|
2657
|
-
var addTransactionResponseNestedFields = getTransactionResponseNestedFields;
|
|
2658
|
-
var updateTransactionResponse = getTransactionResponse;
|
|
2659
|
-
var updateTransactionResponseNestedFields = getTransactionResponseNestedFields;
|
|
2660
2740
|
|
|
2661
|
-
// src/services/
|
|
2662
|
-
var
|
|
2663
|
-
async
|
|
2741
|
+
// src/services/inventory/store.service.ts
|
|
2742
|
+
var createStoreService = (client) => ({
|
|
2743
|
+
async updateStore(input, fetchFields, option) {
|
|
2664
2744
|
var _a, _b, _c, _d;
|
|
2665
2745
|
const res = await client.request(
|
|
2666
|
-
|
|
2746
|
+
storeSchema.updateStore(
|
|
2667
2747
|
gqlQueryStringBuilder(
|
|
2668
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2669
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2748
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateStoreResponse,
|
|
2749
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateStoreResponseNestedFields
|
|
2670
2750
|
)
|
|
2671
2751
|
),
|
|
2672
2752
|
input,
|
|
2673
2753
|
option
|
|
2674
2754
|
);
|
|
2675
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2755
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateStore) != null ? _d : null;
|
|
2676
2756
|
},
|
|
2677
|
-
async
|
|
2678
|
-
var _a, _b, _c
|
|
2757
|
+
async removeStore(input, fetchFields, option) {
|
|
2758
|
+
var _a, _b, _c;
|
|
2679
2759
|
const res = await client.request(
|
|
2680
|
-
|
|
2760
|
+
storeSchema.deleteStore(
|
|
2681
2761
|
gqlQueryStringBuilder(
|
|
2682
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2683
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addTransactionResponseNestedFields
|
|
2762
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeStoreResponse
|
|
2684
2763
|
)
|
|
2685
2764
|
),
|
|
2686
2765
|
input,
|
|
2687
2766
|
option
|
|
2688
2767
|
);
|
|
2689
|
-
return (
|
|
2768
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.deleteStore) != null ? _c : null;
|
|
2690
2769
|
},
|
|
2691
|
-
async
|
|
2770
|
+
async addStore(input, fetchFields, option) {
|
|
2692
2771
|
var _a, _b, _c, _d;
|
|
2693
2772
|
const res = await client.request(
|
|
2694
|
-
|
|
2773
|
+
storeSchema.createStore(
|
|
2695
2774
|
gqlQueryStringBuilder(
|
|
2696
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2697
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
2775
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addStoreResponse,
|
|
2776
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addStoreResponseNestedFields
|
|
2698
2777
|
)
|
|
2699
2778
|
),
|
|
2700
2779
|
input,
|
|
2701
2780
|
option
|
|
2702
2781
|
);
|
|
2703
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
2782
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.createStore) != null ? _d : null;
|
|
2704
2783
|
},
|
|
2705
|
-
async
|
|
2706
|
-
var _a, _b, _c
|
|
2784
|
+
async getStoreCount(input, fetchFields, option) {
|
|
2785
|
+
var _a, _b, _c;
|
|
2707
2786
|
const res = await client.request(
|
|
2708
|
-
|
|
2787
|
+
storeSchema.getStoreCount(
|
|
2709
2788
|
gqlQueryStringBuilder(
|
|
2710
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2711
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionsResponseNestedFields
|
|
2789
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoreCountResponse
|
|
2712
2790
|
)
|
|
2713
2791
|
),
|
|
2714
2792
|
input,
|
|
2715
2793
|
option
|
|
2716
2794
|
);
|
|
2717
|
-
return (
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
// src/services/subscription/schemas/paystack.schema.ts
|
|
2722
|
-
var paystackSchema = {
|
|
2723
|
-
paystackInitializeSubscription: (query) => `
|
|
2724
|
-
mutation paystackInitializeSubscription($userId: String!, $planId: String!, $subscriptionFrequencyType: SubscriptionFrequencyTypeEnum!) {
|
|
2725
|
-
paystackInitializeSubscription(userId: $userId, planId: $planId, subscriptionFrequencyType: $subscriptionFrequencyType) {
|
|
2726
|
-
${query}
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
`,
|
|
2730
|
-
paystackInitializePayment: (query) => `
|
|
2731
|
-
mutation paystackInitializePayment($userId: String!) {
|
|
2732
|
-
paystackInitializePayment(userId: $userId) {
|
|
2733
|
-
${query}
|
|
2734
|
-
}
|
|
2735
|
-
}
|
|
2736
|
-
`
|
|
2737
|
-
};
|
|
2738
|
-
|
|
2739
|
-
// src/services/subscription/types/paystack.ts
|
|
2740
|
-
var paystackInitializePaymentResponse = [
|
|
2741
|
-
"accessCode",
|
|
2742
|
-
"authorizationUrl",
|
|
2743
|
-
"reference"
|
|
2744
|
-
];
|
|
2745
|
-
var paystackInitializeSubscriptionResponse = paystackInitializePaymentResponse;
|
|
2746
|
-
|
|
2747
|
-
// src/services/subscription/paystack.service.ts
|
|
2748
|
-
var createPaystackService = (client) => ({
|
|
2749
|
-
async paystackInitializeSubscription(input, fetchFields, option) {
|
|
2750
|
-
var _a, _b, _c;
|
|
2795
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.getStoreCount) != null ? _c : null;
|
|
2796
|
+
},
|
|
2797
|
+
async getStore(input, fetchFields, option) {
|
|
2798
|
+
var _a, _b, _c, _d;
|
|
2751
2799
|
const res = await client.request(
|
|
2752
|
-
|
|
2800
|
+
storeSchema.getStore(
|
|
2753
2801
|
gqlQueryStringBuilder(
|
|
2754
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2802
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoreResponse,
|
|
2803
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoreResponseNestedFields
|
|
2755
2804
|
)
|
|
2756
2805
|
),
|
|
2757
2806
|
input,
|
|
2758
2807
|
option
|
|
2759
2808
|
);
|
|
2760
|
-
return (
|
|
2809
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStore) != null ? _d : null;
|
|
2761
2810
|
},
|
|
2762
|
-
async
|
|
2763
|
-
var _a, _b;
|
|
2811
|
+
async getStores(input, fetchFields, option) {
|
|
2812
|
+
var _a, _b, _c, _d;
|
|
2764
2813
|
const res = await client.request(
|
|
2765
|
-
|
|
2814
|
+
storeSchema.getStores(
|
|
2766
2815
|
gqlQueryStringBuilder(
|
|
2767
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2816
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoresResponse,
|
|
2817
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoresResponseNestedFields
|
|
2768
2818
|
)
|
|
2769
2819
|
),
|
|
2770
2820
|
input,
|
|
2771
2821
|
option
|
|
2772
2822
|
);
|
|
2773
|
-
return (
|
|
2823
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStores) != null ? _d : null;
|
|
2774
2824
|
}
|
|
2775
2825
|
});
|
|
2776
2826
|
|
|
2777
|
-
// src/services/
|
|
2778
|
-
var
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
];
|
|
2816
|
-
|
|
2817
|
-
// src/services/subscription/types/subscription-plan-feature.type.ts
|
|
2818
|
-
var getSubscriptionPlanFeatureResponse = [
|
|
2819
|
-
"subscriptionPlanFeature"
|
|
2820
|
-
];
|
|
2821
|
-
var _getSubscriptionPlanFeatureResponseNestedFields = {};
|
|
2822
|
-
var getSubscriptionPlanFeatureResponseNestedFields = {
|
|
2823
|
-
..._getSubscriptionPlanFeatureResponseNestedFields,
|
|
2824
|
-
subscriptionPlanFeature: subscriptionPlanFeatureQuery
|
|
2825
|
-
};
|
|
2826
|
-
var getSubscriptionPlanFeaturesResponse = [
|
|
2827
|
-
"subscriptionPlanFeatures",
|
|
2828
|
-
"total"
|
|
2829
|
-
];
|
|
2830
|
-
var getSubscriptionPlanFeaturesResponseNestedFields = {
|
|
2831
|
-
..._getSubscriptionPlanFeatureResponseNestedFields,
|
|
2832
|
-
subscriptionPlanFeatures: subscriptionPlanFeatureQuery
|
|
2833
|
-
};
|
|
2834
|
-
var addSubscriptionPlanFeatureResponse = getSubscriptionPlanFeatureResponse;
|
|
2835
|
-
var addSubscriptionPlanFeatureResponseNestedFields = getSubscriptionPlanFeatureResponseNestedFields;
|
|
2836
|
-
var updateSubscriptionPlanFeatureResponse = getSubscriptionPlanFeatureResponse;
|
|
2837
|
-
var updateSubscriptionPlanFeatureResponseNestedFields = getSubscriptionPlanFeatureResponseNestedFields;
|
|
2838
|
-
var removeSubscriptionPlanFeatureResponse = [
|
|
2839
|
-
"subscriptionPlanFeatureId"
|
|
2840
|
-
];
|
|
2841
|
-
|
|
2842
|
-
// src/services/subscription/types/subscription-plan.type.ts
|
|
2843
|
-
var getSubscriptionPlanResponse = [
|
|
2844
|
-
"subscriptionPlan"
|
|
2845
|
-
];
|
|
2846
|
-
var _getSubscriptionPlanResponseNestedFields = {
|
|
2847
|
-
features: subscriptionPlanFeatureQuery
|
|
2848
|
-
};
|
|
2849
|
-
var getSubscriptionPlanResponseNestedFields = {
|
|
2850
|
-
..._getSubscriptionPlanResponseNestedFields,
|
|
2851
|
-
subscriptionPlan: subscriptionPlanQuery
|
|
2852
|
-
};
|
|
2853
|
-
var getSubscriptionPlansResponse = [
|
|
2854
|
-
"subscriptionPlans",
|
|
2855
|
-
"total"
|
|
2856
|
-
];
|
|
2857
|
-
var getSubscriptionPlansResponseNestedFields = {
|
|
2858
|
-
..._getSubscriptionPlanResponseNestedFields,
|
|
2859
|
-
subscriptionPlans: subscriptionPlanQuery
|
|
2860
|
-
};
|
|
2861
|
-
var addSubscriptionPlanResponse = getSubscriptionPlanResponse;
|
|
2862
|
-
var addSubscriptionPlanResponseNestedFields = getSubscriptionPlanResponseNestedFields;
|
|
2863
|
-
var updateSubscriptionPlanResponse = getSubscriptionPlanResponse;
|
|
2864
|
-
var updateSubscriptionPlanResponseNestedFields = getSubscriptionPlanResponseNestedFields;
|
|
2865
|
-
var removeSubscriptionPlanResponse = [
|
|
2866
|
-
"subscriptionPlanId"
|
|
2867
|
-
];
|
|
2868
|
-
|
|
2869
|
-
// src/services/subscription/types/subscription.type.ts
|
|
2870
|
-
var getSubscriptionResponse = [
|
|
2871
|
-
"subscription"
|
|
2872
|
-
];
|
|
2873
|
-
var _getSubscriptionResponseNestedFields = {};
|
|
2874
|
-
var getSubscriptionResponseNestedFields = {
|
|
2875
|
-
..._getSubscriptionResponseNestedFields,
|
|
2876
|
-
subscription: subscriptionQuery
|
|
2877
|
-
};
|
|
2878
|
-
var getSubscriptionsResponse = [
|
|
2879
|
-
"subscriptions",
|
|
2880
|
-
"total"
|
|
2881
|
-
];
|
|
2882
|
-
var getSubscriptionsResponseNestedFields = {
|
|
2883
|
-
..._getSubscriptionResponseNestedFields,
|
|
2884
|
-
subscriptions: subscriptionQuery
|
|
2827
|
+
// src/services/inventory/schema/store-category.schema.ts
|
|
2828
|
+
var storeCategorySchema = {
|
|
2829
|
+
createStoreCategory: (query) => `
|
|
2830
|
+
mutation createStoreCategory($storeCategory: StoreCategoryInput!) {
|
|
2831
|
+
createStoreCategory(storeCategory: $storeCategory) {
|
|
2832
|
+
${query}
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
`,
|
|
2836
|
+
updateStoreCategory: (query) => `
|
|
2837
|
+
mutation updateStoreCategory($storeCategoryId: String!, $storeCategory: StoreCategoryInput!) {
|
|
2838
|
+
updateStoreCategory(storeCategoryId: $storeCategoryId, storeCategory: $storeCategory) {
|
|
2839
|
+
${query}
|
|
2840
|
+
}
|
|
2841
|
+
}
|
|
2842
|
+
`,
|
|
2843
|
+
removeStoreCategory: (query) => `
|
|
2844
|
+
mutation removeStoreCategory($storeCategoryId: String!) {
|
|
2845
|
+
removeStoreCategory(storeCategoryId: $storeCategoryId) {
|
|
2846
|
+
${query}
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
`,
|
|
2850
|
+
// get
|
|
2851
|
+
getStoreCategory: (query) => `
|
|
2852
|
+
query getStoreCategory($storeCategory: StoreCategoryInput!) {
|
|
2853
|
+
getStoreCategory(storeCategory: $storeCategory) {
|
|
2854
|
+
${query}
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
`,
|
|
2858
|
+
getStoreCategories: (query) => `
|
|
2859
|
+
query getStoreCategories($search: String, $storeCategory: StoreCategoryInput, $storeCategoryIds: [String], $limit: Int!, $skip: Int!) {
|
|
2860
|
+
getStoreCategories(search: $search, storeCategory: $storeCategory, storeCategoryIds: $storeCategoryIds, limit: $limit, skip: $skip) {
|
|
2861
|
+
${query}
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
`
|
|
2885
2865
|
};
|
|
2886
|
-
var addSubscriptionResponse = getSubscriptionResponse;
|
|
2887
|
-
var addSubscriptionResponseNestedFields = getSubscriptionResponseNestedFields;
|
|
2888
|
-
var updateSubscriptionResponse = getSubscriptionResponse;
|
|
2889
|
-
var updateSubscriptionResponseNestedFields = getSubscriptionResponseNestedFields;
|
|
2890
|
-
var removeSubscriptionResponse = [
|
|
2891
|
-
"subscriptionId"
|
|
2892
|
-
];
|
|
2893
2866
|
|
|
2894
|
-
// src/services/
|
|
2895
|
-
var
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2867
|
+
// src/services/inventory/store-category.service.ts
|
|
2868
|
+
var createStoreCategoryService = (client) => ({
|
|
2869
|
+
async getStoreCategories(input, fetchFields, option) {
|
|
2870
|
+
var _a, _b, _c, _d;
|
|
2871
|
+
const res = await client.request(
|
|
2872
|
+
storeCategorySchema.getStoreCategories(
|
|
2873
|
+
gqlQueryStringBuilder(
|
|
2874
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoreCategoriesResponseFields,
|
|
2875
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoreCategoriesResponseNestedFields
|
|
2876
|
+
)
|
|
2877
|
+
),
|
|
2878
|
+
input,
|
|
2879
|
+
option
|
|
2880
|
+
);
|
|
2881
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStoreCategories) != null ? _d : null;
|
|
2882
|
+
},
|
|
2883
|
+
async getStoreCategory(input, fetchFields, option) {
|
|
2884
|
+
var _a, _b, _c, _d;
|
|
2885
|
+
const res = await client.request(
|
|
2886
|
+
storeCategorySchema.getStoreCategory(
|
|
2887
|
+
gqlQueryStringBuilder(
|
|
2888
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoreCategoryResponseFields,
|
|
2889
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoreCategoryResponseNestedFields
|
|
2890
|
+
)
|
|
2891
|
+
),
|
|
2892
|
+
input,
|
|
2893
|
+
option
|
|
2894
|
+
);
|
|
2895
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStoreCategory) != null ? _d : null;
|
|
2896
|
+
},
|
|
2897
|
+
async updateStoreCategory(input, fetchFields, option) {
|
|
2898
|
+
var _a, _b, _c, _d;
|
|
2899
|
+
const res = await client.request(
|
|
2900
|
+
storeCategorySchema.updateStoreCategory(
|
|
2901
|
+
gqlQueryStringBuilder(
|
|
2902
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateStoreCategoryResponseFields,
|
|
2903
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateStoreCategoryResponseNestedFields
|
|
2904
|
+
)
|
|
2905
|
+
),
|
|
2906
|
+
input,
|
|
2907
|
+
option
|
|
2908
|
+
);
|
|
2909
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateStoreCategory) != null ? _d : null;
|
|
2910
|
+
},
|
|
2911
|
+
async createStoreCategory(input, fetchFields, option) {
|
|
2912
|
+
var _a, _b, _c, _d;
|
|
2913
|
+
const res = await client.request(
|
|
2914
|
+
storeCategorySchema.createStoreCategory(
|
|
2915
|
+
gqlQueryStringBuilder(
|
|
2916
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : createStoreCategoryResponseFields,
|
|
2917
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : createStoreCategoryResponseNestedFields
|
|
2918
|
+
)
|
|
2919
|
+
),
|
|
2920
|
+
input,
|
|
2921
|
+
option
|
|
2922
|
+
);
|
|
2923
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.createStoreCategory) != null ? _d : null;
|
|
2924
|
+
},
|
|
2925
|
+
async removeStoreCategory(input, fetchFields, option) {
|
|
2926
|
+
var _a, _b, _c;
|
|
2927
|
+
const res = await client.request(
|
|
2928
|
+
storeCategorySchema.removeStoreCategory(
|
|
2929
|
+
gqlQueryStringBuilder(
|
|
2930
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeStoreCategoryResponseFields
|
|
2931
|
+
)
|
|
2932
|
+
),
|
|
2933
|
+
input,
|
|
2934
|
+
option
|
|
2935
|
+
);
|
|
2936
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeStoreCategory) != null ? _c : null;
|
|
2937
|
+
}
|
|
2938
|
+
});
|
|
2939
|
+
|
|
2940
|
+
// src/services/inventory/schema/store-category-product.schema.ts
|
|
2941
|
+
var storeCategoryProductSchema = {
|
|
2942
|
+
createStoreCategoryProduct: (query) => `
|
|
2943
|
+
mutation createStoreCategoryProduct($storeCategoryProduct: StoreCategoryProductInput!) {
|
|
2944
|
+
createStoreCategoryProduct(storeCategoryProduct: $storeCategoryProduct) {
|
|
2899
2945
|
${query}
|
|
2900
2946
|
}
|
|
2901
2947
|
}
|
|
2902
2948
|
`,
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2949
|
+
updateStoreCategoryProduct: (query) => `
|
|
2950
|
+
mutation updateStoreCategoryProduct($storeCategoryProductId: String!, $storeCategoryProduct: StoreCategoryProductInput!) {
|
|
2951
|
+
updateStoreCategoryProduct(storeCategoryProductId: $storeCategoryProductId, storeCategoryProduct: $storeCategoryProduct) {
|
|
2906
2952
|
${query}
|
|
2907
2953
|
}
|
|
2908
2954
|
}
|
|
2909
2955
|
`,
|
|
2910
|
-
|
|
2911
|
-
mutation
|
|
2912
|
-
|
|
2956
|
+
removeStoreCategoryProduct: (query) => `
|
|
2957
|
+
mutation removeStoreCategoryProduct($storeCategoryProductId: String!) {
|
|
2958
|
+
removeStoreCategoryProduct(storeCategoryProductId: $storeCategoryProductId) {
|
|
2913
2959
|
${query}
|
|
2914
2960
|
}
|
|
2915
2961
|
}
|
|
2916
2962
|
`,
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2963
|
+
// get
|
|
2964
|
+
getStoreCategoryProduct: (query) => `
|
|
2965
|
+
query getStoreCategoryProduct($storeCategoryProduct: StoreCategoryProductInput!) {
|
|
2966
|
+
getStoreCategoryProduct(storeCategoryProduct: $storeCategoryProduct) {
|
|
2920
2967
|
${query}
|
|
2921
2968
|
}
|
|
2922
2969
|
}
|
|
2923
2970
|
`,
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2971
|
+
getStoreCategoryProducts: (query) => `
|
|
2972
|
+
query getStoreCategoryProducts($search: String, $storeCategoryProduct: StoreCategoryProductInput, $storeCategoryProductIds: [String], $limit: Int!, $skip: Int!) {
|
|
2973
|
+
getStoreCategoryProducts(search: $search, storeCategoryProduct: $storeCategoryProduct, storeCategoryProductIds: $storeCategoryProductIds, limit: $limit, skip: $skip) {
|
|
2927
2974
|
${query}
|
|
2928
2975
|
}
|
|
2929
2976
|
}
|
|
2930
2977
|
`
|
|
2931
2978
|
};
|
|
2932
2979
|
|
|
2933
|
-
// src/services/
|
|
2934
|
-
var
|
|
2935
|
-
async
|
|
2936
|
-
var _a, _b, _c;
|
|
2980
|
+
// src/services/inventory/store-category-product.service.ts
|
|
2981
|
+
var createStoreCategoryProductService = (client) => ({
|
|
2982
|
+
async getStoreCategoryProducts(input, fetchFields, option) {
|
|
2983
|
+
var _a, _b, _c, _d;
|
|
2937
2984
|
const res = await client.request(
|
|
2938
|
-
|
|
2985
|
+
storeCategoryProductSchema.getStoreCategoryProducts(
|
|
2939
2986
|
gqlQueryStringBuilder(
|
|
2940
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2987
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoreCategoryProductsResponseFields,
|
|
2988
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoreCategoryProductsResponseNestedFields
|
|
2941
2989
|
)
|
|
2942
2990
|
),
|
|
2943
2991
|
input,
|
|
2944
2992
|
option
|
|
2945
2993
|
);
|
|
2946
|
-
return (
|
|
2994
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStoreCategoryProducts) != null ? _d : null;
|
|
2947
2995
|
},
|
|
2948
|
-
async
|
|
2996
|
+
async getStoreCategoryProduct(input, fetchFields, option) {
|
|
2949
2997
|
var _a, _b, _c, _d;
|
|
2950
2998
|
const res = await client.request(
|
|
2951
|
-
|
|
2999
|
+
storeCategoryProductSchema.getStoreCategoryProduct(
|
|
2952
3000
|
gqlQueryStringBuilder(
|
|
2953
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2954
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3001
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getStoreCategoryProductResponseFields,
|
|
3002
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getStoreCategoryProductResponseNestedFields
|
|
2955
3003
|
)
|
|
2956
3004
|
),
|
|
2957
3005
|
input,
|
|
2958
3006
|
option
|
|
2959
3007
|
);
|
|
2960
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3008
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getStoreCategoryProduct) != null ? _d : null;
|
|
2961
3009
|
},
|
|
2962
|
-
async
|
|
3010
|
+
async updateStoreCategoryProduct(input, fetchFields, option) {
|
|
2963
3011
|
var _a, _b, _c, _d;
|
|
2964
3012
|
const res = await client.request(
|
|
2965
|
-
|
|
3013
|
+
storeCategoryProductSchema.updateStoreCategoryProduct(
|
|
2966
3014
|
gqlQueryStringBuilder(
|
|
2967
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2968
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3015
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateStoreCategoryProductResponseFields,
|
|
3016
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateStoreCategoryProductResponseNestedFields
|
|
2969
3017
|
)
|
|
2970
3018
|
),
|
|
2971
3019
|
input,
|
|
2972
3020
|
option
|
|
2973
3021
|
);
|
|
2974
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3022
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateStoreCategoryProduct) != null ? _d : null;
|
|
2975
3023
|
},
|
|
2976
|
-
async
|
|
3024
|
+
async createStoreCategoryProduct(input, fetchFields, option) {
|
|
2977
3025
|
var _a, _b, _c, _d;
|
|
2978
3026
|
const res = await client.request(
|
|
2979
|
-
|
|
3027
|
+
storeCategoryProductSchema.createStoreCategoryProduct(
|
|
2980
3028
|
gqlQueryStringBuilder(
|
|
2981
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2982
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3029
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : createStoreCategoryProductResponseFields,
|
|
3030
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : createStoreCategoryProductResponseNestedFields
|
|
3031
|
+
)
|
|
3032
|
+
),
|
|
3033
|
+
input,
|
|
3034
|
+
option
|
|
3035
|
+
);
|
|
3036
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.createStoreCategoryProduct) != null ? _d : null;
|
|
3037
|
+
},
|
|
3038
|
+
async removeStoreCategoryProduct(input, fetchFields, option) {
|
|
3039
|
+
var _a, _b, _c;
|
|
3040
|
+
const res = await client.request(
|
|
3041
|
+
storeCategoryProductSchema.removeStoreCategoryProduct(
|
|
3042
|
+
gqlQueryStringBuilder(
|
|
3043
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : removeStoreCategoryProductResponseFields
|
|
3044
|
+
)
|
|
3045
|
+
),
|
|
3046
|
+
input,
|
|
3047
|
+
option
|
|
3048
|
+
);
|
|
3049
|
+
return (_c = (_b = res.data) == null ? void 0 : _b.removeStoreCategoryProduct) != null ? _c : null;
|
|
3050
|
+
}
|
|
3051
|
+
});
|
|
3052
|
+
|
|
3053
|
+
// src/services/sales/schemas/order.schema.ts
|
|
3054
|
+
var orderSchema = {
|
|
3055
|
+
getOrder: (query) => `
|
|
3056
|
+
query getOrder($order: OrderInput) {
|
|
3057
|
+
getOrder(order: $order){
|
|
3058
|
+
${query}
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
`,
|
|
3062
|
+
getOrders: (query) => `
|
|
3063
|
+
query getOrders($orderIds: [String], $order: OrderInput, $limit: Int, $skip: Int){
|
|
3064
|
+
getOrders(orderIds: $orderIds, order: $order, limit: $limit, skip: $skip){
|
|
3065
|
+
${query}
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
`
|
|
3069
|
+
};
|
|
3070
|
+
|
|
3071
|
+
// src/services/sales/sale.entity.ts
|
|
3072
|
+
var transactionQuery = [
|
|
3073
|
+
"_id",
|
|
3074
|
+
"amountPaid",
|
|
3075
|
+
"amountTotal",
|
|
3076
|
+
"createdAt",
|
|
3077
|
+
"from",
|
|
3078
|
+
"fromWallet",
|
|
3079
|
+
"isCredit",
|
|
3080
|
+
"paymentDate",
|
|
3081
|
+
"paymentType",
|
|
3082
|
+
"platform",
|
|
3083
|
+
"saleIds",
|
|
3084
|
+
"saleStatus",
|
|
3085
|
+
"sales",
|
|
3086
|
+
"storeId",
|
|
3087
|
+
"to",
|
|
3088
|
+
"toWallet",
|
|
3089
|
+
"txStatus"
|
|
3090
|
+
];
|
|
3091
|
+
var orderQuery = [
|
|
3092
|
+
"_id",
|
|
3093
|
+
"createdAt",
|
|
3094
|
+
"orderStatus",
|
|
3095
|
+
"transactionId",
|
|
3096
|
+
"userId"
|
|
3097
|
+
];
|
|
3098
|
+
var saleQuery = [
|
|
3099
|
+
"_id",
|
|
3100
|
+
"amountTotal",
|
|
3101
|
+
"createdAt",
|
|
3102
|
+
"packageId",
|
|
3103
|
+
"productId",
|
|
3104
|
+
"quantity",
|
|
3105
|
+
"storeId"
|
|
3106
|
+
];
|
|
3107
|
+
|
|
3108
|
+
// src/services/sales/types/order.type.ts
|
|
3109
|
+
var getOrderResponse = ["order"];
|
|
3110
|
+
var getOrderResponseNestedFields = {
|
|
3111
|
+
order: orderQuery
|
|
3112
|
+
};
|
|
3113
|
+
var getOrdersResponse = ["orders"];
|
|
3114
|
+
var getOrdersResponseNestedFields = {
|
|
3115
|
+
orders: orderQuery
|
|
3116
|
+
};
|
|
3117
|
+
|
|
3118
|
+
// src/services/sales/order.service.ts
|
|
3119
|
+
var createOrderService = (client) => ({
|
|
3120
|
+
async getOrder(input, fetchFields, option) {
|
|
3121
|
+
var _a, _b, _c, _d;
|
|
3122
|
+
const res = await client.request(
|
|
3123
|
+
orderSchema.getOrder(
|
|
3124
|
+
gqlQueryStringBuilder(
|
|
3125
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getOrderResponse,
|
|
3126
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getOrderResponseNestedFields
|
|
2983
3127
|
)
|
|
2984
3128
|
),
|
|
2985
3129
|
input,
|
|
2986
3130
|
option
|
|
2987
3131
|
);
|
|
2988
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3132
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getOrder) != null ? _d : null;
|
|
2989
3133
|
},
|
|
2990
|
-
async
|
|
3134
|
+
async getOrders(input, fetchFields, option) {
|
|
2991
3135
|
var _a, _b, _c, _d;
|
|
2992
3136
|
const res = await client.request(
|
|
2993
|
-
|
|
3137
|
+
orderSchema.getOrders(
|
|
2994
3138
|
gqlQueryStringBuilder(
|
|
2995
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
2996
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3139
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getOrdersResponse,
|
|
3140
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getOrdersResponseNestedFields
|
|
2997
3141
|
)
|
|
2998
3142
|
),
|
|
2999
3143
|
input,
|
|
3000
3144
|
option
|
|
3001
3145
|
);
|
|
3002
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3146
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getOrders) != null ? _d : null;
|
|
3003
3147
|
}
|
|
3004
3148
|
});
|
|
3005
3149
|
|
|
3006
|
-
// src/services/
|
|
3007
|
-
var
|
|
3008
|
-
|
|
3009
|
-
query
|
|
3010
|
-
|
|
3011
|
-
${query}
|
|
3012
|
-
}
|
|
3013
|
-
}
|
|
3014
|
-
`,
|
|
3015
|
-
getSubscriptionPlans: (query) => `
|
|
3016
|
-
query getSubscriptionPlans($search: String, $subscriptionPlanIds: [String], $subscriptionPlan: SubscriptionPlanInput, $limit: Int!, $skip: Int!) {
|
|
3017
|
-
getSubscriptionPlans(search: $search, subscriptionPlanIds: $subscriptionPlanIds, subscriptionPlan: $subscriptionPlan, limit: $limit, skip: $skip) {
|
|
3018
|
-
${query}
|
|
3019
|
-
}
|
|
3020
|
-
}
|
|
3021
|
-
`,
|
|
3022
|
-
addSubscriptionPlan: (query) => `
|
|
3023
|
-
mutation addSubscriptionPlan($subscriptionPlan: SubscriptionPlanInput!) {
|
|
3024
|
-
addSubscriptionPlan(subscriptionPlan: $subscriptionPlan) {
|
|
3025
|
-
${query}
|
|
3026
|
-
}
|
|
3027
|
-
}
|
|
3028
|
-
`,
|
|
3029
|
-
updateSubscriptionPlan: (query) => `
|
|
3030
|
-
mutation updateSubscriptionPlan($subscriptionPlanId: String!, $subscriptionPlan: SubscriptionPlanInput!) {
|
|
3031
|
-
updateSubscriptionPlan(subscriptionPlanId: $subscriptionPlanId, subscriptionPlan: $subscriptionPlan) {
|
|
3150
|
+
// src/services/sales/schemas/sale.schema.ts
|
|
3151
|
+
var saleSchema = {
|
|
3152
|
+
getSales: (query) => `
|
|
3153
|
+
query getSales($saleIds: [String], $saleFilter: SaleFilterInput, $ShouldGetFromAllStores: Boolean, $dateFilter: DateFilterInput, $limit: Int, $skip: Int) {
|
|
3154
|
+
getSales(saleIds: $saleIds, saleFilter: $saleFilter, ShouldGetFromAllStores: $ShouldGetFromAllStores, dateFilter: $dateFilter, limit: $limit, skip: $skip) {
|
|
3032
3155
|
${query}
|
|
3033
3156
|
}
|
|
3034
3157
|
}
|
|
3035
3158
|
`,
|
|
3036
|
-
|
|
3037
|
-
mutation
|
|
3038
|
-
|
|
3159
|
+
updateSale: (query) => `
|
|
3160
|
+
mutation updateSale($saleId: String!, $sale: SaleInput!) {
|
|
3161
|
+
updateSale(saleId: $saleId, sale: $sale) {
|
|
3039
3162
|
${query}
|
|
3040
3163
|
}
|
|
3041
3164
|
}
|
|
3042
3165
|
`
|
|
3043
3166
|
};
|
|
3044
3167
|
|
|
3045
|
-
// src/services/
|
|
3046
|
-
var
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
input,
|
|
3070
|
-
option
|
|
3071
|
-
);
|
|
3072
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.updateSubscriptionPlan) != null ? _d : null;
|
|
3073
|
-
},
|
|
3074
|
-
async addSubscriptionPlan(input, fetchFields, option) {
|
|
3075
|
-
var _a, _b, _c, _d;
|
|
3076
|
-
const res = await client.request(
|
|
3077
|
-
subscriptionPlanSchema.addSubscriptionPlan(
|
|
3078
|
-
gqlQueryStringBuilder(
|
|
3079
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addSubscriptionPlanResponse,
|
|
3080
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addSubscriptionPlanResponseNestedFields
|
|
3081
|
-
)
|
|
3082
|
-
),
|
|
3083
|
-
input,
|
|
3084
|
-
option
|
|
3085
|
-
);
|
|
3086
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.addSubscriptionPlan) != null ? _d : null;
|
|
3087
|
-
},
|
|
3088
|
-
async getSubscriptionPlan(input, fetchFields, option) {
|
|
3168
|
+
// src/services/sales/types/sale.type.ts
|
|
3169
|
+
var getSaleResponse = ["sale"];
|
|
3170
|
+
var _getSaleResponseNestedFields = {
|
|
3171
|
+
..._getProductResponseNestedFields
|
|
3172
|
+
};
|
|
3173
|
+
var getSaleResponseNestedFields = {
|
|
3174
|
+
sale: saleQuery,
|
|
3175
|
+
..._getSaleResponseNestedFields
|
|
3176
|
+
};
|
|
3177
|
+
var getSalesResponse = [
|
|
3178
|
+
"sales",
|
|
3179
|
+
"uniqueProducts"
|
|
3180
|
+
];
|
|
3181
|
+
var getSalesResponseNestedFields = {
|
|
3182
|
+
sales: saleQuery,
|
|
3183
|
+
uniqueProducts: productQuery,
|
|
3184
|
+
..._getSaleResponseNestedFields
|
|
3185
|
+
};
|
|
3186
|
+
var UpdateSaleResponse = ["sale"];
|
|
3187
|
+
var updateSaleResponseNestedFields = getSaleResponseNestedFields;
|
|
3188
|
+
|
|
3189
|
+
// src/services/sales/sale.service.ts
|
|
3190
|
+
var createSaleService = (client) => ({
|
|
3191
|
+
async updateSale(input, fetchFields, option) {
|
|
3089
3192
|
var _a, _b, _c, _d;
|
|
3090
3193
|
const res = await client.request(
|
|
3091
|
-
|
|
3194
|
+
saleSchema.updateSale(
|
|
3092
3195
|
gqlQueryStringBuilder(
|
|
3093
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
3094
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3196
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : UpdateSaleResponse,
|
|
3197
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateSaleResponseNestedFields
|
|
3095
3198
|
)
|
|
3096
3199
|
),
|
|
3097
3200
|
input,
|
|
3098
3201
|
option
|
|
3099
3202
|
);
|
|
3100
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3203
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateSale) != null ? _d : null;
|
|
3101
3204
|
},
|
|
3102
|
-
async
|
|
3205
|
+
async getSales(input, fetchFields, option) {
|
|
3103
3206
|
var _a, _b, _c, _d;
|
|
3104
3207
|
const res = await client.request(
|
|
3105
|
-
|
|
3208
|
+
saleSchema.getSales(
|
|
3106
3209
|
gqlQueryStringBuilder(
|
|
3107
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
3108
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3210
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getSalesResponse,
|
|
3211
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getSalesResponseNestedFields
|
|
3109
3212
|
)
|
|
3110
3213
|
),
|
|
3111
3214
|
input,
|
|
3112
3215
|
option
|
|
3113
3216
|
);
|
|
3114
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3217
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getSales) != null ? _d : null;
|
|
3115
3218
|
}
|
|
3116
3219
|
});
|
|
3117
3220
|
|
|
3118
|
-
// src/services/
|
|
3119
|
-
var
|
|
3120
|
-
|
|
3121
|
-
query
|
|
3122
|
-
|
|
3123
|
-
${query}
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
`,
|
|
3127
|
-
getSubscriptions: (query) => `
|
|
3128
|
-
query getSubscriptions($search: String, $subscriptionIds: [String], $subscription: SubscriptionInput, $limit: Int!, $skip: Int!) {
|
|
3129
|
-
getSubscriptions(search: $search, subscriptionIds: $subscriptionIds, subscription: $subscription, limit: $limit, skip: $skip) {
|
|
3221
|
+
// src/services/sales/schemas/transaction.schema.ts
|
|
3222
|
+
var transactionSchema = {
|
|
3223
|
+
getTransaction: (query) => `
|
|
3224
|
+
query getTransaction($transaction: TransactionInput!){
|
|
3225
|
+
getTransaction(transaction: $transaction){
|
|
3130
3226
|
${query}
|
|
3131
3227
|
}
|
|
3132
3228
|
}
|
|
3133
3229
|
`,
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3230
|
+
getTransactions: (query) => `
|
|
3231
|
+
query getTransactions($dateFilter: DateFilterInput, $transactionIds: [String], $transaction: TransactionInput, $limit: Int, $skip: Int, $shouldGetFromAllStores: Boolean){
|
|
3232
|
+
getTransactions(dateFilter: $dateFilter, transactionIds: $transactionIds, transaction: $transaction, limit: $limit, skip: $skip, shouldGetFromAllStores: $shouldGetFromAllStores){
|
|
3137
3233
|
${query}
|
|
3138
3234
|
}
|
|
3139
3235
|
}
|
|
3140
3236
|
`,
|
|
3141
|
-
|
|
3142
|
-
mutation
|
|
3143
|
-
|
|
3237
|
+
addTransaction: (query) => `
|
|
3238
|
+
mutation addTransaction($transaction: TransactionInput!){
|
|
3239
|
+
addTransaction(transaction: $transaction){
|
|
3144
3240
|
${query}
|
|
3145
3241
|
}
|
|
3146
3242
|
}
|
|
3147
3243
|
`,
|
|
3148
|
-
|
|
3149
|
-
mutation
|
|
3150
|
-
|
|
3244
|
+
updateTransaction: (query) => `
|
|
3245
|
+
mutation updateTransaction($transactionId: String!, $transaction: TransactionInput!){
|
|
3246
|
+
updateTransaction(transactionId: $transactionId, transaction: $transaction){
|
|
3151
3247
|
${query}
|
|
3152
3248
|
}
|
|
3153
3249
|
}
|
|
3154
3250
|
`
|
|
3155
3251
|
};
|
|
3156
3252
|
|
|
3157
|
-
// src/services/
|
|
3158
|
-
var
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3253
|
+
// src/services/sales/types/transaction.type.ts
|
|
3254
|
+
var getTransactionResponse = [
|
|
3255
|
+
"transaction"
|
|
3256
|
+
];
|
|
3257
|
+
var _getTransactionResponseNestedFields = {
|
|
3258
|
+
sales: saleQuery
|
|
3259
|
+
};
|
|
3260
|
+
var getTransactionResponseNestedFields = {
|
|
3261
|
+
transaction: transactionQuery,
|
|
3262
|
+
..._getTransactionResponseNestedFields
|
|
3263
|
+
};
|
|
3264
|
+
var getTransactionsResponse = [
|
|
3265
|
+
"transactions",
|
|
3266
|
+
"uniqueProducts"
|
|
3267
|
+
];
|
|
3268
|
+
var _getTransactionsResponseNestedFields = {
|
|
3269
|
+
sales: saleQuery,
|
|
3270
|
+
uniqueProducts: productNameQuery,
|
|
3271
|
+
..._getProductResponseNestedFields
|
|
3272
|
+
};
|
|
3273
|
+
var getTransactionsResponseNestedFields = {
|
|
3274
|
+
transactions: transactionQuery,
|
|
3275
|
+
..._getTransactionsResponseNestedFields
|
|
3276
|
+
};
|
|
3277
|
+
var addTransactionResponse = getTransactionResponse;
|
|
3278
|
+
var addTransactionResponseNestedFields = getTransactionResponseNestedFields;
|
|
3279
|
+
var updateTransactionResponse = getTransactionResponse;
|
|
3280
|
+
var updateTransactionResponseNestedFields = getTransactionResponseNestedFields;
|
|
3281
|
+
|
|
3282
|
+
// src/services/sales/transaction.service.ts
|
|
3283
|
+
var createTransactionService = (client) => ({
|
|
3284
|
+
async updateTransaction(input, fetchFields, option) {
|
|
3173
3285
|
var _a, _b, _c, _d;
|
|
3174
3286
|
const res = await client.request(
|
|
3175
|
-
|
|
3287
|
+
transactionSchema.updateTransaction(
|
|
3176
3288
|
gqlQueryStringBuilder(
|
|
3177
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
3178
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3289
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : updateTransactionResponse,
|
|
3290
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : updateTransactionResponseNestedFields
|
|
3179
3291
|
)
|
|
3180
3292
|
),
|
|
3181
3293
|
input,
|
|
3182
3294
|
option
|
|
3183
3295
|
);
|
|
3184
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3296
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.updateTransaction) != null ? _d : null;
|
|
3185
3297
|
},
|
|
3186
|
-
async
|
|
3298
|
+
async addTransaction(input, fetchFields, option) {
|
|
3187
3299
|
var _a, _b, _c, _d;
|
|
3188
3300
|
const res = await client.request(
|
|
3189
|
-
|
|
3301
|
+
transactionSchema.addTransaction(
|
|
3190
3302
|
gqlQueryStringBuilder(
|
|
3191
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
3192
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3303
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : addTransactionResponse,
|
|
3304
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : addTransactionResponseNestedFields
|
|
3193
3305
|
)
|
|
3194
3306
|
),
|
|
3195
3307
|
input,
|
|
3196
3308
|
option
|
|
3197
3309
|
);
|
|
3198
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3310
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.addTransaction) != null ? _d : null;
|
|
3199
3311
|
},
|
|
3200
|
-
async
|
|
3312
|
+
async getTransaction(input, fetchFields, option) {
|
|
3201
3313
|
var _a, _b, _c, _d;
|
|
3202
3314
|
const res = await client.request(
|
|
3203
|
-
|
|
3315
|
+
transactionSchema.getTransaction(
|
|
3204
3316
|
gqlQueryStringBuilder(
|
|
3205
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
3206
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3317
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getTransactionResponse,
|
|
3318
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionResponseNestedFields
|
|
3207
3319
|
)
|
|
3208
3320
|
),
|
|
3209
3321
|
input,
|
|
3210
3322
|
option
|
|
3211
3323
|
);
|
|
3212
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3324
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getTransaction) != null ? _d : null;
|
|
3213
3325
|
},
|
|
3214
|
-
async
|
|
3326
|
+
async getTransactions(input, fetchFields, option) {
|
|
3215
3327
|
var _a, _b, _c, _d;
|
|
3216
3328
|
const res = await client.request(
|
|
3217
|
-
|
|
3329
|
+
transactionSchema.getTransactions(
|
|
3218
3330
|
gqlQueryStringBuilder(
|
|
3219
|
-
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a :
|
|
3220
|
-
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b :
|
|
3331
|
+
(_a = fetchFields == null ? void 0 : fetchFields.root) != null ? _a : getTransactionsResponse,
|
|
3332
|
+
(_b = fetchFields == null ? void 0 : fetchFields.nestedFields) != null ? _b : getTransactionsResponseNestedFields
|
|
3221
3333
|
)
|
|
3222
3334
|
),
|
|
3223
3335
|
input,
|
|
3224
3336
|
option
|
|
3225
3337
|
);
|
|
3226
|
-
return (_d = (_c = res.data) == null ? void 0 : _c.
|
|
3338
|
+
return (_d = (_c = res.data) == null ? void 0 : _c.getTransactions) != null ? _d : null;
|
|
3227
3339
|
}
|
|
3228
3340
|
});
|
|
3229
3341
|
|
|
@@ -3279,6 +3391,7 @@ exports.createStoreCategoryResponseFields = createStoreCategoryResponseFields;
|
|
|
3279
3391
|
exports.createStoreCategoryResponseNestedFields = createStoreCategoryResponseNestedFields;
|
|
3280
3392
|
exports.createStoreCategoryService = createStoreCategoryService;
|
|
3281
3393
|
exports.createStoreService = createStoreService;
|
|
3394
|
+
exports.createSubscriptionPlanFeatureBehaviourService = createSubscriptionPlanFeatureBehaviourService;
|
|
3282
3395
|
exports.createSubscriptionPlanFeatureService = createSubscriptionPlanFeatureService;
|
|
3283
3396
|
exports.createSubscriptionPlanService = createSubscriptionPlanService;
|
|
3284
3397
|
exports.createSubscriptionService = createSubscriptionService;
|
|
@@ -3363,6 +3476,9 @@ exports.searchCategoriesAndTemplateResponse = searchCategoriesAndTemplateRespons
|
|
|
3363
3476
|
exports.searchCategoriesAndTemplateResponseNestedFields = searchCategoriesAndTemplateResponseNestedFields;
|
|
3364
3477
|
exports.searchProductNamesResponse = searchProductNamesResponse;
|
|
3365
3478
|
exports.searchProductNamesResponseNestedFields = searchProductNamesResponseNestedFields;
|
|
3479
|
+
exports.subscriptionPlanFeatureBehaviourDeleteIntegration = subscriptionPlanFeatureBehaviourDeleteIntegration;
|
|
3480
|
+
exports.subscriptionPlanFeatureBehaviourIntegration = subscriptionPlanFeatureBehaviourIntegration;
|
|
3481
|
+
exports.subscriptionPlanFeatureBehaviourListIntegration = subscriptionPlanFeatureBehaviourListIntegration;
|
|
3366
3482
|
exports.toAsyncHeadersFactory = toAsyncHeadersFactory;
|
|
3367
3483
|
exports.toAsyncTokenProvider = toAsyncTokenProvider;
|
|
3368
3484
|
exports.transactionQuery = transactionQuery;
|