@experteam-mx/ngx-services 18.5.10 → 18.6.0

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.
@@ -594,9 +594,8 @@ class ApiCompaniesService {
594
594
  * @return {Observable<InstallationsOut>} An observable that emits the installation's data.
595
595
  */
596
596
  getInstallations(params) {
597
- return this.http.get(`${this.url}/installations`, {
598
- params,
599
- }).pipe(map(({ data }) => data));
597
+ return this.http.get(`${this.url}/installations`, { params })
598
+ .pipe(map(({ data }) => data));
600
599
  }
601
600
  /**
602
601
  * Retrieves the installation details based on the given installation ID.
@@ -608,6 +607,37 @@ class ApiCompaniesService {
608
607
  return this.http.get(`${this.url}/installations/${id}`)
609
608
  .pipe(map(({ data }) => data));
610
609
  }
610
+ /**
611
+ * Sends a post-installation request to the server and retrieves the installation details.
612
+ *
613
+ * @param {InstallationIn} body - The installation details to be sent in the request body.
614
+ * @return {Observable<InstallationOut>} An observable that emits the response containing installation output details.
615
+ */
616
+ postInstallation(body) {
617
+ return this.http.post(`${this.url}/installations`, body)
618
+ .pipe(map(({ data }) => data));
619
+ }
620
+ /**
621
+ * Updates an existing installation record by its ID.
622
+ *
623
+ * @param id The unique identifier of the installation to update.
624
+ * @param body The data payload containing the updated installation information.
625
+ * @return An observable that emits the updated installation data upon a successful update.
626
+ */
627
+ putInstallation(id, body) {
628
+ return this.http.put(`${this.url}/installations/${id}`, body)
629
+ .pipe(map(({ data }) => data));
630
+ }
631
+ /**
632
+ * Deletes an installation by its unique identifier.
633
+ *
634
+ * @param {number} id - The unique identifier of the installation to be deleted.
635
+ * @return {Observable<{}>} An observable that emits the response after the installation is deleted.
636
+ */
637
+ deleteInstallation(id) {
638
+ return this.http.delete(`${this.url}/installations/${id}`)
639
+ .pipe(map(({ data }) => data));
640
+ }
611
641
  /**
612
642
  * Retrieves a list of locations based on the provided query parameters.
613
643
  *
@@ -615,9 +645,8 @@ class ApiCompaniesService {
615
645
  * @return {Observable<LocationsOut>} An observable that emits the location's data.
616
646
  */
617
647
  getLocations(params) {
618
- return this.http.get(`${this.url}/locations`, {
619
- params,
620
- }).pipe(map(({ data }) => data));
648
+ return this.http.get(`${this.url}/locations`, { params })
649
+ .pipe(map(({ data }) => data));
621
650
  }
622
651
  /**
623
652
  * Fetches the location details for a given location ID.
@@ -629,16 +658,66 @@ class ApiCompaniesService {
629
658
  return this.http.get(`${this.url}/locations/${id}`)
630
659
  .pipe(map(({ data }) => data));
631
660
  }
661
+ /**
662
+ * Sends a location object to the server and returns the created location data.
663
+ *
664
+ * @param {LocationIn} body - The location input object to be sent in the request body.
665
+ * @return {Observable<LocationOut>} An observable emitting the created location output object.
666
+ */
667
+ postLocation(body) {
668
+ return this.http.post(`${this.url}/locations`, body)
669
+ .pipe(map(({ data }) => data));
670
+ }
671
+ /**
672
+ * Updates the location information for the specified ID.
673
+ *
674
+ * @param {number} id - The unique identifier of the location to be updated.
675
+ * @param {LocationIn} body - The updated location data to be sent in the request body.
676
+ * @return {Observable<LocationOut>} An observable containing the updated location information.
677
+ */
678
+ putLocation(id, body) {
679
+ return this.http.put(`${this.url}/locations/${id}`, body)
680
+ .pipe(map(({ data }) => data));
681
+ }
682
+ /**
683
+ * Deletes a location by its unique identifier.
684
+ *
685
+ * @param {number} id - The unique identifier of the location to be deleted.
686
+ * @return {Observable<{}>} An observable that emits an empty object upon successful deletion.
687
+ */
688
+ deleteLocation(id) {
689
+ return this.http.delete(`${this.url}/locations/${id}`)
690
+ .pipe(map(({ data }) => data));
691
+ }
632
692
  /**
633
693
  * Retrieves a list of active supply entities.
634
694
  *
635
695
  * @param {QueryParams} params - The query parameters to filter supply entities.
636
- * @return {Observable<SupplyEntitiesActivesOut>} Observable emitting supply entities data.
696
+ * @return {Observable<SupplyEntitiesOut>} Observable emitting supply entities data.
637
697
  */
638
698
  getSupplyEntitiesActives(params) {
639
- return this.http.get(`${this.url}/supply-entities/actives`, {
640
- params,
641
- }).pipe(map(({ data }) => data));
699
+ return this.http.get(`${this.url}/supply-entities/actives`, { params })
700
+ .pipe(map(({ data }) => data));
701
+ }
702
+ /**
703
+ * Retrieves supply entities based on the provided query parameters.
704
+ *
705
+ * @param {QueryParams} params - The query parameters used to filter and fetch the supply entities.
706
+ * @return {Observable<SupplyEntitiesOut>} An observable that emits the supply entities data.
707
+ */
708
+ getSupplyEntities(params) {
709
+ return this.http.get(`${this.url}/supply-entities`, { params })
710
+ .pipe(map(({ data }) => data));
711
+ }
712
+ /**
713
+ * Sends supply entities information to the server and receives the processed supply entities data in response.
714
+ *
715
+ * @param {SupplyEntitiesIn} body - The supply entities data to be sent to the server.
716
+ * @return {Observable<SupplyEntitiesOut>} An observable containing the processed supply entities data.
717
+ */
718
+ putSupplyEntities(body) {
719
+ return this.http.post(`${this.url}/accounts`, body)
720
+ .pipe(map(({ data }) => data));
642
721
  }
643
722
  /**
644
723
  * Fetches a list of employees based on the specified query parameters.
@@ -661,6 +740,37 @@ class ApiCompaniesService {
661
740
  return this.http.get(`${this.url}/employees/${id}`)
662
741
  .pipe(map(({ data }) => data));
663
742
  }
743
+ /**
744
+ * Sends a POST request to create a new employee record.
745
+ *
746
+ * @param {EmployeeIn} body - The data of the employee to be created.
747
+ * @return {Observable<EmployeeOut>} An observable containing the created employee data.
748
+ */
749
+ postEmployee(body) {
750
+ return this.http.post(`${this.url}/employees`, body)
751
+ .pipe(map(({ data }) => data));
752
+ }
753
+ /**
754
+ * Updates an existing employee record with the specified data.
755
+ *
756
+ * @param {number} id - The unique identifier of the employee to be updated.
757
+ * @param {EmployeeIn} body - The employee data to update the record with.
758
+ * @return {Observable<EmployeeOut>} An observable containing the updated employee data.
759
+ */
760
+ putEmployee(id, body) {
761
+ return this.http.put(`${this.url}/employees/${id}`, body)
762
+ .pipe(map(({ data }) => data));
763
+ }
764
+ /**
765
+ * Deletes an employee based on the provided ID.
766
+ *
767
+ * @param {number} id - The unique identifier of the employee to delete.
768
+ * @return {Observable<{}>} An observable containing the response data after the employee is deleted.
769
+ */
770
+ deleteEmployee(id) {
771
+ return this.http.delete(`${this.url}/employees/${id}`)
772
+ .pipe(map(({ data }) => data));
773
+ }
664
774
  /**
665
775
  * Retrieves the list of employees for a specified location based on provided query parameters.
666
776
  *
@@ -672,6 +782,36 @@ class ApiCompaniesService {
672
782
  params,
673
783
  }).pipe(map(({ data }) => data));
674
784
  }
785
+ /**
786
+ * Fetches the location employee details for a given employee ID.
787
+ *
788
+ * @param {number} id - The unique identifier of the employee whose location details are to be retrieved.
789
+ * @return {Observable<LocationEmployeeOut>} An observable containing the location employee details.
790
+ */
791
+ getLocationEmployee(id) {
792
+ return this.http.get(`${this.url}/location-employees/${id}`)
793
+ .pipe(map(({ data }) => data));
794
+ }
795
+ /**
796
+ * Deletes a specific location employee by their unique identifier.
797
+ *
798
+ * @param {number} id - The unique identifier of the employee to be deleted.
799
+ * @return {Observable<{}>} - An observable emitting the server's response after the deletion.
800
+ */
801
+ deleteLocationEmployee(id) {
802
+ return this.http.delete(`${this.url}/location-employees/${id}`)
803
+ .pipe(map(({ data }) => data));
804
+ }
805
+ /**
806
+ * Sends a batch of location-employee associations to the server for processing.
807
+ *
808
+ * @param {LocationEmployeeBatchIn} body - The object containing a batch of location-employee data to be posted.
809
+ * @return {Observable<EmployeeOut>} An observable emitting the processed employee data from the server's response.
810
+ */
811
+ postLocationEmployeeBatch(body) {
812
+ return this.http.post(`${this.url}/location-employees/batch`, body)
813
+ .pipe(map(({ data }) => data));
814
+ }
675
815
  /**
676
816
  * Retrieves a list of countries where the company operates.
677
817
  *
@@ -679,9 +819,8 @@ class ApiCompaniesService {
679
819
  * @return {Observable<CompanyCountriesOut>} An observable containing the list of company countries.
680
820
  */
681
821
  getCompanyCountries(params) {
682
- return this.http.get(`${this.url}/company-countries`, {
683
- params,
684
- }).pipe(map(({ data }) => data));
822
+ return this.http.get(`${this.url}/company-countries`, { params })
823
+ .pipe(map(({ data }) => data));
685
824
  }
686
825
  /**
687
826
  * Retrieves the country information for a specified company by its ID.
@@ -693,6 +832,37 @@ class ApiCompaniesService {
693
832
  return this.http.get(`${this.url}/company-countries/${id}`)
694
833
  .pipe(map(({ data }) => data));
695
834
  }
835
+ /**
836
+ * Sends a request to update or create a company country entry on the server.
837
+ *
838
+ * @param {CompanyCountryIn} body The data object representing the company country information to be sent to the server.
839
+ * @return {Observable<CompanyCountryOut>} An observable containing the server response with the updated or created company country data.
840
+ */
841
+ postCompanyCountry(body) {
842
+ return this.http.put(`${this.url}/company-countries`, body)
843
+ .pipe(map(({ data }) => data));
844
+ }
845
+ /**
846
+ * Updates the country information for a specific company.
847
+ *
848
+ * @param {number} id - The unique identifier of the company whose country information needs to be updated.
849
+ * @param {CompanyCountryIn} body - The updated country information to be applied to the company.
850
+ * @return {Observable<CompanyCountryOut>} An observable that emits the updated company country information.
851
+ */
852
+ putCompanyCountry(id, body) {
853
+ return this.http.put(`${this.url}/company-countries/${id}`, body)
854
+ .pipe(map(({ data }) => data));
855
+ }
856
+ /**
857
+ * Deletes a company-country association by its unique identifier.
858
+ *
859
+ * @param {number} id - The unique identifier of the company-country record to be deleted.
860
+ * @return {Observable<{}>} An observable emitting the result of the delete operation.
861
+ */
862
+ deleteCompanyCountry(id) {
863
+ return this.http.delete(`${this.url}/company-countries/${id}`)
864
+ .pipe(map(({ data }) => data));
865
+ }
696
866
  /**
697
867
  * Fetches the reference currencies for a given country.
698
868
  *
@@ -700,7 +870,18 @@ class ApiCompaniesService {
700
870
  * @return {Observable<CountryReferenceCurrenciesOut>} The observable containing the country reference currencies data.
701
871
  */
702
872
  getCountryReferenceCurrencies(params) {
703
- return this.http.get(`${this.url}/country-reference-currencies`, { params }).pipe(map(({ data }) => data));
873
+ return this.http.get(`${this.url}/country-reference-currencies`, { params })
874
+ .pipe(map(({ data }) => data));
875
+ }
876
+ /**
877
+ * Retrieves the reference currency details for a specific country using its ID.
878
+ *
879
+ * @param {number} id - The unique identifier of the country.
880
+ * @return {Observable<CountryReferenceCurrencyOut>} An observable emitting the country's reference currency details.
881
+ */
882
+ getCountryReferenceCurrency(id) {
883
+ return this.http.get(`${this.url}/country-reference-currencies/${id}`)
884
+ .pipe(map(({ data }) => data));
704
885
  }
705
886
  /**
706
887
  * Retrieves a list of currencies for different countries along with their current exchange rates.
@@ -721,6 +902,61 @@ class ApiCompaniesService {
721
902
  return forkJoin($observables);
722
903
  }));
723
904
  }
905
+ /**
906
+ * Updates the reference currency for a specified country.
907
+ *
908
+ * @param {number} id - The unique identifier of the country.
909
+ * @param {CountryReferenceCurrencyIn} body - The data for updating the country's reference currency.
910
+ * @return {Observable<CountryReferenceCurrencyOut>} An Observable emitting the updated country reference currency data.
911
+ */
912
+ putCountryReferenceCurrency(id, body) {
913
+ return this.http.put(`${this.url}/country-reference-currencies/${id}`, body)
914
+ .pipe(map(({ data }) => data));
915
+ }
916
+ /**
917
+ * Sends a POST request to create a country reference currency.
918
+ *
919
+ * @param {CountryReferenceCurrencyIn} body - The payload containing the country reference currency data.
920
+ * @return {Observable<CountryReferenceCurrencyOut>} An observable emitting the created country reference currency.
921
+ */
922
+ postCountryReferenceCurrency(body) {
923
+ return this.http.post(`${this.url}/country-reference-currencies`, body)
924
+ .pipe(map(({ data }) => data));
925
+ }
926
+ /**
927
+ * Sends a POST request to create or update a country reference extra charge.
928
+ *
929
+ * @param {CountryReferenceExtraChargeIn} body - The request payload containing details about the country reference extra charge.
930
+ * @return {Observable<CountryReferenceExtraChargeOut>} An observable containing the response with the created or updated country reference extra charge.
931
+ */
932
+ postCountryReferenceExtraCharge(body) {
933
+ return this.http.post(`${this.url}/country-reference-extra-charges`, body)
934
+ .pipe(map(({ data }) => data));
935
+ }
936
+ /**
937
+ * Updates a country reference extra charge by its ID.
938
+ *
939
+ * @param {number} id - The unique identifier of the country reference extra charge to be updated.
940
+ * @param {CountryReferenceExtraChargeIn} body - The data to update the country reference extra charge with.
941
+ * @return {Observable<CountryReferenceExtraChargeOut>} An observable that emits the updated country reference extra charge.
942
+ */
943
+ putCountryReferenceExtraCharge(id, body) {
944
+ return this.http.put(`${this.url}/country-reference-extra-charges/${id}`, body)
945
+ .pipe(map(({ data }) => data));
946
+ }
947
+ /**
948
+ * Enables or disables a country reference extra charge based on the provided parameters.
949
+ *
950
+ * @param {CountryReferenceExtraCharge} extraCharge - The country reference extra charge object to be updated.
951
+ * @param {boolean} [isActive] - Optional parameter to explicitly set the active status of the extra charge.
952
+ * If not provided, the current active status will be toggled.
953
+ * @return {Observable<EmployeeCustomersOut>} An Observable that emits the updated employee customers output.
954
+ */
955
+ patchCountryReferenceExtraCharge(extraCharge, isActive) {
956
+ return this.http.patch(`${this.url}/country-reference-extra-charges/${extraCharge.id}`, {
957
+ is_active: isActive ?? !extraCharge.is_active
958
+ }).pipe(map(({ data }) => data));
959
+ }
724
960
  /**
725
961
  * Fetches exchange data based on the provided query parameters.
726
962
  *
@@ -728,9 +964,29 @@ class ApiCompaniesService {
728
964
  * @return {Observable<ExchangesOut>} An observable containing the exchange data.
729
965
  */
730
966
  getExchanges(params) {
731
- return this.http.get(`${this.url}/exchanges`, {
732
- params,
733
- }).pipe(map(({ data }) => data));
967
+ return this.http.get(`${this.url}/exchanges`, { params })
968
+ .pipe(map(({ data }) => data));
969
+ }
970
+ /**
971
+ * Sends a POST request to create or update an exchange.
972
+ *
973
+ * @param {ExchangeIn} body - The request body containing the exchange data to be sent.
974
+ * @return {Observable<ExchangeOut>} An observable that emits the response containing the created or updated exchange data.
975
+ */
976
+ postExchange(body) {
977
+ return this.http.put(`${this.url}/exchanges`, body)
978
+ .pipe(map(({ data }) => data));
979
+ }
980
+ /**
981
+ * Updates an existing exchange with new data.
982
+ *
983
+ * @param {number} id - The unique identifier of the exchange to update.
984
+ * @param {ExchangeIn} body - The data to update the exchange with.
985
+ * @return {Observable<ExchangeOut>} An observable that emits the updated exchange data.
986
+ */
987
+ putExchange(id, body) {
988
+ return this.http.put(`${this.url}/exchanges/${id}`, body)
989
+ .pipe(map(({ data }) => data));
734
990
  }
735
991
  /**
736
992
  * Retrieves the current exchanges based on the given query parameters.
@@ -740,9 +996,8 @@ class ApiCompaniesService {
740
996
  * @returns {Observable<ExchangesOut>} - An observable that emits the API response data containing the current exchanges.
741
997
  */
742
998
  getCurrentExchanges(params) {
743
- return this.http.get(`${this.url}/exchanges/current`, {
744
- params,
745
- }).pipe(map(({ data }) => data));
999
+ return this.http.get(`${this.url}/exchanges/current`, { params })
1000
+ .pipe(map(({ data }) => data));
746
1001
  }
747
1002
  /**
748
1003
  * Fetches the country-specific tax information for a company.
@@ -751,20 +1006,140 @@ class ApiCompaniesService {
751
1006
  * @return {Observable<CompanyCountryTaxesOut>} An observable that emits the tax information.
752
1007
  */
753
1008
  getCompanyCountryTaxes(params) {
754
- return this.http.get(`${this.url}/company-country-taxes`, {
755
- params,
756
- }).pipe(map(({ data }) => data));
1009
+ return this.http.get(`${this.url}/company-country-taxes`, { params })
1010
+ .pipe(map(({ data }) => data));
1011
+ }
1012
+ /**
1013
+ * Fetches account information based on the provided query parameters.
1014
+ *
1015
+ * @param {QueryParams} params - The query parameters for fetching account data.
1016
+ * @return {Observable<AccountsOut>} An observable emitting the account data.
1017
+ */
1018
+ getAccounts(params) {
1019
+ return this.http.get(`${this.url}/accounts`)
1020
+ .pipe(map(({ data }) => data));
1021
+ }
1022
+ /**
1023
+ * Fetches the account information for the specified account ID.
1024
+ *
1025
+ * @param {number} id - The unique identifier of the account to retrieve.
1026
+ * @return {Observable<AccountOut>} An observable that emits the account details.
1027
+ */
1028
+ getAccount(id) {
1029
+ return this.http.get(`${this.url}/accounts/${id}`)
1030
+ .pipe(map(({ data }) => data));
1031
+ }
1032
+ /**
1033
+ * Creates a new account by sending account details in the body.
1034
+ *
1035
+ * @param {AccountIn} body - The account information to be sent in the request body.
1036
+ * @return {Observable<AccountOut>} Observable that emits the created account details upon success.
1037
+ */
1038
+ postAccount(body) {
1039
+ return this.http.post(`${this.url}/accounts`, body)
1040
+ .pipe(map(({ data }) => data));
1041
+ }
1042
+ /**
1043
+ * Updates an account with the specified ID using the provided data.
1044
+ *
1045
+ * @param {number} id - The unique identifier of the account to be updated.
1046
+ * @param {AccountIn} body - The data to update the account with.
1047
+ * @return {Observable<AccountOut>} An observable emitting the updated account details.
1048
+ */
1049
+ putAccount(id, body) {
1050
+ return this.http.post(`${this.url}/accounts/${id}`, body)
1051
+ .pipe(map(({ data }) => data));
1052
+ }
1053
+ /**
1054
+ * Fetches account entity data from the server based on the provided query parameters.
1055
+ *
1056
+ * @param {QueryParams} params - The query parameters to be sent with the HTTP request.
1057
+ * @return {Observable<AccountEntitiesOut>} An observable that emits the account entities data.
1058
+ */
1059
+ getAccountEntities(params) {
1060
+ return this.http.get(`${this.url}/account-entities`, { params })
1061
+ .pipe(map(({ data }) => data));
1062
+ }
1063
+ /**
1064
+ * Updates an account entity using the provided details.
1065
+ *
1066
+ * @param {AccountEntitiesIn} body The account entity data to be updated.
1067
+ * @return {Observable<AccountEntitiesOut>} An observable containing the updated account entity details.
1068
+ */
1069
+ putAccountEntity(body) {
1070
+ return this.http.put(`${this.url}/account-entities`, body)
1071
+ .pipe(map(({ data }) => data));
757
1072
  }
758
1073
  /**
759
1074
  * Retrieves the list of active account entities based on the provided query parameters.
760
1075
  *
761
1076
  * @param {QueryParams} params - The parameters to filter and query active account entities.
762
- * @return {Observable<AccountEntitiesActivesOut>} An observable that emits the list of active account entities.
1077
+ * @return {Observable<AccountEntitiesOut>} An observable that emits the list of active account entities.
763
1078
  */
764
1079
  getAccountEntitiesActives(params) {
765
- return this.http.get(`${this.url}/account-entities/actives`, {
766
- params,
767
- }).pipe(map(({ data }) => data));
1080
+ return this.http.get(`${this.url}/account-entities/actives`, { params })
1081
+ .pipe(map(({ data }) => data));
1082
+ }
1083
+ /**
1084
+ * Fetches a list of account categories based on the provided query parameters.
1085
+ *
1086
+ * @param {QueryParams} params - The query parameters used to filter the account categories.
1087
+ * @return {Observable<AccountCategoriesOut>} An observable that emits the fetched account categories data.
1088
+ */
1089
+ getAccountCategories(params) {
1090
+ return this.http.get(`${this.url}/account-categories`, { params, })
1091
+ .pipe(map(({ data }) => data));
1092
+ }
1093
+ /**
1094
+ * Retrieves a list of account types from the server.
1095
+ *
1096
+ * @param {QueryParams} params - The query parameters to filter or customize the request.
1097
+ * @return {Observable<AccountTypesOut>} An observable emitting the account types data.
1098
+ */
1099
+ getAccountTypes(params) {
1100
+ return this.http.get(`${this.url}/account-types`, { params, })
1101
+ .pipe(map(({ data }) => data));
1102
+ }
1103
+ /**
1104
+ * Retrieves the account type for the given account ID.
1105
+ *
1106
+ * @param {number} id - The unique identifier of the account.
1107
+ * @return {Observable<AccountTypeOut>} An observable that emits the account type data.
1108
+ */
1109
+ getAccountType(id) {
1110
+ return this.http.get(`${this.url}/account-types/${id}`)
1111
+ .pipe(map(({ data }) => data));
1112
+ }
1113
+ /**
1114
+ * Sends a POST request to create a new account type.
1115
+ *
1116
+ * @param {AccountTypeIn} body - The data for the account type to be created.
1117
+ * @return {Observable<AccountTypeOut>} An observable that emits the created account type object.
1118
+ */
1119
+ postAccountType(body) {
1120
+ return this.http.post(`${this.url}/account-types`, body)
1121
+ .pipe(map(({ data }) => data));
1122
+ }
1123
+ /**
1124
+ * Updates an account type with the specified ID using the provided data.
1125
+ *
1126
+ * @param {number} id - The unique identifier of the account type to update.
1127
+ * @param {AccountTypeIn} body - The data to update the account type with.
1128
+ * @return {Observable<AccountTypeOut>} An observable containing the updated account type data.
1129
+ */
1130
+ putAccountType(id, body) {
1131
+ return this.http.put(`${this.url}/account-types/${id}`, body)
1132
+ .pipe(map(({ data }) => data));
1133
+ }
1134
+ /**
1135
+ * Retrieves parameters based on the provided query parameters.
1136
+ *
1137
+ * @param {QueryParams} params - The query parameters used to filter or fetch the desired parameters.
1138
+ * @return {Observable<ParametersOut>} An observable that emits the fetched parameters.
1139
+ */
1140
+ getParameters(params) {
1141
+ return this.http.get(`${this.url}/parameters`, { params, })
1142
+ .pipe(map(({ data }) => data));
768
1143
  }
769
1144
  /**
770
1145
  * Retrieves the parameter values based on the provided parameter names.
@@ -773,11 +1148,20 @@ class ApiCompaniesService {
773
1148
  * @param {string[]} params.paramNames - An array of parameter names for which the values need to be fetched.
774
1149
  * @return {Observable<ParametersValuesOut>} An observable that emits the fetched parameter values.
775
1150
  */
776
- getParametersValues({ paramNames, }) {
1151
+ getParametersValues({ paramNames }) {
777
1152
  const parameters = paramNames.map((p) => ({ name: p }));
778
- return this.http.post(`${this.url}/parameters-values`, {
779
- parameters
780
- }).pipe(map(({ data }) => data));
1153
+ return this.http.post(`${this.url}/parameters-values`, { parameters })
1154
+ .pipe(map(({ data }) => data));
1155
+ }
1156
+ /**
1157
+ * Retrieves parameter values based on the provided level configuration.
1158
+ *
1159
+ * @param {ParametersByLevelIn} parameters - The input object containing the criteria or level details to retrieve the parameters.
1160
+ * @return {Observable<ParametersValuesOut>} An observable that emits the parameter values fetched from the server.
1161
+ */
1162
+ getParameterValueByModel(parameters) {
1163
+ return this.http.post(`${this.url}/parameters-values`, { parameters })
1164
+ .pipe(map(({ data }) => data));
781
1165
  }
782
1166
  /**
783
1167
  * Retrieves the value of a specified parameter.
@@ -797,9 +1181,8 @@ class ApiCompaniesService {
797
1181
  * @return {Observable<CountryReferencesOut>} An observable containing the country reference data.
798
1182
  */
799
1183
  getCountryReferences(params) {
800
- return this.http.get(`${this.url}/country-references`, {
801
- params,
802
- }).pipe(map(({ data }) => data));
1184
+ return this.http.get(`${this.url}/country-references`, { params })
1185
+ .pipe(map(({ data }) => data));
803
1186
  }
804
1187
  /**
805
1188
  * Fetches the country reference data for a given country ID.
@@ -811,6 +1194,17 @@ class ApiCompaniesService {
811
1194
  return this.http.get(`${this.url}/country-references/${id}`)
812
1195
  .pipe(map(({ data }) => data));
813
1196
  }
1197
+ /**
1198
+ * Updates a country reference resource with the specified ID and data.
1199
+ *
1200
+ * @param {number} id - The unique identifier of the country reference to be updated.
1201
+ * @param {CountryReferenceIn} body - The data to update the country reference with.
1202
+ * @return {Observable<CountryReferenceOut>} An observable that emits the updated country reference object.
1203
+ */
1204
+ putCountryReference(id, body) {
1205
+ return this.http.put(`${this.url}/country-references/${id}`, body)
1206
+ .pipe(map(({ data }) => data));
1207
+ }
814
1208
  /**
815
1209
  * Fetches the list of workflows based on the provided query parameters.
816
1210
  *
@@ -818,9 +1212,8 @@ class ApiCompaniesService {
818
1212
  * @return {Observable<WorkflowsOut>} An observable containing the workflow data.
819
1213
  */
820
1214
  getWorkflows(params) {
821
- return this.http.get(`${this.url}/workflows`, {
822
- params,
823
- }).pipe(map(({ data }) => data));
1215
+ return this.http.get(`${this.url}/workflows`, { params })
1216
+ .pipe(map(({ data }) => data));
824
1217
  }
825
1218
  /**
826
1219
  * Fetches the list of employee customer
@@ -829,9 +1222,8 @@ class ApiCompaniesService {
829
1222
  * @return {Observable<EmployeeCustomersOut>} An observable containing the employee customer data.
830
1223
  */
831
1224
  getEmployeesCustomers(params) {
832
- return this.http.get(`${this.url}/employee-customers`, {
833
- params,
834
- }).pipe(map(({ data }) => data));
1225
+ return this.http.get(`${this.url}/employee-customers`, { params })
1226
+ .pipe(map(({ data }) => data));
835
1227
  }
836
1228
  /**
837
1229
  * Sends a POST request to create or update employee customer records and processes the server response.
@@ -840,7 +1232,8 @@ class ApiCompaniesService {
840
1232
  * @return {Observable<EmployeeCustomersOut>} An observable that emits the updated employee customer data on successful response.
841
1233
  */
842
1234
  postEmployeeCustomers(body) {
843
- return this.http.post(`${this.url}/employee-customers`, body).pipe(map(({ data }) => data));
1235
+ return this.http.post(`${this.url}/employee-customers`, body)
1236
+ .pipe(map(({ data }) => data));
844
1237
  }
845
1238
  /**
846
1239
  * Updates the employee-customer association record identified by the given ID with the provided data.
@@ -850,7 +1243,8 @@ class ApiCompaniesService {
850
1243
  * @return {Observable<EmployeeCustomersOut>} An observable that emits the updated employee-customer data.
851
1244
  */
852
1245
  putEmployeeCustomers(id, body) {
853
- return this.http.put(`${this.url}/employee-customers/${id}`, body).pipe(map(({ data }) => data));
1246
+ return this.http.put(`${this.url}/employee-customers/${id}`, body)
1247
+ .pipe(map(({ data }) => data));
854
1248
  }
855
1249
  /**
856
1250
  * Fetches the employee-customer details based on the provided employee customer ID.
@@ -859,7 +1253,8 @@ class ApiCompaniesService {
859
1253
  * @return {Observable<EmployeeCustomersOut>} An observable that emits the updated employee-customer data.
860
1254
  */
861
1255
  getEmployeeCustomer(id) {
862
- return this.http.get(`${this.url}/employee-customers/${id}`).pipe(map(({ data }) => data));
1256
+ return this.http.get(`${this.url}/employee-customers/${id}`)
1257
+ .pipe(map(({ data }) => data));
863
1258
  }
864
1259
  /**
865
1260
  * Enables or disables an employee customer's active state.
@@ -869,7 +1264,7 @@ class ApiCompaniesService {
869
1264
  * If null or undefined, the active state will be toggled.
870
1265
  * @return {Observable<EmployeeCustomersOut>} An observable containing the updated employee customer output.
871
1266
  */
872
- enableDisableEmployeeCustomers(employee, isActive) {
1267
+ patchEmployeeCustomers(employee, isActive) {
873
1268
  return this.http.patch(`${this.url}/employee-customers/${employee.id}`, {
874
1269
  is_active: isActive ?? !employee.is_active
875
1270
  }).pipe(map(({ data }) => data));
@@ -878,14 +1273,15 @@ class ApiCompaniesService {
878
1273
  * Submits a file containing employee customer data for a specific country to the server.
879
1274
  *
880
1275
  * @param {number} countryId - The identifier of the country for which the data is being uploaded.
881
- * @param {File} file - The file containing employee customer data to be uploaded.
1276
+ * @param {File} file - The file contains employee customer data to be uploaded.
882
1277
  * @return {Observable<BoardingProcessIdIn>} Observable that emits the processed boarding process ID on success.
883
1278
  */
884
1279
  postEmployeeCustomersLoad(countryId, file) {
885
- const formData = new FormData();
886
- formData.append('file', file);
887
- formData.append('country_id', countryId.toString());
888
- return this.http.post(`${this.url}/employee-customers/load`, formData).pipe(map(({ data }) => data));
1280
+ const body = new FormData();
1281
+ body.append('file', file);
1282
+ body.append('country_id', countryId.toString());
1283
+ return this.http.post(`${this.url}/employee-customers/load`, body)
1284
+ .pipe(map(({ data }) => data));
889
1285
  }
890
1286
  /**
891
1287
  * Downloads a file containing customer data for a specific employee based on the provided country ID.
@@ -906,7 +1302,232 @@ class ApiCompaniesService {
906
1302
  * @return {Observable<BoardingProcessIn>} An observable containing the boarding process details.
907
1303
  */
908
1304
  getBoardingProcess(id) {
909
- return this.http.get(`${this.url}/boarding-process/${id}`).pipe(map(({ data }) => data));
1305
+ return this.http.get(`${this.url}/boarding-process/${id}`)
1306
+ .pipe(map(({ data }) => data));
1307
+ }
1308
+ /**
1309
+ * Fetches a list of systems based on the provided query parameters.
1310
+ *
1311
+ * @param {QueryParams} params - The parameters used to filter the systems.
1312
+ * @return {Observable<SystemsOut>} An observable that emits the retrieved systems data.
1313
+ */
1314
+ getSystems(params) {
1315
+ return this.http.get(`${this.url}/systems`, { params })
1316
+ .pipe(map(({ data }) => data));
1317
+ }
1318
+ /**
1319
+ * Retrieves the system by the specified ID.
1320
+ *
1321
+ * @param {number} id - The unique identifier of the system to be retrieved.
1322
+ * @return {Observable<SystemOut>} An observable that emits the requested system information.
1323
+ */
1324
+ getSystem(id) {
1325
+ return this.http.get(`${this.url}/systems/${id}`)
1326
+ .pipe(map(({ data }) => data));
1327
+ }
1328
+ /**
1329
+ * Sends a POST request to create or update a system.
1330
+ *
1331
+ * @param {SystemIn} body - The data representing the system to be created or updated.
1332
+ * @return {Observable<SystemOut>} An observable emitting the resulting system output after the API request succeeds.
1333
+ */
1334
+ postSystem(body) {
1335
+ return this.http.post(`${this.url}/systems`, body)
1336
+ .pipe(map(({ data }) => data));
1337
+ }
1338
+ /**
1339
+ * Updates the system identified by the given ID with the provided request body and returns the updated system details.
1340
+ *
1341
+ * @param {number} id - The unique identifier of the system to be updated.
1342
+ * @param {SystemIn} body - The payload containing the updated system details.
1343
+ * @return {Observable<SystemOut>} An observable emitting the updated system data.
1344
+ */
1345
+ putSystem(id, body) {
1346
+ return this.http.post(`${this.url}/systems/${id}`, body)
1347
+ .pipe(map(({ data }) => data));
1348
+ }
1349
+ /**
1350
+ * Retrieves a list of system entities based on the specified query parameters.
1351
+ *
1352
+ * @param {QueryParams} params - The query parameters used to filter or specify the system entities to retrieve.
1353
+ * @return {Observable<SystemEntitiesOut>} An Observable that emits the retrieved system entities.
1354
+ */
1355
+ getSystemEntities(params) {
1356
+ return this.http.get(`${this.url}/system-entities`, { params })
1357
+ .pipe(map(({ data }) => data));
1358
+ }
1359
+ /**
1360
+ * Updates the system entities by sending the provided data to the server.
1361
+ *
1362
+ * @param {SystemEntitiesIn} body - The data object representing the system entities to be updated.
1363
+ * @return {Observable<SystemEntitiesOut>} An observable containing the updated system entities data.
1364
+ */
1365
+ putSystemEntities(body) {
1366
+ return this.http.put(`${this.url}/system-entities`, body)
1367
+ .pipe(map(({ data }) => data));
1368
+ }
1369
+ /**
1370
+ * Retrieves workflow configurations based on the provided query parameters.
1371
+ *
1372
+ * @param {QueryParams} params - The query parameters to filter the workflow configurations.
1373
+ * @return {Observable<WorkflowConfigsOut>} An observable emitting the workflow configurations.
1374
+ */
1375
+ getWorkflowConfigs(params) {
1376
+ return this.http.get(`${this.url}/workflow-configs`, { params })
1377
+ .pipe(map(({ data }) => data));
1378
+ }
1379
+ /**
1380
+ * Sends a batch of workflow configuration data to the server for processing.
1381
+ *
1382
+ * @param {WorkflowConfigsBatchIn} body - The input data containing a batch of workflow configurations to be sent.
1383
+ * @return {Observable<WorkflowConfigsOut>} An observable that emits the processed batch of workflow configuration data as a response.
1384
+ */
1385
+ postWorkflowConfigsBatch(body) {
1386
+ return this.http.post(`${this.url}/workflow-configs/batch`, body)
1387
+ .pipe(map(({ data }) => data));
1388
+ }
1389
+ /**
1390
+ * Sends a POST request to create a new company and returns the created company's details.
1391
+ *
1392
+ * @param {CompanyIn} body - The payload containing the details of the company to be created.
1393
+ * @return {Observable<CompanyOut>} An Observable emitting the response with the created company's details.
1394
+ */
1395
+ postCompany(body) {
1396
+ return this.http.post(`${this.url}/companies`, body)
1397
+ .pipe(map(({ data }) => data));
1398
+ }
1399
+ /**
1400
+ * Updates the details of an existing company using its ID.
1401
+ *
1402
+ * @param {number} id - The unique identifier of the company to update.
1403
+ * @param {CompanyIn} body - The object containing the updated company data.
1404
+ * @return {Observable<CompanyOut>} An observable that emits the updated company details.
1405
+ */
1406
+ putCompany(id, body) {
1407
+ return this.http.put(`${this.url}/companies/${id}`, body)
1408
+ .pipe(map(({ data }) => data));
1409
+ }
1410
+ /**
1411
+ * Deletes a company by its unique identifier.
1412
+ *
1413
+ * @param {number} id - The unique identifier of the company to be deleted.
1414
+ * @return {Observable<{}>} An observable that emits an empty object upon successful deletion or an error if the operation fails.
1415
+ */
1416
+ deleteCompany(id) {
1417
+ return this.http.delete(`${this.url}/companies/${id}`)
1418
+ .pipe(map(({ data }) => data));
1419
+ }
1420
+ /**
1421
+ * Fetches product entities from the server based on the provided query parameters.
1422
+ *
1423
+ * @param {QueryParams} params The query parameters used to modify the request for product entities.
1424
+ * @return {Observable<ProductEntitiesOut>} An observable that emits the product entities retrieved from the server.
1425
+ */
1426
+ getProductEntities(params) {
1427
+ return this.http.get(`${this.url}/product-entities`, { params })
1428
+ .pipe(map(({ data }) => data));
1429
+ }
1430
+ /**
1431
+ * Sends a PUT request to update product entities and returns the updated entity.
1432
+ *
1433
+ * @param {ProductEntitiesIn} body - The payload containing the data to update the product entity.
1434
+ * @return {Observable<ProductEntitiesOut>} Observable that emits the updated product entity.
1435
+ */
1436
+ putProductEntities(body) {
1437
+ return this.http.put(`${this.url}/product-entities`, body)
1438
+ .pipe(map(({ data }) => data));
1439
+ }
1440
+ /**
1441
+ * Retrieves the country reference products based on the given query parameters.
1442
+ *
1443
+ * @param {QueryParams} params The query parameters used to filter and retrieve the country reference products.
1444
+ * @return {Observable<CountryReferenceProductsOut>} An observable emitting the fetched country reference products data.
1445
+ */
1446
+ getCountryReferenceProducts(params) {
1447
+ return this.http.get(`${this.url}/country-reference-products`, { params })
1448
+ .pipe(map(({ data }) => data));
1449
+ }
1450
+ /**
1451
+ * Sends a request to update or create country reference products.
1452
+ *
1453
+ * @param {CountryReferenceProductIn} body - The payload containing the details of the country reference products to post.
1454
+ * @return {Observable<CountryReferenceProductOut>} An observable that emits the updated or created country reference product data.
1455
+ */
1456
+ postCountryReferenceProducts(body) {
1457
+ return this.http.put(`${this.url}/country-reference-products`, body)
1458
+ .pipe(map(({ data }) => data));
1459
+ }
1460
+ /**
1461
+ * Updates a country reference product with the specified ID using the provided data.
1462
+ *
1463
+ * @param {number} id - The unique identifier of the country reference product to update.
1464
+ * @param {CountryReferenceProductIn} body - The updated country reference product data to be sent in the request body.
1465
+ * @return {Observable<CountryReferenceProductOut>} An observable emitting the updated country reference product.
1466
+ */
1467
+ putCountryReferenceProducts(id, body) {
1468
+ return this.http.put(`${this.url}/country-reference-products/${id}`, body)
1469
+ .pipe(map(({ data }) => data));
1470
+ }
1471
+ /**
1472
+ * Fetches the extra charge entities from the server based on the provided query parameters.
1473
+ *
1474
+ * @param {QueryParams} params - An object containing the query parameters to filter the extra charge entities.
1475
+ * @return {Observable<ExtraChargeEntitiesOut>} An observable that emits the extra charge entities retrieved from the server.
1476
+ */
1477
+ getExtraChargeEntities(params) {
1478
+ return this.http.get(`${this.url}/extracharge-entities`, { params })
1479
+ .pipe(map(({ data }) => data));
1480
+ }
1481
+ /**
1482
+ * Updates extra charge entities by sending the provided data to the server.
1483
+ *
1484
+ * @param {ExtraChargeEntitiesIn} body - The data to update the extra charge entities.
1485
+ * @return {Observable<ExtraChargeEntitiesOut>} An observable that emits the updated extra charge entities.
1486
+ */
1487
+ putExtraChargeEntities(body) {
1488
+ return this.http.put(`${this.url}/extracharge-entities`, body)
1489
+ .pipe(map(({ data }) => data));
1490
+ }
1491
+ /**
1492
+ * Retrieves the parameter configurations based on the provided query parameters.
1493
+ *
1494
+ * @param {QueryParams} params - The query parameters to filter the parameter configurations.
1495
+ * @return {Observable<ParameterConfigsOut>} An observable that emits the parameter configurations data.
1496
+ */
1497
+ getParameterConfigs(params) {
1498
+ return this.http.get(`${this.url}/parameter-configs`, { params })
1499
+ .pipe(map(({ data }) => data));
1500
+ }
1501
+ /**
1502
+ * Submits a configuration for parameters to the server.
1503
+ *
1504
+ * @param {ParameterConfigIn} body - The input configuration object containing the parameters to be submitted.
1505
+ * @return {Observable<ParameterConfigOut>} An observable emitting the server's response containing the updated parameter configuration.
1506
+ */
1507
+ postParameterConfig(body) {
1508
+ return this.http.delete(`${this.url}/parameter-configs`)
1509
+ .pipe(map(({ data }) => data));
1510
+ }
1511
+ /**
1512
+ * Updates the configuration of a parameter with the provided ID and input data.
1513
+ *
1514
+ * @param {number} id - The unique identifier of the parameter configuration to be updated.
1515
+ * @param {ParameterConfigIn} body - The input data containing the updated configuration for the parameter.
1516
+ * @return {Observable<ParameterConfigOut>} An observable that emits the updated parameter configuration.
1517
+ */
1518
+ putParameterConfig(id, body) {
1519
+ return this.http.delete(`${this.url}/parameter-configs/${id}`)
1520
+ .pipe(map(({ data }) => data));
1521
+ }
1522
+ /**
1523
+ * Deletes a parameter configuration specified by its ID.
1524
+ *
1525
+ * @param {number} id - The unique identifier of the parameter configuration to be deleted.
1526
+ * @return {Observable<ParameterConfigOut>} An observable containing the deleted parameter configuration data.
1527
+ */
1528
+ deleteParameterConfig(id) {
1529
+ return this.http.delete(`${this.url}/parameter-configs/${id}`)
1530
+ .pipe(map(({ data }) => data));
910
1531
  }
911
1532
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCompaniesService, deps: [{ token: 'env' }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
912
1533
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ApiCompaniesService, providedIn: 'root' });