augustin-wien / augustina-backend

An open-source web shop designed for selling magazines on the street.
GNU Affero General Public License v3.0
7 stars 0 forks source link

Improve Handler ListVendors by ordering licenseIDs #107

Closed lebe1 closed 1 year ago

lebe1 commented 1 year ago

Type of change

Description

IMPORTANT TO KNOW

Since I have no extended demo data to test with I can just assume, that this command does order the licenseIDs alphabetically but not numerical. To order it numerical, we would have to add something like this

SELECT vendor.ID, LicenseID, FirstName, LastName, LastPayout, Balance
FROM Vendor
JOIN account ON account.vendor = vendor.id
ORDER BY
  SUBSTR(LicenseID, 1, 1),  -- Sort by the letter part
  CAST(SUBSTR(LicenseID, 3) AS SIGNED);  -- Sort by the numeric part

This in fact would mean though, we can not apply our ordering list to any other license IDs having more than one character, which would contradict to our generalisition approach... What do you think?

CHANGES

TODO

Checklist: