From 35b6ae7c963174dda6df8e9cfeb10071901e9740 Mon Sep 17 00:00:00 2001 From: yusualhashash Date: Tue, 30 Jul 2024 09:17:41 +0300 Subject: [PATCH 1/7] refactor: add get function --- apps/web/src/app/api/company/[data]/route.ts | 128 +++++++------------ 1 file changed, 45 insertions(+), 83 deletions(-) diff --git a/apps/web/src/app/api/company/[data]/route.ts b/apps/web/src/app/api/company/[data]/route.ts index 01ed97d40..321784686 100644 --- a/apps/web/src/app/api/company/[data]/route.ts +++ b/apps/web/src/app/api/company/[data]/route.ts @@ -1,6 +1,5 @@ import type { Volo_Abp_Http_RemoteServiceErrorResponse } from "@ayasofyazilim/saas/AccountService"; import { ApiError } from "@ayasofyazilim/saas/IdentityService"; -import type { GetApiMerchantServiceMerchantsDetailResponse } from "@ayasofyazilim/saas/MerchantService"; import type { NextRequest } from "next/server"; import { getIdentityServiceClient, @@ -20,85 +19,48 @@ function isApiError(error: unknown): error is ApiError { const clients: Clients = { merchants: async () => { const client = await getMerchantServiceClient(); - const merchant = client.merchant; + const merchant = client.organization; return { get: async () => { - const getDetails: GetApiMerchantServiceMerchantsDetailResponse = - await merchant.getApiMerchantServiceMerchantsDetail({ - maxResultCount: 1000, - }); - return ( - getDetails.items?.map((item) => { - const organization = - item.entityInformations?.[0]?.organizations?.[0]; - return { - Company: organization?.name || "", - CustomerNumber: organization?.customerNumber || "", - ProductGroups: - organization?.productGroups?.map((pg) => pg.name) || [], - Address: - organization?.contactInformation?.addresses?.[0]?.fullAddress || - "", - }; - }) || [] - ); - }, - post: (formdata: any) => { - return formdata; - // return merchant.postApiMerchantServiceMerchantsCreateMerchantWithComponents( - // { - // requestBody: { - // entityInformationTypes: [ - // { - // organizations: [ - // { - // name: formdata.Company, - // taxpayerId: "string", - // legalStatusCode: "string", - // customerNumber: formdata.CustomerNumber, - // contactInformation: { - // startDate: "2024-06-27T10:53:06.853Z", - // endDate: "2024-06-27T10:53:06.853Z", - // telephone: [ - // { - // areaCode: "string", - // localNumber: "string", - // ituCountryCode: "string", - // }, - // ], - // address: [ - // { - // typeCode: 0, - // addressLine: "string", - // city: "string", - // terriority: "string", - // postalCode: "string", - // country: "string", - // fullAddress: formdata.Address, - // }, - // ], - // email: [ - // { - // emailAddress: "string", - // }, - // ], - // }, - // productGroups: [ - // { - // name: formdata.ProductGroups, - // vatRate: 0, - // productCode: "string", - // isActive: true, - // }, - // ], - // }, - // ], - // }, - // ], - // }, - // }, - // ); + const getDetails = + await merchant.getApiMerchantServiceOrganizationsDetail(); + + return getDetails.items?.map((organization) => { + const contactInfo = organization.contactInformation || {}; + const telephone = contactInfo.telephones?.[0] || {}; + const address = contactInfo.addresses?.[0] || {}; + const email = contactInfo.emails?.[0] || {}; + const productGroup = organization.productGroups?.[0] || {}; + + return { + id: organization.id || "", + name: organization.name || "", + taxpayerId: organization.taxpayerId || "", + legalStatusCode: organization.legalStatusCode || "", + customerNumber: organization.customerNumber || "", + areaCode: telephone.areaCode || "", + localNumber: telephone.localNumber || "", + ituCountryCode: telephone.ituCountryCode || "", + primaryFlag: telephone.primaryFlag || false, + telephoneTypeCode: telephone.typeCode || 0, + addressLine: address.addressLine || "", + city: address.city || "", + terriority: address.terriority || "", + postalCode: address.postalCode || "", + country: address.country || "", + fullAddress: address.fullAddress || "", + addressPrimaryFlag: address.primaryFlag || false, + addressTypeCode: address.typeCode || 0, + emailAddress: email.emailAddress || "", + emailPrimaryFlag: email.primaryFlag || false, + emailTypeCode: email.typeCode || 0, + productName: productGroup.name || "", + vatRate: productGroup.vatRate || 0, + productCode: productGroup.productCode || "", + isActive: productGroup.isActive || false, + }; + }); }, }; }, @@ -335,7 +297,7 @@ const clients: Clients = { export async function GET( request: NextRequest, - { params }: { params: { data: string } }, + { params }: { params: { data: string } } ) { if (!clients[params.data]) { // return status 404 @@ -358,7 +320,7 @@ export async function GET( export async function POST( request: NextRequest, - { params }: { params: { data: string } }, + { params }: { params: { data: string } } ) { if (!clients[params.data]) { return errorResponse("Invalid data type"); @@ -373,7 +335,7 @@ export async function POST( const body = error.body as Volo_Abp_Http_RemoteServiceErrorResponse; return errorResponse( body.error?.message || "Something went wrong", - error.status, + error.status ); } return errorResponse("Something went wrong"); @@ -382,7 +344,7 @@ export async function POST( export async function DELETE( request: NextRequest, - { params }: { params: { data: string } }, + { params }: { params: { data: string } } ) { if (!clients[params.data]) { return errorResponse("Invalid data type"); @@ -397,7 +359,7 @@ export async function DELETE( export async function PUT( request: NextRequest, - { params }: { params: { data: string } }, + { params }: { params: { data: string } } ) { if (!clients[params.data]) { return errorResponse("Invalid data type"); @@ -415,7 +377,7 @@ export async function PUT( const body = error.body as Volo_Abp_Http_RemoteServiceErrorResponse; return errorResponse( body.error?.message || "Something went wrong", - error.status, + error.status ); } return errorResponse("Something went wrong"); From b47d4fd2e42c420e28c3d8814e1cb67830b02d41 Mon Sep 17 00:00:00 2001 From: yusualhashash Date: Tue, 30 Jul 2024 09:19:47 +0300 Subject: [PATCH 2/7] feat: add post function for merchant --- apps/web/src/app/api/company/[data]/route.ts | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/apps/web/src/app/api/company/[data]/route.ts b/apps/web/src/app/api/company/[data]/route.ts index 321784686..c1af64fe4 100644 --- a/apps/web/src/app/api/company/[data]/route.ts +++ b/apps/web/src/app/api/company/[data]/route.ts @@ -62,6 +62,54 @@ const clients: Clients = { }; }); }, + post: async (formdata: any) => + merchant.postApiMerchantServiceOrganizations({ + requestBody: { + name: formdata.name, + taxpayerId: formdata.taxpayerId, + legalStatusCode: formdata.legalStatusCode, + customerNumber: formdata.customerNumber, + contactInformation: { + telephones: [ + { + areaCode: formdata.areaCode, + localNumber: formdata.localNumber, + ituCountryCode: formdata.ituCountryCode, + primaryFlag: formdata.primaryFlag, + typeCode: formdata.telephoneTypeCode, + }, + ], + addresses: [ + { + addressLine: formdata.addressLine, + city: formdata.city, + terriority: formdata.terriority, + postalCode: formdata.postalCode, + country: formdata.country, + fullAddress: formdata.fullAddress, + primaryFlag: formdata.addressPrimaryFlag, + typeCode: formdata.addressTypeCode, + }, + ], + emails: [ + { + emailAddress: formdata.emailAddress, + primaryFlag: formdata.emailPrimaryFlag, + typeCode: formdata.emailTypeCode, + }, + ], + }, + productGroups: [ + { + name: formdata.productName, + vatRate: formdata.vatRate, + productCode: formdata.productCode, + isActive: formdata.isActive, + }, + ], + }, + entityInformationTypeId: "e5f7f9e0-ceee-71f6-7b93-3a136c155b82", + }), }; }, From 9392799c5b2d83f649037bab0558c70fb0ba75a0 Mon Sep 17 00:00:00 2001 From: yusualhashash Date: Tue, 30 Jul 2024 09:37:45 +0300 Subject: [PATCH 3/7] feat: add put function for merchant --- apps/web/src/app/api/company/[data]/route.ts | 89 ++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/apps/web/src/app/api/company/[data]/route.ts b/apps/web/src/app/api/company/[data]/route.ts index c1af64fe4..321c1cf79 100644 --- a/apps/web/src/app/api/company/[data]/route.ts +++ b/apps/web/src/app/api/company/[data]/route.ts @@ -110,6 +110,95 @@ const clients: Clients = { }, entityInformationTypeId: "e5f7f9e0-ceee-71f6-7b93-3a136c155b82", }), + put: async (requestBody: { + id: string; + requestBody: { + name: string; + taxpayerId: string; + legalStatusCode: string; + customerNumber: string; + areaCode: string; + localNumber: string; + ituCountryCode: string; + primaryFlag: boolean; + telephoneTypeCode: number; + addressLine: string; + city: string; + terriority: string; + postalCode: string; + country: string; + fullAddress: string; + addressPrimaryFlag: boolean; + addressTypeCode: number; + emailAddress: string; + emailPrimaryFlag: boolean; + emailTypeCode: number; + productName: string; + vatRate: number; + productCode: string; + isActive: boolean; + }; + }) => { + const currentDetails = + await merchant.getApiMerchantServiceOrganizationsDetailById({ + id: requestBody.id, + }); + + const updatedDetails = { + ...currentDetails, + name: requestBody.requestBody.name, + taxpayerId: requestBody.requestBody.taxpayerId, + legalStatusCode: requestBody.requestBody.legalStatusCode, + customerNumber: requestBody.requestBody.customerNumber, + contactInformation: { + ...currentDetails.contactInformation, + telephones: [ + { + ...currentDetails.contactInformation?.telephones?.[0], + areaCode: requestBody.requestBody.areaCode, + localNumber: requestBody.requestBody.localNumber, + ituCountryCode: requestBody.requestBody.ituCountryCode, + primaryFlag: requestBody.requestBody.primaryFlag, + typeCode: requestBody.requestBody.telephoneTypeCode, + }, + ], + addresses: [ + { + ...currentDetails.contactInformation?.addresses?.[0], + addressLine: requestBody.requestBody.addressLine, + city: requestBody.requestBody.city, + terriority: requestBody.requestBody.terriority, + postalCode: requestBody.requestBody.postalCode, + country: requestBody.requestBody.country, + fullAddress: requestBody.requestBody.fullAddress, + primaryFlag: requestBody.requestBody.addressPrimaryFlag, + typeCode: requestBody.requestBody.addressTypeCode, + }, + ], + emails: [ + { + ...currentDetails.contactInformation?.emails?.[0], + emailAddress: requestBody.requestBody.emailAddress, + primaryFlag: requestBody.requestBody.emailPrimaryFlag, + typeCode: requestBody.requestBody.emailTypeCode, + }, + ], + }, + productGroups: [ + { + ...currentDetails.productGroups?.[0], + name: requestBody.requestBody.productName, + vatRate: requestBody.requestBody.vatRate, + productCode: requestBody.requestBody.productCode, + isActive: requestBody.requestBody.isActive, + }, + ], + }; + + return merchant.putApiMerchantServiceOrganizations({ + requestBody: updatedDetails as any, + }); + }, }; }, From 0f168632e2fd8cdd3cba83375a82c4839b696deb Mon Sep 17 00:00:00 2001 From: yusualhashash Date: Tue, 30 Jul 2024 09:39:58 +0300 Subject: [PATCH 4/7] feat: add delete function for merchant --- apps/web/src/app/api/company/[data]/route.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/web/src/app/api/company/[data]/route.ts b/apps/web/src/app/api/company/[data]/route.ts index 321c1cf79..b4e2f591d 100644 --- a/apps/web/src/app/api/company/[data]/route.ts +++ b/apps/web/src/app/api/company/[data]/route.ts @@ -199,6 +199,8 @@ const clients: Clients = { requestBody: updatedDetails as any, }); }, + delete: async (id: string) => + merchant.deleteApiMerchantServiceOrganizations({ id }), }; }, From ff6c459ed7425f6c6fcb5421e44a4a88a303721b Mon Sep 17 00:00:00 2001 From: yusualhashash Date: Tue, 30 Jul 2024 09:41:16 +0300 Subject: [PATCH 5/7] refactor: make the list in company page as horizental --- apps/web/src/app/[lang]/app/[type]/company/layout.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/web/src/app/[lang]/app/[type]/company/layout.tsx b/apps/web/src/app/[lang]/app/[type]/company/layout.tsx index de83ae48c..c5bde74b8 100644 --- a/apps/web/src/app/[lang]/app/[type]/company/layout.tsx +++ b/apps/web/src/app/[lang]/app/[type]/company/layout.tsx @@ -97,7 +97,6 @@ export default function Layout({ children }: LayoutProps) { defaultActiveSectionId={path} linkElement={Link} sections={navbarItems} - vertical > {children} From a69e39eabe449dd1e1f1313cb32222f389938749 Mon Sep 17 00:00:00 2001 From: yusualhashash Date: Tue, 30 Jul 2024 09:42:30 +0300 Subject: [PATCH 6/7] refactor: add all the fileds to the form position in merchant --- .../[lang]/app/[type]/company/[data]/page.tsx | 113 ++++++++++++++---- 1 file changed, 91 insertions(+), 22 deletions(-) diff --git a/apps/web/src/app/[lang]/app/[type]/company/[data]/page.tsx b/apps/web/src/app/[lang]/app/[type]/company/[data]/page.tsx index 4861aa9cc..f5cb6cb24 100644 --- a/apps/web/src/app/[lang]/app/[type]/company/[data]/page.tsx +++ b/apps/web/src/app/[lang]/app/[type]/company/[data]/page.tsx @@ -22,7 +22,6 @@ import { $showRefund_points, $showTax_free, } from "./schemas.gen"; - async function controlledFetch( url: string, options: RequestInit, @@ -44,7 +43,6 @@ async function controlledFetch( toast.error("Something went wrong 3 "); } } - interface formModifier { formPositions?: string[]; excludeList?: string[]; @@ -57,7 +55,6 @@ interface formModifier { when: (_value: any) => boolean; }[]; } - interface tableData { createFormSchema: formModifier; editFormSchema: formModifier; @@ -67,21 +64,107 @@ interface tableData { const dataConfig: Record = { merchants: { - filterBy: "Company", + filterBy: "name", createFormSchema: { - formPositions: ["Company", "CustomerNumber", "ProductGroups", "Address"], + formPositions: [ + "name", + "taxpayerId", + "legalStatusCode", + "customerNumber", + "areaCode", + "localNumber", + "ituCountryCode", + "primaryFlag", + "telephoneTypeCode", + "addressLine", + "city", + "terriority", + "postalCode", + "country", + "fullAddress", + "addressPrimaryFlag", + "addressTypeCode", + "emailAddress", + "emailPrimaryFlag", + "emailTypeCode", + "productName", + "vatRate", + "productCode", + "isActive", + ], + schema: $createMerchants, }, editFormSchema: { - formPositions: ["Company", "CustomerNumber", "ProductGroups", "Address"], + formPositions: [ + "name", + "taxpayerId", + "legalStatusCode", + "customerNumber", + "areaCode", + "localNumber", + "ituCountryCode", + "primaryFlag", + "telephoneTypeCode", + "addressLine", + "city", + "terriority", + "postalCode", + "country", + "fullAddress", + "addressPrimaryFlag", + "addressTypeCode", + "emailAddress", + "emailPrimaryFlag", + "emailTypeCode", + "productName", + "vatRate", + "productCode", + "isActive", + ], schema: $editMerchants, }, tableSchema: { - formPositions: ["Company", "CustomerNumber", "ProductGroups", "Address"], + excludeList: [ + "id", + "creationTime", + "creatorId", + "lastModificationTime", + "lastModifierId", + "isDeleted", + "deleterId", + "deletionTime", + "parentCompanyId", + ], + formPositions: [ + "name", + "taxpayerId", + "legalStatusCode", + "customerNumber", + "areaCode", + "localNumber", + "ituCountryCode", + "primaryFlag", + "telephoneTypeCode", + "addressLine", + "city", + "terriority", + "postalCode", + "country", + "fullAddress", + "addressPrimaryFlag", + "addressTypeCode", + "emailAddress", + "emailPrimaryFlag", + "emailTypeCode", + "productName", + "vatRate", + "productCode", + "isActive", + ], schema: $showMerchants, }, }, - refund_points: { createFormSchema: { formPositions: ["Company", "CustomerNumber", "ProductGroups", "Address"], @@ -97,7 +180,6 @@ const dataConfig: Record = { }, filterBy: "Company", }, - customs: { createFormSchema: { formPositions: ["Company", "CustomerNumber", "ProductGroups", "Address"], @@ -113,7 +195,6 @@ const dataConfig: Record = { }, filterBy: "Company", }, - tax_free: { filterBy: "Company", createFormSchema: { @@ -129,7 +210,6 @@ const dataConfig: Record = { excludeList: ["Company", "CustomerNumber", "ProductGroups", "Address"], }, }, - tax_offices: { filterBy: "Company", createFormSchema: { @@ -146,7 +226,6 @@ const dataConfig: Record = { }, }, }; - function convertEnumField( value: string | number, enumArray: string[], @@ -156,7 +235,6 @@ function convertEnumField( } return enumArray.indexOf(value); } - export default function Page({ params, }: { @@ -165,7 +243,6 @@ export default function Page({ const [roles, setRoles] = useState(); const [isLoading, setIsLoading] = useState(true); const fetchLink = getBaseLink(`/api/company/${params.data}`); - function getRoles() { function onData(data: any) { let returnData = data; @@ -225,12 +302,10 @@ export default function Page({ ); }, }; - useEffect(() => { setIsLoading(true); getRoles(); }, []); - function parseFormValues(schema: formModifier, data: any) { const newSchema = createZodObject( schema.schema, @@ -244,13 +319,11 @@ export default function Page({ Object.entries(schema.convertors).forEach(([key, value]) => { returnObject[key] = convertEnumField(returnObject[key], value); }); - return returnObject; }); const parsed = transformedSchema.parse(data); return parsed; } - const onEdit = (data: any, row: any, editFormSchema: any) => { const parsedData = parseFormValues(editFormSchema, data); controlledFetch( @@ -266,7 +339,6 @@ export default function Page({ "Updated Successfully", ); }; - const onDelete = (e: any, row: any) => { controlledFetch( fetchLink, @@ -278,7 +350,6 @@ export default function Page({ "Deleted Successfully", ); }; - function convertZod(schema: formModifier) { const newSchema = createZodObject( schema.schema, @@ -289,7 +360,6 @@ export default function Page({ } const editFormSchema = dataConfig[params.data].editFormSchema; const editFormSchemaZod = convertZod(editFormSchema); - const columnsData: columnsType = { type: "Auto", data: { @@ -307,7 +377,6 @@ export default function Page({ onDelete, }, }; - return ( Date: Tue, 30 Jul 2024 09:43:11 +0300 Subject: [PATCH 7/7] refactor: add all the fileds to scheme in merchant --- .../app/[type]/company/[data]/schemas.gen.ts | 278 +++++++++++++++++- 1 file changed, 264 insertions(+), 14 deletions(-) diff --git a/apps/web/src/app/[lang]/app/[type]/company/[data]/schemas.gen.ts b/apps/web/src/app/[lang]/app/[type]/company/[data]/schemas.gen.ts index 2ed8008a7..1f8cdc884 100644 --- a/apps/web/src/app/[lang]/app/[type]/company/[data]/schemas.gen.ts +++ b/apps/web/src/app/[lang]/app/[type]/company/[data]/schemas.gen.ts @@ -1,80 +1,330 @@ export const $createMerchants = { - required: ["adminEmailAddress", "adminPassword", "name"], type: "object", properties: { - Company: { + name: { maxLength: 64, minLength: 0, type: "string", }, - CustomerNumber: { + taxpayerId: { maxLength: 64, minLength: 0, type: "string", }, - ProductGroups: { + legalStatusCode: { maxLength: 64, minLength: 0, type: "string", }, - Address: { + customerNumber: { + maxLength: 64, + minLength: 0, + type: "string", + }, + areaCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + localNumber: { + maxLength: 64, + minLength: 0, + type: "string", + }, + ituCountryCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + primaryFlag: { + type: "boolean", + }, + telephoneTypeCode: { + type: "integer", + }, + addressLine: { + maxLength: 64, + minLength: 0, + type: "string", + }, + city: { + maxLength: 64, + minLength: 0, + type: "string", + }, + terriority: { + maxLength: 64, + minLength: 0, + type: "string", + }, + postalCode: { maxLength: 64, minLength: 0, type: "string", }, + country: { + maxLength: 64, + minLength: 0, + type: "string", + }, + fullAddress: { + maxLength: 64, + minLength: 0, + type: "string", + }, + addressPrimaryFlag: { + type: "boolean", + }, + addressTypeCode: { + type: "integer", + }, + emailAddress: { + maxLength: 64, + minLength: 0, + type: "string", + }, + emailPrimaryFlag: { + type: "boolean", + }, + emailTypeCode: { + type: "integer", + }, + productName: { + maxLength: 64, + minLength: 0, + type: "string", + }, + vatRate: { + type: "integer", + }, + productCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + isActive: { + type: "boolean", + }, }, } as const; export const $showMerchants = { type: "object", properties: { - Company: { + name: { maxLength: 64, minLength: 0, type: "string", }, - CustomerNumber: { + taxpayerId: { maxLength: 64, minLength: 0, type: "string", }, - ProductGroups: { + legalStatusCode: { maxLength: 64, minLength: 0, type: "string", }, - Address: { + customerNumber: { maxLength: 64, minLength: 0, type: "string", }, + areaCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + localNumber: { + maxLength: 64, + minLength: 0, + type: "string", + }, + ituCountryCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + primaryFlag: { + type: "boolean", + }, + telephoneTypeCode: { + type: "integer", + }, + addressLine: { + maxLength: 64, + minLength: 0, + type: "string", + }, + city: { + maxLength: 64, + minLength: 0, + type: "string", + }, + terriority: { + maxLength: 64, + minLength: 0, + type: "string", + }, + postalCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + country: { + maxLength: 64, + minLength: 0, + type: "string", + }, + fullAddress: { + maxLength: 64, + minLength: 0, + type: "string", + }, + addressPrimaryFlag: { + type: "boolean", + }, + addressTypeCode: { + type: "integer", + }, + emailAddress: { + maxLength: 64, + minLength: 0, + type: "string", + }, + emailPrimaryFlag: { + type: "boolean", + }, + emailTypeCode: { + type: "integer", + }, + productName: { + maxLength: 64, + minLength: 0, + type: "string", + }, + vatRate: { + type: "integer", + }, + productCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + isActive: { + type: "boolean", + }, }, } as const; export const $editMerchants = { - required: ["name"], type: "object", properties: { - Company: { + name: { maxLength: 64, minLength: 0, type: "string", }, - CustomerNumber: { + taxpayerId: { maxLength: 64, minLength: 0, type: "string", }, - ProductGroups: { + legalStatusCode: { maxLength: 64, minLength: 0, type: "string", }, - Address: { + customerNumber: { + maxLength: 64, + minLength: 0, + type: "string", + }, + areaCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + localNumber: { + maxLength: 64, + minLength: 0, + type: "string", + }, + ituCountryCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + primaryFlag: { + type: "boolean", + }, + telephoneTypeCode: { + type: "integer", + }, + addressLine: { + maxLength: 64, + minLength: 0, + type: "string", + }, + city: { + maxLength: 64, + minLength: 0, + type: "string", + }, + terriority: { + maxLength: 64, + minLength: 0, + type: "string", + }, + postalCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + country: { maxLength: 64, minLength: 0, type: "string", }, + fullAddress: { + maxLength: 64, + minLength: 0, + type: "string", + }, + addressPrimaryFlag: { + type: "boolean", + }, + addressTypeCode: { + type: "integer", + }, + emailAddress: { + maxLength: 64, + minLength: 0, + type: "string", + }, + emailPrimaryFlag: { + type: "boolean", + }, + emailTypeCode: { + type: "integer", + }, + productName: { + maxLength: 64, + minLength: 0, + type: "string", + }, + vatRate: { + type: "integer", + }, + productCode: { + maxLength: 64, + minLength: 0, + type: "string", + }, + isActive: { + type: "boolean", + }, }, } as const;