Skip to content

Commit

Permalink
Merge branch 'main' into ContractStores
Browse files Browse the repository at this point in the history
  • Loading branch information
eren-ayasofyazilim authored Dec 5, 2024
2 parents 4e57f04 + 9049ec7 commit 126d911
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
28 changes: 28 additions & 0 deletions apps/web/src/app/[lang]/app/actions/ContractService/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import type {
GetApiContractServiceMerchantsByIdContractsContractHeadersData,
GetApiContractServiceMerchantsContractsContractHeadersByIdContractSettingsData,
GetApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
GetApiContractServiceRebateTablesRebateTableHeadersTemplatesData,
GetApiContractServiceRefundTablesRefundFeeHeadersByIdData,
GetApiContractServiceRefundTablesRefundFeeHeadersData,
GetApiContractServiceRefundTablesRefundTableHeadersByIdData,
GetApiContractServiceRefundTablesRefundTableHeadersData,
PostApiContractServiceMerchantsByIdContractsContractHeadersData,
PostApiContractServiceMerchantsContractsContractHeadersByIdContractSettingsData,
PostApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
PutApiContractServiceMerchantsContractsContractHeadersByIdSetDefaultSettingData,
PutApiContractServiceMerchantsContractsContractSettingsByIdData,
} from "@ayasofyazilim/saas/ContractService";
Expand Down Expand Up @@ -48,6 +50,32 @@ export async function postMerchantContractHeadersByMerchantIdApi(
return structuredError(error);
}
}
export async function getMerchantContractHeadersContractStoresByHeaderIdApi(
data: GetApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
) {
try {
const requests = await getApiRequests();
const response =
await requests.merchants.getContractHeadersContractStoresByHeaderId(data);
return structuredResponse(response);
} catch (error) {
return structuredError(error);
}
}
export async function postMerchantContractHeadersContractStoresByHeaderIdApi(
data: PostApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
) {
try {
const requests = await getApiRequests();
const response =
await requests.merchants.postContractHeadersContractStoresByHeaderId(
data,
);
return structuredResponse(response);
} catch (error) {
return structuredError(error);
}
}
export async function getMerchantContractHeaderByIdApi(id: string) {
try {
const requests = await getApiRequests();
Expand Down
14 changes: 14 additions & 0 deletions apps/web/src/app/[lang]/app/actions/api-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import type {
import type {
GetApiContractServiceMerchantsByIdContractsContractHeadersData,
GetApiContractServiceMerchantsContractsContractHeadersByIdContractSettingsData,
GetApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
GetApiContractServiceRebateTablesRebateTableHeadersTemplatesData,
GetApiContractServiceRefundTablesRefundFeeHeadersByIdData,
GetApiContractServiceRefundTablesRefundFeeHeadersData,
GetApiContractServiceRefundTablesRefundTableHeadersByIdData,
GetApiContractServiceRefundTablesRefundTableHeadersData,
PostApiContractServiceMerchantsByIdContractsContractHeadersData,
PostApiContractServiceMerchantsContractsContractHeadersByIdContractSettingsData,
PostApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
PostApiContractServiceMerchantsContractsContractHeadersByIdRebateSettingsData,
PostApiContractServiceRebateTablesRebateTableHeadersTemplatesData,
PostApiContractServiceRefundTablesRefundFeeHeadersByIdRefundFeeDetailsData,
Expand Down Expand Up @@ -245,6 +247,18 @@ export async function getApiRequests() {
await contractsClient.contractsMerchant.deleteApiContractServiceMerchantsContractsContractSettingsById(
{ id },
),
getContractHeadersContractStoresByHeaderId: async (
data: GetApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
) =>
await contractsClient.contractsMerchant.getApiContractServiceMerchantsContractsContractHeadersByIdContractStores(
data,
),
postContractHeadersContractStoresByHeaderId: async (
data: PostApiContractServiceMerchantsContractsContractHeadersByIdContractStoresData,
) =>
await contractsClient.contractsMerchant.postApiContractServiceMerchantsContractsContractHeadersByIdContractStores(
data,
),
getContractHeaderContractSettingsByHeaderId: async (
data: GetApiContractServiceMerchantsContractsContractHeadersByIdContractSettingsData,
) =>
Expand Down

0 comments on commit 126d911

Please sign in to comment.