bigint
This commit is contained in:
1 parent
6b73831b51
commit
0e785e0c8c
4 files changed
+9
-8
No files matched your search
@@ -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
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user