diff --git a/apps/console/src/components/form/CountriesField.tsx b/apps/console/src/components/form/CountriesField.tsx new file mode 100644 index 000000000..9648552db --- /dev/null +++ b/apps/console/src/components/form/CountriesField.tsx @@ -0,0 +1,169 @@ +import { useTranslate } from "@probo/i18n"; +import { useRef, useState } from "react"; +import { Badge, Input, IconCrossLargeX } from "@probo/ui"; +import { type Control, Controller, type FieldPath, type FieldValues } from "react-hook-form"; +import { getCountryName, getCountryOptions, countries, type CountryCode } from "@probo/helpers"; +import clsx from "clsx"; + +type Props = { + control: Control; + name: FieldPath; + disabled?: boolean; +}; + +export function CountriesField({ control, name, disabled }: Props) { + return ( + ( + + )} + /> + ); +} + +type CountriesFieldInputProps = { + value: string[]; + onValueChange: (value: string[]) => void; + disabled?: boolean; +}; + +function CountriesFieldInput(props: CountriesFieldInputProps) { + const { __ } = useTranslate(); + const animateBadge = useRef(false); + + const addCountry = (code: string) => { + animateBadge.current = true; + props.onValueChange([...props.value, code]); + }; + + const removeCountry = (code: string) => { + animateBadge.current = true; + props.onValueChange(props.value.filter((v) => v !== code)); + }; + + return ( +
0 ? "space-y-4" : "")}> + {props.value.length > 0 && ( +
+
+ {props.value.map((countryCode) => ( + + + + ))} +
+
+ )} + {!props.disabled && ( + !props.value.includes(c) + )} + onAdd={addCountry} + /> + )} +
+ ); +} + +type CountryInputProps = { + availableCountries: readonly CountryCode[]; + onAdd: (code: string) => void; +}; + +function CountryInput({ availableCountries, onAdd }: CountryInputProps) { + const { __ } = useTranslate(); + const [search, setSearch] = useState(""); + const [isOpen, setIsOpen] = useState(false); + const countryOptions = getCountryOptions(__); + + const filteredCountries = countryOptions + .filter((option: { value: string; label: string }) => availableCountries.includes(option.value as CountryCode)) + .filter((option: { value: string; label: string }) => + option.label.toLowerCase().includes(search.toLowerCase()) + ); + + const handleCountryClick = (value: string) => { + onAdd(value); + setSearch(""); + }; + + return ( +
+
+
+ setSearch(e.target.value)} + onFocus={() => setIsOpen(true)} + placeholder={__("Search and add countries...")} + className="w-full pr-8" + /> + +
+
+ + {isOpen && filteredCountries.length > 0 && ( +
+ {filteredCountries.map((option: { value: string; label: string }) => ( + + ))} +
+ )} + + {isOpen && ( +
setIsOpen(false)} + /> + )} +
+ ); +} diff --git a/apps/console/src/hooks/forms/__generated__/useVendorFormFragment.graphql.ts b/apps/console/src/hooks/forms/__generated__/useVendorFormFragment.graphql.ts index c8f5e4b2c..71e62b341 100644 --- a/apps/console/src/hooks/forms/__generated__/useVendorFormFragment.graphql.ts +++ b/apps/console/src/hooks/forms/__generated__/useVendorFormFragment.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<28b582a607c240a6304ea42cb2451776>> * @lightSyntaxTransform * @nogrep */ @@ -9,12 +9,16 @@ // @ts-nocheck import { ReaderFragment } from 'relay-runtime'; +export type CountryCode = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW"; +export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL"; import { FragmentRefs } from "relay-runtime"; export type useVendorFormFragment$data = { readonly businessOwner: { readonly id: string; } | null | undefined; + readonly category: VendorCategory; readonly certifications: ReadonlyArray; + readonly countries: ReadonlyArray; readonly dataProcessingAgreementUrl: string | null | undefined; readonly description: string | null | undefined; readonly headquarterAddress: string | null | undefined; @@ -70,6 +74,13 @@ return { "name": "description", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "category", + "storageKey": null + }, { "alias": null, "args": null, @@ -133,6 +144,13 @@ return { "name": "certifications", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "countries", + "storageKey": null + }, { "alias": null, "args": null, @@ -173,6 +191,6 @@ return { }; })(); -(node as any).hash = "87f1029f8c634a5f7efdb6d7abe17709"; +(node as any).hash = "89148658660d29dbe0ab6761300c6771"; export default node; diff --git a/apps/console/src/hooks/forms/__generated__/useVendorFormMutation.graphql.ts b/apps/console/src/hooks/forms/__generated__/useVendorFormMutation.graphql.ts index 7caa9b286..a69700f59 100644 --- a/apps/console/src/hooks/forms/__generated__/useVendorFormMutation.graphql.ts +++ b/apps/console/src/hooks/forms/__generated__/useVendorFormMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<3f3a2de3bcfe5c2e7abbea0ba0fb4848>> * @lightSyntaxTransform * @nogrep */ @@ -10,12 +10,14 @@ import { ConcreteRequest } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; +export type CountryCode = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW"; export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL"; export type UpdateVendorInput = { businessAssociateAgreementUrl?: string | null | undefined; businessOwnerId?: string | null | undefined; category?: VendorCategory | null | undefined; certifications?: ReadonlyArray | null | undefined; + countries?: ReadonlyArray | null | undefined; dataProcessingAgreementUrl?: string | null | undefined; description?: string | null | undefined; headquarterAddress?: string | null | undefined; @@ -148,6 +150,13 @@ return { "name": "description", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "category", + "storageKey": null + }, { "alias": null, "args": null, @@ -211,6 +220,13 @@ return { "name": "certifications", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "countries", + "storageKey": null + }, { "alias": null, "args": null, @@ -254,12 +270,12 @@ return { ] }, "params": { - "cacheID": "324b4589b4692806f555489703521bcd", + "cacheID": "35a5e6d13ef172a9a8640740a5606b46", "id": null, "metadata": {}, "name": "useVendorFormMutation", "operationKind": "mutation", - "text": "mutation useVendorFormMutation(\n $input: UpdateVendorInput!\n) {\n updateVendor(input: $input) {\n vendor {\n ...useVendorFormFragment\n id\n }\n }\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n" + "text": "mutation useVendorFormMutation(\n $input: UpdateVendorInput!\n) {\n updateVendor(input: $input) {\n vendor {\n ...useVendorFormFragment\n id\n }\n }\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n" } }; })(); diff --git a/apps/console/src/hooks/forms/useVendorForm.tsx b/apps/console/src/hooks/forms/useVendorForm.tsx index 1376442f4..1c11fa516 100644 --- a/apps/console/src/hooks/forms/useVendorForm.tsx +++ b/apps/console/src/hooks/forms/useVendorForm.tsx @@ -10,6 +10,7 @@ import { useEffect, useMemo } from "react"; const schema = z.object({ name: z.string(), description: z.string(), + category: z.string().nullish(), statusPageUrl: z.string(), termsOfServiceUrl: z.string(), privacyPolicyUrl: z.string(), @@ -19,6 +20,7 @@ const schema = z.object({ legalName: z.string(), headquarterAddress: z.string(), certifications: z.array(z.string()), + countries: z.array(z.string()), securityPageUrl: z.string(), trustPageUrl: z.string(), businessOwnerId: z.string().nullish(), @@ -30,6 +32,7 @@ const vendorFormFragment = graphql` id name description + category statusPageUrl termsOfServiceUrl privacyPolicyUrl @@ -39,6 +42,7 @@ const vendorFormFragment = graphql` legalName headquarterAddress certifications + countries securityPageUrl trustPageUrl businessOwner { @@ -73,6 +77,7 @@ export function useVendorForm(vendorKey: useVendorFormFragment$key) { () => ({ name: vendor.name, description: vendor.description ?? "", + category: vendor.category ?? null, statusPageUrl: vendor.statusPageUrl ?? "", termsOfServiceUrl: vendor.termsOfServiceUrl ?? "", privacyPolicyUrl: vendor.privacyPolicyUrl ?? "", @@ -82,6 +87,7 @@ export function useVendorForm(vendorKey: useVendorFormFragment$key) { legalName: vendor.legalName ?? "", headquarterAddress: vendor.headquarterAddress ?? "", certifications: [...(vendor.certifications ?? [])], + countries: [...(vendor.countries ?? [])], securityPageUrl: vendor.securityPageUrl ?? "", trustPageUrl: vendor.trustPageUrl ?? "", businessOwnerId: vendor.businessOwner?.id, diff --git a/apps/console/src/hooks/graph/__generated__/TrustCenterVendorGraphUpdateMutation.graphql.ts b/apps/console/src/hooks/graph/__generated__/TrustCenterVendorGraphUpdateMutation.graphql.ts index 481ee137c..c5475a0a9 100644 --- a/apps/console/src/hooks/graph/__generated__/TrustCenterVendorGraphUpdateMutation.graphql.ts +++ b/apps/console/src/hooks/graph/__generated__/TrustCenterVendorGraphUpdateMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<309fa8f1d9e203536f9b7d00b3622456>> * @lightSyntaxTransform * @nogrep */ @@ -10,12 +10,14 @@ import { ConcreteRequest } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; +export type CountryCode = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW"; export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL"; export type UpdateVendorInput = { businessAssociateAgreementUrl?: string | null | undefined; businessOwnerId?: string | null | undefined; category?: VendorCategory | null | undefined; certifications?: ReadonlyArray | null | undefined; + countries?: ReadonlyArray | null | undefined; dataProcessingAgreementUrl?: string | null | undefined; description?: string | null | undefined; headquarterAddress?: string | null | undefined; diff --git a/apps/console/src/hooks/graph/__generated__/VendorGraphCreateMutation.graphql.ts b/apps/console/src/hooks/graph/__generated__/VendorGraphCreateMutation.graphql.ts index c1c3b9262..6f3f5608d 100644 --- a/apps/console/src/hooks/graph/__generated__/VendorGraphCreateMutation.graphql.ts +++ b/apps/console/src/hooks/graph/__generated__/VendorGraphCreateMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<8ef289e99926f279eb0e2d5ea955cb32>> + * @generated SignedSource<<58e32433a39672dcebad5b51c5d18bd4>> * @lightSyntaxTransform * @nogrep */ @@ -9,12 +9,14 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; +export type CountryCode = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW"; export type VendorCategory = "ANALYTICS" | "CLOUD_MONITORING" | "CLOUD_PROVIDER" | "COLLABORATION" | "CUSTOMER_SUPPORT" | "DATA_STORAGE_AND_PROCESSING" | "DOCUMENT_MANAGEMENT" | "EMPLOYEE_MANAGEMENT" | "ENGINEERING" | "FINANCE" | "IDENTITY_PROVIDER" | "IT" | "MARKETING" | "OFFICE_OPERATIONS" | "OTHER" | "PASSWORD_MANAGEMENT" | "PRODUCT_AND_DESIGN" | "PROFESSIONAL_SERVICES" | "RECRUITING" | "SALES" | "SECURITY" | "VERSION_CONTROL"; export type CreateVendorInput = { businessAssociateAgreementUrl?: string | null | undefined; businessOwnerId?: string | null | undefined; category?: VendorCategory | null | undefined; certifications?: ReadonlyArray | null | undefined; + countries?: ReadonlyArray | null | undefined; dataProcessingAgreementUrl?: string | null | undefined; description?: string | null | undefined; headquarterAddress?: string | null | undefined; diff --git a/apps/console/src/hooks/graph/__generated__/VendorGraphNodeQuery.graphql.ts b/apps/console/src/hooks/graph/__generated__/VendorGraphNodeQuery.graphql.ts index 3fc407fe4..23dc724bd 100644 --- a/apps/console/src/hooks/graph/__generated__/VendorGraphNodeQuery.graphql.ts +++ b/apps/console/src/hooks/graph/__generated__/VendorGraphNodeQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<15c7796ac43c03708488ba03ef9d76a6>> * @lightSyntaxTransform * @nogrep */ @@ -361,6 +361,13 @@ return { (v5/*: any*/), (v6/*: any*/), (v10/*: any*/), + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "category", + "storageKey": null + }, { "alias": null, "args": null, @@ -417,6 +424,13 @@ return { "name": "certifications", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "countries", + "storageKey": null + }, { "alias": null, "args": null, @@ -807,12 +821,12 @@ return { ] }, "params": { - "cacheID": "f0b506b57e84959deb0b1e3fa0481897", + "cacheID": "90924936acacd1851e8e81b1d94d6655", "id": null, "metadata": {}, "name": "VendorGraphNodeQuery", "operationKind": "query", - "text": "query VendorGraphNodeQuery(\n $vendorId: ID!\n $organizationId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n snapshotId\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorContactsTabFragment\n ...VendorServicesTabFragment\n ...VendorRiskAssessmentTabFragment\n ...VendorOverviewTabBusinessAssociateAgreementFragment\n ...VendorOverviewTabDataPrivacyAgreementFragment\n }\n id\n }\n viewer {\n user {\n people(organizationId: $organizationId) {\n id\n }\n id\n }\n id\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n fileUrl\n fileSize\n}\n\nfragment VendorContactsTabFragment on Vendor {\n contacts(first: 50) {\n edges {\n node {\n id\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n\nfragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {\n businessAssociateAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorOverviewTabDataPrivacyAgreementFragment on Vendor {\n dataPrivacyAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n assessedAt\n assessedBy {\n id\n fullName\n }\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment VendorServicesTabFragment on Vendor {\n services(first: 50) {\n edges {\n node {\n id\n ...VendorServicesTabFragment_service\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n" + "text": "query VendorGraphNodeQuery(\n $vendorId: ID!\n $organizationId: ID!\n) {\n node(id: $vendorId) {\n __typename\n ... on Vendor {\n id\n snapshotId\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorContactsTabFragment\n ...VendorServicesTabFragment\n ...VendorRiskAssessmentTabFragment\n ...VendorOverviewTabBusinessAssociateAgreementFragment\n ...VendorOverviewTabDataPrivacyAgreementFragment\n }\n id\n }\n viewer {\n user {\n people(organizationId: $organizationId) {\n id\n }\n id\n }\n id\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n fileUrl\n fileSize\n}\n\nfragment VendorContactsTabFragment on Vendor {\n contacts(first: 50) {\n edges {\n node {\n id\n ...VendorContactsTabFragment_contact\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorContactsTabFragment_contact on VendorContact {\n id\n fullName\n email\n phone\n role\n createdAt\n updatedAt\n}\n\nfragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor {\n businessAssociateAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorOverviewTabDataPrivacyAgreementFragment on Vendor {\n dataPrivacyAgreement {\n id\n fileName\n fileUrl\n validFrom\n validUntil\n createdAt\n }\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n assessedAt\n assessedBy {\n id\n fullName\n }\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment VendorServicesTabFragment on Vendor {\n services(first: 50) {\n edges {\n node {\n id\n ...VendorServicesTabFragment_service\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorServicesTabFragment_service on VendorService {\n id\n name\n description\n createdAt\n updatedAt\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n" } }; })(); diff --git a/apps/console/src/pages/organizations/vendors/dialogs/CreateVendorDialog.tsx b/apps/console/src/pages/organizations/vendors/dialogs/CreateVendorDialog.tsx index f6fd5ffc9..8946b7c87 100644 --- a/apps/console/src/pages/organizations/vendors/dialogs/CreateVendorDialog.tsx +++ b/apps/console/src/pages/organizations/vendors/dialogs/CreateVendorDialog.tsx @@ -51,6 +51,7 @@ export function CreateVendorDialog({ serviceLevelAgreementUrl: vendor.serviceLevelAgreementUrl, dataProcessingAgreementUrl: vendor.dataProcessingAgreementUrl, certifications: vendor.certifications, + countries: vendor.countries, securityPageUrl: vendor.securityPageUrl, trustPageUrl: vendor.trustPageUrl, statusPageUrl: vendor.statusPageUrl, diff --git a/apps/console/src/pages/organizations/vendors/dialogs/__generated__/ImportAssessmentDialogMutation.graphql.ts b/apps/console/src/pages/organizations/vendors/dialogs/__generated__/ImportAssessmentDialogMutation.graphql.ts index 98f6f42f1..10b1601fe 100644 --- a/apps/console/src/pages/organizations/vendors/dialogs/__generated__/ImportAssessmentDialogMutation.graphql.ts +++ b/apps/console/src/pages/organizations/vendors/dialogs/__generated__/ImportAssessmentDialogMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<6db92ed13cdca3a852d1b7b9c113840e>> * @lightSyntaxTransform * @nogrep */ @@ -218,6 +218,13 @@ return { "name": "description", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "category", + "storageKey": null + }, { "alias": null, "args": null, @@ -274,6 +281,13 @@ return { "name": "certifications", "storageKey": null }, + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "countries", + "storageKey": null + }, { "alias": null, "args": null, @@ -528,12 +542,12 @@ return { ] }, "params": { - "cacheID": "dbe0c3ef0f5d4d36436224603629d30a", + "cacheID": "025f271f1dca46c6f052f0d59a4315cc", "id": null, "metadata": {}, "name": "ImportAssessmentDialogMutation", "operationKind": "mutation", - "text": "mutation ImportAssessmentDialogMutation(\n $input: AssessVendorInput!\n) {\n assessVendor(input: $input) {\n vendor {\n id\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorRiskAssessmentTabFragment\n }\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n fileUrl\n fileSize\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n assessedAt\n assessedBy {\n id\n fullName\n }\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n" + "text": "mutation ImportAssessmentDialogMutation(\n $input: AssessVendorInput!\n) {\n assessVendor(input: $input) {\n vendor {\n id\n name\n websiteUrl\n ...useVendorFormFragment\n ...VendorComplianceTabFragment\n ...VendorRiskAssessmentTabFragment\n }\n }\n}\n\nfragment VendorComplianceTabFragment on Vendor {\n complianceReports(first: 50) {\n edges {\n node {\n id\n ...VendorComplianceTabFragment_report\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n id\n}\n\nfragment VendorComplianceTabFragment_report on VendorComplianceReport {\n id\n reportDate\n validUntil\n reportName\n fileUrl\n fileSize\n}\n\nfragment VendorRiskAssessmentTabFragment on Vendor {\n id\n riskAssessments(first: 50) {\n edges {\n node {\n id\n ...VendorRiskAssessmentTabFragment_assessment\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n hasPreviousPage\n startCursor\n }\n }\n}\n\nfragment VendorRiskAssessmentTabFragment_assessment on VendorRiskAssessment {\n id\n assessedAt\n assessedBy {\n id\n fullName\n }\n expiresAt\n dataSensitivity\n businessImpact\n notes\n}\n\nfragment useVendorFormFragment on Vendor {\n id\n name\n description\n category\n statusPageUrl\n termsOfServiceUrl\n privacyPolicyUrl\n serviceLevelAgreementUrl\n dataProcessingAgreementUrl\n websiteUrl\n legalName\n headquarterAddress\n certifications\n countries\n securityPageUrl\n trustPageUrl\n businessOwner {\n id\n }\n securityOwner {\n id\n }\n}\n" } }; })(); diff --git a/apps/console/src/pages/organizations/vendors/tabs/VendorOverviewTab.tsx b/apps/console/src/pages/organizations/vendors/tabs/VendorOverviewTab.tsx index 3d9c8d065..2def05d05 100644 --- a/apps/console/src/pages/organizations/vendors/tabs/VendorOverviewTab.tsx +++ b/apps/console/src/pages/organizations/vendors/tabs/VendorOverviewTab.tsx @@ -1,8 +1,10 @@ import { useTranslate } from "@probo/i18n"; import { useVendorForm } from "/hooks/forms/useVendorForm"; import { useOutletContext, useParams } from "react-router"; -import { Button, Card, Field, Input, IconPlusLarge, IconTrashCan, IconPencil } from "@probo/ui"; +import { Button, Card, Field, Input, IconPlusLarge, IconTrashCan, IconPencil, Option } from "@probo/ui"; import { PeopleSelectField } from "/components/form/PeopleSelectField"; +import { ControlledField } from "/components/form/ControlledField"; +import { CountriesField } from "/components/form/CountriesField"; import { useOrganizationId } from "/hooks/useOrganizationId"; import { useMemo } from "react"; import { usePageTitle } from "@probo/hooks"; @@ -17,6 +19,7 @@ import { EditDataPrivacyAgreementDialog } from "../dialogs/EditDataPrivacyAgreem import type { useVendorFormFragment$key } from "/hooks/forms/__generated__/useVendorFormFragment.graphql"; import type { VendorOverviewTabBusinessAssociateAgreementFragment$key } from "./__generated__/VendorOverviewTabBusinessAssociateAgreementFragment.graphql"; import type { VendorOverviewTabDataPrivacyAgreementFragment$key } from "./__generated__/VendorOverviewTabDataPrivacyAgreementFragment.graphql"; +import type { VendorCategory } from "@probo/vendors"; const vendorBusinessAssociateAgreementFragment = graphql` fragment VendorOverviewTabBusinessAssociateAgreementFragment on Vendor { @@ -54,6 +57,31 @@ export default function VendorOverviewTab() { }>(); const { __ } = useTranslate(); + + const vendorCategories: { value: VendorCategory; label: string }[] = [ + { value: "ANALYTICS", label: __("Analytics") }, + { value: "CLOUD_MONITORING", label: __("Cloud Monitoring") }, + { value: "CLOUD_PROVIDER", label: __("Cloud Provider") }, + { value: "COLLABORATION", label: __("Collaboration") }, + { value: "CUSTOMER_SUPPORT", label: __("Customer Support") }, + { value: "DATA_STORAGE_AND_PROCESSING", label: __("Data Storage and Processing") }, + { value: "DOCUMENT_MANAGEMENT", label: __("Document Management") }, + { value: "EMPLOYEE_MANAGEMENT", label: __("Employee Management") }, + { value: "ENGINEERING", label: __("Engineering") }, + { value: "FINANCE", label: __("Finance") }, + { value: "IDENTITY_PROVIDER", label: __("Identity Provider") }, + { value: "IT", label: __("IT") }, + { value: "MARKETING", label: __("Marketing") }, + { value: "OFFICE_OPERATIONS", label: __("Office Operations") }, + { value: "OTHER", label: __("Other") }, + { value: "PASSWORD_MANAGEMENT", label: __("Password Management") }, + { value: "PRODUCT_AND_DESIGN", label: __("Product and Design") }, + { value: "PROFESSIONAL_SERVICES", label: __("Professional Services") }, + { value: "RECRUITING", label: __("Recruiting") }, + { value: "SALES", label: __("Sales") }, + { value: "SECURITY", label: __("Security") }, + { value: "VERSION_CONTROL", label: __("Version Control") }, + ]; const organizationId = useOrganizationId(); const { snapshotId } = useParams<{ snapshotId?: string }>(); const isSnapshotMode = Boolean(snapshotId); @@ -119,6 +147,21 @@ export default function VendorOverviewTab() { error={errors.description?.message} disabled={isSubmitting || isSnapshotMode} /> + + {vendorCategories.map((category) => ( + + ))} +
+
+

