update commission
This commit is contained in:
@@ -51,6 +51,9 @@ export class OrderSchema extends PothosSchema {
|
||||
type: 'DateTime',
|
||||
description: 'The date and time the order was updated.',
|
||||
}),
|
||||
commission: t.exposeFloat('commission', {
|
||||
description: 'The commission of the order.',
|
||||
}),
|
||||
user: t.relation('user', {
|
||||
description: 'The user who made the order.',
|
||||
}),
|
||||
@@ -107,7 +110,7 @@ export class OrderSchema extends PothosSchema {
|
||||
description: 'Create a new order.',
|
||||
args: {
|
||||
data: t.arg({
|
||||
type: this.builder.generator.getCreateInput('Order', ['id', 'user', 'paymentId', 'payment', 'refundTicket', 'status', 'total', 'createdAt', 'updatedAt']),
|
||||
type: this.builder.generator.getCreateInput('Order', ['id', 'user', 'paymentId', 'payment', 'refundTicket', 'status', 'total', 'createdAt', 'updatedAt', 'commission']),
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
@@ -146,6 +149,7 @@ export class OrderSchema extends PothosSchema {
|
||||
userId: ctx.http.me?.id ?? '',
|
||||
serviceId: service.id,
|
||||
scheduleId: args.data.schedule.connect?.id ?? '',
|
||||
commission: service.commission ?? 0.0,
|
||||
},
|
||||
})
|
||||
// check if service is valid
|
||||
|
||||
Reference in New Issue
Block a user