Skip to content

Commit

Permalink
chore: make processingCompleted non-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleSamtoshi committed Nov 17, 2023
1 parent 40b4a5e commit 7e14b14
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/api/src/domain/wallet-invoices/index.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type WalletInvoiceWithOptionalLnInvoice = {
recipientWalletDescriptor: PartialWalletDescriptor<WalletCurrency>
paid: boolean
createdAt: Date
processingCompleted?: boolean
processingCompleted: boolean
lnInvoice?: LnInvoice // LnInvoice is optional because some older invoices don't have it
}

Expand Down
2 changes: 1 addition & 1 deletion core/api/src/services/mongoose/schema.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ interface WalletInvoiceRecord {
currency: string
timestamp: Date
selfGenerated: boolean
processingCompleted?: boolean
processingCompleted: boolean
pubkey: string
paid: boolean
paymentRequest?: string // optional because we historically did not store it
Expand Down
5 changes: 1 addition & 4 deletions core/api/src/services/mongoose/wallet-invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ export const WalletInvoicesRepository = (): IWalletInvoicesRepository => {
try {
pending = WalletInvoice.find({
paid: false,
$or: [
{ processingCompleted: false },
{ processingCompleted: { $exists: false } }, // TODO remove this after migration
],
processingCompleted: false,
}).cursor({
batchSize: 100,
})
Expand Down

0 comments on commit 7e14b14

Please sign in to comment.