@abella-bilhalba-engenharia/api-client 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -170,6 +170,214 @@ var adminContract = {
170
170
  },
171
171
  summary: "Create a new client"
172
172
  }
173
+ }),
174
+ units: c2.router({
175
+ list: {
176
+ method: "GET",
177
+ path: "/units",
178
+ headers: z3.object({
179
+ authorization: authorizationHeader
180
+ }),
181
+ query: z3.object({
182
+ page: z3.number().positive().optional(),
183
+ perPage: z3.number().positive().optional()
184
+ }),
185
+ responses: {
186
+ 200: z3.object({
187
+ data: z3.array(
188
+ z3.object({
189
+ id: z3.uuidv4(),
190
+ commissioningDate: z3.iso.date(),
191
+ installation: z3.object({
192
+ name: z3.string(),
193
+ id: z3.uuidv4(),
194
+ installationCode: z3.int().min(1).max(9999999999)
195
+ }),
196
+ client: z3.object({
197
+ name: z3.string(),
198
+ id: z3.uuidv4()
199
+ }),
200
+ equipments: z3.object({
201
+ inverter: z3.string()
202
+ })
203
+ })
204
+ )
205
+ })
206
+ },
207
+ summary: "List all units"
208
+ },
209
+ store: {
210
+ method: "POST",
211
+ path: "/units",
212
+ headers: z3.object({
213
+ authorization: authorizationHeader
214
+ }),
215
+ body: z3.object({
216
+ installationId: z3.uuidv4(),
217
+ commissioningDate: z3.iso.date(),
218
+ equipments: z3.object({
219
+ inverter: z3.string(),
220
+ panels: z3.array(
221
+ z3.object({
222
+ model: z3.string(),
223
+ quantity: z3.int().positive()
224
+ })
225
+ )
226
+ })
227
+ }),
228
+ responses: {
229
+ 201: z3.object({
230
+ data: z3.object({
231
+ id: z3.uuidv4(),
232
+ commissioningDate: z3.iso.date(),
233
+ installation: z3.object({
234
+ name: z3.string(),
235
+ id: z3.uuidv4(),
236
+ installationCode: z3.int().min(1).max(9999999999)
237
+ }),
238
+ client: z3.object({
239
+ name: z3.string(),
240
+ id: z3.uuidv4()
241
+ }),
242
+ equipments: z3.object({
243
+ inverter: z3.string(),
244
+ panels: z3.array(
245
+ z3.object({
246
+ model: z3.string(),
247
+ quantity: z3.int().positive()
248
+ })
249
+ )
250
+ })
251
+ })
252
+ })
253
+ },
254
+ summary: "Create a new unit"
255
+ }
256
+ }),
257
+ invoices: c2.router({
258
+ list: {
259
+ method: "GET",
260
+ path: "/invoices/:installationId",
261
+ headers: z3.object({
262
+ authorization: authorizationHeader
263
+ }),
264
+ pathParams: z3.object({
265
+ installationId: z3.uuidv4()
266
+ }),
267
+ query: z3.object({
268
+ page: z3.number().positive().optional(),
269
+ perPage: z3.number().positive().optional()
270
+ }),
271
+ responses: {
272
+ 200: z3.object({
273
+ data: z3.array(
274
+ z3.object({
275
+ id: z3.uuidv4(),
276
+ date: z3.iso.date(),
277
+ installation: z3.object({
278
+ name: z3.string(),
279
+ id: z3.uuidv4(),
280
+ installationCode: z3.int().min(1).max(9999999999)
281
+ }),
282
+ readingDates: z3.object({
283
+ previous: z3.iso.date(),
284
+ actual: z3.iso.date(),
285
+ next: z3.iso.date()
286
+ }),
287
+ tariff: z3.object({
288
+ tusd: z3.int().nonnegative(),
289
+ te: z3.int().nonnegative(),
290
+ increases: z3.int().nonnegative(),
291
+ decreases: z3.int().nonnegative(),
292
+ utilityTotal: z3.int().nonnegative()
293
+ }),
294
+ energy: z3.object({
295
+ minimumCharge: z3.int().nonnegative(),
296
+ balance: z3.int().nonnegative(),
297
+ active: z3.int().nonnegative(),
298
+ injected: z3.int().nonnegative()
299
+ }),
300
+ client: z3.object({
301
+ name: z3.string(),
302
+ id: z3.uuidv4()
303
+ })
304
+ })
305
+ )
306
+ })
307
+ },
308
+ summary: "List all invoices for a installation"
309
+ },
310
+ store: {
311
+ method: "POST",
312
+ path: "/invoices",
313
+ headers: z3.object({
314
+ authorization: authorizationHeader
315
+ }),
316
+ body: z3.object({
317
+ installationId: z3.uuidv4(),
318
+ date: z3.iso.date(),
319
+ readingDates: z3.object({
320
+ previous: z3.iso.date(),
321
+ actual: z3.iso.date(),
322
+ next: z3.iso.date()
323
+ }),
324
+ tariff: z3.object({
325
+ tusd: z3.int().nonnegative(),
326
+ te: z3.int().nonnegative(),
327
+ increases: z3.int().nonnegative(),
328
+ decreases: z3.int().nonnegative(),
329
+ utilityTotal: z3.int().nonnegative()
330
+ }),
331
+ energy: z3.object({
332
+ minimumCharge: z3.int().nonnegative(),
333
+ balance: z3.int().nonnegative(),
334
+ active: z3.int().nonnegative(),
335
+ injected: z3.int().nonnegative()
336
+ }),
337
+ client: z3.object({
338
+ name: z3.string(),
339
+ id: z3.uuidv4()
340
+ })
341
+ }),
342
+ responses: {
343
+ 201: z3.object({
344
+ data: z3.array(
345
+ z3.object({
346
+ id: z3.uuidv4(),
347
+ date: z3.iso.date(),
348
+ installation: z3.object({
349
+ name: z3.string(),
350
+ id: z3.uuidv4(),
351
+ installationCode: z3.int().min(1).max(9999999999)
352
+ }),
353
+ readingDates: z3.object({
354
+ previous: z3.iso.date(),
355
+ actual: z3.iso.date(),
356
+ next: z3.iso.date()
357
+ }),
358
+ tariff: z3.object({
359
+ tusd: z3.int().nonnegative(),
360
+ te: z3.int().nonnegative(),
361
+ increases: z3.int().nonnegative(),
362
+ decreases: z3.int().nonnegative(),
363
+ utilityTotal: z3.int().nonnegative()
364
+ }),
365
+ energy: z3.object({
366
+ minimumCharge: z3.int().nonnegative(),
367
+ balance: z3.int().nonnegative(),
368
+ active: z3.int().nonnegative(),
369
+ injected: z3.int().nonnegative()
370
+ }),
371
+ client: z3.object({
372
+ name: z3.string(),
373
+ id: z3.uuidv4()
374
+ })
375
+ })
376
+ )
377
+ })
378
+ },
379
+ summary: "Create a new unit"
380
+ }
173
381
  })
174
382
  };
175
383
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@abella-bilhalba-engenharia/api-client",
3
3
  "description": "Type-safe Client for Abella Bilhalba Engenharia API.",
4
4
  "author": "TheDevick",
5
- "version": "0.0.28",
5
+ "version": "0.0.30",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "types": "./dist/index.d.ts",