@inclouded/tmf-inventory
v1.0.4
Published
``` npm install --save @inclouded/tmf-inventory ```
Downloads
2
Keywords
Readme
TMF Inventory Firestore SDK
npm install --save @inclouded/tmf-inventory
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF Inventory resource in an installable Angular folder form. The SDK can be installed for every Angular 2+ project. The SDK accomplishes the necessary CRUD operations.
Usage
For using the SDK an Angular 2+ project is needed, in which we can establish a connection to a Firestore database instance. (configured in environments.ts)
The SDK can be used in a Service in the following way:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { AngularFirestore } from '@angular/fire/firestore';
import { InventoryApi, Paging, OrderBy } from '@inclouded/tmf-inventory'
@Injectable()
export class InventoryService {
InventoryApi: InventoryApi;
constructor(private afs: AngularFirestore) {
this.InventoryApi = new InventoryApi(this.afs);
}
addInventory(service: any, id?: string) {
return this.InventoryApi.add(service, id);
}
getAllInventory() {
return this.InventoryApi.getAll();
}
deleteInventory(serviceId: string) {
return this.InventoryApi.delete(serviceId);
}
updateInventory(service: any) {
return this.InventoryApi.update(service);
}
getInventoryById(id: string) {
return this.InventoryApi.getById(id);
}
getInventoryByRelatedParty(relatedParty: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByRelatedParty(relatedParty);
}
getInventoryByProductCharacteristic(productCharacteristic: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByProductCharacteristic(productCharacteristic);
}
getInventoryByType(serviceType: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByType(serviceType);
}
getInventoryByTypeAndDistributor(serviceType: string, distributorId: string, status?: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByTypeAndDistributor(serviceType, distributorId, status);
}
getInventoryByTypeAndInstaller(serviceType: string, installerId: string, status?: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByTypeAndInstaller(serviceType, installerId, status);
}
getInventoryByTypeAndCustomer(serviceType: string, customerId: string, status?: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByTypeAndCustomer(serviceType, customerId, status);
}
getInventoryByTypeAndOwner(serviceType: string, ownerId: string, status?: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByTypeAndOwner(serviceType, ownerId, status);
}
getInventoryByNameSubStr(nameSubStr: string, orderBy?: OrderBy, paging?: Paging) {
return this.InventoryApi.getInventoryByNameSubStr(nameSubStr);
}
Developer: Zoltán R. Jánki ([email protected]), Gábor Simon ([email protected])