Add countries and category to vendors

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2025-09-12 15:32:06 +02:00
parent 41512a7a89
commit a2dc85f853
23 changed files with 3781 additions and 16 deletions

View File

@@ -0,0 +1,854 @@
// Copyright (c) 2025 Probo Inc <hello@getprobo.com>.
//
// 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
}

View File

@@ -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;

View File

@@ -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,

View File

@@ -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,

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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"`

View File

@@ -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,
}

View File

@@ -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)

View File

@@ -182,6 +182,7 @@ type Vendor implements Node {
category: VendorCategory!
websiteUrl: String
privacyPolicyUrl: String
countries: [String!]!
}
type VendorConnection {