diff --git a/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/details.tsx b/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/details.tsx new file mode 100644 index 000000000..fb777cbd3 --- /dev/null +++ b/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/details.tsx @@ -0,0 +1,116 @@ +"use client"; +import type { UniRefund_ContractService_ContractsForMerchant_ContractHeaders_ContractHeaderDetailForMerchantDto as ContractHeaderDetailForMerchantDto } from "@ayasofyazilim/saas/ContractService"; +import { $UniRefund_ContractService_ContractsForMerchant_ContractHeaders_ContractHeaderDetailForMerchantDto as $ContractHeaderDetailForMerchantDto } from "@ayasofyazilim/saas/ContractService"; +import { createZodObject } from "@repo/ayasofyazilim-ui/lib/create-zod-object"; +import AutoForm from "@repo/ayasofyazilim-ui/organisms/auto-form"; +import { + SectionLayout, + SectionLayoutContent, +} from "@repo/ayasofyazilim-ui/templates/section-layout-v2"; +import type { ContractServiceResource } from "src/language-data/ContractService"; + +interface DetailsProp { + contractHeaderDetails: ContractHeaderDetailForMerchantDto; + partyName: "merchants"; + partyId: string; + languageData: ContractServiceResource; +} +export default function Details({ ...props }: DetailsProp) { + const { languageData } = props; + return ( + + + + {/* */} + + + ); +} + +function ContractSection({ ...props }: DetailsProp) { + const $DetailsSchema = createZodObject( + $ContractHeaderDetailForMerchantDto, + [ + "name", + "webSite", + "merchantClassification", + "status", + "isDraft", + "addressCommonData", + "contractHeaderRefundTableHeaders", + ], + undefined, + { + merchantBasicInformationDto: ["name", "numberOfStores"], + addressCommonData: [ + "countryId", + "regionId", + "cityId", + "districtId", + "neighborhoodId", + "addressLine", + "type", + ], + }, + ); + + return ( + + + + ); +} + +function ContractSettingsSection({ languageData }: DetailsProp) { + return ( + + <>{languageData["Contracts.Create.ContractSettings"]} + + ); +} + +function RebateSettingsSection({ languageData }: DetailsProp) { + return ( + + <>{languageData["Contracts.Create.RebateSettings"]} + + ); +} diff --git a/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/page.tsx b/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/page.tsx index 4132c1fc9..84c9f8403 100644 --- a/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/page.tsx +++ b/apps/web/src/app/[lang]/app/[type]/parties/[partyName]/[partyId]/contracts/[contractId]/page.tsx @@ -1,18 +1,40 @@ +import { getResourceData } from "src/language-data/ContractService"; import { getBaseLink } from "src/utils"; +import { getMerchantContractHeaderByIdApi } from "src/app/[lang]/app/actions/ContractService/action"; +import Details from "./details"; -export default function Page({ +export default async function Page({ params, }: { - params: { contractId: string; partyName: string; partyId: string }; -}): JSX.Element { + params: { + contractId: string; + partyName: "merchants"; + partyId: string; + lang: string; + }; +}) { + const contractHeaderDetails = await getMerchantContractHeaderByIdApi( + params.contractId, + ); + if (contractHeaderDetails.type !== "success") { + return <>XS; + } + + const { languageData } = await getResourceData(params.lang); return ( <> -
{params.contractId}
+
- Edit Contract - {params.contractId} + {languageData["Contracts.Edit.Title"]} - ( + {contractHeaderDetails.data.name})
- You can edit contract from here. + {languageData["Contracts.Edit.Description"]}