[REF] Add in APIv4 Product Entity and Fix APIv4 Syntax Conformance test failures...
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 9 Jul 2021 04:13:05 +0000 (14:13 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 9 Jul 2021 04:27:26 +0000 (14:27 +1000)
update version

Civi/Api4/ContributionProduct.php
Civi/Api4/EntityBatch.php
Civi/Api4/Product.php [new file with mode: 0644]
tests/phpunit/api/v4/DataSets/ConformanceTest.json
tests/phpunit/api/v4/Entity/ConformanceTest.php

index d18ff7fb92f58f7c0beb9072d8a6360c11408de4..de34bb0675332668defa5694d130a81a0716fd3b 100644 (file)
@@ -15,6 +15,7 @@ namespace Civi\Api4;
 /**
  * Contribution Product entity.
  *
+ * @since 5.41
  * @package Civi\Api4
  */
 class ContributionProduct extends Generic\DAOEntity {
index 9952295beb92c3572de94955290e5eaee1918be4..b85e64d0e5b31dea1fc9831b1ed4bd4d362c96f2 100644 (file)
@@ -22,6 +22,7 @@ namespace Civi\Api4;
 /**
  * EntityBatch entity.
  *
+ * @since 5.41
  * @searchable none
  * @package Civi\Api4
  */
diff --git a/Civi/Api4/Product.php b/Civi/Api4/Product.php
new file mode 100644 (file)
index 0000000..9be31a6
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+ */
+
+namespace Civi\Api4;
+
+/**
+ * Product entity.
+ *
+ * @since 5.41
+ * @package Civi\Api4
+ */
+class Product extends Generic\DAOEntity {
+
+}
index 67eed06c4f501247187fd80419959ab23a7369cd..3d7918ecba1979831bb8ec53bdbe1bf98164c641 100644 (file)
       "name": "Batch_433397",
       "status_id": "1"
     }
+  ],
+  "Product": [
+    {
+      "name": "Test Product",
+      "price": "10.00",
+      "sku": "Test SKU",
+      "financial_type_id:name": "Donation",
+      "min_contribution": "10.00"
+    }
   ]
 }
index 4d2d024a405ca9da7fd4556340be1166e8bda11c..c03933de963f464dbcc91bac22c07fb58ea1a95a 100644 (file)
@@ -54,6 +54,7 @@ class ConformanceTest extends UnitTestCase implements HookInterface {
       'civicrm_event',
       'civicrm_participant',
       'civicrm_batch',
+      'civicrm_product',
     ];
     $this->dropByPrefix('civicrm_value_myfavorite');
     $this->cleanup(['tablesToTruncate' => $tablesToTruncate]);