Ananas APItest bench
staging api.qa2.ananastest.com
TC-PRICE-02 Functional changes data

Updating price during the day

Verify the "today for tomorrow" rule

Specification · xlsx

Steps

  1. Send a new price

Expected result

HTTP 200; the price becomes valid the following day at 00:00

Endpoints

PUT /product/api/v1/merchant-integration/product/bulk

Run

API_URL
https://api.qa2.ananastest.com
TARGET_ID
2555660

Change parameters

A dry run builds every request without sending it; responses come from a local stub.

Test code

mirrors tests/BulkTest.php::tc_price_02()
34// Verify the "today for tomorrow" rule
35public function tc_price_02(): void
36{
37 $timezone = new DateTimeZone('Europe/Belgrade');
38 $currentTime = new DateTimeImmutable('now', $timezone);
39
40 if ((int) $currentTime->format('G') < 2) {
41 $this->fail('Wrong time');
42 }
43
44 $targetId = (int) $_ENV['TARGET_ID'];
45
46 $productData = [
47 [
48 'id' => $targetId,
49 'basePrice' => 123456,
50 ],
51 ];
52
53 $response = $this->ananas->editInBulk($productData);
54
55 $this->assertEquals(200, $response['statusCode']);
56 $this->assertEquals('SUCCESS', $response['response'][0]['status']);
57}

web/app/Scenarios/BulkScenarios.php · line numbers refer to this file

Not run yet. Run it against the API, or do a dry run to see the requests it would send.