2021-04-10 05:47:05 +00:00
|
|
|
import {FirebaseResource, FirebaseResourceItem} from "../FirebaseResource"
|
|
|
|
import {Injectable} from "@extollo/di"
|
|
|
|
import {RTDBRef} from "../units/FirebaseUnit"
|
2021-04-10 09:57:10 +00:00
|
|
|
import {AsyncCollection} from "@extollo/util"
|
2021-04-10 05:47:05 +00:00
|
|
|
|
2021-04-10 08:44:56 +00:00
|
|
|
/**
|
|
|
|
* Interface representing a client-submitted encounter transaction.
|
|
|
|
*/
|
2021-04-10 05:47:05 +00:00
|
|
|
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'
|
|
|
|
}
|