New abstract structure

Events for invoices get emitted in rooms
This commit is contained in:
2020-12-28 19:04:13 +01:00
parent 7f8ae69e2e
commit 0b3502d81f
14 changed files with 467 additions and 229 deletions

View File

@@ -17,29 +17,26 @@ export interface IInvoice extends Document {
selector: string;
// Available payment methods
// [{ method: 'btc', amount: 0.0000105 }]
// { method: 'btc', amount: 0.0000105 }
paymentMethods: IPaymentMethod[];
// This is the method choosen by the user
paymentMethod?: CryptoUnits;
// Will be created as soon as the user picked one options
// 1Kss3e9iPB9vTgWJJZ1SZNkkFKcFJXPz9t
receiveAddress: string;
paidWith?: CryptoUnits;
// Already paid amount, in case that not the entire amount was paid with once.
// 0.000013
paid?: number;
receiveAddress?: string;
// Is set when invoice got paid
// 3b38c3a215d4e7981e1516b2dcbf76fca58911274d5d55b3d615274d6e10f2c1
transcationHashes?: string[];
transcationHashes?: string;
cart?: ICart[];
totalPrice?: number;
currency: FiatUnits;
// Time in minutes the user has to pay.
// Time left = (createdAt + dueBy) - Date.now() / 1000
dueBy: number;
// Datetime the user has to pay.
dueBy: Date;
status?: PaymentStatus;