loc-chain-backend/src/app/rtdb/TransactionResource.ts

25 lines
816 B
TypeScript
Raw Normal View History

import {FirebaseResource, FirebaseResourceItem} from "../FirebaseResource"
import {Injectable} from "@extollo/di"
import {RTDBRef} from "../units/FirebaseUnit"
import {AsyncCollection} from "@extollo/util"
2021-04-10 08:44:56 +00:00
/**
* Interface representing a client-submitted encounter transaction.
*/
export interface TransactionResourceItem extends FirebaseResourceItem {
combinedHash: string;
timestamp: number;
encodedGPSLocation: string;
partnerPublicKey: string;
validationSignature: string;
}
@Injectable()
export class TransactionResource extends FirebaseResource<TransactionResourceItem> {
public static collect(): AsyncCollection<TransactionResourceItem> {
return new AsyncCollection<TransactionResourceItem>(new TransactionResource())
}
protected refName: RTDBRef = 'transaction'
}