@eleva-io/erp-sdk
Version:
SDK oficial para el ERP de Eleva
43 lines • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommunitiesPropertiesAPI = exports.CommunitiesBlocksPropertiesAPI = void 0;
const crud_1 = require("../../../../utils/crud");
const guards_1 = require("../../../../utils/guards");
const reserve_1 = require("./reserve");
class CommunitiesBlocksPropertiesAPI extends crud_1.CRUD {
_propertyId;
constructor(httpClient, baseUrl, _propertyId) {
super(httpClient, {
basePath: baseUrl,
id: _propertyId,
});
this._propertyId = _propertyId;
}
persons(id) {
(0, guards_1.requireField)('propertyId', this._propertyId);
return new crud_1.CRUD(this._httpClient, {
basePath: `${this._config.basePath}/${this._propertyId}/persons`,
id: id,
});
}
}
exports.CommunitiesBlocksPropertiesAPI = CommunitiesBlocksPropertiesAPI;
class CommunitiesPropertiesAPI {
_httpClient;
_baseUrl;
_propertyId;
constructor(_httpClient, _baseUrl, _propertyId) {
this._httpClient = _httpClient;
this._baseUrl = _baseUrl;
this._propertyId = _propertyId;
}
async find(query) {
return this._httpClient.get(this._baseUrl, query);
}
reserves(id) {
(0, guards_1.requireField)('propertyId', this._propertyId);
return new reserve_1.PropertiesReservesAPI(this._httpClient, `${this._baseUrl}/${this._propertyId}/reserves`, id);
}
}
exports.CommunitiesPropertiesAPI = CommunitiesPropertiesAPI;
//# sourceMappingURL=properties.js.map