@inclouded/tmf-organizations
v1.0.8
Published
``` npm install --save @inclouded/tmf-organizations ```
Downloads
4
Keywords
Readme
TMF Organization Firestore SDK
npm install --save @inclouded/tmf-organizations
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF Organization 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 { OrganizationsApi } from '@inclouded/tmf-organizations'
@Injectable()
export class OrganizationsService {
OrganizationsApi: OrganizationsApi;
constructor(private afs: AngularFirestore) {
this.OrganizationsApi = new OrganizationsApi(this.afs);
}
addOrganization(organization: any, id?: string) {
return this.OrganizationsApi.add(organization, id);
}
getAllOrganizations() {
return this.OrganizationsApi.getAll();
}
deleteOrganization(organizationId: string) {
return this.OrganizationsApi.delete(organizationId);
}
updateOrganization(organization: any) {
return this.OrganizationsApi.update(organization);
}
getOrganizationById(id: string) {
return this.OrganizationsApi.getById(id);
}
getOrganizationsByOrganizationChildRelationship(organizationChildRelationship: string, orderBy?: OrderBy, paging?: Paging) {
return this.OrganizationsApi.getOrganizationsByOrganizationChildRelationship(organizationChildRelationship);
}
getOrganizationsByOrganizationIdentification(organizationIdentification: string, orderBy?: OrderBy, paging?: Paging) {
return this.OrganizationsApi.getOrganizationsByOrganizationIdentification(organizationIdentification);
}
getOrganizationsByContactMedium(contactMedium: string, orderBy?: OrderBy, paging?: Paging) {
return this.OrganizationsApi.getOrganizationsByContactMedium(contactMedium);
}
getOrgParyByEmployeeId(relatedParty: string, orderBy?: OrderBy, paging?: Paging) {
return this.OrganizationsApi.getOrgParyByEmployeeId(relatedParty);
}
getOrgParyByNameSubStr(nameSubStr: string, orderBy?: OrderBy, paging?: Paging) {
return this.OrganizationsApi.getOrgParyByNameSubStr(nameSubStr);
}
}
Developer: Zoltán R. Jánki ([email protected]), Gábor Simon ([email protected])