Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package phpOMS\Api\CreditRating |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace phpOMS\Api\CreditRating; |
| 16 | |
| 17 | /** |
| 18 | * EU VAT validation interface |
| 19 | * |
| 20 | * @package phpOMS\Api\CreditRating |
| 21 | * @license OMS License 2.0 |
| 22 | * @link https://jingga.app |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | interface CreditRatingInterface |
| 26 | { |
| 27 | /** |
| 28 | * Authenticate with the API |
| 29 | * |
| 30 | * @param string $username Username |
| 31 | * @param string $password Password |
| 32 | * |
| 33 | * @return string |
| 34 | * |
| 35 | * @since 1.0.0 |
| 36 | */ |
| 37 | public function auth(string $username, string $password) : string; |
| 38 | |
| 39 | /** |
| 40 | * Find companies matching search parameters |
| 41 | * |
| 42 | * @param string $token API token |
| 43 | * @param string $name Company name |
| 44 | * @param string $address Company address |
| 45 | * @param string $street Company street |
| 46 | * @param string $city Company city |
| 47 | * @param string $postal Company postal |
| 48 | * @param string $province Company province |
| 49 | * @param string $phoneNo Company phone number |
| 50 | * @param string $houseNo Company house number |
| 51 | * @param string $vatNo Company VAT number |
| 52 | * @param string $localRegistrationNo Company registration number |
| 53 | * @param array $countries countries to search in |
| 54 | * @param int $threshold Match threshold |
| 55 | * |
| 56 | * @return array |
| 57 | * |
| 58 | * @since 1.0.0 |
| 59 | */ |
| 60 | public function findCompanies( |
| 61 | string $token, |
| 62 | string $name = '', |
| 63 | string $address = '', |
| 64 | string $street = '', |
| 65 | string $city = '', |
| 66 | string $postal = '', |
| 67 | string $province = '', |
| 68 | string $phoneNo = '', |
| 69 | string $houseNo = '', |
| 70 | string $vatNo = '', |
| 71 | string $localRegistrationNo = '', |
| 72 | array $countries = [], |
| 73 | int $threshold = 900, |
| 74 | ) : array; |
| 75 | |
| 76 | /** |
| 77 | * Get credit report of company |
| 78 | * |
| 79 | * @param string $token API token |
| 80 | * @param string $id Company id |
| 81 | * @param string $template Report type |
| 82 | * @param string $language Report language |
| 83 | * |
| 84 | * @return array |
| 85 | * |
| 86 | * @since 1.0.0 |
| 87 | */ |
| 88 | public function creditReport(string $token, string $id, string $template = 'full', string $language = 'en') : array; |
| 89 | |
| 90 | /** |
| 91 | * Find companies matching search parameters if they couldn't be found in the database |
| 92 | * |
| 93 | * @param string $token API token |
| 94 | * @param string $ownName Name of the person requesting the company |
| 95 | * @param string $ownCompanyName Own company name |
| 96 | * @param string $ownCompanyRegistrationNo Owm company registration number |
| 97 | * @param string $ownEmail Email of the person requestion the company |
| 98 | * @param string $name Company name |
| 99 | * @param string $address Company address |
| 100 | * @param string $street Company street |
| 101 | * @param string $city Company city |
| 102 | * @param string $postal Company postal |
| 103 | * @param string $province Company province |
| 104 | * @param string $phoneNo Company phone number |
| 105 | * @param string $houseNo Company house number |
| 106 | * @param string $vatNo Company VAT number |
| 107 | * @param string $localRegistrationNo Company registration number |
| 108 | * @param string $country Company country |
| 109 | * |
| 110 | * @return string |
| 111 | * |
| 112 | * @since 1.0.0 |
| 113 | */ |
| 114 | public function investigate( |
| 115 | string $token, |
| 116 | string $ownName = '', |
| 117 | string $ownCompanyName = '', |
| 118 | string $ownCompanyRegistrationNo = '', |
| 119 | string $ownEmail = '', |
| 120 | string $name = '', |
| 121 | string $address = '', |
| 122 | string $street = '', |
| 123 | string $city = '', |
| 124 | string $postal = '', |
| 125 | string $province = '', |
| 126 | string $phoneNo = '', |
| 127 | string $houseNo = '', |
| 128 | string $vatNo = '', |
| 129 | string $localRegistrationNo = '', |
| 130 | string $country = '' |
| 131 | ) : string; |
| 132 | |
| 133 | /** |
| 134 | * Get investigations |
| 135 | * |
| 136 | * @param string $token API token |
| 137 | * @param \DateTime $start Investitions requested from this starting date |
| 138 | * |
| 139 | * @return array |
| 140 | * |
| 141 | * @since 1.0.0 |
| 142 | */ |
| 143 | public function showInvestigations(string $token, \DateTime $start) : array; |
| 144 | |
| 145 | /** |
| 146 | * Get the status/result of a investigation |
| 147 | * |
| 148 | * @param string $token API token |
| 149 | * @param string $id Investigation ID |
| 150 | * |
| 151 | * @return array |
| 152 | * |
| 153 | * @since 1.0.0 |
| 154 | */ |
| 155 | public function getInvestigation(string $token, string $id) : array; |
| 156 | } |