UNPKG

@eleva-io/erp-sdk

Version:

SDK oficial para el ERP de Eleva

38 lines 1.25 kB
import { CRUD } from '../../../../utils/crud'; import { requireField } from '../../../../utils/guards'; import { PropertiesReservesAPI } from './reserve'; export class CommunitiesBlocksPropertiesAPI extends CRUD { _propertyId; constructor(httpClient, baseUrl, _propertyId) { super(httpClient, { basePath: baseUrl, id: _propertyId, }); this._propertyId = _propertyId; } persons(id) { requireField('propertyId', this._propertyId); return new CRUD(this._httpClient, { basePath: `${this._config.basePath}/${this._propertyId}/persons`, id: id, }); } } export 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) { requireField('propertyId', this._propertyId); return new PropertiesReservesAPI(this._httpClient, `${this._baseUrl}/${this._propertyId}/reserves`, id); } } //# sourceMappingURL=properties.js.map