@tagsamurai/fats-api-services 1.0.0-alpha.235 → 1.0.0-alpha.237

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.
@@ -620,7 +620,7 @@ const AssignmentServices$1 = {
620
620
  postTransaction: (body) => {
621
621
  return API$x.post("/transaction", body);
622
622
  },
623
- putTransaction: (id, body) => {
623
+ putTransactionRequest: (id, body) => {
624
624
  return API$x.put(`/transaction/${id}/request`, body);
625
625
  },
626
626
  putCancelTransaction: (body) => {
@@ -815,10 +815,136 @@ const MyAssetServices = {
815
815
  return API$t.get("/history/options", { params });
816
816
  }
817
817
  };
818
+ const PREFIX = "/transfer/v2";
819
+ const PrelistAPI = createAxiosInstance({
820
+ env: "APP_TAGSAMURAI_API",
821
+ prefix: `${PREFIX}/prelist`
822
+ });
823
+ const TransactionAPI = createAxiosInstance({
824
+ env: "APP_TAGSAMURAI_API",
825
+ prefix: `${PREFIX}/transaction`
826
+ });
827
+ const ApprovalAPI = createAxiosInstance({
828
+ env: "APP_TAGSAMURAI_API",
829
+ prefix: `${PREFIX}/approval`
830
+ });
831
+ const TransferServices = {
832
+ // ------ TRANSACTION ------
833
+ getTransactions: (params) => {
834
+ return TransactionAPI.get("/", { params });
835
+ },
836
+ getTransactionDetail: (id) => {
837
+ return TransactionAPI.get(`/${id}`);
838
+ },
839
+ getTransactionDetailAssets: (id, params) => {
840
+ return TransactionAPI.get(`/${id}/request`, { params });
841
+ },
842
+ getRequestFilterOptions: (id, field) => {
843
+ const params = {};
844
+ if (field) {
845
+ params[field] = true;
846
+ } else {
847
+ params.nameOptions = true;
848
+ params.brandOptions = true;
849
+ params.modelOptions = true;
850
+ }
851
+ return TransactionAPI.get(`/${id}/request/options`, { params });
852
+ },
853
+ getOldTransactionLog: (id) => {
854
+ return TransactionAPI.get(`/request/${id}/transaction-log`);
855
+ },
856
+ getOldTransactionOptions: (field) => {
857
+ const params = {};
858
+ params[field] = true;
859
+ return TransactionAPI.get("/options", { params });
860
+ },
861
+ postOldCreateTransaction: (body) => {
862
+ return TransactionAPI.post("/", body);
863
+ },
864
+ putCancelTransactions: (ids) => {
865
+ const body = { id: ids };
866
+ return TransactionAPI.put("/cancel", body);
867
+ },
868
+ putUpdateTransaction: (id, body) => {
869
+ return TransactionAPI.put(`/${id}`, body);
870
+ },
871
+ putCancelRequests: (ids) => {
872
+ const body = { id: ids };
873
+ return TransactionAPI.put("/request/cancel", body);
874
+ },
875
+ getHistoryByTransaction: (params) => {
876
+ return TransactionAPI.get("/history", { params });
877
+ },
878
+ getHistoryByTransactionOptions: (field) => {
879
+ const params = {};
880
+ params[field] = true;
881
+ return TransactionAPI.get("/history/options", { params });
882
+ },
883
+ getHistoryByAsset: (params) => {
884
+ return TransactionAPI.get("/history/by-asset", { params });
885
+ },
886
+ getHistoryByAssetOptions: (field) => {
887
+ const params = {};
888
+ params[field] = true;
889
+ return TransactionAPI.get("/history/by-asset/options", { params });
890
+ },
891
+ getApproverList: (tranasctionId) => {
892
+ return TransactionAPI.get(`/${tranasctionId}/approval-history`);
893
+ },
894
+ putHandoverTransaction: (id, body) => {
895
+ return TransactionAPI.put(`/${id}/handover`, body);
896
+ },
897
+ // ------ PRELIST ------
898
+ getPrelist: (params) => {
899
+ return PrelistAPI.get("/", { params });
900
+ },
901
+ postAddPrelistData: (body) => {
902
+ return PrelistAPI.post("/", body);
903
+ },
904
+ deletePrelist: (ids) => {
905
+ return PrelistAPI.delete("/", {
906
+ params: {
907
+ id: JSON.stringify(ids)
908
+ }
909
+ });
910
+ },
911
+ getPrelistAssets: (id) => {
912
+ const params = { id };
913
+ return PrelistAPI.get("/request", { params });
914
+ },
915
+ // APPROVAL
916
+ getApprovals: (status, params) => {
917
+ const formattedParams = { ...params, status: JSON.stringify([status]) };
918
+ return ApprovalAPI.get("/", { params: formattedParams });
919
+ },
920
+ getApprovalOptions: (status, field) => {
921
+ const params = {
922
+ status: JSON.stringify([status])
923
+ };
924
+ params[field] = true;
925
+ return ApprovalAPI.get("/options", { params });
926
+ },
927
+ getApprovalDetail: (id, approvalType) => {
928
+ const params = {
929
+ groupType: approvalType
930
+ };
931
+ return ApprovalAPI.get(`/transaction/${id}`, { params });
932
+ },
933
+ getApprovalDetailOptions: (id, field, approvalType) => {
934
+ const params = {};
935
+ params[field] = true;
936
+ params.groupType = approvalType;
937
+ return ApprovalAPI.get(`/transaction/${id}/options`, { params });
938
+ },
939
+ putUpdateApproval: (body) => {
940
+ return ApprovalAPI.put("/approve", body);
941
+ }
942
+ };
818
943
  const API$s = createAxiosInstance({
819
944
  prefix: "/transfer/v2"
820
945
  });
821
946
  const TransferServicesGo = {
947
+ ...TransferServices,
822
948
  getTransactionData: (params) => {
823
949
  return API$s.get("/transaction", { params });
824
950
  },
@@ -627,7 +627,7 @@ System.register(["axios"], function(exports, module) {
627
627
  postTransaction: (body) => {
628
628
  return API$x.post("/transaction", body);
629
629
  },
630
- putTransaction: (id, body) => {
630
+ putTransactionRequest: (id, body) => {
631
631
  return API$x.put(`/transaction/${id}/request`, body);
632
632
  },
633
633
  putCancelTransaction: (body) => {
@@ -822,10 +822,136 @@ System.register(["axios"], function(exports, module) {
822
822
  return API$t.get("/history/options", { params });
823
823
  }
824
824
  });
825
+ const PREFIX = "/transfer/v2";
826
+ const PrelistAPI = createAxiosInstance({
827
+ env: "APP_TAGSAMURAI_API",
828
+ prefix: `${PREFIX}/prelist`
829
+ });
830
+ const TransactionAPI = createAxiosInstance({
831
+ env: "APP_TAGSAMURAI_API",
832
+ prefix: `${PREFIX}/transaction`
833
+ });
834
+ const ApprovalAPI = createAxiosInstance({
835
+ env: "APP_TAGSAMURAI_API",
836
+ prefix: `${PREFIX}/approval`
837
+ });
838
+ const TransferServices = {
839
+ // ------ TRANSACTION ------
840
+ getTransactions: (params) => {
841
+ return TransactionAPI.get("/", { params });
842
+ },
843
+ getTransactionDetail: (id) => {
844
+ return TransactionAPI.get(`/${id}`);
845
+ },
846
+ getTransactionDetailAssets: (id, params) => {
847
+ return TransactionAPI.get(`/${id}/request`, { params });
848
+ },
849
+ getRequestFilterOptions: (id, field) => {
850
+ const params = {};
851
+ if (field) {
852
+ params[field] = true;
853
+ } else {
854
+ params.nameOptions = true;
855
+ params.brandOptions = true;
856
+ params.modelOptions = true;
857
+ }
858
+ return TransactionAPI.get(`/${id}/request/options`, { params });
859
+ },
860
+ getOldTransactionLog: (id) => {
861
+ return TransactionAPI.get(`/request/${id}/transaction-log`);
862
+ },
863
+ getOldTransactionOptions: (field) => {
864
+ const params = {};
865
+ params[field] = true;
866
+ return TransactionAPI.get("/options", { params });
867
+ },
868
+ postOldCreateTransaction: (body) => {
869
+ return TransactionAPI.post("/", body);
870
+ },
871
+ putCancelTransactions: (ids) => {
872
+ const body = { id: ids };
873
+ return TransactionAPI.put("/cancel", body);
874
+ },
875
+ putUpdateTransaction: (id, body) => {
876
+ return TransactionAPI.put(`/${id}`, body);
877
+ },
878
+ putCancelRequests: (ids) => {
879
+ const body = { id: ids };
880
+ return TransactionAPI.put("/request/cancel", body);
881
+ },
882
+ getHistoryByTransaction: (params) => {
883
+ return TransactionAPI.get("/history", { params });
884
+ },
885
+ getHistoryByTransactionOptions: (field) => {
886
+ const params = {};
887
+ params[field] = true;
888
+ return TransactionAPI.get("/history/options", { params });
889
+ },
890
+ getHistoryByAsset: (params) => {
891
+ return TransactionAPI.get("/history/by-asset", { params });
892
+ },
893
+ getHistoryByAssetOptions: (field) => {
894
+ const params = {};
895
+ params[field] = true;
896
+ return TransactionAPI.get("/history/by-asset/options", { params });
897
+ },
898
+ getApproverList: (tranasctionId) => {
899
+ return TransactionAPI.get(`/${tranasctionId}/approval-history`);
900
+ },
901
+ putHandoverTransaction: (id, body) => {
902
+ return TransactionAPI.put(`/${id}/handover`, body);
903
+ },
904
+ // ------ PRELIST ------
905
+ getPrelist: (params) => {
906
+ return PrelistAPI.get("/", { params });
907
+ },
908
+ postAddPrelistData: (body) => {
909
+ return PrelistAPI.post("/", body);
910
+ },
911
+ deletePrelist: (ids) => {
912
+ return PrelistAPI.delete("/", {
913
+ params: {
914
+ id: JSON.stringify(ids)
915
+ }
916
+ });
917
+ },
918
+ getPrelistAssets: (id) => {
919
+ const params = { id };
920
+ return PrelistAPI.get("/request", { params });
921
+ },
922
+ // APPROVAL
923
+ getApprovals: (status, params) => {
924
+ const formattedParams = { ...params, status: JSON.stringify([status]) };
925
+ return ApprovalAPI.get("/", { params: formattedParams });
926
+ },
927
+ getApprovalOptions: (status, field) => {
928
+ const params = {
929
+ status: JSON.stringify([status])
930
+ };
931
+ params[field] = true;
932
+ return ApprovalAPI.get("/options", { params });
933
+ },
934
+ getApprovalDetail: (id, approvalType) => {
935
+ const params = {
936
+ groupType: approvalType
937
+ };
938
+ return ApprovalAPI.get(`/transaction/${id}`, { params });
939
+ },
940
+ getApprovalDetailOptions: (id, field, approvalType) => {
941
+ const params = {};
942
+ params[field] = true;
943
+ params.groupType = approvalType;
944
+ return ApprovalAPI.get(`/transaction/${id}/options`, { params });
945
+ },
946
+ putUpdateApproval: (body) => {
947
+ return ApprovalAPI.put("/approve", body);
948
+ }
949
+ };
825
950
  const API$s = createAxiosInstance({
826
951
  prefix: "/transfer/v2"
827
952
  });
828
953
  const TransferServicesGo = exports("TransferServices", {
954
+ ...TransferServices,
829
955
  getTransactionData: (params) => {
830
956
  return API$s.get("/transaction", { params });
831
957
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.235",
3
+ "version": "1.0.0-alpha.237",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -36,6 +36,7 @@ declare const AssignmentServices: {
36
36
  email: string;
37
37
  }) => Promise<AxiosResponse>;
38
38
  postSendConfirmationEmail: (id: string) => Promise<AxiosResponse>;
39
+ putTransactionRequest: (id: string, body: import('../dto/assignment.dto').EnterprisePutTransactionDto[]) => Promise<AxiosResponse>;
39
40
  putCancelTransaction: (body: {
40
41
  id: string[];
41
42
  }) => Promise<AxiosResponse>;
@@ -32,7 +32,7 @@ declare const AssignmentServices: {
32
32
  }) => Promise<AxiosResponse>;
33
33
  postSendConfirmationEmail: (id: string) => Promise<AxiosResponse>;
34
34
  postTransaction: (body: EnterprisePostTransactionDto[]) => Promise<AxiosResponse>;
35
- putTransaction: (id: string, body: EnterprisePutTransactionDto[]) => Promise<AxiosResponse>;
35
+ putTransactionRequest: (id: string, body: EnterprisePutTransactionDto[]) => Promise<AxiosResponse>;
36
36
  putCancelTransaction: (body: {
37
37
  id: string[];
38
38
  }) => Promise<AxiosResponse>;
@@ -5,9 +5,9 @@ declare const TransferServices: {
5
5
  getTransactionDetail: (id: string) => Promise<AxiosResponse>;
6
6
  getTransactionDetailAssets: (id: string, params?: GetTransferDetailAssetParam) => Promise<AxiosResponse>;
7
7
  getRequestFilterOptions: (id: string, field?: "nameOptions" | "brandOptions" | "modelOptions") => Promise<AxiosResponse>;
8
- getTransactionLog: (id: string) => Promise<AxiosResponse>;
9
- getTransactionOptions: (field: string) => Promise<AxiosResponse>;
10
- postCreateTransaction: (body: CreateTransferTrxItem[]) => Promise<AxiosResponse>;
8
+ getOldTransactionLog: (id: string) => Promise<AxiosResponse>;
9
+ getOldTransactionOptions: (field: string) => Promise<AxiosResponse>;
10
+ postOldCreateTransaction: (body: CreateTransferTrxItem[]) => Promise<AxiosResponse>;
11
11
  putCancelTransactions: (ids: string[]) => Promise<AxiosResponse>;
12
12
  putUpdateTransaction: (id: string, body: UpdateTrxBody) => Promise<AxiosResponse>;
13
13
  putCancelRequests: (ids: string[]) => Promise<AxiosResponse>;
@@ -7,5 +7,30 @@ declare const TransferServicesGo: {
7
7
  getTransactionOptions: (params?: TransactionOptionBoolean) => Promise<AxiosResponse<FetchDetailResponse<TransferOption>>>;
8
8
  getTransactionLog: (id: string) => Promise<AxiosResponse<FetchDetailResponse<TransferLog>>>;
9
9
  postCreateTransaction: (body: CreateTransactionDTO) => Promise<AxiosResponse>;
10
+ getTransactions: (params?: import('../dto/oldTransferService.dto').GetTransferTransactionParam) => Promise<AxiosResponse>;
11
+ getTransactionDetail: (id: string) => Promise<AxiosResponse>;
12
+ getTransactionDetailAssets: (id: string, params?: import('../dto/oldTransferService.dto').GetTransferDetailAssetParam) => Promise<AxiosResponse>;
13
+ getRequestFilterOptions: (id: string, field?: "nameOptions" | "brandOptions" | "modelOptions") => Promise<AxiosResponse>;
14
+ getOldTransactionLog: (id: string) => Promise<AxiosResponse>;
15
+ getOldTransactionOptions: (field: string) => Promise<AxiosResponse>;
16
+ postOldCreateTransaction: (body: import('../dto/oldTransferService.dto').CreateTransferTrxItem[]) => Promise<AxiosResponse>;
17
+ putCancelTransactions: (ids: string[]) => Promise<AxiosResponse>;
18
+ putUpdateTransaction: (id: string, body: import('../dto/oldTransferService.dto').UpdateTrxBody) => Promise<AxiosResponse>;
19
+ putCancelRequests: (ids: string[]) => Promise<AxiosResponse>;
20
+ getHistoryByTransaction: (params?: import('../dto/oldTransferService.dto').GetTransferTransactionParam) => Promise<AxiosResponse>;
21
+ getHistoryByTransactionOptions: (field: string) => Promise<AxiosResponse>;
22
+ getHistoryByAsset: (params?: import('../dto/oldTransferService.dto').GetTransferTransactionParam) => Promise<AxiosResponse>;
23
+ getHistoryByAssetOptions: (field: string) => Promise<AxiosResponse>;
24
+ getApproverList: (tranasctionId: string) => Promise<AxiosResponse>;
25
+ putHandoverTransaction: (id: string, body: import('../dto/oldTransferService.dto').HandoverBody) => Promise<AxiosResponse>;
26
+ getPrelist: (params?: import('../dto/oldTransferService.dto').GetTransferPrelistParam) => Promise<AxiosResponse>;
27
+ postAddPrelistData: (body: import('../dto/oldTransferService.dto').TransferPreListDto) => Promise<AxiosResponse>;
28
+ deletePrelist: (ids: string[]) => Promise<AxiosResponse>;
29
+ getPrelistAssets: (id: string) => Promise<AxiosResponse>;
30
+ getApprovals: (status: "Need Approval" | "Finished Approval", params?: import('../dto/oldTransferService.dto').GetTransferApprovalParam) => Promise<AxiosResponse>;
31
+ getApprovalOptions: (status: "Need Approval" | "Finished Approval", field: string) => Promise<AxiosResponse>;
32
+ getApprovalDetail: (id: string, approvalType: "Origin" | "Destination") => Promise<AxiosResponse>;
33
+ getApprovalDetailOptions: (id: string, field: string, approvalType: "Origin" | "Destination") => Promise<AxiosResponse>;
34
+ putUpdateApproval: (body: import('../dto/oldTransferService.dto').UpdateApprovalBody) => Promise<AxiosResponse>;
10
35
  };
11
36
  export default TransferServicesGo;