@inclouded/tmf-customers
v1.0.6
Published
``` npm install --save @inclouded/tmf-customers ```
Downloads
4
Keywords
Readme
TMF Customer Firestore SDK
npm install --save @inclouded/tmf-customers
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF Customer 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 { CustomersApi } from '@inclouded/tmf-customers'
@Injectable()
export class CustomersService {
CustomersApi: CustomersApi;
constructor(private afs: AngularFirestore) {
this.CustomersApi = new CustomersApi(this.afs);
}
addCustomer(customer: any, id?: string) {
return this.CustomersApi.add(customer, id);
}
getAllCustomers() {
return this.CustomersApi.getAll();
}
deleteCustomer(customerId: string) {
return this.CustomersApi.delete(customerId);
}
updateCustomer(customer: any) {
return this.CustomersApi.update(customer);
}
getCustomerById(id: string) {
return this.CustomersApi.getById(id);
}
getCustomersByAgreement(agreement: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomersByAgreement(agreement);
}
getCustomersByAccount(account: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomersByAccount(account);
}
getCustomersByContactMedium(contactMedium: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomersByContactMedium(contactMedium);
}
getCustomerByRaletedPartyId(relatedParty: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomerByRaletedPartyId(relatedParty);
}
getCustomersByCharacteristic(characteristic: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomersByCharacteristic(characteristic);
}
getCustomersByEngagedParty(engagedParty: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomersByEngagedParty(engagedParty);
}
getCustomersByNameSubStr(nameSubStr: string, releatedPartyId?: string, orderBy?: OrderBy, paging?: Paging) {
return this.CustomersApi.getCustomersByNameSubStr(nameSubStr, releatedPartyId);
}
}
Developer: Zoltán R. Jánki ([email protected]), Gábor Simon ([email protected])