Skip to content

Commit

Permalink
Alpha Version
Browse files Browse the repository at this point in the history
  • Loading branch information
Vítězslav Dvořák committed Oct 10, 2023
1 parent 7283c9b commit e57313c
Show file tree
Hide file tree
Showing 11 changed files with 434 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ composer.phar
/nbproject/
/tests/.phpunit.result.cache
.vscode/settings.json
/.php-cs-fixer.cache
/.vscode/
/.phpunit.result.cache
/src/.php-cs-fixer.cache
/.phpunit.cache/
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Realpad Takeout API Client for PHP

//for real estate developer IT / reporting departments, integrators, and
other 3rd parties//
*for real estate developer IT / reporting departments, integrators, and other 3rd parties*

This document describes how to use the Realpad Takeout API to back up the data stored in the
system. Both structured data (such as lists of customers, deals, etc) and files uploaded to the
Expand Down Expand Up @@ -44,10 +43,14 @@ crc="3826804066"/>

● uid is the unique identifier of this resource, by which it can be retrieved using
get-projects.

● content-type is the MIME type of the file, resolved when uploaded to the system (it’s
the best guess).

● file-name is the original file name when it was uploaded to the system.

● size is the file size in bytes.

● crc is the CRC32 checksum of the file.

This endpoint will always return all the resources. It’s up to your system to determine which
Expand All @@ -62,7 +65,7 @@ curl \
https://cms.realpad.eu/resource/bd5563ae-abc...
```

## Endpoints with a binary payload
## Endpoints

All of these endpoints return a single Excel file with a .xls extension, containing all the relevant
data stored in our system. These endpoints behave just like get-resource, in that the HTTP
Expand Down Expand Up @@ -136,11 +139,14 @@ Accepts several additional optional parameters:
● `filter_status`` - if left empty, invoices in all statuses are sent. 1 - new invoices. 2 -
invoices in Review #1. 3 - invoices in Review #2. 4 - invoices in approval. 5 - fully
approved invoices. 6 - fully rejected invoices.

`filter_groupcompany` - if left empty, invoices from all the group companies are sent. If
Realpad database IDs of group companies are provided (as a comma-separated list),
then only invoices from these companies are sent.

● `filter_issued_from`` - specify a date in the 2019-12-31 format to only send invoices
issues after that date.

`filter_issued_to` - specify a date in the 2019-12-31 format to only send invoices issues
before that date.
The initial set of columns describes the Invoice itself, and the last set of columns contains the
Expand All @@ -150,32 +156,59 @@ data of its Lines.

Unit status enumeration
● 0 - free.

● 1 - pre-reserved.

● 2 - reserved.

● 3 - sold.

● 4 - not for sale.

● 5 - delayed.

Unit type enumeration

● 1 - flat.

● 2 - parking.

● 3 - cellar.

● 4 - outdoor parking.

● 5 - garage.

● 6 - commercial space.

● 7 - family house.

● 8 - land.

● 9 - atelier.

● 10 - office.

● 11 - art workshop.

● 12 - non-residential unit.

● 13 - motorbike parking.

● 14 - creative workshop.

● 15 - townhouse.

● 16 - utility room.

● 17 - condominium.

● 18 - storage.

● 19 - apartment.

● 20 - accommodation unit.

● 21 - bike stand.

● 22 - communal area.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"description": "Realpad Takeout API Client",
"type": "library",
"require": {
"vitexsoftware/ease-core": "dev-main"
"vitexsoftware/ease-core": "dev-main",
"phpoffice/phpspreadsheet": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "10.5.x-dev"
Expand All @@ -16,7 +17,7 @@
},
"authors": [
{
"name": "CyberVitexus",
"name": "Vítězslav Dvořák",
"email": "[email protected]"
}
],
Expand Down
11 changes: 11 additions & 0 deletions examples/listcustomers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

require_once __DIR__ . '/../vendor/autoload.php';

\Ease\Shared::init(['REALPAD_USERNAME', 'REALPAD_PASSWORD'], '../.env');

$client = new \SpojeNet\Realpad\ApiClient();

$customers = $client->listCustomers();

print_r($customers);
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
require_once __DIR__ . '/../vendor/autoload.php';


\Ease\Shared::init(['REALPAD_USERNAME','REALPAD_PASSWORD'], '../.env' );
\Ease\Shared::init(['REALPAD_USERNAME','REALPAD_PASSWORD'], '../.env');

$client = new \SpojeNet\Realpad\ApiClient();

$resources = $client->getResources();
$resources = $client->listResources();

print_r($resources);

14 changes: 14 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="tests/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="true" beStrictAboutCoverageMetadata="true">
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</phpunit>
Loading

0 comments on commit e57313c

Please sign in to comment.