aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@vespa.ai>2023-10-30 15:58:22 +0100
committerBjørn Christian Seime <bjorncs@vespa.ai>2023-10-30 16:13:23 +0100
commit6a3584d8b799bc815ec339aa2038dccc8a415f1a (patch)
treef6e45f921e1a0a54dac1675794ce60328c1b4d3e /controller-server
parent8b6c5e37aff416b59f4182f901328479d543a71e (diff)
Make tax id optional for some countries
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java4
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java1
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json2
3 files changed, 3 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index fa32d61675c..1fd8e7c8f3b 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -721,10 +721,6 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler {
var mergedPurchaseOrder = optional("purchaseOrder", inspector).map(PurchaseOrder::new).orElse(billing.getPurchaseOrder());
var mergedInvoiceEmail = optional("invoiceEmail", inspector).map(mail -> new Email(mail, false)).orElse(billing.getInvoiceEmail());
- if (!inspector.field("taxId").valid() && inspector.field("address").valid()) {
- throw new IllegalArgumentException("Tax ID information is mandatory for setting up billing");
- }
-
var mergedBilling = info.billingContact()
.withContact(mergedContact)
.withAddress(mergedAddress)
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java
index b4237a46c5a..93c13e6ed4c 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/billing/BillingApiHandlerV2.java
@@ -131,6 +131,7 @@ public class BillingApiHandlerV2 extends RestApiRequestHandler<BillingApiHandler
var countryCursor = countries.addObject();
countryCursor.setString("code", country.code());
countryCursor.setString("name", country.displayName());
+ countryCursor.setBool("taxIdMandatory", country.taxIdMandatory());
var taxTypesCursors = countryCursor.setArray("taxTypes");
country.taxTypes().forEach(taxType -> {
var taxTypeCursor = taxTypesCursors.addObject();
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json
index 2714de1e64d..5247b84a900 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/billing/responses/accepted-countries.json
@@ -3,6 +3,7 @@
{
"code": "NO",
"name": "Norway",
+ "taxIdMandatory": true,
"taxTypes": [
{
"id": "no_vat",
@@ -15,6 +16,7 @@
{
"code": "CA",
"name": "Canada",
+ "taxIdMandatory": true,
"taxTypes": [
{
"id": "ca_gst_hst",