1.0.3 • Published 3 years ago

@inclouded/tmf-communicationmessages v1.0.3

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

TMF CommunicationMessages Firestore SDK

npm install --save @inclouded/tmf-communicationmessage

Introduction

In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF CommunicationMessages 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

  1. 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)

  2. 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 { CommunicationMessagesApi } from '@inclouded/tmf-communicationmessage'

@Injectable()
export class CommunicationMessagesService {

    CommunicationMessagesApi: CommunicationMessagesApi;
    constructor(private afs: AngularFirestore) {
        this.CommunicationMessagesApi = new CommunicationMessagesApi(this.afs);
    }

    addCommunicationMessage(communicationmessage: any, id?: string) {
        return this.CommunicationMessagesApi.add(communicationmessage, id);
    }

    getAllCommunicationMessages() {
        return this.CommunicationMessagesApi.getAll();
    }

    deleteCommunicationMessage(communicationmessageId: string) {
        return this.CommunicationMessagesApi.delete(communicationmessageId);
    }

    updateCommunicationMessage(communicationmessage: any) {
        return this.CommunicationMessagesApi.update(communicationmessage);
    }

    getCommunicationMessageById(id: string) {
        return this.CommunicationMessagesApi.getById(id);
    }

    getCommunicationMessagesByPriority(priority: string, orderBy?: OrderBy, paging?: Paging) {
        return this.CommunicationMessagesApi.getCommunicationMessagesByPriority(priority);
    }

    getCommunicationMessagesByParty(party: string, orderBy?: OrderBy, paging?: Paging) {
        return this.CommunicationMessagesApi.getCommunicationMessagesByParty(party);
    }
}

Developer: Zoltán R. Jánki (jankiz@inf.u-szeged.hu), Gábor Simon (simonovszkij@gmail.com)