From 18bebd0c09fcc70972b094f0df0cb160e5bf62e9 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Wed, 27 Jan 2021 11:31:41 -0800 Subject: [PATCH] swag, for key chk --- api/blaze/blaze_models/transactions_response.go | 2 +- app/mysql.go | 12 +++++++++--- swagger/blaze-taxnexus.yaml | 2 +- swagger/vendor-gw-taxnexus.yaml | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/api/blaze/blaze_models/transactions_response.go b/api/blaze/blaze_models/transactions_response.go index 8b6fca4..59810cf 100644 --- a/api/blaze/blaze_models/transactions_response.go +++ b/api/blaze/blaze_models/transactions_response.go @@ -839,7 +839,7 @@ type TransactionsResponseValuesItems0CartItemsItems0 struct { BatchID string `json:"batchId,omitempty"` // batch sku - BatchSku float64 `json:"batchSku,omitempty"` + BatchSku string `json:"batchSku,omitempty"` // calc cultivation tax CalcCultivationTax float64 `json:"calcCultivationTax,omitempty"` diff --git a/app/mysql.go b/app/mysql.go index fb8b267..3580295 100644 --- a/app/mysql.go +++ b/app/mysql.go @@ -11,19 +11,25 @@ import ( var MyDB *sql.DB // InitDB initializes the MySQL database using DSN information from the config file +// and disables foreign key check's because we maintain referential integreity to allow +// for mass batch input. +// func InitDB() { var db *sql.DB var err error - if GetDBMS() == "mysql" { - db, err = sql.Open("mysql", GetDSN()) - } else { + if GetDBMS() != "mysql" { sugar.Fatalf("app.InitDB: 💣 ⛔ unknown DBMS: %s", GetDBMS()) return } + db, err = sql.Open("mysql", GetDSN()) if err != nil { sugar.Fatalf("app.InitDB: 💣 ⛔ Can't log on to DBMS host: %w", err) return } + _, err = db.Exec("set foreign_key_check=0") + if err != nil { + sugar.Warnf("app.InitDB: 💣⛔ can't disable foreign key check") + } MyDB = db sugar.Debugf("app.InitDB: 👍 📤 %s", GetDBMS()) } diff --git a/swagger/blaze-taxnexus.yaml b/swagger/blaze-taxnexus.yaml index 7698373..37a487b 100644 --- a/swagger/blaze-taxnexus.yaml +++ b/swagger/blaze-taxnexus.yaml @@ -6501,7 +6501,7 @@ definitions: type: string batchSku: example: 0 - type: number + type: string calcCultivationTax: example: 0 type: number diff --git a/swagger/vendor-gw-taxnexus.yaml b/swagger/vendor-gw-taxnexus.yaml index db0ead2..ff547fb 100644 --- a/swagger/vendor-gw-taxnexus.yaml +++ b/swagger/vendor-gw-taxnexus.yaml @@ -16,7 +16,7 @@ info: contact: email: "noc@taxnexus.net" license: - name: "Proprietary" + name: "Proprietary - Copyright (c) 2018-2021 by Taxnexus, Inc." termsOfService: "https://www.taxnexus.com/terms/" description: | # Taxnexus Vendor Gateway