Skip to content

refactor: Added parameters to the db requests to fit usage#127

Open
lexinor wants to merge 1 commit into
project-error:mainfrom
lexinor:patch-1
Open

refactor: Added parameters to the db requests to fit usage#127
lexinor wants to merge 1 commit into
project-error:mainfrom
lexinor:patch-1

Conversation

@lexinor

@lexinor lexinor commented Nov 6, 2022

Copy link
Copy Markdown

Pull Request Description

  • Added some ordering paramters to properly fit usage. We are now showing the UNPAID and latest Invoices instead of showing the PAID and oldest
  • Changed default expiring date from TWO WEEKS to ONE WEEK

Pull Request Checklist:

  • Have you followed the guidelines in our contributing document and Code of Conduct?
  • Have you checked to ensure there aren't other open for the same update/change?
  • Have you built and tested the resource in-game after the relevant change?

- Added some ordering paramters to properly fit usage. We are now showing the UNPAID and latest Invoices instead of showing the PAID and oldest
- Changed default expiring date from TWO WEEKS to ONE WEEK
export class InvoiceDB {
async getAllInvoices(): Promise<InvoiceModel[]> {
return await InvoiceModel.findAll();
return await InvoiceModel.findAll({ order: [['status', 'DESC'], ['createdAt', 'DESC']]});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What value does status have here again?

@lexinor lexinor Nov 17, 2022

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to filter on the status which are "PAID", "PENDING", etc.. Like that we can view the pending invoices and the earliest ones instead of the oldest and paid ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants