Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lexinor
Copy link

@lexinor lexinor commented Nov 6, 2022

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
@@ -7,14 +7,14 @@ import { Transaction } from 'sequelize/types';
@singleton()
export class InvoiceDB {
async getAllInvoices(): Promise<InvoiceModel[]> {
return await InvoiceModel.findAll();
return await InvoiceModel.findAll({ order: [['status', 'DESC'], ['createdAt', 'DESC']]});
Copy link
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?

Copy link
Author

@lexinor lexinor Nov 17, 2022

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