{__("Countries")}

+ + + +
+ {/* Ownership */}

{__("Ownership details")}

diff --git a/packages/helpers/src/countries.ts b/packages/helpers/src/countries.ts new file mode 100644 index 000000000..6eb6d7a92 --- /dev/null +++ b/packages/helpers/src/countries.ts @@ -0,0 +1,299 @@ +type Translator = (s: string) => string; + +// ISO 3166-1 alpha-2 country codes +export const countries = [ + "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", + "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", + "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", + "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", + "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", + "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", + "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", + "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", + "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GT", + "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", + "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", + "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", + "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", + "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", + "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", + "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", + "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", + "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", + "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", + "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", + "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", + "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", + "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", + "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", + "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW", +] as const; + +export type CountryCode = typeof countries[number]; + +const countryNames: Record string> = { + "AD": (__) => __("Andorra"), + "AE": (__) => __("United Arab Emirates"), + "AF": (__) => __("Afghanistan"), + "AG": (__) => __("Antigua and Barbuda"), + "AI": (__) => __("Anguilla"), + "AL": (__) => __("Albania"), + "AM": (__) => __("Armenia"), + "AO": (__) => __("Angola"), + "AQ": (__) => __("Antarctica"), + "AR": (__) => __("Argentina"), + "AS": (__) => __("American Samoa"), + "AT": (__) => __("Austria"), + "AU": (__) => __("Australia"), + "AW": (__) => __("Aruba"), + "AX": (__) => __("Åland Islands"), + "AZ": (__) => __("Azerbaijan"), + "BA": (__) => __("Bosnia and Herzegovina"), + "BB": (__) => __("Barbados"), + "BD": (__) => __("Bangladesh"), + "BE": (__) => __("Belgium"), + "BF": (__) => __("Burkina Faso"), + "BG": (__) => __("Bulgaria"), + "BH": (__) => __("Bahrain"), + "BI": (__) => __("Burundi"), + "BJ": (__) => __("Benin"), + "BL": (__) => __("Saint Barthélemy"), + "BM": (__) => __("Bermuda"), + "BN": (__) => __("Brunei"), + "BO": (__) => __("Bolivia"), + "BQ": (__) => __("Bonaire, Sint Eustatius and Saba"), + "BR": (__) => __("Brazil"), + "BS": (__) => __("Bahamas"), + "BT": (__) => __("Bhutan"), + "BV": (__) => __("Bouvet Island"), + "BW": (__) => __("Botswana"), + "BY": (__) => __("Belarus"), + "BZ": (__) => __("Belize"), + "CA": (__) => __("Canada"), + "CC": (__) => __("Cocos (Keeling) Islands"), + "CD": (__) => __("Congo (DRC)"), + "CF": (__) => __("Central African Republic"), + "CG": (__) => __("Congo (Republic)"), + "CH": (__) => __("Switzerland"), + "CI": (__) => __("Côte d'Ivoire"), + "CK": (__) => __("Cook Islands"), + "CL": (__) => __("Chile"), + "CM": (__) => __("Cameroon"), + "CN": (__) => __("China"), + "CO": (__) => __("Colombia"), + "CR": (__) => __("Costa Rica"), + "CU": (__) => __("Cuba"), + "CV": (__) => __("Cape Verde"), + "CW": (__) => __("Curaçao"), + "CX": (__) => __("Christmas Island"), + "CY": (__) => __("Cyprus"), + "CZ": (__) => __("Czechia"), + "DE": (__) => __("Germany"), + "DJ": (__) => __("Djibouti"), + "DK": (__) => __("Denmark"), + "DM": (__) => __("Dominica"), + "DO": (__) => __("Dominican Republic"), + "DZ": (__) => __("Algeria"), + "EC": (__) => __("Ecuador"), + "EE": (__) => __("Estonia"), + "EG": (__) => __("Egypt"), + "EH": (__) => __("Western Sahara"), + "ER": (__) => __("Eritrea"), + "ES": (__) => __("Spain"), + "ET": (__) => __("Ethiopia"), + "FI": (__) => __("Finland"), + "FJ": (__) => __("Fiji"), + "FK": (__) => __("Falkland Islands"), + "FM": (__) => __("Micronesia"), + "FO": (__) => __("Faroe Islands"), + "FR": (__) => __("France"), + "GA": (__) => __("Gabon"), + "GB": (__) => __("United Kingdom"), + "GD": (__) => __("Grenada"), + "GE": (__) => __("Georgia"), + "GF": (__) => __("French Guiana"), + "GG": (__) => __("Guernsey"), + "GH": (__) => __("Ghana"), + "GI": (__) => __("Gibraltar"), + "GL": (__) => __("Greenland"), + "GM": (__) => __("Gambia"), + "GN": (__) => __("Guinea"), + "GP": (__) => __("Guadeloupe"), + "GQ": (__) => __("Equatorial Guinea"), + "GR": (__) => __("Greece"), + "GT": (__) => __("Guatemala"), + "GU": (__) => __("Guam"), + "GW": (__) => __("Guinea-Bissau"), + "GY": (__) => __("Guyana"), + "HK": (__) => __("Hong Kong"), + "HM": (__) => __("Heard Island and McDonald Islands"), + "HN": (__) => __("Honduras"), + "HR": (__) => __("Croatia"), + "HT": (__) => __("Haiti"), + "HU": (__) => __("Hungary"), + "ID": (__) => __("Indonesia"), + "IE": (__) => __("Ireland"), + "IL": (__) => __("Israel"), + "IM": (__) => __("Isle of Man"), + "IN": (__) => __("India"), + "IO": (__) => __("British Indian Ocean Territory"), + "IQ": (__) => __("Iraq"), + "IR": (__) => __("Iran"), + "IS": (__) => __("Iceland"), + "IT": (__) => __("Italy"), + "JE": (__) => __("Jersey"), + "JM": (__) => __("Jamaica"), + "JO": (__) => __("Jordan"), + "JP": (__) => __("Japan"), + "KE": (__) => __("Kenya"), + "KG": (__) => __("Kyrgyzstan"), + "KH": (__) => __("Cambodia"), + "KI": (__) => __("Kiribati"), + "KM": (__) => __("Comoros"), + "KN": (__) => __("Saint Kitts and Nevis"), + "KP": (__) => __("North Korea"), + "KR": (__) => __("South Korea"), + "KW": (__) => __("Kuwait"), + "KY": (__) => __("Cayman Islands"), + "KZ": (__) => __("Kazakhstan"), + "LA": (__) => __("Laos"), + "LB": (__) => __("Lebanon"), + "LC": (__) => __("Saint Lucia"), + "LI": (__) => __("Liechtenstein"), + "LK": (__) => __("Sri Lanka"), + "LR": (__) => __("Liberia"), + "LS": (__) => __("Lesotho"), + "LT": (__) => __("Lithuania"), + "LU": (__) => __("Luxembourg"), + "LV": (__) => __("Latvia"), + "LY": (__) => __("Libya"), + "MA": (__) => __("Morocco"), + "MC": (__) => __("Monaco"), + "MD": (__) => __("Moldova"), + "ME": (__) => __("Montenegro"), + "MF": (__) => __("Saint Martin"), + "MG": (__) => __("Madagascar"), + "MH": (__) => __("Marshall Islands"), + "MK": (__) => __("North Macedonia"), + "ML": (__) => __("Mali"), + "MM": (__) => __("Myanmar"), + "MN": (__) => __("Mongolia"), + "MO": (__) => __("Macau"), + "MP": (__) => __("Northern Mariana Islands"), + "MQ": (__) => __("Martinique"), + "MR": (__) => __("Mauritania"), + "MS": (__) => __("Montserrat"), + "MT": (__) => __("Malta"), + "MU": (__) => __("Mauritius"), + "MV": (__) => __("Maldives"), + "MW": (__) => __("Malawi"), + "MX": (__) => __("Mexico"), + "MY": (__) => __("Malaysia"), + "MZ": (__) => __("Mozambique"), + "NA": (__) => __("Namibia"), + "NC": (__) => __("New Caledonia"), + "NE": (__) => __("Niger"), + "NF": (__) => __("Norfolk Island"), + "NG": (__) => __("Nigeria"), + "NI": (__) => __("Nicaragua"), + "NL": (__) => __("Netherlands"), + "NO": (__) => __("Norway"), + "NP": (__) => __("Nepal"), + "NR": (__) => __("Nauru"), + "NU": (__) => __("Niue"), + "NZ": (__) => __("New Zealand"), + "OM": (__) => __("Oman"), + "PA": (__) => __("Panama"), + "PE": (__) => __("Peru"), + "PF": (__) => __("French Polynesia"), + "PG": (__) => __("Papua New Guinea"), + "PH": (__) => __("Philippines"), + "PK": (__) => __("Pakistan"), + "PL": (__) => __("Poland"), + "PM": (__) => __("Saint Pierre and Miquelon"), + "PN": (__) => __("Pitcairn"), + "PR": (__) => __("Puerto Rico"), + "PS": (__) => __("Palestine"), + "PT": (__) => __("Portugal"), + "PW": (__) => __("Palau"), + "PY": (__) => __("Paraguay"), + "QA": (__) => __("Qatar"), + "RE": (__) => __("Réunion"), + "RO": (__) => __("Romania"), + "RS": (__) => __("Serbia"), + "RU": (__) => __("Russia"), + "RW": (__) => __("Rwanda"), + "SA": (__) => __("Saudi Arabia"), + "SB": (__) => __("Solomon Islands"), + "SC": (__) => __("Seychelles"), + "SD": (__) => __("Sudan"), + "SE": (__) => __("Sweden"), + "SG": (__) => __("Singapore"), + "SH": (__) => __("Saint Helena"), + "SI": (__) => __("Slovenia"), + "SJ": (__) => __("Svalbard and Jan Mayen"), + "SK": (__) => __("Slovakia"), + "SL": (__) => __("Sierra Leone"), + "SM": (__) => __("San Marino"), + "SN": (__) => __("Senegal"), + "SO": (__) => __("Somalia"), + "SR": (__) => __("Suriname"), + "SS": (__) => __("South Sudan"), + "ST": (__) => __("São Tomé and Príncipe"), + "SV": (__) => __("El Salvador"), + "SX": (__) => __("Sint Maarten"), + "SY": (__) => __("Syria"), + "SZ": (__) => __("Eswatini"), + "TC": (__) => __("Turks and Caicos Islands"), + "TD": (__) => __("Chad"), + "TF": (__) => __("French Southern Territories"), + "TG": (__) => __("Togo"), + "TH": (__) => __("Thailand"), + "TJ": (__) => __("Tajikistan"), + "TK": (__) => __("Tokelau"), + "TL": (__) => __("Timor-Leste"), + "TM": (__) => __("Turkmenistan"), + "TN": (__) => __("Tunisia"), + "TO": (__) => __("Tonga"), + "TR": (__) => __("Turkey"), + "TT": (__) => __("Trinidad and Tobago"), + "TV": (__) => __("Tuvalu"), + "TW": (__) => __("Taiwan"), + "TZ": (__) => __("Tanzania"), + "UA": (__) => __("Ukraine"), + "UG": (__) => __("Uganda"), + "UM": (__) => __("United States Minor Outlying Islands"), + "US": (__) => __("United States"), + "UY": (__) => __("Uruguay"), + "UZ": (__) => __("Uzbekistan"), + "VA": (__) => __("Vatican City"), + "VC": (__) => __("Saint Vincent and the Grenadines"), + "VE": (__) => __("Venezuela"), + "VG": (__) => __("Virgin Islands (British)"), + "VI": (__) => __("Virgin Islands (U.S.)"), + "VN": (__) => __("Vietnam"), + "VU": (__) => __("Vanuatu"), + "WF": (__) => __("Wallis and Futuna"), + "WS": (__) => __("Samoa"), + "YE": (__) => __("Yemen"), + "YT": (__) => __("Mayotte"), + "ZA": (__) => __("South Africa"), + "ZM": (__) => __("Zambia"), + "ZW": (__) => __("Zimbabwe"), +}; + +export function getCountryName(__: Translator, code: CountryCode): string { + const translator = countryNames[code]; + return translator ? translator(__) : code; +} + +export function getCountryOptions(__: Translator) { + return countries.map(code => ({ + value: code, + label: getCountryName(__, code), + })); +} + +export function getCountryLabel(__: Translator, code: CountryCode): string { + return getCountryName(__, code); +} diff --git a/packages/helpers/src/index.ts b/packages/helpers/src/index.ts index e90138e33..45c6ff2e1 100644 --- a/packages/helpers/src/index.ts +++ b/packages/helpers/src/index.ts @@ -12,6 +12,7 @@ export { randomInt } from "./number"; export { getMeasureStateLabel, measureStates } from "./measure"; export { getRole, getRoles, peopleRoles } from "./people"; export { certificationCategoryLabel, certifications } from "./certifications"; +export { getCountryName, getCountryOptions, getCountryLabel, countries, type CountryCode } from "./countries"; export { availableFrameworks } from "./frameworks"; export { getDocumentTypeLabel, documentTypes } from "./documents"; export { getAssetTypeVariant, getCriticityVariant } from "./assets"; diff --git a/packages/vendors/data.d.ts b/packages/vendors/data.d.ts index 753acbdd5..601fa02f7 100644 --- a/packages/vendors/data.d.ts +++ b/packages/vendors/data.d.ts @@ -83,6 +83,9 @@ export interface Vendor { /** URL to vendor's status page */ statusPageUrl?: string; + + /** Countries where the vendor is located */ + countries?: CountryCode[]; } /** diff --git a/pkg/coredata/country_code.go b/pkg/coredata/country_code.go new file mode 100644 index 000000000..1a437c843 --- /dev/null +++ b/pkg/coredata/country_code.go @@ -0,0 +1,854 @@ +// Copyright (c) 2025 Probo Inc . +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +package coredata + +import ( + "database/sql/driver" + "fmt" + "strings" +) + +type ( + CountryCode string +) + +const ( + CountryCodeAD CountryCode = "AD" + CountryCodeAE CountryCode = "AE" + CountryCodeAF CountryCode = "AF" + CountryCodeAG CountryCode = "AG" + CountryCodeAI CountryCode = "AI" + CountryCodeAL CountryCode = "AL" + CountryCodeAM CountryCode = "AM" + CountryCodeAO CountryCode = "AO" + CountryCodeAQ CountryCode = "AQ" + CountryCodeAR CountryCode = "AR" + CountryCodeAS CountryCode = "AS" + CountryCodeAT CountryCode = "AT" + CountryCodeAU CountryCode = "AU" + CountryCodeAW CountryCode = "AW" + CountryCodeAX CountryCode = "AX" + CountryCodeAZ CountryCode = "AZ" + CountryCodeBA CountryCode = "BA" + CountryCodeBB CountryCode = "BB" + CountryCodeBD CountryCode = "BD" + CountryCodeBE CountryCode = "BE" + CountryCodeBF CountryCode = "BF" + CountryCodeBG CountryCode = "BG" + CountryCodeBH CountryCode = "BH" + CountryCodeBI CountryCode = "BI" + CountryCodeBJ CountryCode = "BJ" + CountryCodeBL CountryCode = "BL" + CountryCodeBM CountryCode = "BM" + CountryCodeBN CountryCode = "BN" + CountryCodeBO CountryCode = "BO" + CountryCodeBQ CountryCode = "BQ" + CountryCodeBR CountryCode = "BR" + CountryCodeBS CountryCode = "BS" + CountryCodeBT CountryCode = "BT" + CountryCodeBV CountryCode = "BV" + CountryCodeBW CountryCode = "BW" + CountryCodeBY CountryCode = "BY" + CountryCodeBZ CountryCode = "BZ" + CountryCodeCA CountryCode = "CA" + CountryCodeCC CountryCode = "CC" + CountryCodeCD CountryCode = "CD" + CountryCodeCF CountryCode = "CF" + CountryCodeCG CountryCode = "CG" + CountryCodeCH CountryCode = "CH" + CountryCodeCI CountryCode = "CI" + CountryCodeCK CountryCode = "CK" + CountryCodeCL CountryCode = "CL" + CountryCodeCM CountryCode = "CM" + CountryCodeCN CountryCode = "CN" + CountryCodeCO CountryCode = "CO" + CountryCodeCR CountryCode = "CR" + CountryCodeCU CountryCode = "CU" + CountryCodeCV CountryCode = "CV" + CountryCodeCW CountryCode = "CW" + CountryCodeCX CountryCode = "CX" + CountryCodeCY CountryCode = "CY" + CountryCodeCZ CountryCode = "CZ" + CountryCodeDE CountryCode = "DE" + CountryCodeDJ CountryCode = "DJ" + CountryCodeDK CountryCode = "DK" + CountryCodeDM CountryCode = "DM" + CountryCodeDO CountryCode = "DO" + CountryCodeDZ CountryCode = "DZ" + CountryCodeEC CountryCode = "EC" + CountryCodeEE CountryCode = "EE" + CountryCodeEG CountryCode = "EG" + CountryCodeEH CountryCode = "EH" + CountryCodeER CountryCode = "ER" + CountryCodeES CountryCode = "ES" + CountryCodeET CountryCode = "ET" + CountryCodeFI CountryCode = "FI" + CountryCodeFJ CountryCode = "FJ" + CountryCodeFK CountryCode = "FK" + CountryCodeFM CountryCode = "FM" + CountryCodeFO CountryCode = "FO" + CountryCodeFR CountryCode = "FR" + CountryCodeGA CountryCode = "GA" + CountryCodeGB CountryCode = "GB" + CountryCodeGD CountryCode = "GD" + CountryCodeGE CountryCode = "GE" + CountryCodeGF CountryCode = "GF" + CountryCodeGG CountryCode = "GG" + CountryCodeGH CountryCode = "GH" + CountryCodeGI CountryCode = "GI" + CountryCodeGL CountryCode = "GL" + CountryCodeGM CountryCode = "GM" + CountryCodeGN CountryCode = "GN" + CountryCodeGP CountryCode = "GP" + CountryCodeGQ CountryCode = "GQ" + CountryCodeGR CountryCode = "GR" + CountryCodeGT CountryCode = "GT" + CountryCodeGU CountryCode = "GU" + CountryCodeGW CountryCode = "GW" + CountryCodeGY CountryCode = "GY" + CountryCodeHK CountryCode = "HK" + CountryCodeHM CountryCode = "HM" + CountryCodeHN CountryCode = "HN" + CountryCodeHR CountryCode = "HR" + CountryCodeHT CountryCode = "HT" + CountryCodeHU CountryCode = "HU" + CountryCodeID CountryCode = "ID" + CountryCodeIE CountryCode = "IE" + CountryCodeIL CountryCode = "IL" + CountryCodeIM CountryCode = "IM" + CountryCodeIN CountryCode = "IN" + CountryCodeIO CountryCode = "IO" + CountryCodeIQ CountryCode = "IQ" + CountryCodeIR CountryCode = "IR" + CountryCodeIS CountryCode = "IS" + CountryCodeIT CountryCode = "IT" + CountryCodeJE CountryCode = "JE" + CountryCodeJM CountryCode = "JM" + CountryCodeJO CountryCode = "JO" + CountryCodeJP CountryCode = "JP" + CountryCodeKE CountryCode = "KE" + CountryCodeKG CountryCode = "KG" + CountryCodeKH CountryCode = "KH" + CountryCodeKI CountryCode = "KI" + CountryCodeKM CountryCode = "KM" + CountryCodeKN CountryCode = "KN" + CountryCodeKP CountryCode = "KP" + CountryCodeKR CountryCode = "KR" + CountryCodeKW CountryCode = "KW" + CountryCodeKY CountryCode = "KY" + CountryCodeKZ CountryCode = "KZ" + CountryCodeLA CountryCode = "LA" + CountryCodeLB CountryCode = "LB" + CountryCodeLC CountryCode = "LC" + CountryCodeLI CountryCode = "LI" + CountryCodeLK CountryCode = "LK" + CountryCodeLR CountryCode = "LR" + CountryCodeLS CountryCode = "LS" + CountryCodeLT CountryCode = "LT" + CountryCodeLU CountryCode = "LU" + CountryCodeLV CountryCode = "LV" + CountryCodeLY CountryCode = "LY" + CountryCodeMA CountryCode = "MA" + CountryCodeMC CountryCode = "MC" + CountryCodeMD CountryCode = "MD" + CountryCodeME CountryCode = "ME" + CountryCodeMF CountryCode = "MF" + CountryCodeMG CountryCode = "MG" + CountryCodeMH CountryCode = "MH" + CountryCodeMK CountryCode = "MK" + CountryCodeML CountryCode = "ML" + CountryCodeMM CountryCode = "MM" + CountryCodeMN CountryCode = "MN" + CountryCodeMO CountryCode = "MO" + CountryCodeMP CountryCode = "MP" + CountryCodeMQ CountryCode = "MQ" + CountryCodeMR CountryCode = "MR" + CountryCodeMS CountryCode = "MS" + CountryCodeMT CountryCode = "MT" + CountryCodeMU CountryCode = "MU" + CountryCodeMV CountryCode = "MV" + CountryCodeMW CountryCode = "MW" + CountryCodeMX CountryCode = "MX" + CountryCodeMY CountryCode = "MY" + CountryCodeMZ CountryCode = "MZ" + CountryCodeNA CountryCode = "NA" + CountryCodeNC CountryCode = "NC" + CountryCodeNE CountryCode = "NE" + CountryCodeNF CountryCode = "NF" + CountryCodeNG CountryCode = "NG" + CountryCodeNI CountryCode = "NI" + CountryCodeNL CountryCode = "NL" + CountryCodeNO CountryCode = "NO" + CountryCodeNP CountryCode = "NP" + CountryCodeNR CountryCode = "NR" + CountryCodeNU CountryCode = "NU" + CountryCodeNZ CountryCode = "NZ" + CountryCodeOM CountryCode = "OM" + CountryCodePA CountryCode = "PA" + CountryCodePE CountryCode = "PE" + CountryCodePF CountryCode = "PF" + CountryCodePG CountryCode = "PG" + CountryCodePH CountryCode = "PH" + CountryCodePK CountryCode = "PK" + CountryCodePL CountryCode = "PL" + CountryCodePM CountryCode = "PM" + CountryCodePN CountryCode = "PN" + CountryCodePR CountryCode = "PR" + CountryCodePS CountryCode = "PS" + CountryCodePT CountryCode = "PT" + CountryCodePW CountryCode = "PW" + CountryCodePY CountryCode = "PY" + CountryCodeQA CountryCode = "QA" + CountryCodeRE CountryCode = "RE" + CountryCodeRO CountryCode = "RO" + CountryCodeRS CountryCode = "RS" + CountryCodeRU CountryCode = "RU" + CountryCodeRW CountryCode = "RW" + CountryCodeSA CountryCode = "SA" + CountryCodeSB CountryCode = "SB" + CountryCodeSC CountryCode = "SC" + CountryCodeSD CountryCode = "SD" + CountryCodeSE CountryCode = "SE" + CountryCodeSG CountryCode = "SG" + CountryCodeSH CountryCode = "SH" + CountryCodeSI CountryCode = "SI" + CountryCodeSJ CountryCode = "SJ" + CountryCodeSK CountryCode = "SK" + CountryCodeSL CountryCode = "SL" + CountryCodeSM CountryCode = "SM" + CountryCodeSN CountryCode = "SN" + CountryCodeSO CountryCode = "SO" + CountryCodeSR CountryCode = "SR" + CountryCodeSS CountryCode = "SS" + CountryCodeST CountryCode = "ST" + CountryCodeSV CountryCode = "SV" + CountryCodeSX CountryCode = "SX" + CountryCodeSY CountryCode = "SY" + CountryCodeSZ CountryCode = "SZ" + CountryCodeTC CountryCode = "TC" + CountryCodeTD CountryCode = "TD" + CountryCodeTF CountryCode = "TF" + CountryCodeTG CountryCode = "TG" + CountryCodeTH CountryCode = "TH" + CountryCodeTJ CountryCode = "TJ" + CountryCodeTK CountryCode = "TK" + CountryCodeTL CountryCode = "TL" + CountryCodeTM CountryCode = "TM" + CountryCodeTN CountryCode = "TN" + CountryCodeTO CountryCode = "TO" + CountryCodeTR CountryCode = "TR" + CountryCodeTT CountryCode = "TT" + CountryCodeTV CountryCode = "TV" + CountryCodeTW CountryCode = "TW" + CountryCodeTZ CountryCode = "TZ" + CountryCodeUA CountryCode = "UA" + CountryCodeUG CountryCode = "UG" + CountryCodeUM CountryCode = "UM" + CountryCodeUS CountryCode = "US" + CountryCodeUY CountryCode = "UY" + CountryCodeUZ CountryCode = "UZ" + CountryCodeVA CountryCode = "VA" + CountryCodeVC CountryCode = "VC" + CountryCodeVE CountryCode = "VE" + CountryCodeVG CountryCode = "VG" + CountryCodeVI CountryCode = "VI" + CountryCodeVN CountryCode = "VN" + CountryCodeVU CountryCode = "VU" + CountryCodeWF CountryCode = "WF" + CountryCodeWS CountryCode = "WS" + CountryCodeYE CountryCode = "YE" + CountryCodeYT CountryCode = "YT" + CountryCodeZA CountryCode = "ZA" + CountryCodeZM CountryCode = "ZM" + CountryCodeZW CountryCode = "ZW" +) + +func (ct CountryCode) String() string { + return string(ct) +} + +func (ct *CountryCode) Scan(value any) error { + var s string + switch v := value.(type) { + case string: + s = v + case []byte: + s = string(v) + default: + return fmt.Errorf("unsupported type for CountryCode: %T", value) + } + + switch s { + case CountryCodeAD.String(): + *ct = CountryCodeAD + case CountryCodeAE.String(): + *ct = CountryCodeAE + case CountryCodeAF.String(): + *ct = CountryCodeAF + case CountryCodeAG.String(): + *ct = CountryCodeAG + case CountryCodeAI.String(): + *ct = CountryCodeAI + case CountryCodeAL.String(): + *ct = CountryCodeAL + case CountryCodeAM.String(): + *ct = CountryCodeAM + case CountryCodeAO.String(): + *ct = CountryCodeAO + case CountryCodeAQ.String(): + *ct = CountryCodeAQ + case CountryCodeAR.String(): + *ct = CountryCodeAR + case CountryCodeAS.String(): + *ct = CountryCodeAS + case CountryCodeAT.String(): + *ct = CountryCodeAT + case CountryCodeAU.String(): + *ct = CountryCodeAU + case CountryCodeAW.String(): + *ct = CountryCodeAW + case CountryCodeAX.String(): + *ct = CountryCodeAX + case CountryCodeAZ.String(): + *ct = CountryCodeAZ + case CountryCodeBA.String(): + *ct = CountryCodeBA + case CountryCodeBB.String(): + *ct = CountryCodeBB + case CountryCodeBD.String(): + *ct = CountryCodeBD + case CountryCodeBE.String(): + *ct = CountryCodeBE + case CountryCodeBF.String(): + *ct = CountryCodeBF + case CountryCodeBG.String(): + *ct = CountryCodeBG + case CountryCodeBH.String(): + *ct = CountryCodeBH + case CountryCodeBI.String(): + *ct = CountryCodeBI + case CountryCodeBJ.String(): + *ct = CountryCodeBJ + case CountryCodeBL.String(): + *ct = CountryCodeBL + case CountryCodeBM.String(): + *ct = CountryCodeBM + case CountryCodeBN.String(): + *ct = CountryCodeBN + case CountryCodeBO.String(): + *ct = CountryCodeBO + case CountryCodeBQ.String(): + *ct = CountryCodeBQ + case CountryCodeBR.String(): + *ct = CountryCodeBR + case CountryCodeBS.String(): + *ct = CountryCodeBS + case CountryCodeBT.String(): + *ct = CountryCodeBT + case CountryCodeBV.String(): + *ct = CountryCodeBV + case CountryCodeBW.String(): + *ct = CountryCodeBW + case CountryCodeBY.String(): + *ct = CountryCodeBY + case CountryCodeBZ.String(): + *ct = CountryCodeBZ + case CountryCodeCA.String(): + *ct = CountryCodeCA + case CountryCodeCC.String(): + *ct = CountryCodeCC + case CountryCodeCD.String(): + *ct = CountryCodeCD + case CountryCodeCF.String(): + *ct = CountryCodeCF + case CountryCodeCG.String(): + *ct = CountryCodeCG + case CountryCodeCH.String(): + *ct = CountryCodeCH + case CountryCodeCI.String(): + *ct = CountryCodeCI + case CountryCodeCK.String(): + *ct = CountryCodeCK + case CountryCodeCL.String(): + *ct = CountryCodeCL + case CountryCodeCM.String(): + *ct = CountryCodeCM + case CountryCodeCN.String(): + *ct = CountryCodeCN + case CountryCodeCO.String(): + *ct = CountryCodeCO + case CountryCodeCR.String(): + *ct = CountryCodeCR + case CountryCodeCU.String(): + *ct = CountryCodeCU + case CountryCodeCV.String(): + *ct = CountryCodeCV + case CountryCodeCW.String(): + *ct = CountryCodeCW + case CountryCodeCX.String(): + *ct = CountryCodeCX + case CountryCodeCY.String(): + *ct = CountryCodeCY + case CountryCodeCZ.String(): + *ct = CountryCodeCZ + case CountryCodeDE.String(): + *ct = CountryCodeDE + case CountryCodeDJ.String(): + *ct = CountryCodeDJ + case CountryCodeDK.String(): + *ct = CountryCodeDK + case CountryCodeDM.String(): + *ct = CountryCodeDM + case CountryCodeDO.String(): + *ct = CountryCodeDO + case CountryCodeDZ.String(): + *ct = CountryCodeDZ + case CountryCodeEC.String(): + *ct = CountryCodeEC + case CountryCodeEE.String(): + *ct = CountryCodeEE + case CountryCodeEG.String(): + *ct = CountryCodeEG + case CountryCodeEH.String(): + *ct = CountryCodeEH + case CountryCodeER.String(): + *ct = CountryCodeER + case CountryCodeES.String(): + *ct = CountryCodeES + case CountryCodeET.String(): + *ct = CountryCodeET + case CountryCodeFI.String(): + *ct = CountryCodeFI + case CountryCodeFJ.String(): + *ct = CountryCodeFJ + case CountryCodeFK.String(): + *ct = CountryCodeFK + case CountryCodeFM.String(): + *ct = CountryCodeFM + case CountryCodeFO.String(): + *ct = CountryCodeFO + case CountryCodeFR.String(): + *ct = CountryCodeFR + case CountryCodeGA.String(): + *ct = CountryCodeGA + case CountryCodeGB.String(): + *ct = CountryCodeGB + case CountryCodeGD.String(): + *ct = CountryCodeGD + case CountryCodeGE.String(): + *ct = CountryCodeGE + case CountryCodeGF.String(): + *ct = CountryCodeGF + case CountryCodeGG.String(): + *ct = CountryCodeGG + case CountryCodeGH.String(): + *ct = CountryCodeGH + case CountryCodeGI.String(): + *ct = CountryCodeGI + case CountryCodeGL.String(): + *ct = CountryCodeGL + case CountryCodeGM.String(): + *ct = CountryCodeGM + case CountryCodeGN.String(): + *ct = CountryCodeGN + case CountryCodeGP.String(): + *ct = CountryCodeGP + case CountryCodeGQ.String(): + *ct = CountryCodeGQ + case CountryCodeGR.String(): + *ct = CountryCodeGR + case CountryCodeGT.String(): + *ct = CountryCodeGT + case CountryCodeGU.String(): + *ct = CountryCodeGU + case CountryCodeGW.String(): + *ct = CountryCodeGW + case CountryCodeGY.String(): + *ct = CountryCodeGY + case CountryCodeHK.String(): + *ct = CountryCodeHK + case CountryCodeHM.String(): + *ct = CountryCodeHM + case CountryCodeHN.String(): + *ct = CountryCodeHN + case CountryCodeHR.String(): + *ct = CountryCodeHR + case CountryCodeHT.String(): + *ct = CountryCodeHT + case CountryCodeHU.String(): + *ct = CountryCodeHU + case CountryCodeID.String(): + *ct = CountryCodeID + case CountryCodeIE.String(): + *ct = CountryCodeIE + case CountryCodeIL.String(): + *ct = CountryCodeIL + case CountryCodeIM.String(): + *ct = CountryCodeIM + case CountryCodeIN.String(): + *ct = CountryCodeIN + case CountryCodeIO.String(): + *ct = CountryCodeIO + case CountryCodeIQ.String(): + *ct = CountryCodeIQ + case CountryCodeIR.String(): + *ct = CountryCodeIR + case CountryCodeIS.String(): + *ct = CountryCodeIS + case CountryCodeIT.String(): + *ct = CountryCodeIT + case CountryCodeJE.String(): + *ct = CountryCodeJE + case CountryCodeJM.String(): + *ct = CountryCodeJM + case CountryCodeJO.String(): + *ct = CountryCodeJO + case CountryCodeJP.String(): + *ct = CountryCodeJP + case CountryCodeKE.String(): + *ct = CountryCodeKE + case CountryCodeKG.String(): + *ct = CountryCodeKG + case CountryCodeKH.String(): + *ct = CountryCodeKH + case CountryCodeKI.String(): + *ct = CountryCodeKI + case CountryCodeKM.String(): + *ct = CountryCodeKM + case CountryCodeKN.String(): + *ct = CountryCodeKN + case CountryCodeKP.String(): + *ct = CountryCodeKP + case CountryCodeKR.String(): + *ct = CountryCodeKR + case CountryCodeKW.String(): + *ct = CountryCodeKW + case CountryCodeKY.String(): + *ct = CountryCodeKY + case CountryCodeKZ.String(): + *ct = CountryCodeKZ + case CountryCodeLA.String(): + *ct = CountryCodeLA + case CountryCodeLB.String(): + *ct = CountryCodeLB + case CountryCodeLC.String(): + *ct = CountryCodeLC + case CountryCodeLI.String(): + *ct = CountryCodeLI + case CountryCodeLK.String(): + *ct = CountryCodeLK + case CountryCodeLR.String(): + *ct = CountryCodeLR + case CountryCodeLS.String(): + *ct = CountryCodeLS + case CountryCodeLT.String(): + *ct = CountryCodeLT + case CountryCodeLU.String(): + *ct = CountryCodeLU + case CountryCodeLV.String(): + *ct = CountryCodeLV + case CountryCodeLY.String(): + *ct = CountryCodeLY + case CountryCodeMA.String(): + *ct = CountryCodeMA + case CountryCodeMC.String(): + *ct = CountryCodeMC + case CountryCodeMD.String(): + *ct = CountryCodeMD + case CountryCodeME.String(): + *ct = CountryCodeME + case CountryCodeMF.String(): + *ct = CountryCodeMF + case CountryCodeMG.String(): + *ct = CountryCodeMG + case CountryCodeMH.String(): + *ct = CountryCodeMH + case CountryCodeMK.String(): + *ct = CountryCodeMK + case CountryCodeML.String(): + *ct = CountryCodeML + case CountryCodeMM.String(): + *ct = CountryCodeMM + case CountryCodeMN.String(): + *ct = CountryCodeMN + case CountryCodeMO.String(): + *ct = CountryCodeMO + case CountryCodeMP.String(): + *ct = CountryCodeMP + case CountryCodeMQ.String(): + *ct = CountryCodeMQ + case CountryCodeMR.String(): + *ct = CountryCodeMR + case CountryCodeMS.String(): + *ct = CountryCodeMS + case CountryCodeMT.String(): + *ct = CountryCodeMT + case CountryCodeMU.String(): + *ct = CountryCodeMU + case CountryCodeMV.String(): + *ct = CountryCodeMV + case CountryCodeMW.String(): + *ct = CountryCodeMW + case CountryCodeMX.String(): + *ct = CountryCodeMX + case CountryCodeMY.String(): + *ct = CountryCodeMY + case CountryCodeMZ.String(): + *ct = CountryCodeMZ + case CountryCodeNA.String(): + *ct = CountryCodeNA + case CountryCodeNC.String(): + *ct = CountryCodeNC + case CountryCodeNE.String(): + *ct = CountryCodeNE + case CountryCodeNF.String(): + *ct = CountryCodeNF + case CountryCodeNG.String(): + *ct = CountryCodeNG + case CountryCodeNI.String(): + *ct = CountryCodeNI + case CountryCodeNL.String(): + *ct = CountryCodeNL + case CountryCodeNO.String(): + *ct = CountryCodeNO + case CountryCodeNP.String(): + *ct = CountryCodeNP + case CountryCodeNR.String(): + *ct = CountryCodeNR + case CountryCodeNU.String(): + *ct = CountryCodeNU + case CountryCodeNZ.String(): + *ct = CountryCodeNZ + case CountryCodeOM.String(): + *ct = CountryCodeOM + case CountryCodePA.String(): + *ct = CountryCodePA + case CountryCodePE.String(): + *ct = CountryCodePE + case CountryCodePF.String(): + *ct = CountryCodePF + case CountryCodePG.String(): + *ct = CountryCodePG + case CountryCodePH.String(): + *ct = CountryCodePH + case CountryCodePK.String(): + *ct = CountryCodePK + case CountryCodePL.String(): + *ct = CountryCodePL + case CountryCodePM.String(): + *ct = CountryCodePM + case CountryCodePN.String(): + *ct = CountryCodePN + case CountryCodePR.String(): + *ct = CountryCodePR + case CountryCodePS.String(): + *ct = CountryCodePS + case CountryCodePT.String(): + *ct = CountryCodePT + case CountryCodePW.String(): + *ct = CountryCodePW + case CountryCodePY.String(): + *ct = CountryCodePY + case CountryCodeQA.String(): + *ct = CountryCodeQA + case CountryCodeRE.String(): + *ct = CountryCodeRE + case CountryCodeRO.String(): + *ct = CountryCodeRO + case CountryCodeRS.String(): + *ct = CountryCodeRS + case CountryCodeRU.String(): + *ct = CountryCodeRU + case CountryCodeRW.String(): + *ct = CountryCodeRW + case CountryCodeSA.String(): + *ct = CountryCodeSA + case CountryCodeSB.String(): + *ct = CountryCodeSB + case CountryCodeSC.String(): + *ct = CountryCodeSC + case CountryCodeSD.String(): + *ct = CountryCodeSD + case CountryCodeSE.String(): + *ct = CountryCodeSE + case CountryCodeSG.String(): + *ct = CountryCodeSG + case CountryCodeSH.String(): + *ct = CountryCodeSH + case CountryCodeSI.String(): + *ct = CountryCodeSI + case CountryCodeSJ.String(): + *ct = CountryCodeSJ + case CountryCodeSK.String(): + *ct = CountryCodeSK + case CountryCodeSL.String(): + *ct = CountryCodeSL + case CountryCodeSM.String(): + *ct = CountryCodeSM + case CountryCodeSN.String(): + *ct = CountryCodeSN + case CountryCodeSO.String(): + *ct = CountryCodeSO + case CountryCodeSR.String(): + *ct = CountryCodeSR + case CountryCodeSS.String(): + *ct = CountryCodeSS + case CountryCodeST.String(): + *ct = CountryCodeST + case CountryCodeSV.String(): + *ct = CountryCodeSV + case CountryCodeSY.String(): + *ct = CountryCodeSY + case CountryCodeSZ.String(): + *ct = CountryCodeSZ + case CountryCodeTC.String(): + *ct = CountryCodeTC + case CountryCodeTD.String(): + *ct = CountryCodeTD + case CountryCodeTF.String(): + *ct = CountryCodeTF + case CountryCodeTG.String(): + *ct = CountryCodeTG + case CountryCodeTH.String(): + *ct = CountryCodeTH + case CountryCodeTJ.String(): + *ct = CountryCodeTJ + case CountryCodeTK.String(): + *ct = CountryCodeTK + case CountryCodeTL.String(): + *ct = CountryCodeTL + case CountryCodeTM.String(): + *ct = CountryCodeTM + case CountryCodeTN.String(): + *ct = CountryCodeTN + case CountryCodeTO.String(): + *ct = CountryCodeTO + case CountryCodeTR.String(): + *ct = CountryCodeTR + case CountryCodeTT.String(): + *ct = CountryCodeTT + case CountryCodeTV.String(): + *ct = CountryCodeTV + case CountryCodeTW.String(): + *ct = CountryCodeTW + case CountryCodeTZ.String(): + *ct = CountryCodeTZ + case CountryCodeUA.String(): + *ct = CountryCodeUA + case CountryCodeUG.String(): + *ct = CountryCodeUG + case CountryCodeUM.String(): + *ct = CountryCodeUM + case CountryCodeUS.String(): + *ct = CountryCodeUS + case CountryCodeUY.String(): + *ct = CountryCodeUY + case CountryCodeUZ.String(): + *ct = CountryCodeUZ + case CountryCodeVA.String(): + *ct = CountryCodeVA + case CountryCodeVC.String(): + *ct = CountryCodeVC + case CountryCodeVE.String(): + *ct = CountryCodeVE + case CountryCodeVG.String(): + *ct = CountryCodeVG + case CountryCodeVI.String(): + *ct = CountryCodeVI + case CountryCodeVN.String(): + *ct = CountryCodeVN + case CountryCodeVU.String(): + *ct = CountryCodeVU + case CountryCodeWF.String(): + *ct = CountryCodeWF + case CountryCodeWS.String(): + *ct = CountryCodeWS + case CountryCodeYE.String(): + *ct = CountryCodeYE + case CountryCodeYT.String(): + *ct = CountryCodeYT + case CountryCodeZA.String(): + *ct = CountryCodeZA + case CountryCodeZM.String(): + *ct = CountryCodeZM + case CountryCodeZW.String(): + *ct = CountryCodeZW + default: + return fmt.Errorf("invalid CountryCode value: %q", s) + } + return nil +} + +func (st CountryCode) Value() (driver.Value, error) { + return st.String(), nil +} + +type CountryCodes []CountryCode + +func (s *CountryCodes) Scan(value any) error { + switch v := value.(type) { + case string: + return s.scanFromString(v) + case []byte: + return s.scanFromString(string(v)) + default: + return fmt.Errorf("unsupported type for CountryCodes: %T", value) + } +} + +func (s *CountryCodes) scanFromString(str string) error { + str = strings.TrimSpace(str) + if str == "{}" || str == "" { + *s = []CountryCode{} + return nil + } + + if strings.HasPrefix(str, "{") && strings.HasSuffix(str, "}") { + str = str[1 : len(str)-1] + } + + parts := strings.Split(str, ",") + result := make([]CountryCode, len(parts)) + + for i, part := range parts { + part = strings.TrimSpace(part) + + if strings.HasPrefix(part, `"`) && strings.HasSuffix(part, `"`) { + part = part[1 : len(part)-1] + } + + var ct CountryCode + if err := ct.Scan(part); err != nil { + return fmt.Errorf("invalid country code in array: %s", part) + } + result[i] = ct + } + + *s = result + return nil +} + +func (s CountryCodes) Value() (driver.Value, error) { + if len(s) == 0 { + return "{}", nil + } + + values := make([]string, len(s)) + for i, ct := range s { + values[i] = ct.String() + } + + return "{" + strings.Join(values, ",") + "}", nil +} diff --git a/pkg/coredata/migrations/20250912T131913Z.sql b/pkg/coredata/migrations/20250912T131913Z.sql new file mode 100644 index 000000000..f31ae4991 --- /dev/null +++ b/pkg/coredata/migrations/20250912T131913Z.sql @@ -0,0 +1,31 @@ +-- ISO 3166-1 alpha-2 country codes +CREATE TYPE country_code AS ENUM ( + 'AD','AE','AF','AG','AI','AL','AM','AO','AQ','AR', + 'AS','AT','AU','AW','AX','AZ','BA','BB','BD','BE', + 'BF','BG','BH','BI','BJ','BL','BM','BN','BO','BQ', + 'BR','BS','BT','BV','BW','BY','BZ','CA','CC','CD', + 'CF','CG','CH','CI','CK','CL','CM','CN','CO','CR', + 'CU','CV','CW','CX','CY','CZ','DE','DJ','DK','DM', + 'DO','DZ','EC','EE','EG','EH','ER','ES','ET','FI', + 'FJ','FK','FM','FO','FR','GA','GB','GD','GE','GF', + 'GG','GH','GI','GL','GM','GN','GP','GQ','GR','GT', + 'GU','GW','GY','HK','HM','HN','HR','HT','HU','ID', + 'IE','IL','IM','IN','IO','IQ','IR','IS','IT','JE', + 'JM','JO','JP','KE','KG','KH','KI','KM','KN','KP', + 'KR','KW','KY','KZ','LA','LB','LC','LI','LK','LR', + 'LS','LT','LU','LV','LY','MA','MC','MD','ME','MF', + 'MG','MH','MK','ML','MM','MN','MO','MP','MQ','MR', + 'MS','MT','MU','MV','MW','MX','MY','MZ','NA','NC', + 'NE','NF','NG','NI','NL','NO','NP','NR','NU','NZ', + 'OM','PA','PE','PF','PG','PH','PK','PL','PM','PN', + 'PR','PS','PT','PW','PY','QA','RE','RO','RS','RU', + 'RW','SA','SB','SC','SD','SE','SG','SH','SI','SJ', + 'SK','SL','SM','SN','SO','SR','SS','ST','SV','SX', + 'SY','SZ','TC','TD','TF','TG','TH','TJ','TK','TL', + 'TM','TN','TO','TR','TT','TV','TW','TZ','UA','UG', + 'UM','US','UY','UZ','VA','VC','VE','VG','VI','VN', + 'VU','WF','WS','YE','YT','ZA','ZM','ZW' +); + +ALTER TABLE vendors ADD COLUMN countries country_code[] NOT NULL DEFAULT '{}'; +ALTER TABLE vendors ALTER COLUMN countries DROP DEFAULT; diff --git a/pkg/coredata/vendor.go b/pkg/coredata/vendor.go index 179dc3bf8..eb1b97c66 100644 --- a/pkg/coredata/vendor.go +++ b/pkg/coredata/vendor.go @@ -43,6 +43,7 @@ type ( BusinessAssociateAgreementURL *string `db:"business_associate_agreement_url"` SubprocessorsListURL *string `db:"subprocessors_list_url"` Certifications []string `db:"certifications"` + Countries CountryCodes `db:"countries"` BusinessOwnerID *gid.GID `db:"business_owner_id"` SecurityOwnerID *gid.GID `db:"security_owner_id"` StatusPageURL *string `db:"status_page_url"` @@ -99,6 +100,7 @@ SELECT business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -162,6 +164,7 @@ INSERT INTO business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -190,6 +193,7 @@ VALUES ( @business_associate_agreement_url, @subprocessors_list_url, @certifications, + @countries, @business_owner_id, @security_owner_id, @status_page_url, @@ -220,6 +224,7 @@ VALUES ( "business_associate_agreement_url": v.BusinessAssociateAgreementURL, "subprocessors_list_url": v.SubprocessorsListURL, "certifications": v.Certifications, + "countries": v.Countries, "business_owner_id": v.BusinessOwnerID, "security_owner_id": v.SecurityOwnerID, "status_page_url": v.StatusPageURL, @@ -311,6 +316,7 @@ SELECT business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -372,6 +378,7 @@ SET business_associate_agreement_url = @business_associate_agreement_url, subprocessors_list_url = @subprocessors_list_url, certifications = @certifications, + countries = @countries, status_page_url = @status_page_url, terms_of_service_url = @terms_of_service_url, security_page_url = @security_page_url, @@ -400,6 +407,7 @@ WHERE %s "business_associate_agreement_url": v.BusinessAssociateAgreementURL, "subprocessors_list_url": v.SubprocessorsListURL, "certifications": v.Certifications, + "countries": v.Countries, "status_page_url": v.StatusPageURL, "terms_of_service_url": v.TermsOfServiceURL, "security_page_url": v.SecurityPageURL, @@ -513,6 +521,7 @@ WITH vend AS ( v.business_associate_agreement_url, v.subprocessors_list_url, v.certifications, + v.countries, v.business_owner_id, v.security_owner_id, v.status_page_url, @@ -547,6 +556,7 @@ SELECT business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -648,6 +658,7 @@ WITH vend AS ( v.business_associate_agreement_url, v.subprocessors_list_url, v.certifications, + v.countries, v.business_owner_id, v.security_owner_id, v.status_page_url, @@ -682,6 +693,7 @@ SELECT business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -761,6 +773,7 @@ INSERT INTO vendors ( business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -789,6 +802,7 @@ SELECT v.business_associate_agreement_url, v.subprocessors_list_url, v.certifications, + v.countries, v.business_owner_id, v.security_owner_id, v.status_page_url, @@ -861,6 +875,7 @@ INSERT INTO vendors ( business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -889,6 +904,7 @@ SELECT v.business_associate_agreement_url, v.subprocessors_list_url, v.certifications, + v.countries, v.business_owner_id, v.security_owner_id, v.status_page_url, @@ -963,6 +979,7 @@ INSERT INTO vendors ( business_associate_agreement_url, subprocessors_list_url, certifications, + countries, business_owner_id, security_owner_id, status_page_url, @@ -991,6 +1008,7 @@ SELECT v.business_associate_agreement_url, v.subprocessors_list_url, v.certifications, + v.countries, v.business_owner_id, v.security_owner_id, v.status_page_url, diff --git a/pkg/probo/vendor_service.go b/pkg/probo/vendor_service.go index 834986851..bd3631af8 100644 --- a/pkg/probo/vendor_service.go +++ b/pkg/probo/vendor_service.go @@ -44,6 +44,7 @@ type ( BusinessAssociateAgreementURL *string SubprocessorsListURL *string Certifications []string + Countries coredata.CountryCodes SecurityPageURL *string TrustPageURL *string TermsOfServiceURL *string @@ -67,6 +68,7 @@ type ( BusinessAssociateAgreementURL *string SubprocessorsListURL *string Certifications []string + Countries coredata.CountryCodes SecurityPageURL *string TrustPageURL *string StatusPageURL *string @@ -290,6 +292,10 @@ func (s VendorService) Update( vendor.Certifications = req.Certifications } + if req.Countries != nil { + vendor.Countries = req.Countries + } + if req.StatusPageURL != nil { vendor.StatusPageURL = req.StatusPageURL } @@ -396,6 +402,7 @@ func (s VendorService) Create( BusinessAssociateAgreementURL: req.BusinessAssociateAgreementURL, SubprocessorsListURL: req.SubprocessorsListURL, Certifications: req.Certifications, + Countries: req.Countries, SecurityPageURL: req.SecurityPageURL, TrustPageURL: req.TrustPageURL, StatusPageURL: req.StatusPageURL, diff --git a/pkg/server/api/console/v1/schema.graphql b/pkg/server/api/console/v1/schema.graphql index d6b2c32b4..9c6cbcff1 100644 --- a/pkg/server/api/console/v1/schema.graphql +++ b/pkg/server/api/console/v1/schema.graphql @@ -563,6 +563,258 @@ enum DocumentVersionOrderField ) } +enum CountryCode + @goModel(model: "github.com/getprobo/probo/pkg/coredata.CountryCode") { + AD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAD") + AE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAE") + AF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAF") + AG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAG") + AI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAI") + AL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAL") + AM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAM") + AO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAO") + AQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAQ") + AR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAR") + AS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAS") + AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAT") + AU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAU") + AW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAW") + AX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAX") + AZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAZ") + BA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBA") + BB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBB") + BD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBD") + BE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBE") + BF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBF") + BG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBG") + BH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBH") + BI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBI") + BJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBJ") + BL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBL") + BM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBM") + BN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBN") + BO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBO") + BQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBQ") + BR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBR") + BS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBS") + BT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBT") + BV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBV") + BW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBW") + BY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBY") + BZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBZ") + CA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCA") + CC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCC") + CD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCD") + CF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCF") + CG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCG") + CH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCH") + CI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCI") + CK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCK") + CL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCL") + CM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCM") + CN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCN") + CO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCO") + CR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCR") + CU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCU") + CV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCV") + CW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCW") + CX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCX") + CY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCY") + CZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCZ") + DE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDE") + DJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDJ") + DK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDK") + DM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDM") + DO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDO") + DZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDZ") + EC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEC") + EE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEE") + EG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEG") + EH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEH") + ER @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeER") + ES @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeES") + ET @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeET") + FI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFI") + FJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFJ") + FK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFK") + FM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFM") + FO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFO") + FR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFR") + GA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGA") + GB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGB") + GD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGD") + GE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGE") + GF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGF") + GG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGG") + GH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGH") + GI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGI") + GL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGL") + GM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGM") + GN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGN") + GP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGP") + GQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGQ") + GR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGR") + GT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGT") + GU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGU") + GW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGW") + GY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGY") + HK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHK") + HM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHM") + HN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHN") + HR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHR") + HT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHT") + HU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHU") + ID @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeID") + IE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIE") + IL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIL") + IM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIM") + IN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIN") + IO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIO") + IQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIQ") + IR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIR") + IS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIS") + IT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIT") + JE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJE") + JM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJM") + JO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJO") + JP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJP") + KE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKE") + KG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKG") + KH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKH") + KI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKI") + KM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKM") + KN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKN") + KP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKP") + KR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKR") + KW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKW") + KY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKY") + KZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKZ") + LA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLA") + LB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLB") + LC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLC") + LI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLI") + LK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLK") + LR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLR") + LS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLS") + LT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLT") + LU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLU") + LV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLV") + LY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLY") + MA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMA") + MC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMC") + MD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMD") + ME @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeME") + MF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMF") + MG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMG") + MH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMH") + MK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMK") + ML @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeML") + MM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMM") + MN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMN") + MO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMO") + MP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMP") + MQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMQ") + MR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMR") + MS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMS") + MT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMT") + MU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMU") + MV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMV") + MW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMW") + MX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMX") + MY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMY") + MZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMZ") + NA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNA") + NC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNC") + NE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNE") + NF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNF") + NG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNG") + NI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNI") + NL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNL") + NO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNO") + NP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNP") + NR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNR") + NU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNU") + NZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNZ") + OM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeOM") + PA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePA") + PE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePE") + PF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePF") + PG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePG") + PH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePH") + PK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePK") + PL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePL") + PM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePM") + PN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePN") + PR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePR") + PS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePS") + PT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePT") + PW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePW") + PY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePY") + QA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeQA") + RE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRE") + RO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRO") + RS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRS") + RU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRU") + RW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRW") + SA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSA") + SB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSB") + SC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSC") + SD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSD") + SE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSE") + SG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSG") + SH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSH") + SI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSI") + SJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSJ") + SK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSK") + SL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSL") + SM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSM") + SN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSN") + SO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSO") + SR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSR") + SS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSS") + ST @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeST") + SV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSV") + SX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSX") + SY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSY") + SZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSZ") + TC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTC") + TD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTD") + TF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTF") + TG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTG") + TH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTH") + TJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTJ") + TK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTK") + TL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTL") + TM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTM") + TN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTN") + TO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTO") + TR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTR") + TT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTT") + TV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTV") + TW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTW") + TZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTZ") + UA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUA") + UG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUG") + UM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUM") + US @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUS") + UY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUY") + UZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUZ") + VA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVA") + VC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVC") + VE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVE") + VG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVG") + VI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVI") + VN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVN") + VU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVU") + WF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeWF") + WS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeWS") + YE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeYE") + YT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeYT") + ZA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeZA") + ZM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeZM") + ZW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeZW") +} + enum VendorCategory @goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorCategory") { ANALYTICS @@ -1412,6 +1664,7 @@ type Vendor implements Node { businessAssociateAgreementUrl: String subprocessorsListUrl: String certifications: [String!]! + countries: [CountryCode!]! securityPageUrl: String trustPageUrl: String headquarterAddress: String @@ -2555,6 +2808,7 @@ input CreateVendorInput { businessAssociateAgreementUrl: String subprocessorsListUrl: String certifications: [String!] + countries: [CountryCode!] securityPageUrl: String trustPageUrl: String statusPageUrl: String @@ -2579,6 +2833,7 @@ input UpdateVendorInput { headquarterAddress: String category: VendorCategory certifications: [String!] + countries: [CountryCode!] securityPageUrl: String trustPageUrl: String businessOwnerId: ID diff --git a/pkg/server/api/console/v1/schema/schema.go b/pkg/server/api/console/v1/schema/schema.go index 7fff17927..48cdabb23 100644 --- a/pkg/server/api/console/v1/schema/schema.go +++ b/pkg/server/api/console/v1/schema/schema.go @@ -1303,6 +1303,7 @@ type ComplexityRoot struct { Certifications func(childComplexity int) int ComplianceReports func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorComplianceReportOrderBy) int Contacts func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorContactOrderBy) int + Countries func(childComplexity int) int CreatedAt func(childComplexity int) int DataPrivacyAgreement func(childComplexity int) int DataProcessingAgreementURL func(childComplexity int) int @@ -7112,6 +7113,13 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.Vendor.Contacts(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.VendorContactOrderBy)), true + case "Vendor.countries": + if e.complexity.Vendor.Countries == nil { + break + } + + return e.complexity.Vendor.Countries(childComplexity), true + case "Vendor.createdAt": if e.complexity.Vendor.CreatedAt == nil { break @@ -8636,6 +8644,258 @@ enum DocumentVersionOrderField ) } +enum CountryCode + @goModel(model: "github.com/getprobo/probo/pkg/coredata.CountryCode") { + AD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAD") + AE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAE") + AF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAF") + AG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAG") + AI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAI") + AL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAL") + AM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAM") + AO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAO") + AQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAQ") + AR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAR") + AS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAS") + AT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAT") + AU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAU") + AW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAW") + AX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAX") + AZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeAZ") + BA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBA") + BB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBB") + BD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBD") + BE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBE") + BF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBF") + BG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBG") + BH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBH") + BI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBI") + BJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBJ") + BL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBL") + BM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBM") + BN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBN") + BO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBO") + BQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBQ") + BR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBR") + BS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBS") + BT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBT") + BV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBV") + BW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBW") + BY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBY") + BZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeBZ") + CA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCA") + CC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCC") + CD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCD") + CF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCF") + CG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCG") + CH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCH") + CI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCI") + CK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCK") + CL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCL") + CM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCM") + CN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCN") + CO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCO") + CR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCR") + CU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCU") + CV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCV") + CW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCW") + CX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCX") + CY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCY") + CZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeCZ") + DE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDE") + DJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDJ") + DK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDK") + DM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDM") + DO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDO") + DZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeDZ") + EC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEC") + EE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEE") + EG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEG") + EH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeEH") + ER @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeER") + ES @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeES") + ET @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeET") + FI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFI") + FJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFJ") + FK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFK") + FM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFM") + FO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFO") + FR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeFR") + GA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGA") + GB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGB") + GD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGD") + GE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGE") + GF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGF") + GG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGG") + GH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGH") + GI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGI") + GL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGL") + GM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGM") + GN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGN") + GP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGP") + GQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGQ") + GR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGR") + GT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGT") + GU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGU") + GW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGW") + GY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeGY") + HK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHK") + HM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHM") + HN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHN") + HR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHR") + HT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHT") + HU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeHU") + ID @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeID") + IE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIE") + IL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIL") + IM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIM") + IN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIN") + IO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIO") + IQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIQ") + IR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIR") + IS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIS") + IT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeIT") + JE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJE") + JM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJM") + JO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJO") + JP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeJP") + KE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKE") + KG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKG") + KH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKH") + KI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKI") + KM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKM") + KN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKN") + KP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKP") + KR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKR") + KW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKW") + KY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKY") + KZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeKZ") + LA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLA") + LB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLB") + LC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLC") + LI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLI") + LK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLK") + LR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLR") + LS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLS") + LT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLT") + LU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLU") + LV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLV") + LY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeLY") + MA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMA") + MC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMC") + MD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMD") + ME @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeME") + MF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMF") + MG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMG") + MH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMH") + MK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMK") + ML @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeML") + MM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMM") + MN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMN") + MO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMO") + MP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMP") + MQ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMQ") + MR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMR") + MS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMS") + MT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMT") + MU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMU") + MV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMV") + MW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMW") + MX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMX") + MY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMY") + MZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeMZ") + NA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNA") + NC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNC") + NE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNE") + NF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNF") + NG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNG") + NI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNI") + NL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNL") + NO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNO") + NP @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNP") + NR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNR") + NU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNU") + NZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeNZ") + OM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeOM") + PA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePA") + PE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePE") + PF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePF") + PG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePG") + PH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePH") + PK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePK") + PL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePL") + PM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePM") + PN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePN") + PR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePR") + PS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePS") + PT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePT") + PW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePW") + PY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodePY") + QA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeQA") + RE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRE") + RO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRO") + RS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRS") + RU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRU") + RW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeRW") + SA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSA") + SB @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSB") + SC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSC") + SD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSD") + SE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSE") + SG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSG") + SH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSH") + SI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSI") + SJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSJ") + SK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSK") + SL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSL") + SM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSM") + SN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSN") + SO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSO") + SR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSR") + SS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSS") + ST @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeST") + SV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSV") + SX @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSX") + SY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSY") + SZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeSZ") + TC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTC") + TD @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTD") + TF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTF") + TG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTG") + TH @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTH") + TJ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTJ") + TK @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTK") + TL @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTL") + TM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTM") + TN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTN") + TO @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTO") + TR @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTR") + TT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTT") + TV @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTV") + TW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTW") + TZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeTZ") + UA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUA") + UG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUG") + UM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUM") + US @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUS") + UY @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUY") + UZ @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeUZ") + VA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVA") + VC @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVC") + VE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVE") + VG @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVG") + VI @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVI") + VN @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVN") + VU @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeVU") + WF @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeWF") + WS @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeWS") + YE @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeYE") + YT @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeYT") + ZA @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeZA") + ZM @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeZM") + ZW @goEnum(value: "github.com/getprobo/probo/pkg/coredata.CountryCodeZW") +} + enum VendorCategory @goModel(model: "github.com/getprobo/probo/pkg/coredata.VendorCategory") { ANALYTICS @@ -9485,6 +9745,7 @@ type Vendor implements Node { businessAssociateAgreementUrl: String subprocessorsListUrl: String certifications: [String!]! + countries: [CountryCode!]! securityPageUrl: String trustPageUrl: String headquarterAddress: String @@ -10628,6 +10889,7 @@ input CreateVendorInput { businessAssociateAgreementUrl: String subprocessorsListUrl: String certifications: [String!] + countries: [CountryCode!] securityPageUrl: String trustPageUrl: String statusPageUrl: String @@ -10652,6 +10914,7 @@ input UpdateVendorInput { headquarterAddress: String category: VendorCategory certifications: [String!] + countries: [CountryCode!] securityPageUrl: String trustPageUrl: String businessOwnerId: ID @@ -19418,6 +19681,8 @@ func (ec *executionContext) fieldContext_AssessVendorPayload_vendor(_ context.Co return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -52211,6 +52476,8 @@ func (ec *executionContext) fieldContext_UpdateVendorPayload_vendor(_ context.Co return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -54337,6 +54604,50 @@ func (ec *executionContext) fieldContext_Vendor_certifications(_ context.Context return fc, nil } +func (ec *executionContext) _Vendor_countries(ctx context.Context, field graphql.CollectedField, obj *types.Vendor) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Vendor_countries(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Countries, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]coredata.CountryCode) + fc.Result = res + return ec.marshalNCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Vendor_countries(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Vendor", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type CountryCode does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Vendor_securityPageUrl(ctx context.Context, field graphql.CollectedField, obj *types.Vendor) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Vendor_securityPageUrl(ctx, field) if err != nil { @@ -54801,6 +55112,8 @@ func (ec *executionContext) fieldContext_VendorBusinessAssociateAgreement_vendor return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -55253,6 +55566,8 @@ func (ec *executionContext) fieldContext_VendorComplianceReport_vendor(_ context return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -56068,6 +56383,8 @@ func (ec *executionContext) fieldContext_VendorContact_vendor(_ context.Context, return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -56680,6 +56997,8 @@ func (ec *executionContext) fieldContext_VendorDataPrivacyAgreement_vendor(_ con return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -57132,6 +57451,8 @@ func (ec *executionContext) fieldContext_VendorEdge_node(_ context.Context, fiel return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -57282,6 +57603,8 @@ func (ec *executionContext) fieldContext_VendorRiskAssessment_vendor(_ context.C return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -58017,6 +58340,8 @@ func (ec *executionContext) fieldContext_VendorService_vendor(_ context.Context, return ec.fieldContext_Vendor_subprocessorsListUrl(ctx, field) case "certifications": return ec.fieldContext_Vendor_certifications(ctx, field) + case "countries": + return ec.fieldContext_Vendor_countries(ctx, field) case "securityPageUrl": return ec.fieldContext_Vendor_securityPageUrl(ctx, field) case "trustPageUrl": @@ -62499,7 +62824,7 @@ func (ec *executionContext) unmarshalInputCreateVendorInput(ctx context.Context, asMap[k] = v } - fieldsInOrder := [...]string{"organizationId", "name", "description", "headquarterAddress", "legalName", "websiteUrl", "privacyPolicyUrl", "category", "serviceLevelAgreementUrl", "dataProcessingAgreementUrl", "businessAssociateAgreementUrl", "subprocessorsListUrl", "certifications", "securityPageUrl", "trustPageUrl", "statusPageUrl", "termsOfServiceUrl", "businessOwnerId", "securityOwnerId"} + fieldsInOrder := [...]string{"organizationId", "name", "description", "headquarterAddress", "legalName", "websiteUrl", "privacyPolicyUrl", "category", "serviceLevelAgreementUrl", "dataProcessingAgreementUrl", "businessAssociateAgreementUrl", "subprocessorsListUrl", "certifications", "countries", "securityPageUrl", "trustPageUrl", "statusPageUrl", "termsOfServiceUrl", "businessOwnerId", "securityOwnerId"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -62597,6 +62922,13 @@ func (ec *executionContext) unmarshalInputCreateVendorInput(ctx context.Context, return it, err } it.Certifications = data + case "countries": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countries")) + data, err := ec.unmarshalOCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx, v) + if err != nil { + return it, err + } + it.Countries = data case "securityPageUrl": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("securityPageUrl")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -66343,7 +66675,7 @@ func (ec *executionContext) unmarshalInputUpdateVendorInput(ctx context.Context, asMap[k] = v } - fieldsInOrder := [...]string{"id", "name", "description", "statusPageUrl", "termsOfServiceUrl", "privacyPolicyUrl", "serviceLevelAgreementUrl", "dataProcessingAgreementUrl", "businessAssociateAgreementUrl", "subprocessorsListUrl", "websiteUrl", "legalName", "headquarterAddress", "category", "certifications", "securityPageUrl", "trustPageUrl", "businessOwnerId", "securityOwnerId", "showOnTrustCenter"} + fieldsInOrder := [...]string{"id", "name", "description", "statusPageUrl", "termsOfServiceUrl", "privacyPolicyUrl", "serviceLevelAgreementUrl", "dataProcessingAgreementUrl", "businessAssociateAgreementUrl", "subprocessorsListUrl", "websiteUrl", "legalName", "headquarterAddress", "category", "certifications", "countries", "securityPageUrl", "trustPageUrl", "businessOwnerId", "securityOwnerId", "showOnTrustCenter"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -66455,6 +66787,13 @@ func (ec *executionContext) unmarshalInputUpdateVendorInput(ctx context.Context, return it, err } it.Certifications = data + case "countries": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("countries")) + data, err := ec.unmarshalOCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx, v) + if err != nil { + return it, err + } + it.Countries = data case "securityPageUrl": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("securityPageUrl")) data, err := ec.unmarshalOString2ᚖstring(ctx, v) @@ -80299,6 +80638,11 @@ func (ec *executionContext) _Vendor(ctx context.Context, sel ast.SelectionSet, o if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "countries": + out.Values[i] = ec._Vendor_countries(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } case "securityPageUrl": out.Values[i] = ec._Vendor_securityPageUrl(ctx, field, obj) case "trustPageUrl": @@ -82832,6 +83176,1088 @@ var ( } ) +func (ec *executionContext) unmarshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode(ctx context.Context, v any) (coredata.CountryCode, error) { + tmp, err := graphql.UnmarshalString(v) + res := unmarshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode[tmp] + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode(ctx context.Context, sel ast.SelectionSet, v coredata.CountryCode) graphql.Marshaler { + _ = sel + res := graphql.MarshalString(marshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode[v]) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +var ( + unmarshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode = map[string]coredata.CountryCode{ + "AD": coredata.CountryCodeAD, + "AE": coredata.CountryCodeAE, + "AF": coredata.CountryCodeAF, + "AG": coredata.CountryCodeAG, + "AI": coredata.CountryCodeAI, + "AL": coredata.CountryCodeAL, + "AM": coredata.CountryCodeAM, + "AO": coredata.CountryCodeAO, + "AQ": coredata.CountryCodeAQ, + "AR": coredata.CountryCodeAR, + "AS": coredata.CountryCodeAS, + "AT": coredata.CountryCodeAT, + "AU": coredata.CountryCodeAU, + "AW": coredata.CountryCodeAW, + "AX": coredata.CountryCodeAX, + "AZ": coredata.CountryCodeAZ, + "BA": coredata.CountryCodeBA, + "BB": coredata.CountryCodeBB, + "BD": coredata.CountryCodeBD, + "BE": coredata.CountryCodeBE, + "BF": coredata.CountryCodeBF, + "BG": coredata.CountryCodeBG, + "BH": coredata.CountryCodeBH, + "BI": coredata.CountryCodeBI, + "BJ": coredata.CountryCodeBJ, + "BL": coredata.CountryCodeBL, + "BM": coredata.CountryCodeBM, + "BN": coredata.CountryCodeBN, + "BO": coredata.CountryCodeBO, + "BQ": coredata.CountryCodeBQ, + "BR": coredata.CountryCodeBR, + "BS": coredata.CountryCodeBS, + "BT": coredata.CountryCodeBT, + "BV": coredata.CountryCodeBV, + "BW": coredata.CountryCodeBW, + "BY": coredata.CountryCodeBY, + "BZ": coredata.CountryCodeBZ, + "CA": coredata.CountryCodeCA, + "CC": coredata.CountryCodeCC, + "CD": coredata.CountryCodeCD, + "CF": coredata.CountryCodeCF, + "CG": coredata.CountryCodeCG, + "CH": coredata.CountryCodeCH, + "CI": coredata.CountryCodeCI, + "CK": coredata.CountryCodeCK, + "CL": coredata.CountryCodeCL, + "CM": coredata.CountryCodeCM, + "CN": coredata.CountryCodeCN, + "CO": coredata.CountryCodeCO, + "CR": coredata.CountryCodeCR, + "CU": coredata.CountryCodeCU, + "CV": coredata.CountryCodeCV, + "CW": coredata.CountryCodeCW, + "CX": coredata.CountryCodeCX, + "CY": coredata.CountryCodeCY, + "CZ": coredata.CountryCodeCZ, + "DE": coredata.CountryCodeDE, + "DJ": coredata.CountryCodeDJ, + "DK": coredata.CountryCodeDK, + "DM": coredata.CountryCodeDM, + "DO": coredata.CountryCodeDO, + "DZ": coredata.CountryCodeDZ, + "EC": coredata.CountryCodeEC, + "EE": coredata.CountryCodeEE, + "EG": coredata.CountryCodeEG, + "EH": coredata.CountryCodeEH, + "ER": coredata.CountryCodeER, + "ES": coredata.CountryCodeES, + "ET": coredata.CountryCodeET, + "FI": coredata.CountryCodeFI, + "FJ": coredata.CountryCodeFJ, + "FK": coredata.CountryCodeFK, + "FM": coredata.CountryCodeFM, + "FO": coredata.CountryCodeFO, + "FR": coredata.CountryCodeFR, + "GA": coredata.CountryCodeGA, + "GB": coredata.CountryCodeGB, + "GD": coredata.CountryCodeGD, + "GE": coredata.CountryCodeGE, + "GF": coredata.CountryCodeGF, + "GG": coredata.CountryCodeGG, + "GH": coredata.CountryCodeGH, + "GI": coredata.CountryCodeGI, + "GL": coredata.CountryCodeGL, + "GM": coredata.CountryCodeGM, + "GN": coredata.CountryCodeGN, + "GP": coredata.CountryCodeGP, + "GQ": coredata.CountryCodeGQ, + "GR": coredata.CountryCodeGR, + "GT": coredata.CountryCodeGT, + "GU": coredata.CountryCodeGU, + "GW": coredata.CountryCodeGW, + "GY": coredata.CountryCodeGY, + "HK": coredata.CountryCodeHK, + "HM": coredata.CountryCodeHM, + "HN": coredata.CountryCodeHN, + "HR": coredata.CountryCodeHR, + "HT": coredata.CountryCodeHT, + "HU": coredata.CountryCodeHU, + "ID": coredata.CountryCodeID, + "IE": coredata.CountryCodeIE, + "IL": coredata.CountryCodeIL, + "IM": coredata.CountryCodeIM, + "IN": coredata.CountryCodeIN, + "IO": coredata.CountryCodeIO, + "IQ": coredata.CountryCodeIQ, + "IR": coredata.CountryCodeIR, + "IS": coredata.CountryCodeIS, + "IT": coredata.CountryCodeIT, + "JE": coredata.CountryCodeJE, + "JM": coredata.CountryCodeJM, + "JO": coredata.CountryCodeJO, + "JP": coredata.CountryCodeJP, + "KE": coredata.CountryCodeKE, + "KG": coredata.CountryCodeKG, + "KH": coredata.CountryCodeKH, + "KI": coredata.CountryCodeKI, + "KM": coredata.CountryCodeKM, + "KN": coredata.CountryCodeKN, + "KP": coredata.CountryCodeKP, + "KR": coredata.CountryCodeKR, + "KW": coredata.CountryCodeKW, + "KY": coredata.CountryCodeKY, + "KZ": coredata.CountryCodeKZ, + "LA": coredata.CountryCodeLA, + "LB": coredata.CountryCodeLB, + "LC": coredata.CountryCodeLC, + "LI": coredata.CountryCodeLI, + "LK": coredata.CountryCodeLK, + "LR": coredata.CountryCodeLR, + "LS": coredata.CountryCodeLS, + "LT": coredata.CountryCodeLT, + "LU": coredata.CountryCodeLU, + "LV": coredata.CountryCodeLV, + "LY": coredata.CountryCodeLY, + "MA": coredata.CountryCodeMA, + "MC": coredata.CountryCodeMC, + "MD": coredata.CountryCodeMD, + "ME": coredata.CountryCodeME, + "MF": coredata.CountryCodeMF, + "MG": coredata.CountryCodeMG, + "MH": coredata.CountryCodeMH, + "MK": coredata.CountryCodeMK, + "ML": coredata.CountryCodeML, + "MM": coredata.CountryCodeMM, + "MN": coredata.CountryCodeMN, + "MO": coredata.CountryCodeMO, + "MP": coredata.CountryCodeMP, + "MQ": coredata.CountryCodeMQ, + "MR": coredata.CountryCodeMR, + "MS": coredata.CountryCodeMS, + "MT": coredata.CountryCodeMT, + "MU": coredata.CountryCodeMU, + "MV": coredata.CountryCodeMV, + "MW": coredata.CountryCodeMW, + "MX": coredata.CountryCodeMX, + "MY": coredata.CountryCodeMY, + "MZ": coredata.CountryCodeMZ, + "NA": coredata.CountryCodeNA, + "NC": coredata.CountryCodeNC, + "NE": coredata.CountryCodeNE, + "NF": coredata.CountryCodeNF, + "NG": coredata.CountryCodeNG, + "NI": coredata.CountryCodeNI, + "NL": coredata.CountryCodeNL, + "NO": coredata.CountryCodeNO, + "NP": coredata.CountryCodeNP, + "NR": coredata.CountryCodeNR, + "NU": coredata.CountryCodeNU, + "NZ": coredata.CountryCodeNZ, + "OM": coredata.CountryCodeOM, + "PA": coredata.CountryCodePA, + "PE": coredata.CountryCodePE, + "PF": coredata.CountryCodePF, + "PG": coredata.CountryCodePG, + "PH": coredata.CountryCodePH, + "PK": coredata.CountryCodePK, + "PL": coredata.CountryCodePL, + "PM": coredata.CountryCodePM, + "PN": coredata.CountryCodePN, + "PR": coredata.CountryCodePR, + "PS": coredata.CountryCodePS, + "PT": coredata.CountryCodePT, + "PW": coredata.CountryCodePW, + "PY": coredata.CountryCodePY, + "QA": coredata.CountryCodeQA, + "RE": coredata.CountryCodeRE, + "RO": coredata.CountryCodeRO, + "RS": coredata.CountryCodeRS, + "RU": coredata.CountryCodeRU, + "RW": coredata.CountryCodeRW, + "SA": coredata.CountryCodeSA, + "SB": coredata.CountryCodeSB, + "SC": coredata.CountryCodeSC, + "SD": coredata.CountryCodeSD, + "SE": coredata.CountryCodeSE, + "SG": coredata.CountryCodeSG, + "SH": coredata.CountryCodeSH, + "SI": coredata.CountryCodeSI, + "SJ": coredata.CountryCodeSJ, + "SK": coredata.CountryCodeSK, + "SL": coredata.CountryCodeSL, + "SM": coredata.CountryCodeSM, + "SN": coredata.CountryCodeSN, + "SO": coredata.CountryCodeSO, + "SR": coredata.CountryCodeSR, + "SS": coredata.CountryCodeSS, + "ST": coredata.CountryCodeST, + "SV": coredata.CountryCodeSV, + "SX": coredata.CountryCodeSX, + "SY": coredata.CountryCodeSY, + "SZ": coredata.CountryCodeSZ, + "TC": coredata.CountryCodeTC, + "TD": coredata.CountryCodeTD, + "TF": coredata.CountryCodeTF, + "TG": coredata.CountryCodeTG, + "TH": coredata.CountryCodeTH, + "TJ": coredata.CountryCodeTJ, + "TK": coredata.CountryCodeTK, + "TL": coredata.CountryCodeTL, + "TM": coredata.CountryCodeTM, + "TN": coredata.CountryCodeTN, + "TO": coredata.CountryCodeTO, + "TR": coredata.CountryCodeTR, + "TT": coredata.CountryCodeTT, + "TV": coredata.CountryCodeTV, + "TW": coredata.CountryCodeTW, + "TZ": coredata.CountryCodeTZ, + "UA": coredata.CountryCodeUA, + "UG": coredata.CountryCodeUG, + "UM": coredata.CountryCodeUM, + "US": coredata.CountryCodeUS, + "UY": coredata.CountryCodeUY, + "UZ": coredata.CountryCodeUZ, + "VA": coredata.CountryCodeVA, + "VC": coredata.CountryCodeVC, + "VE": coredata.CountryCodeVE, + "VG": coredata.CountryCodeVG, + "VI": coredata.CountryCodeVI, + "VN": coredata.CountryCodeVN, + "VU": coredata.CountryCodeVU, + "WF": coredata.CountryCodeWF, + "WS": coredata.CountryCodeWS, + "YE": coredata.CountryCodeYE, + "YT": coredata.CountryCodeYT, + "ZA": coredata.CountryCodeZA, + "ZM": coredata.CountryCodeZM, + "ZW": coredata.CountryCodeZW, + } + marshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode = map[coredata.CountryCode]string{ + coredata.CountryCodeAD: "AD", + coredata.CountryCodeAE: "AE", + coredata.CountryCodeAF: "AF", + coredata.CountryCodeAG: "AG", + coredata.CountryCodeAI: "AI", + coredata.CountryCodeAL: "AL", + coredata.CountryCodeAM: "AM", + coredata.CountryCodeAO: "AO", + coredata.CountryCodeAQ: "AQ", + coredata.CountryCodeAR: "AR", + coredata.CountryCodeAS: "AS", + coredata.CountryCodeAT: "AT", + coredata.CountryCodeAU: "AU", + coredata.CountryCodeAW: "AW", + coredata.CountryCodeAX: "AX", + coredata.CountryCodeAZ: "AZ", + coredata.CountryCodeBA: "BA", + coredata.CountryCodeBB: "BB", + coredata.CountryCodeBD: "BD", + coredata.CountryCodeBE: "BE", + coredata.CountryCodeBF: "BF", + coredata.CountryCodeBG: "BG", + coredata.CountryCodeBH: "BH", + coredata.CountryCodeBI: "BI", + coredata.CountryCodeBJ: "BJ", + coredata.CountryCodeBL: "BL", + coredata.CountryCodeBM: "BM", + coredata.CountryCodeBN: "BN", + coredata.CountryCodeBO: "BO", + coredata.CountryCodeBQ: "BQ", + coredata.CountryCodeBR: "BR", + coredata.CountryCodeBS: "BS", + coredata.CountryCodeBT: "BT", + coredata.CountryCodeBV: "BV", + coredata.CountryCodeBW: "BW", + coredata.CountryCodeBY: "BY", + coredata.CountryCodeBZ: "BZ", + coredata.CountryCodeCA: "CA", + coredata.CountryCodeCC: "CC", + coredata.CountryCodeCD: "CD", + coredata.CountryCodeCF: "CF", + coredata.CountryCodeCG: "CG", + coredata.CountryCodeCH: "CH", + coredata.CountryCodeCI: "CI", + coredata.CountryCodeCK: "CK", + coredata.CountryCodeCL: "CL", + coredata.CountryCodeCM: "CM", + coredata.CountryCodeCN: "CN", + coredata.CountryCodeCO: "CO", + coredata.CountryCodeCR: "CR", + coredata.CountryCodeCU: "CU", + coredata.CountryCodeCV: "CV", + coredata.CountryCodeCW: "CW", + coredata.CountryCodeCX: "CX", + coredata.CountryCodeCY: "CY", + coredata.CountryCodeCZ: "CZ", + coredata.CountryCodeDE: "DE", + coredata.CountryCodeDJ: "DJ", + coredata.CountryCodeDK: "DK", + coredata.CountryCodeDM: "DM", + coredata.CountryCodeDO: "DO", + coredata.CountryCodeDZ: "DZ", + coredata.CountryCodeEC: "EC", + coredata.CountryCodeEE: "EE", + coredata.CountryCodeEG: "EG", + coredata.CountryCodeEH: "EH", + coredata.CountryCodeER: "ER", + coredata.CountryCodeES: "ES", + coredata.CountryCodeET: "ET", + coredata.CountryCodeFI: "FI", + coredata.CountryCodeFJ: "FJ", + coredata.CountryCodeFK: "FK", + coredata.CountryCodeFM: "FM", + coredata.CountryCodeFO: "FO", + coredata.CountryCodeFR: "FR", + coredata.CountryCodeGA: "GA", + coredata.CountryCodeGB: "GB", + coredata.CountryCodeGD: "GD", + coredata.CountryCodeGE: "GE", + coredata.CountryCodeGF: "GF", + coredata.CountryCodeGG: "GG", + coredata.CountryCodeGH: "GH", + coredata.CountryCodeGI: "GI", + coredata.CountryCodeGL: "GL", + coredata.CountryCodeGM: "GM", + coredata.CountryCodeGN: "GN", + coredata.CountryCodeGP: "GP", + coredata.CountryCodeGQ: "GQ", + coredata.CountryCodeGR: "GR", + coredata.CountryCodeGT: "GT", + coredata.CountryCodeGU: "GU", + coredata.CountryCodeGW: "GW", + coredata.CountryCodeGY: "GY", + coredata.CountryCodeHK: "HK", + coredata.CountryCodeHM: "HM", + coredata.CountryCodeHN: "HN", + coredata.CountryCodeHR: "HR", + coredata.CountryCodeHT: "HT", + coredata.CountryCodeHU: "HU", + coredata.CountryCodeID: "ID", + coredata.CountryCodeIE: "IE", + coredata.CountryCodeIL: "IL", + coredata.CountryCodeIM: "IM", + coredata.CountryCodeIN: "IN", + coredata.CountryCodeIO: "IO", + coredata.CountryCodeIQ: "IQ", + coredata.CountryCodeIR: "IR", + coredata.CountryCodeIS: "IS", + coredata.CountryCodeIT: "IT", + coredata.CountryCodeJE: "JE", + coredata.CountryCodeJM: "JM", + coredata.CountryCodeJO: "JO", + coredata.CountryCodeJP: "JP", + coredata.CountryCodeKE: "KE", + coredata.CountryCodeKG: "KG", + coredata.CountryCodeKH: "KH", + coredata.CountryCodeKI: "KI", + coredata.CountryCodeKM: "KM", + coredata.CountryCodeKN: "KN", + coredata.CountryCodeKP: "KP", + coredata.CountryCodeKR: "KR", + coredata.CountryCodeKW: "KW", + coredata.CountryCodeKY: "KY", + coredata.CountryCodeKZ: "KZ", + coredata.CountryCodeLA: "LA", + coredata.CountryCodeLB: "LB", + coredata.CountryCodeLC: "LC", + coredata.CountryCodeLI: "LI", + coredata.CountryCodeLK: "LK", + coredata.CountryCodeLR: "LR", + coredata.CountryCodeLS: "LS", + coredata.CountryCodeLT: "LT", + coredata.CountryCodeLU: "LU", + coredata.CountryCodeLV: "LV", + coredata.CountryCodeLY: "LY", + coredata.CountryCodeMA: "MA", + coredata.CountryCodeMC: "MC", + coredata.CountryCodeMD: "MD", + coredata.CountryCodeME: "ME", + coredata.CountryCodeMF: "MF", + coredata.CountryCodeMG: "MG", + coredata.CountryCodeMH: "MH", + coredata.CountryCodeMK: "MK", + coredata.CountryCodeML: "ML", + coredata.CountryCodeMM: "MM", + coredata.CountryCodeMN: "MN", + coredata.CountryCodeMO: "MO", + coredata.CountryCodeMP: "MP", + coredata.CountryCodeMQ: "MQ", + coredata.CountryCodeMR: "MR", + coredata.CountryCodeMS: "MS", + coredata.CountryCodeMT: "MT", + coredata.CountryCodeMU: "MU", + coredata.CountryCodeMV: "MV", + coredata.CountryCodeMW: "MW", + coredata.CountryCodeMX: "MX", + coredata.CountryCodeMY: "MY", + coredata.CountryCodeMZ: "MZ", + coredata.CountryCodeNA: "NA", + coredata.CountryCodeNC: "NC", + coredata.CountryCodeNE: "NE", + coredata.CountryCodeNF: "NF", + coredata.CountryCodeNG: "NG", + coredata.CountryCodeNI: "NI", + coredata.CountryCodeNL: "NL", + coredata.CountryCodeNO: "NO", + coredata.CountryCodeNP: "NP", + coredata.CountryCodeNR: "NR", + coredata.CountryCodeNU: "NU", + coredata.CountryCodeNZ: "NZ", + coredata.CountryCodeOM: "OM", + coredata.CountryCodePA: "PA", + coredata.CountryCodePE: "PE", + coredata.CountryCodePF: "PF", + coredata.CountryCodePG: "PG", + coredata.CountryCodePH: "PH", + coredata.CountryCodePK: "PK", + coredata.CountryCodePL: "PL", + coredata.CountryCodePM: "PM", + coredata.CountryCodePN: "PN", + coredata.CountryCodePR: "PR", + coredata.CountryCodePS: "PS", + coredata.CountryCodePT: "PT", + coredata.CountryCodePW: "PW", + coredata.CountryCodePY: "PY", + coredata.CountryCodeQA: "QA", + coredata.CountryCodeRE: "RE", + coredata.CountryCodeRO: "RO", + coredata.CountryCodeRS: "RS", + coredata.CountryCodeRU: "RU", + coredata.CountryCodeRW: "RW", + coredata.CountryCodeSA: "SA", + coredata.CountryCodeSB: "SB", + coredata.CountryCodeSC: "SC", + coredata.CountryCodeSD: "SD", + coredata.CountryCodeSE: "SE", + coredata.CountryCodeSG: "SG", + coredata.CountryCodeSH: "SH", + coredata.CountryCodeSI: "SI", + coredata.CountryCodeSJ: "SJ", + coredata.CountryCodeSK: "SK", + coredata.CountryCodeSL: "SL", + coredata.CountryCodeSM: "SM", + coredata.CountryCodeSN: "SN", + coredata.CountryCodeSO: "SO", + coredata.CountryCodeSR: "SR", + coredata.CountryCodeSS: "SS", + coredata.CountryCodeST: "ST", + coredata.CountryCodeSV: "SV", + coredata.CountryCodeSX: "SX", + coredata.CountryCodeSY: "SY", + coredata.CountryCodeSZ: "SZ", + coredata.CountryCodeTC: "TC", + coredata.CountryCodeTD: "TD", + coredata.CountryCodeTF: "TF", + coredata.CountryCodeTG: "TG", + coredata.CountryCodeTH: "TH", + coredata.CountryCodeTJ: "TJ", + coredata.CountryCodeTK: "TK", + coredata.CountryCodeTL: "TL", + coredata.CountryCodeTM: "TM", + coredata.CountryCodeTN: "TN", + coredata.CountryCodeTO: "TO", + coredata.CountryCodeTR: "TR", + coredata.CountryCodeTT: "TT", + coredata.CountryCodeTV: "TV", + coredata.CountryCodeTW: "TW", + coredata.CountryCodeTZ: "TZ", + coredata.CountryCodeUA: "UA", + coredata.CountryCodeUG: "UG", + coredata.CountryCodeUM: "UM", + coredata.CountryCodeUS: "US", + coredata.CountryCodeUY: "UY", + coredata.CountryCodeUZ: "UZ", + coredata.CountryCodeVA: "VA", + coredata.CountryCodeVC: "VC", + coredata.CountryCodeVE: "VE", + coredata.CountryCodeVG: "VG", + coredata.CountryCodeVI: "VI", + coredata.CountryCodeVN: "VN", + coredata.CountryCodeVU: "VU", + coredata.CountryCodeWF: "WF", + coredata.CountryCodeWS: "WS", + coredata.CountryCodeYE: "YE", + coredata.CountryCodeYT: "YT", + coredata.CountryCodeZA: "ZA", + coredata.CountryCodeZM: "ZM", + coredata.CountryCodeZW: "ZW", + } +) + +func (ec *executionContext) unmarshalNCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx context.Context, v any) ([]coredata.CountryCode, error) { + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]coredata.CountryCode, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx context.Context, sel ast.SelectionSet, v []coredata.CountryCode) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +var ( + unmarshalNCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ = map[string]coredata.CountryCode{ + "AD": coredata.CountryCodeAD, + "AE": coredata.CountryCodeAE, + "AF": coredata.CountryCodeAF, + "AG": coredata.CountryCodeAG, + "AI": coredata.CountryCodeAI, + "AL": coredata.CountryCodeAL, + "AM": coredata.CountryCodeAM, + "AO": coredata.CountryCodeAO, + "AQ": coredata.CountryCodeAQ, + "AR": coredata.CountryCodeAR, + "AS": coredata.CountryCodeAS, + "AT": coredata.CountryCodeAT, + "AU": coredata.CountryCodeAU, + "AW": coredata.CountryCodeAW, + "AX": coredata.CountryCodeAX, + "AZ": coredata.CountryCodeAZ, + "BA": coredata.CountryCodeBA, + "BB": coredata.CountryCodeBB, + "BD": coredata.CountryCodeBD, + "BE": coredata.CountryCodeBE, + "BF": coredata.CountryCodeBF, + "BG": coredata.CountryCodeBG, + "BH": coredata.CountryCodeBH, + "BI": coredata.CountryCodeBI, + "BJ": coredata.CountryCodeBJ, + "BL": coredata.CountryCodeBL, + "BM": coredata.CountryCodeBM, + "BN": coredata.CountryCodeBN, + "BO": coredata.CountryCodeBO, + "BQ": coredata.CountryCodeBQ, + "BR": coredata.CountryCodeBR, + "BS": coredata.CountryCodeBS, + "BT": coredata.CountryCodeBT, + "BV": coredata.CountryCodeBV, + "BW": coredata.CountryCodeBW, + "BY": coredata.CountryCodeBY, + "BZ": coredata.CountryCodeBZ, + "CA": coredata.CountryCodeCA, + "CC": coredata.CountryCodeCC, + "CD": coredata.CountryCodeCD, + "CF": coredata.CountryCodeCF, + "CG": coredata.CountryCodeCG, + "CH": coredata.CountryCodeCH, + "CI": coredata.CountryCodeCI, + "CK": coredata.CountryCodeCK, + "CL": coredata.CountryCodeCL, + "CM": coredata.CountryCodeCM, + "CN": coredata.CountryCodeCN, + "CO": coredata.CountryCodeCO, + "CR": coredata.CountryCodeCR, + "CU": coredata.CountryCodeCU, + "CV": coredata.CountryCodeCV, + "CW": coredata.CountryCodeCW, + "CX": coredata.CountryCodeCX, + "CY": coredata.CountryCodeCY, + "CZ": coredata.CountryCodeCZ, + "DE": coredata.CountryCodeDE, + "DJ": coredata.CountryCodeDJ, + "DK": coredata.CountryCodeDK, + "DM": coredata.CountryCodeDM, + "DO": coredata.CountryCodeDO, + "DZ": coredata.CountryCodeDZ, + "EC": coredata.CountryCodeEC, + "EE": coredata.CountryCodeEE, + "EG": coredata.CountryCodeEG, + "EH": coredata.CountryCodeEH, + "ER": coredata.CountryCodeER, + "ES": coredata.CountryCodeES, + "ET": coredata.CountryCodeET, + "FI": coredata.CountryCodeFI, + "FJ": coredata.CountryCodeFJ, + "FK": coredata.CountryCodeFK, + "FM": coredata.CountryCodeFM, + "FO": coredata.CountryCodeFO, + "FR": coredata.CountryCodeFR, + "GA": coredata.CountryCodeGA, + "GB": coredata.CountryCodeGB, + "GD": coredata.CountryCodeGD, + "GE": coredata.CountryCodeGE, + "GF": coredata.CountryCodeGF, + "GG": coredata.CountryCodeGG, + "GH": coredata.CountryCodeGH, + "GI": coredata.CountryCodeGI, + "GL": coredata.CountryCodeGL, + "GM": coredata.CountryCodeGM, + "GN": coredata.CountryCodeGN, + "GP": coredata.CountryCodeGP, + "GQ": coredata.CountryCodeGQ, + "GR": coredata.CountryCodeGR, + "GT": coredata.CountryCodeGT, + "GU": coredata.CountryCodeGU, + "GW": coredata.CountryCodeGW, + "GY": coredata.CountryCodeGY, + "HK": coredata.CountryCodeHK, + "HM": coredata.CountryCodeHM, + "HN": coredata.CountryCodeHN, + "HR": coredata.CountryCodeHR, + "HT": coredata.CountryCodeHT, + "HU": coredata.CountryCodeHU, + "ID": coredata.CountryCodeID, + "IE": coredata.CountryCodeIE, + "IL": coredata.CountryCodeIL, + "IM": coredata.CountryCodeIM, + "IN": coredata.CountryCodeIN, + "IO": coredata.CountryCodeIO, + "IQ": coredata.CountryCodeIQ, + "IR": coredata.CountryCodeIR, + "IS": coredata.CountryCodeIS, + "IT": coredata.CountryCodeIT, + "JE": coredata.CountryCodeJE, + "JM": coredata.CountryCodeJM, + "JO": coredata.CountryCodeJO, + "JP": coredata.CountryCodeJP, + "KE": coredata.CountryCodeKE, + "KG": coredata.CountryCodeKG, + "KH": coredata.CountryCodeKH, + "KI": coredata.CountryCodeKI, + "KM": coredata.CountryCodeKM, + "KN": coredata.CountryCodeKN, + "KP": coredata.CountryCodeKP, + "KR": coredata.CountryCodeKR, + "KW": coredata.CountryCodeKW, + "KY": coredata.CountryCodeKY, + "KZ": coredata.CountryCodeKZ, + "LA": coredata.CountryCodeLA, + "LB": coredata.CountryCodeLB, + "LC": coredata.CountryCodeLC, + "LI": coredata.CountryCodeLI, + "LK": coredata.CountryCodeLK, + "LR": coredata.CountryCodeLR, + "LS": coredata.CountryCodeLS, + "LT": coredata.CountryCodeLT, + "LU": coredata.CountryCodeLU, + "LV": coredata.CountryCodeLV, + "LY": coredata.CountryCodeLY, + "MA": coredata.CountryCodeMA, + "MC": coredata.CountryCodeMC, + "MD": coredata.CountryCodeMD, + "ME": coredata.CountryCodeME, + "MF": coredata.CountryCodeMF, + "MG": coredata.CountryCodeMG, + "MH": coredata.CountryCodeMH, + "MK": coredata.CountryCodeMK, + "ML": coredata.CountryCodeML, + "MM": coredata.CountryCodeMM, + "MN": coredata.CountryCodeMN, + "MO": coredata.CountryCodeMO, + "MP": coredata.CountryCodeMP, + "MQ": coredata.CountryCodeMQ, + "MR": coredata.CountryCodeMR, + "MS": coredata.CountryCodeMS, + "MT": coredata.CountryCodeMT, + "MU": coredata.CountryCodeMU, + "MV": coredata.CountryCodeMV, + "MW": coredata.CountryCodeMW, + "MX": coredata.CountryCodeMX, + "MY": coredata.CountryCodeMY, + "MZ": coredata.CountryCodeMZ, + "NA": coredata.CountryCodeNA, + "NC": coredata.CountryCodeNC, + "NE": coredata.CountryCodeNE, + "NF": coredata.CountryCodeNF, + "NG": coredata.CountryCodeNG, + "NI": coredata.CountryCodeNI, + "NL": coredata.CountryCodeNL, + "NO": coredata.CountryCodeNO, + "NP": coredata.CountryCodeNP, + "NR": coredata.CountryCodeNR, + "NU": coredata.CountryCodeNU, + "NZ": coredata.CountryCodeNZ, + "OM": coredata.CountryCodeOM, + "PA": coredata.CountryCodePA, + "PE": coredata.CountryCodePE, + "PF": coredata.CountryCodePF, + "PG": coredata.CountryCodePG, + "PH": coredata.CountryCodePH, + "PK": coredata.CountryCodePK, + "PL": coredata.CountryCodePL, + "PM": coredata.CountryCodePM, + "PN": coredata.CountryCodePN, + "PR": coredata.CountryCodePR, + "PS": coredata.CountryCodePS, + "PT": coredata.CountryCodePT, + "PW": coredata.CountryCodePW, + "PY": coredata.CountryCodePY, + "QA": coredata.CountryCodeQA, + "RE": coredata.CountryCodeRE, + "RO": coredata.CountryCodeRO, + "RS": coredata.CountryCodeRS, + "RU": coredata.CountryCodeRU, + "RW": coredata.CountryCodeRW, + "SA": coredata.CountryCodeSA, + "SB": coredata.CountryCodeSB, + "SC": coredata.CountryCodeSC, + "SD": coredata.CountryCodeSD, + "SE": coredata.CountryCodeSE, + "SG": coredata.CountryCodeSG, + "SH": coredata.CountryCodeSH, + "SI": coredata.CountryCodeSI, + "SJ": coredata.CountryCodeSJ, + "SK": coredata.CountryCodeSK, + "SL": coredata.CountryCodeSL, + "SM": coredata.CountryCodeSM, + "SN": coredata.CountryCodeSN, + "SO": coredata.CountryCodeSO, + "SR": coredata.CountryCodeSR, + "SS": coredata.CountryCodeSS, + "ST": coredata.CountryCodeST, + "SV": coredata.CountryCodeSV, + "SX": coredata.CountryCodeSX, + "SY": coredata.CountryCodeSY, + "SZ": coredata.CountryCodeSZ, + "TC": coredata.CountryCodeTC, + "TD": coredata.CountryCodeTD, + "TF": coredata.CountryCodeTF, + "TG": coredata.CountryCodeTG, + "TH": coredata.CountryCodeTH, + "TJ": coredata.CountryCodeTJ, + "TK": coredata.CountryCodeTK, + "TL": coredata.CountryCodeTL, + "TM": coredata.CountryCodeTM, + "TN": coredata.CountryCodeTN, + "TO": coredata.CountryCodeTO, + "TR": coredata.CountryCodeTR, + "TT": coredata.CountryCodeTT, + "TV": coredata.CountryCodeTV, + "TW": coredata.CountryCodeTW, + "TZ": coredata.CountryCodeTZ, + "UA": coredata.CountryCodeUA, + "UG": coredata.CountryCodeUG, + "UM": coredata.CountryCodeUM, + "US": coredata.CountryCodeUS, + "UY": coredata.CountryCodeUY, + "UZ": coredata.CountryCodeUZ, + "VA": coredata.CountryCodeVA, + "VC": coredata.CountryCodeVC, + "VE": coredata.CountryCodeVE, + "VG": coredata.CountryCodeVG, + "VI": coredata.CountryCodeVI, + "VN": coredata.CountryCodeVN, + "VU": coredata.CountryCodeVU, + "WF": coredata.CountryCodeWF, + "WS": coredata.CountryCodeWS, + "YE": coredata.CountryCodeYE, + "YT": coredata.CountryCodeYT, + "ZA": coredata.CountryCodeZA, + "ZM": coredata.CountryCodeZM, + "ZW": coredata.CountryCodeZW, + } + marshalNCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ = map[coredata.CountryCode]string{ + coredata.CountryCodeAD: "AD", + coredata.CountryCodeAE: "AE", + coredata.CountryCodeAF: "AF", + coredata.CountryCodeAG: "AG", + coredata.CountryCodeAI: "AI", + coredata.CountryCodeAL: "AL", + coredata.CountryCodeAM: "AM", + coredata.CountryCodeAO: "AO", + coredata.CountryCodeAQ: "AQ", + coredata.CountryCodeAR: "AR", + coredata.CountryCodeAS: "AS", + coredata.CountryCodeAT: "AT", + coredata.CountryCodeAU: "AU", + coredata.CountryCodeAW: "AW", + coredata.CountryCodeAX: "AX", + coredata.CountryCodeAZ: "AZ", + coredata.CountryCodeBA: "BA", + coredata.CountryCodeBB: "BB", + coredata.CountryCodeBD: "BD", + coredata.CountryCodeBE: "BE", + coredata.CountryCodeBF: "BF", + coredata.CountryCodeBG: "BG", + coredata.CountryCodeBH: "BH", + coredata.CountryCodeBI: "BI", + coredata.CountryCodeBJ: "BJ", + coredata.CountryCodeBL: "BL", + coredata.CountryCodeBM: "BM", + coredata.CountryCodeBN: "BN", + coredata.CountryCodeBO: "BO", + coredata.CountryCodeBQ: "BQ", + coredata.CountryCodeBR: "BR", + coredata.CountryCodeBS: "BS", + coredata.CountryCodeBT: "BT", + coredata.CountryCodeBV: "BV", + coredata.CountryCodeBW: "BW", + coredata.CountryCodeBY: "BY", + coredata.CountryCodeBZ: "BZ", + coredata.CountryCodeCA: "CA", + coredata.CountryCodeCC: "CC", + coredata.CountryCodeCD: "CD", + coredata.CountryCodeCF: "CF", + coredata.CountryCodeCG: "CG", + coredata.CountryCodeCH: "CH", + coredata.CountryCodeCI: "CI", + coredata.CountryCodeCK: "CK", + coredata.CountryCodeCL: "CL", + coredata.CountryCodeCM: "CM", + coredata.CountryCodeCN: "CN", + coredata.CountryCodeCO: "CO", + coredata.CountryCodeCR: "CR", + coredata.CountryCodeCU: "CU", + coredata.CountryCodeCV: "CV", + coredata.CountryCodeCW: "CW", + coredata.CountryCodeCX: "CX", + coredata.CountryCodeCY: "CY", + coredata.CountryCodeCZ: "CZ", + coredata.CountryCodeDE: "DE", + coredata.CountryCodeDJ: "DJ", + coredata.CountryCodeDK: "DK", + coredata.CountryCodeDM: "DM", + coredata.CountryCodeDO: "DO", + coredata.CountryCodeDZ: "DZ", + coredata.CountryCodeEC: "EC", + coredata.CountryCodeEE: "EE", + coredata.CountryCodeEG: "EG", + coredata.CountryCodeEH: "EH", + coredata.CountryCodeER: "ER", + coredata.CountryCodeES: "ES", + coredata.CountryCodeET: "ET", + coredata.CountryCodeFI: "FI", + coredata.CountryCodeFJ: "FJ", + coredata.CountryCodeFK: "FK", + coredata.CountryCodeFM: "FM", + coredata.CountryCodeFO: "FO", + coredata.CountryCodeFR: "FR", + coredata.CountryCodeGA: "GA", + coredata.CountryCodeGB: "GB", + coredata.CountryCodeGD: "GD", + coredata.CountryCodeGE: "GE", + coredata.CountryCodeGF: "GF", + coredata.CountryCodeGG: "GG", + coredata.CountryCodeGH: "GH", + coredata.CountryCodeGI: "GI", + coredata.CountryCodeGL: "GL", + coredata.CountryCodeGM: "GM", + coredata.CountryCodeGN: "GN", + coredata.CountryCodeGP: "GP", + coredata.CountryCodeGQ: "GQ", + coredata.CountryCodeGR: "GR", + coredata.CountryCodeGT: "GT", + coredata.CountryCodeGU: "GU", + coredata.CountryCodeGW: "GW", + coredata.CountryCodeGY: "GY", + coredata.CountryCodeHK: "HK", + coredata.CountryCodeHM: "HM", + coredata.CountryCodeHN: "HN", + coredata.CountryCodeHR: "HR", + coredata.CountryCodeHT: "HT", + coredata.CountryCodeHU: "HU", + coredata.CountryCodeID: "ID", + coredata.CountryCodeIE: "IE", + coredata.CountryCodeIL: "IL", + coredata.CountryCodeIM: "IM", + coredata.CountryCodeIN: "IN", + coredata.CountryCodeIO: "IO", + coredata.CountryCodeIQ: "IQ", + coredata.CountryCodeIR: "IR", + coredata.CountryCodeIS: "IS", + coredata.CountryCodeIT: "IT", + coredata.CountryCodeJE: "JE", + coredata.CountryCodeJM: "JM", + coredata.CountryCodeJO: "JO", + coredata.CountryCodeJP: "JP", + coredata.CountryCodeKE: "KE", + coredata.CountryCodeKG: "KG", + coredata.CountryCodeKH: "KH", + coredata.CountryCodeKI: "KI", + coredata.CountryCodeKM: "KM", + coredata.CountryCodeKN: "KN", + coredata.CountryCodeKP: "KP", + coredata.CountryCodeKR: "KR", + coredata.CountryCodeKW: "KW", + coredata.CountryCodeKY: "KY", + coredata.CountryCodeKZ: "KZ", + coredata.CountryCodeLA: "LA", + coredata.CountryCodeLB: "LB", + coredata.CountryCodeLC: "LC", + coredata.CountryCodeLI: "LI", + coredata.CountryCodeLK: "LK", + coredata.CountryCodeLR: "LR", + coredata.CountryCodeLS: "LS", + coredata.CountryCodeLT: "LT", + coredata.CountryCodeLU: "LU", + coredata.CountryCodeLV: "LV", + coredata.CountryCodeLY: "LY", + coredata.CountryCodeMA: "MA", + coredata.CountryCodeMC: "MC", + coredata.CountryCodeMD: "MD", + coredata.CountryCodeME: "ME", + coredata.CountryCodeMF: "MF", + coredata.CountryCodeMG: "MG", + coredata.CountryCodeMH: "MH", + coredata.CountryCodeMK: "MK", + coredata.CountryCodeML: "ML", + coredata.CountryCodeMM: "MM", + coredata.CountryCodeMN: "MN", + coredata.CountryCodeMO: "MO", + coredata.CountryCodeMP: "MP", + coredata.CountryCodeMQ: "MQ", + coredata.CountryCodeMR: "MR", + coredata.CountryCodeMS: "MS", + coredata.CountryCodeMT: "MT", + coredata.CountryCodeMU: "MU", + coredata.CountryCodeMV: "MV", + coredata.CountryCodeMW: "MW", + coredata.CountryCodeMX: "MX", + coredata.CountryCodeMY: "MY", + coredata.CountryCodeMZ: "MZ", + coredata.CountryCodeNA: "NA", + coredata.CountryCodeNC: "NC", + coredata.CountryCodeNE: "NE", + coredata.CountryCodeNF: "NF", + coredata.CountryCodeNG: "NG", + coredata.CountryCodeNI: "NI", + coredata.CountryCodeNL: "NL", + coredata.CountryCodeNO: "NO", + coredata.CountryCodeNP: "NP", + coredata.CountryCodeNR: "NR", + coredata.CountryCodeNU: "NU", + coredata.CountryCodeNZ: "NZ", + coredata.CountryCodeOM: "OM", + coredata.CountryCodePA: "PA", + coredata.CountryCodePE: "PE", + coredata.CountryCodePF: "PF", + coredata.CountryCodePG: "PG", + coredata.CountryCodePH: "PH", + coredata.CountryCodePK: "PK", + coredata.CountryCodePL: "PL", + coredata.CountryCodePM: "PM", + coredata.CountryCodePN: "PN", + coredata.CountryCodePR: "PR", + coredata.CountryCodePS: "PS", + coredata.CountryCodePT: "PT", + coredata.CountryCodePW: "PW", + coredata.CountryCodePY: "PY", + coredata.CountryCodeQA: "QA", + coredata.CountryCodeRE: "RE", + coredata.CountryCodeRO: "RO", + coredata.CountryCodeRS: "RS", + coredata.CountryCodeRU: "RU", + coredata.CountryCodeRW: "RW", + coredata.CountryCodeSA: "SA", + coredata.CountryCodeSB: "SB", + coredata.CountryCodeSC: "SC", + coredata.CountryCodeSD: "SD", + coredata.CountryCodeSE: "SE", + coredata.CountryCodeSG: "SG", + coredata.CountryCodeSH: "SH", + coredata.CountryCodeSI: "SI", + coredata.CountryCodeSJ: "SJ", + coredata.CountryCodeSK: "SK", + coredata.CountryCodeSL: "SL", + coredata.CountryCodeSM: "SM", + coredata.CountryCodeSN: "SN", + coredata.CountryCodeSO: "SO", + coredata.CountryCodeSR: "SR", + coredata.CountryCodeSS: "SS", + coredata.CountryCodeST: "ST", + coredata.CountryCodeSV: "SV", + coredata.CountryCodeSX: "SX", + coredata.CountryCodeSY: "SY", + coredata.CountryCodeSZ: "SZ", + coredata.CountryCodeTC: "TC", + coredata.CountryCodeTD: "TD", + coredata.CountryCodeTF: "TF", + coredata.CountryCodeTG: "TG", + coredata.CountryCodeTH: "TH", + coredata.CountryCodeTJ: "TJ", + coredata.CountryCodeTK: "TK", + coredata.CountryCodeTL: "TL", + coredata.CountryCodeTM: "TM", + coredata.CountryCodeTN: "TN", + coredata.CountryCodeTO: "TO", + coredata.CountryCodeTR: "TR", + coredata.CountryCodeTT: "TT", + coredata.CountryCodeTV: "TV", + coredata.CountryCodeTW: "TW", + coredata.CountryCodeTZ: "TZ", + coredata.CountryCodeUA: "UA", + coredata.CountryCodeUG: "UG", + coredata.CountryCodeUM: "UM", + coredata.CountryCodeUS: "US", + coredata.CountryCodeUY: "UY", + coredata.CountryCodeUZ: "UZ", + coredata.CountryCodeVA: "VA", + coredata.CountryCodeVC: "VC", + coredata.CountryCodeVE: "VE", + coredata.CountryCodeVG: "VG", + coredata.CountryCodeVI: "VI", + coredata.CountryCodeVN: "VN", + coredata.CountryCodeVU: "VU", + coredata.CountryCodeWF: "WF", + coredata.CountryCodeWS: "WS", + coredata.CountryCodeYE: "YE", + coredata.CountryCodeYT: "YT", + coredata.CountryCodeZA: "ZA", + coredata.CountryCodeZM: "ZM", + coredata.CountryCodeZW: "ZW", + } +) + func (ec *executionContext) unmarshalNCreateAssetInput2githubᚗcomᚋgetproboᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateAssetInput(ctx context.Context, v any) (types.CreateAssetInput, error) { res, err := ec.unmarshalInputCreateAssetInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) @@ -88658,6 +90084,574 @@ var ( } ) +func (ec *executionContext) unmarshalOCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx context.Context, v any) ([]coredata.CountryCode, error) { + if v == nil { + return nil, nil + } + var vSlice []any + vSlice = graphql.CoerceList(v) + var err error + res := make([]coredata.CountryCode, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ(ctx context.Context, sel ast.SelectionSet, v []coredata.CountryCode) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNCountryCode2githubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCode(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +var ( + unmarshalOCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ = map[string]coredata.CountryCode{ + "AD": coredata.CountryCodeAD, + "AE": coredata.CountryCodeAE, + "AF": coredata.CountryCodeAF, + "AG": coredata.CountryCodeAG, + "AI": coredata.CountryCodeAI, + "AL": coredata.CountryCodeAL, + "AM": coredata.CountryCodeAM, + "AO": coredata.CountryCodeAO, + "AQ": coredata.CountryCodeAQ, + "AR": coredata.CountryCodeAR, + "AS": coredata.CountryCodeAS, + "AT": coredata.CountryCodeAT, + "AU": coredata.CountryCodeAU, + "AW": coredata.CountryCodeAW, + "AX": coredata.CountryCodeAX, + "AZ": coredata.CountryCodeAZ, + "BA": coredata.CountryCodeBA, + "BB": coredata.CountryCodeBB, + "BD": coredata.CountryCodeBD, + "BE": coredata.CountryCodeBE, + "BF": coredata.CountryCodeBF, + "BG": coredata.CountryCodeBG, + "BH": coredata.CountryCodeBH, + "BI": coredata.CountryCodeBI, + "BJ": coredata.CountryCodeBJ, + "BL": coredata.CountryCodeBL, + "BM": coredata.CountryCodeBM, + "BN": coredata.CountryCodeBN, + "BO": coredata.CountryCodeBO, + "BQ": coredata.CountryCodeBQ, + "BR": coredata.CountryCodeBR, + "BS": coredata.CountryCodeBS, + "BT": coredata.CountryCodeBT, + "BV": coredata.CountryCodeBV, + "BW": coredata.CountryCodeBW, + "BY": coredata.CountryCodeBY, + "BZ": coredata.CountryCodeBZ, + "CA": coredata.CountryCodeCA, + "CC": coredata.CountryCodeCC, + "CD": coredata.CountryCodeCD, + "CF": coredata.CountryCodeCF, + "CG": coredata.CountryCodeCG, + "CH": coredata.CountryCodeCH, + "CI": coredata.CountryCodeCI, + "CK": coredata.CountryCodeCK, + "CL": coredata.CountryCodeCL, + "CM": coredata.CountryCodeCM, + "CN": coredata.CountryCodeCN, + "CO": coredata.CountryCodeCO, + "CR": coredata.CountryCodeCR, + "CU": coredata.CountryCodeCU, + "CV": coredata.CountryCodeCV, + "CW": coredata.CountryCodeCW, + "CX": coredata.CountryCodeCX, + "CY": coredata.CountryCodeCY, + "CZ": coredata.CountryCodeCZ, + "DE": coredata.CountryCodeDE, + "DJ": coredata.CountryCodeDJ, + "DK": coredata.CountryCodeDK, + "DM": coredata.CountryCodeDM, + "DO": coredata.CountryCodeDO, + "DZ": coredata.CountryCodeDZ, + "EC": coredata.CountryCodeEC, + "EE": coredata.CountryCodeEE, + "EG": coredata.CountryCodeEG, + "EH": coredata.CountryCodeEH, + "ER": coredata.CountryCodeER, + "ES": coredata.CountryCodeES, + "ET": coredata.CountryCodeET, + "FI": coredata.CountryCodeFI, + "FJ": coredata.CountryCodeFJ, + "FK": coredata.CountryCodeFK, + "FM": coredata.CountryCodeFM, + "FO": coredata.CountryCodeFO, + "FR": coredata.CountryCodeFR, + "GA": coredata.CountryCodeGA, + "GB": coredata.CountryCodeGB, + "GD": coredata.CountryCodeGD, + "GE": coredata.CountryCodeGE, + "GF": coredata.CountryCodeGF, + "GG": coredata.CountryCodeGG, + "GH": coredata.CountryCodeGH, + "GI": coredata.CountryCodeGI, + "GL": coredata.CountryCodeGL, + "GM": coredata.CountryCodeGM, + "GN": coredata.CountryCodeGN, + "GP": coredata.CountryCodeGP, + "GQ": coredata.CountryCodeGQ, + "GR": coredata.CountryCodeGR, + "GT": coredata.CountryCodeGT, + "GU": coredata.CountryCodeGU, + "GW": coredata.CountryCodeGW, + "GY": coredata.CountryCodeGY, + "HK": coredata.CountryCodeHK, + "HM": coredata.CountryCodeHM, + "HN": coredata.CountryCodeHN, + "HR": coredata.CountryCodeHR, + "HT": coredata.CountryCodeHT, + "HU": coredata.CountryCodeHU, + "ID": coredata.CountryCodeID, + "IE": coredata.CountryCodeIE, + "IL": coredata.CountryCodeIL, + "IM": coredata.CountryCodeIM, + "IN": coredata.CountryCodeIN, + "IO": coredata.CountryCodeIO, + "IQ": coredata.CountryCodeIQ, + "IR": coredata.CountryCodeIR, + "IS": coredata.CountryCodeIS, + "IT": coredata.CountryCodeIT, + "JE": coredata.CountryCodeJE, + "JM": coredata.CountryCodeJM, + "JO": coredata.CountryCodeJO, + "JP": coredata.CountryCodeJP, + "KE": coredata.CountryCodeKE, + "KG": coredata.CountryCodeKG, + "KH": coredata.CountryCodeKH, + "KI": coredata.CountryCodeKI, + "KM": coredata.CountryCodeKM, + "KN": coredata.CountryCodeKN, + "KP": coredata.CountryCodeKP, + "KR": coredata.CountryCodeKR, + "KW": coredata.CountryCodeKW, + "KY": coredata.CountryCodeKY, + "KZ": coredata.CountryCodeKZ, + "LA": coredata.CountryCodeLA, + "LB": coredata.CountryCodeLB, + "LC": coredata.CountryCodeLC, + "LI": coredata.CountryCodeLI, + "LK": coredata.CountryCodeLK, + "LR": coredata.CountryCodeLR, + "LS": coredata.CountryCodeLS, + "LT": coredata.CountryCodeLT, + "LU": coredata.CountryCodeLU, + "LV": coredata.CountryCodeLV, + "LY": coredata.CountryCodeLY, + "MA": coredata.CountryCodeMA, + "MC": coredata.CountryCodeMC, + "MD": coredata.CountryCodeMD, + "ME": coredata.CountryCodeME, + "MF": coredata.CountryCodeMF, + "MG": coredata.CountryCodeMG, + "MH": coredata.CountryCodeMH, + "MK": coredata.CountryCodeMK, + "ML": coredata.CountryCodeML, + "MM": coredata.CountryCodeMM, + "MN": coredata.CountryCodeMN, + "MO": coredata.CountryCodeMO, + "MP": coredata.CountryCodeMP, + "MQ": coredata.CountryCodeMQ, + "MR": coredata.CountryCodeMR, + "MS": coredata.CountryCodeMS, + "MT": coredata.CountryCodeMT, + "MU": coredata.CountryCodeMU, + "MV": coredata.CountryCodeMV, + "MW": coredata.CountryCodeMW, + "MX": coredata.CountryCodeMX, + "MY": coredata.CountryCodeMY, + "MZ": coredata.CountryCodeMZ, + "NA": coredata.CountryCodeNA, + "NC": coredata.CountryCodeNC, + "NE": coredata.CountryCodeNE, + "NF": coredata.CountryCodeNF, + "NG": coredata.CountryCodeNG, + "NI": coredata.CountryCodeNI, + "NL": coredata.CountryCodeNL, + "NO": coredata.CountryCodeNO, + "NP": coredata.CountryCodeNP, + "NR": coredata.CountryCodeNR, + "NU": coredata.CountryCodeNU, + "NZ": coredata.CountryCodeNZ, + "OM": coredata.CountryCodeOM, + "PA": coredata.CountryCodePA, + "PE": coredata.CountryCodePE, + "PF": coredata.CountryCodePF, + "PG": coredata.CountryCodePG, + "PH": coredata.CountryCodePH, + "PK": coredata.CountryCodePK, + "PL": coredata.CountryCodePL, + "PM": coredata.CountryCodePM, + "PN": coredata.CountryCodePN, + "PR": coredata.CountryCodePR, + "PS": coredata.CountryCodePS, + "PT": coredata.CountryCodePT, + "PW": coredata.CountryCodePW, + "PY": coredata.CountryCodePY, + "QA": coredata.CountryCodeQA, + "RE": coredata.CountryCodeRE, + "RO": coredata.CountryCodeRO, + "RS": coredata.CountryCodeRS, + "RU": coredata.CountryCodeRU, + "RW": coredata.CountryCodeRW, + "SA": coredata.CountryCodeSA, + "SB": coredata.CountryCodeSB, + "SC": coredata.CountryCodeSC, + "SD": coredata.CountryCodeSD, + "SE": coredata.CountryCodeSE, + "SG": coredata.CountryCodeSG, + "SH": coredata.CountryCodeSH, + "SI": coredata.CountryCodeSI, + "SJ": coredata.CountryCodeSJ, + "SK": coredata.CountryCodeSK, + "SL": coredata.CountryCodeSL, + "SM": coredata.CountryCodeSM, + "SN": coredata.CountryCodeSN, + "SO": coredata.CountryCodeSO, + "SR": coredata.CountryCodeSR, + "SS": coredata.CountryCodeSS, + "ST": coredata.CountryCodeST, + "SV": coredata.CountryCodeSV, + "SX": coredata.CountryCodeSX, + "SY": coredata.CountryCodeSY, + "SZ": coredata.CountryCodeSZ, + "TC": coredata.CountryCodeTC, + "TD": coredata.CountryCodeTD, + "TF": coredata.CountryCodeTF, + "TG": coredata.CountryCodeTG, + "TH": coredata.CountryCodeTH, + "TJ": coredata.CountryCodeTJ, + "TK": coredata.CountryCodeTK, + "TL": coredata.CountryCodeTL, + "TM": coredata.CountryCodeTM, + "TN": coredata.CountryCodeTN, + "TO": coredata.CountryCodeTO, + "TR": coredata.CountryCodeTR, + "TT": coredata.CountryCodeTT, + "TV": coredata.CountryCodeTV, + "TW": coredata.CountryCodeTW, + "TZ": coredata.CountryCodeTZ, + "UA": coredata.CountryCodeUA, + "UG": coredata.CountryCodeUG, + "UM": coredata.CountryCodeUM, + "US": coredata.CountryCodeUS, + "UY": coredata.CountryCodeUY, + "UZ": coredata.CountryCodeUZ, + "VA": coredata.CountryCodeVA, + "VC": coredata.CountryCodeVC, + "VE": coredata.CountryCodeVE, + "VG": coredata.CountryCodeVG, + "VI": coredata.CountryCodeVI, + "VN": coredata.CountryCodeVN, + "VU": coredata.CountryCodeVU, + "WF": coredata.CountryCodeWF, + "WS": coredata.CountryCodeWS, + "YE": coredata.CountryCodeYE, + "YT": coredata.CountryCodeYT, + "ZA": coredata.CountryCodeZA, + "ZM": coredata.CountryCodeZM, + "ZW": coredata.CountryCodeZW, + } + marshalOCountryCode2ᚕgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCountryCodeᚄ = map[coredata.CountryCode]string{ + coredata.CountryCodeAD: "AD", + coredata.CountryCodeAE: "AE", + coredata.CountryCodeAF: "AF", + coredata.CountryCodeAG: "AG", + coredata.CountryCodeAI: "AI", + coredata.CountryCodeAL: "AL", + coredata.CountryCodeAM: "AM", + coredata.CountryCodeAO: "AO", + coredata.CountryCodeAQ: "AQ", + coredata.CountryCodeAR: "AR", + coredata.CountryCodeAS: "AS", + coredata.CountryCodeAT: "AT", + coredata.CountryCodeAU: "AU", + coredata.CountryCodeAW: "AW", + coredata.CountryCodeAX: "AX", + coredata.CountryCodeAZ: "AZ", + coredata.CountryCodeBA: "BA", + coredata.CountryCodeBB: "BB", + coredata.CountryCodeBD: "BD", + coredata.CountryCodeBE: "BE", + coredata.CountryCodeBF: "BF", + coredata.CountryCodeBG: "BG", + coredata.CountryCodeBH: "BH", + coredata.CountryCodeBI: "BI", + coredata.CountryCodeBJ: "BJ", + coredata.CountryCodeBL: "BL", + coredata.CountryCodeBM: "BM", + coredata.CountryCodeBN: "BN", + coredata.CountryCodeBO: "BO", + coredata.CountryCodeBQ: "BQ", + coredata.CountryCodeBR: "BR", + coredata.CountryCodeBS: "BS", + coredata.CountryCodeBT: "BT", + coredata.CountryCodeBV: "BV", + coredata.CountryCodeBW: "BW", + coredata.CountryCodeBY: "BY", + coredata.CountryCodeBZ: "BZ", + coredata.CountryCodeCA: "CA", + coredata.CountryCodeCC: "CC", + coredata.CountryCodeCD: "CD", + coredata.CountryCodeCF: "CF", + coredata.CountryCodeCG: "CG", + coredata.CountryCodeCH: "CH", + coredata.CountryCodeCI: "CI", + coredata.CountryCodeCK: "CK", + coredata.CountryCodeCL: "CL", + coredata.CountryCodeCM: "CM", + coredata.CountryCodeCN: "CN", + coredata.CountryCodeCO: "CO", + coredata.CountryCodeCR: "CR", + coredata.CountryCodeCU: "CU", + coredata.CountryCodeCV: "CV", + coredata.CountryCodeCW: "CW", + coredata.CountryCodeCX: "CX", + coredata.CountryCodeCY: "CY", + coredata.CountryCodeCZ: "CZ", + coredata.CountryCodeDE: "DE", + coredata.CountryCodeDJ: "DJ", + coredata.CountryCodeDK: "DK", + coredata.CountryCodeDM: "DM", + coredata.CountryCodeDO: "DO", + coredata.CountryCodeDZ: "DZ", + coredata.CountryCodeEC: "EC", + coredata.CountryCodeEE: "EE", + coredata.CountryCodeEG: "EG", + coredata.CountryCodeEH: "EH", + coredata.CountryCodeER: "ER", + coredata.CountryCodeES: "ES", + coredata.CountryCodeET: "ET", + coredata.CountryCodeFI: "FI", + coredata.CountryCodeFJ: "FJ", + coredata.CountryCodeFK: "FK", + coredata.CountryCodeFM: "FM", + coredata.CountryCodeFO: "FO", + coredata.CountryCodeFR: "FR", + coredata.CountryCodeGA: "GA", + coredata.CountryCodeGB: "GB", + coredata.CountryCodeGD: "GD", + coredata.CountryCodeGE: "GE", + coredata.CountryCodeGF: "GF", + coredata.CountryCodeGG: "GG", + coredata.CountryCodeGH: "GH", + coredata.CountryCodeGI: "GI", + coredata.CountryCodeGL: "GL", + coredata.CountryCodeGM: "GM", + coredata.CountryCodeGN: "GN", + coredata.CountryCodeGP: "GP", + coredata.CountryCodeGQ: "GQ", + coredata.CountryCodeGR: "GR", + coredata.CountryCodeGT: "GT", + coredata.CountryCodeGU: "GU", + coredata.CountryCodeGW: "GW", + coredata.CountryCodeGY: "GY", + coredata.CountryCodeHK: "HK", + coredata.CountryCodeHM: "HM", + coredata.CountryCodeHN: "HN", + coredata.CountryCodeHR: "HR", + coredata.CountryCodeHT: "HT", + coredata.CountryCodeHU: "HU", + coredata.CountryCodeID: "ID", + coredata.CountryCodeIE: "IE", + coredata.CountryCodeIL: "IL", + coredata.CountryCodeIM: "IM", + coredata.CountryCodeIN: "IN", + coredata.CountryCodeIO: "IO", + coredata.CountryCodeIQ: "IQ", + coredata.CountryCodeIR: "IR", + coredata.CountryCodeIS: "IS", + coredata.CountryCodeIT: "IT", + coredata.CountryCodeJE: "JE", + coredata.CountryCodeJM: "JM", + coredata.CountryCodeJO: "JO", + coredata.CountryCodeJP: "JP", + coredata.CountryCodeKE: "KE", + coredata.CountryCodeKG: "KG", + coredata.CountryCodeKH: "KH", + coredata.CountryCodeKI: "KI", + coredata.CountryCodeKM: "KM", + coredata.CountryCodeKN: "KN", + coredata.CountryCodeKP: "KP", + coredata.CountryCodeKR: "KR", + coredata.CountryCodeKW: "KW", + coredata.CountryCodeKY: "KY", + coredata.CountryCodeKZ: "KZ", + coredata.CountryCodeLA: "LA", + coredata.CountryCodeLB: "LB", + coredata.CountryCodeLC: "LC", + coredata.CountryCodeLI: "LI", + coredata.CountryCodeLK: "LK", + coredata.CountryCodeLR: "LR", + coredata.CountryCodeLS: "LS", + coredata.CountryCodeLT: "LT", + coredata.CountryCodeLU: "LU", + coredata.CountryCodeLV: "LV", + coredata.CountryCodeLY: "LY", + coredata.CountryCodeMA: "MA", + coredata.CountryCodeMC: "MC", + coredata.CountryCodeMD: "MD", + coredata.CountryCodeME: "ME", + coredata.CountryCodeMF: "MF", + coredata.CountryCodeMG: "MG", + coredata.CountryCodeMH: "MH", + coredata.CountryCodeMK: "MK", + coredata.CountryCodeML: "ML", + coredata.CountryCodeMM: "MM", + coredata.CountryCodeMN: "MN", + coredata.CountryCodeMO: "MO", + coredata.CountryCodeMP: "MP", + coredata.CountryCodeMQ: "MQ", + coredata.CountryCodeMR: "MR", + coredata.CountryCodeMS: "MS", + coredata.CountryCodeMT: "MT", + coredata.CountryCodeMU: "MU", + coredata.CountryCodeMV: "MV", + coredata.CountryCodeMW: "MW", + coredata.CountryCodeMX: "MX", + coredata.CountryCodeMY: "MY", + coredata.CountryCodeMZ: "MZ", + coredata.CountryCodeNA: "NA", + coredata.CountryCodeNC: "NC", + coredata.CountryCodeNE: "NE", + coredata.CountryCodeNF: "NF", + coredata.CountryCodeNG: "NG", + coredata.CountryCodeNI: "NI", + coredata.CountryCodeNL: "NL", + coredata.CountryCodeNO: "NO", + coredata.CountryCodeNP: "NP", + coredata.CountryCodeNR: "NR", + coredata.CountryCodeNU: "NU", + coredata.CountryCodeNZ: "NZ", + coredata.CountryCodeOM: "OM", + coredata.CountryCodePA: "PA", + coredata.CountryCodePE: "PE", + coredata.CountryCodePF: "PF", + coredata.CountryCodePG: "PG", + coredata.CountryCodePH: "PH", + coredata.CountryCodePK: "PK", + coredata.CountryCodePL: "PL", + coredata.CountryCodePM: "PM", + coredata.CountryCodePN: "PN", + coredata.CountryCodePR: "PR", + coredata.CountryCodePS: "PS", + coredata.CountryCodePT: "PT", + coredata.CountryCodePW: "PW", + coredata.CountryCodePY: "PY", + coredata.CountryCodeQA: "QA", + coredata.CountryCodeRE: "RE", + coredata.CountryCodeRO: "RO", + coredata.CountryCodeRS: "RS", + coredata.CountryCodeRU: "RU", + coredata.CountryCodeRW: "RW", + coredata.CountryCodeSA: "SA", + coredata.CountryCodeSB: "SB", + coredata.CountryCodeSC: "SC", + coredata.CountryCodeSD: "SD", + coredata.CountryCodeSE: "SE", + coredata.CountryCodeSG: "SG", + coredata.CountryCodeSH: "SH", + coredata.CountryCodeSI: "SI", + coredata.CountryCodeSJ: "SJ", + coredata.CountryCodeSK: "SK", + coredata.CountryCodeSL: "SL", + coredata.CountryCodeSM: "SM", + coredata.CountryCodeSN: "SN", + coredata.CountryCodeSO: "SO", + coredata.CountryCodeSR: "SR", + coredata.CountryCodeSS: "SS", + coredata.CountryCodeST: "ST", + coredata.CountryCodeSV: "SV", + coredata.CountryCodeSX: "SX", + coredata.CountryCodeSY: "SY", + coredata.CountryCodeSZ: "SZ", + coredata.CountryCodeTC: "TC", + coredata.CountryCodeTD: "TD", + coredata.CountryCodeTF: "TF", + coredata.CountryCodeTG: "TG", + coredata.CountryCodeTH: "TH", + coredata.CountryCodeTJ: "TJ", + coredata.CountryCodeTK: "TK", + coredata.CountryCodeTL: "TL", + coredata.CountryCodeTM: "TM", + coredata.CountryCodeTN: "TN", + coredata.CountryCodeTO: "TO", + coredata.CountryCodeTR: "TR", + coredata.CountryCodeTT: "TT", + coredata.CountryCodeTV: "TV", + coredata.CountryCodeTW: "TW", + coredata.CountryCodeTZ: "TZ", + coredata.CountryCodeUA: "UA", + coredata.CountryCodeUG: "UG", + coredata.CountryCodeUM: "UM", + coredata.CountryCodeUS: "US", + coredata.CountryCodeUY: "UY", + coredata.CountryCodeUZ: "UZ", + coredata.CountryCodeVA: "VA", + coredata.CountryCodeVC: "VC", + coredata.CountryCodeVE: "VE", + coredata.CountryCodeVG: "VG", + coredata.CountryCodeVI: "VI", + coredata.CountryCodeVN: "VN", + coredata.CountryCodeVU: "VU", + coredata.CountryCodeWF: "WF", + coredata.CountryCodeWS: "WS", + coredata.CountryCodeYE: "YE", + coredata.CountryCodeYT: "YT", + coredata.CountryCodeZA: "ZA", + coredata.CountryCodeZM: "ZM", + coredata.CountryCodeZW: "ZW", + } +) + func (ec *executionContext) unmarshalOCriticityLevel2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋcoredataᚐCriticityLevel(ctx context.Context, v any) (*coredata.CriticityLevel, error) { if v == nil { return nil, nil diff --git a/pkg/server/api/console/v1/types/types.go b/pkg/server/api/console/v1/types/types.go index f5bf4bde3..a50d5ac5a 100644 --- a/pkg/server/api/console/v1/types/types.go +++ b/pkg/server/api/console/v1/types/types.go @@ -547,6 +547,7 @@ type CreateVendorInput struct { BusinessAssociateAgreementURL *string `json:"businessAssociateAgreementUrl,omitempty"` SubprocessorsListURL *string `json:"subprocessorsListUrl,omitempty"` Certifications []string `json:"certifications,omitempty"` + Countries []coredata.CountryCode `json:"countries,omitempty"` SecurityPageURL *string `json:"securityPageUrl,omitempty"` TrustPageURL *string `json:"trustPageUrl,omitempty"` StatusPageURL *string `json:"statusPageUrl,omitempty"` @@ -1792,6 +1793,7 @@ type UpdateVendorInput struct { HeadquarterAddress *string `json:"headquarterAddress,omitempty"` Category *coredata.VendorCategory `json:"category,omitempty"` Certifications []string `json:"certifications,omitempty"` + Countries []coredata.CountryCode `json:"countries,omitempty"` SecurityPageURL *string `json:"securityPageUrl,omitempty"` TrustPageURL *string `json:"trustPageUrl,omitempty"` BusinessOwnerID *gid.GID `json:"businessOwnerId,omitempty"` @@ -1933,6 +1935,7 @@ type Vendor struct { BusinessAssociateAgreementURL *string `json:"businessAssociateAgreementUrl,omitempty"` SubprocessorsListURL *string `json:"subprocessorsListUrl,omitempty"` Certifications []string `json:"certifications"` + Countries []coredata.CountryCode `json:"countries"` SecurityPageURL *string `json:"securityPageUrl,omitempty"` TrustPageURL *string `json:"trustPageUrl,omitempty"` HeadquarterAddress *string `json:"headquarterAddress,omitempty"` diff --git a/pkg/server/api/console/v1/types/vendor.go b/pkg/server/api/console/v1/types/vendor.go index 606656179..db3d76b69 100644 --- a/pkg/server/api/console/v1/types/vendor.go +++ b/pkg/server/api/console/v1/types/vendor.go @@ -81,6 +81,7 @@ func NewVendor(v *coredata.Vendor) *Vendor { Category: v.Category, ShowOnTrustCenter: v.ShowOnTrustCenter, SnapshotID: v.SnapshotID, + Countries: v.Countries, UpdatedAt: v.UpdatedAt, CreatedAt: v.CreatedAt, } diff --git a/pkg/server/api/console/v1/v1_resolver.go b/pkg/server/api/console/v1/v1_resolver.go index 339f8dcee..e68a84907 100644 --- a/pkg/server/api/console/v1/v1_resolver.go +++ b/pkg/server/api/console/v1/v1_resolver.go @@ -1390,6 +1390,7 @@ func (r *mutationResolver) CreateVendor(ctx context.Context, input types.CreateV TrustPageURL: input.TrustPageURL, BusinessOwnerID: input.BusinessOwnerID, SecurityOwnerID: input.SecurityOwnerID, + Countries: input.Countries, }, ) if err != nil { @@ -1425,6 +1426,7 @@ func (r *mutationResolver) UpdateVendor(ctx context.Context, input types.UpdateV BusinessOwnerID: &input.BusinessOwnerID, SecurityOwnerID: &input.SecurityOwnerID, ShowOnTrustCenter: input.ShowOnTrustCenter, + Countries: input.Countries, }) if err != nil { return nil, fmt.Errorf("cannot update vendor: %w", err) diff --git a/pkg/server/api/trust/v1/schema.graphql b/pkg/server/api/trust/v1/schema.graphql index 273569ea9..50c4bed4b 100644 --- a/pkg/server/api/trust/v1/schema.graphql +++ b/pkg/server/api/trust/v1/schema.graphql @@ -182,6 +182,7 @@ type Vendor implements Node { category: VendorCategory! websiteUrl: String privacyPolicyUrl: String + countries: [String!]! } type VendorConnection {