This commit is contained in:
ntr committed 2022-12-21 23:32:57 +11:00
1 parent 6b73831b51
commit 0e785e0c8c
4 files changed
+9 -8

No files matched your search

-2
View File
@@ -3,8 +3,6 @@ contact options on landing page
move want add to rpc
listing ids overflowing
skip unofficial release
status stepper
+4 -4
View File
@@ -11,8 +11,8 @@ datasource db {
}
model Listing {
id Int @id
seller Int
id BigInt @id
seller BigInt
data Json
wantId String @db.Uuid
@@ -43,7 +43,7 @@ model User {
model Want {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
release Int
release BigInt
data Json
userId String @db.Uuid
@@ -71,7 +71,7 @@ model Offer {
shipping Decimal @db.Money
total Decimal @db.Money
listingId Int
listingId BigInt
listing Listing @relation(fields: [listingId], references: [id])
userId String @db.Uuid
+4 -2
View File
@@ -112,12 +112,14 @@ export default function createOffers(log: Log, pg: Pg) {
const offers = await pg.userOffers(user);
const groups = Object.values(groupBy(offers, (o) => o.wantId))
.map(g => {
const offers = sortBy(g, sortOffers);
// the offer status is just the most advanced status
// based on sort
const offers = sortBy(g, sortOffers);
const status = offers[0].status;
// now actually sort them by price
offers.sort((a, b) => a.total - b.total);
const details = offers[0].want.data;
return {
+1
View File
@@ -77,6 +77,7 @@ function Home() {
return (
<div>
<button onClick={sync}> sync listings </button>
<button onClick={sync}> generate offers </button>
<hr />
<div class='bundles'>
{offers.map(SellerGroup)}