Skip to content

Commit 16c7c5f

Browse files
chore: wip
1 parent 05e52b5 commit 16c7c5f

File tree

5 files changed

+9
-33
lines changed

5 files changed

+9
-33
lines changed

storage/framework/core/commerce/src/coupons/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ export {
99
fetchAll,
1010
fetchByCode,
1111
fetchById,
12-
type FetchCouponsOptions,
1312
fetchPaginated,
1413
fetchStats,
14+
fetchCouponCounts,
15+
fetchCouponCountsByType,
16+
fetchRedemptionStats,
17+
fetchTopRedeemedCoupons,
18+
fetchRedemptionTrend,
19+
fetchConversionRate,
20+
getActiveCouponsMoMChange,
1521
} from './fetch'
1622

1723
export {
@@ -20,4 +26,4 @@ export {
2026

2127
export {
2228
update,
23-
} from './update'
29+
} from './update'

storage/framework/orm/src/models/Payment.ts

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export interface PaymentsTable {
1818
id: Generated<number>
1919
order_id: number
2020
user_id: number
21-
customer_id: string
2221
amount: number
2322
method: string
2423
status: string
@@ -69,7 +68,7 @@ interface QueryOptions {
6968

7069
export class PaymentModel {
7170
private readonly hidden: Array<keyof PaymentJsonResponse> = []
72-
private readonly fillable: Array<keyof PaymentJsonResponse> = ['customer_id', 'amount', 'method', 'status', 'date', 'currency', 'reference_number', 'card_last_four', 'card_brand', 'billing_email', 'transaction_id', 'payment_provider', 'refund_amount', 'notes', 'uuid']
71+
private readonly fillable: Array<keyof PaymentJsonResponse> = ['amount', 'method', 'status', 'date', 'currency', 'reference_number', 'card_last_four', 'card_brand', 'billing_email', 'transaction_id', 'payment_provider', 'refund_amount', 'notes', 'uuid']
7372
private readonly guarded: Array<keyof PaymentJsonResponse> = []
7473
protected attributes = {} as PaymentJsonResponse
7574
protected originalAttributes = {} as PaymentJsonResponse
@@ -171,10 +170,6 @@ export class PaymentModel {
171170
return this.attributes.uuid
172171
}
173172

174-
get customer_id(): string {
175-
return this.attributes.customer_id
176-
}
177-
178173
get amount(): number {
179174
return this.attributes.amount
180175
}
@@ -239,10 +234,6 @@ export class PaymentModel {
239234
this.attributes.uuid = value
240235
}
241236

242-
set customer_id(value: string) {
243-
this.attributes.customer_id = value
244-
}
245-
246237
set amount(value: number) {
247238
this.attributes.amount = value
248239
}
@@ -1242,14 +1233,6 @@ export class PaymentModel {
12421233
return instance
12431234
}
12441235

1245-
static whereCustomerId(value: string): PaymentModel {
1246-
const instance = new PaymentModel(undefined)
1247-
1248-
instance.selectFromQuery = instance.selectFromQuery.where('customer_id', '=', value)
1249-
1250-
return instance
1251-
}
1252-
12531236
static whereAmount(value: string): PaymentModel {
12541237
const instance = new PaymentModel(undefined)
12551238

@@ -1914,7 +1897,6 @@ export class PaymentModel {
19141897
uuid: this.uuid,
19151898

19161899
id: this.id,
1917-
customer_id: this.customer_id,
19181900
amount: this.amount,
19191901
method: this.method,
19201902
status: this.status,
@@ -1987,13 +1969,6 @@ export async function remove(id: number): Promise<void> {
19871969
.execute()
19881970
}
19891971

1990-
export async function whereCustomerId(value: string): Promise<PaymentModel[]> {
1991-
const query = DB.instance.selectFrom('payments').where('customer_id', '=', value)
1992-
const results: PaymentJsonResponse = await query.execute()
1993-
1994-
return results.map((modelItem: PaymentJsonResponse) => new PaymentModel(modelItem))
1995-
}
1996-
19971972
export async function whereAmount(value: number): Promise<PaymentModel[]> {
19981973
const query = DB.instance.selectFrom('payments').where('amount', '=', value)
19991974
const results: PaymentJsonResponse = await query.execute()

storage/framework/requests/PaymentRequest.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ interface CustomAttributes {
1313
}
1414
interface RequestDataPayment {
1515
id: number
16-
customer_id: string
1716
amount: number
1817
method: string
1918
status: string
@@ -32,7 +31,6 @@ interface RequestDataPayment {
3231
}
3332
export class PaymentRequest extends Request<RequestDataPayment> implements PaymentRequestType {
3433
public id = 1
35-
public customer_id = ''
3634
public amount = 0
3735
public method = ''
3836
public status = ''

storage/framework/types/attributes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export interface Attributes {
2929
password: string
3030
title: string
3131
body: string
32-
customer_id: string
3332
amount: number
3433
method: string
3534
date: Date | string

storage/framework/types/requests.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ export interface PostRequestType extends Request {
226226

227227
interface RequestDataPayment {
228228
id: number
229-
customer_id: string
230229
amount: number
231230
method: string
232231
status: string
@@ -248,7 +247,6 @@ export interface PaymentRequestType extends Request {
248247
get: <T = string>(key: string, defaultValue?: T) => T
249248
all: () => RequestDataPayment
250249
id: number
251-
customer_id: string
252250
amount: number
253251
method: string
254252
status: string

0 commit comments

Comments
 (0)