fix order number
This commit is contained in:
@@ -24,7 +24,7 @@ import { OrderPrint } from './print.entity';
|
||||
@Index({ properties: ['designer'] })
|
||||
@Index({ properties: ['status'] })
|
||||
export class Order extends BaseEntity {
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt'
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt' | 'orderNumber'
|
||||
|
||||
@ManyToOne(() => InvoiceItem, { nullable: true })
|
||||
invoiceItem?: InvoiceItem
|
||||
@@ -56,7 +56,8 @@ export class Order extends BaseEntity {
|
||||
|
||||
@Property({
|
||||
type: 'int',
|
||||
unique: true
|
||||
unique: true,
|
||||
autoincrement: true,
|
||||
})
|
||||
orderNumber: number & Opt;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ export class OrderRepository extends EntityRepository<Order> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Search by order number or user information
|
||||
if (search) {
|
||||
const searchPattern = `%${search}%`;
|
||||
@@ -98,7 +98,7 @@ export class OrderRepository extends EntityRepository<Order> {
|
||||
limit,
|
||||
offset,
|
||||
orderBy: { [orderBy]: order.toLowerCase() as 'asc' | 'desc' },
|
||||
populate: ['user','product'],
|
||||
populate: ['user', 'product', 'designer'],
|
||||
});
|
||||
|
||||
// Collect all (orderId, productId) pairs for efficient review lookup
|
||||
|
||||
Reference in New Issue
Block a user