feat(hiboutik): add Hiboutik API client, repositories and DTOs

HiboutikClient handles Basic auth and walks paginated endpoints. One read-only repository per entity (brands, categories, suppliers, products, stocks, customers).
This commit is contained in:
MastersGame
2026-11-05 23:00:47 +01:00
parent 8f377a1fe9
commit 2424a086e0
13 changed files with 334 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { Injectable } from '@nestjs/common';
import { HiboutikClient } from './hiboutik.client';
import { BrandHiboutikDto } from '../models/hiboutikDTO/brand.hiboutik.dto';
/** Reads brands from the Hiboutik API. */
@Injectable()
export class BrandHiboutikRepository {
constructor(private readonly hiboutikClient: HiboutikClient) {}
async getBrands(): Promise<BrandHiboutikDto[]> {
return this.hiboutikClient.getAllPages<BrandHiboutikDto>('/brands', {
order_by: 'brand_id',
sort: 'ASC',
});
}
}