Skip to content

Commit f4bd26f

Browse files
chore: wip
1 parent bbccdc8 commit f4bd26f

File tree

18 files changed

+144
-0
lines changed

18 files changed

+144
-0
lines changed

storage/framework/core/orm/src/generate.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,8 @@ export async function generateModelString(
16321632
),
16331633
) as New${modelName}
16341634
1635+
await this.mapCustomSetters(filteredValues)
1636+
16351637
${uuidQuery}
16361638
16371639
const result = await DB.instance.insertInto('${tableName}')
@@ -2222,6 +2224,8 @@ export async function generateModelString(
22222224
),
22232225
) as New${modelName}
22242226
2227+
await this.mapCustomSetters(filteredValues)
2228+
22252229
await DB.instance.updateTable('${tableName}')
22262230
.set(filteredValues)
22272231
.where('id', '=', this.id)
@@ -2244,6 +2248,8 @@ export async function generateModelString(
22442248
if (this.id === undefined) {
22452249
this.updateFromQuery.set(${formattedModelName}).execute()
22462250
}
2251+
2252+
await this.mapCustomSetters(${formattedModelName})
22472253
22482254
await DB.instance.updateTable('${tableName}')
22492255
.set(${formattedModelName})
@@ -2274,6 +2280,8 @@ export async function generateModelString(
22742280
),
22752281
) as New${modelName}
22762282
2283+
await this.mapCustomSetters(filteredValues)
2284+
22772285
if (this.id === undefined) {
22782286
await DB.instance.insertInto('${tableName}')
22792287
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ export class AccessTokenModel {
840840
),
841841
) as NewAccessToken
842842

843+
await this.mapCustomSetters(filteredValues)
844+
843845
const result = await DB.instance.insertInto('personal_access_tokens')
844846
.values(filteredValues)
845847
.executeTakeFirst()
@@ -1447,6 +1449,8 @@ export class AccessTokenModel {
14471449
),
14481450
) as NewAccessToken
14491451

1452+
await this.mapCustomSetters(filteredValues)
1453+
14501454
await DB.instance.updateTable('personal_access_tokens')
14511455
.set(filteredValues)
14521456
.where('id', '=', this.id)
@@ -1468,6 +1472,8 @@ export class AccessTokenModel {
14681472
this.updateFromQuery.set(accesstoken).execute()
14691473
}
14701474

1475+
await this.mapCustomSetters(accesstoken)
1476+
14711477
await DB.instance.updateTable('personal_access_tokens')
14721478
.set(accesstoken)
14731479
.where('id', '=', this.id)
@@ -1494,6 +1500,8 @@ export class AccessTokenModel {
14941500
),
14951501
) as NewAccessToken
14961502

1503+
await this.mapCustomSetters(filteredValues)
1504+
14971505
if (this.id === undefined) {
14981506
await DB.instance.insertInto('personal_access_tokens')
14991507
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,8 @@ export class ActivityModel {
863863
),
864864
) as NewActivity
865865

866+
await this.mapCustomSetters(filteredValues)
867+
866868
const result = await DB.instance.insertInto('activities')
867869
.values(filteredValues)
868870
.executeTakeFirst()
@@ -1497,6 +1499,8 @@ export class ActivityModel {
14971499
),
14981500
) as NewActivity
14991501

1502+
await this.mapCustomSetters(filteredValues)
1503+
15001504
await DB.instance.updateTable('activities')
15011505
.set(filteredValues)
15021506
.where('id', '=', this.id)
@@ -1518,6 +1522,8 @@ export class ActivityModel {
15181522
this.updateFromQuery.set(activity).execute()
15191523
}
15201524

1525+
await this.mapCustomSetters(activity)
1526+
15211527
await DB.instance.updateTable('activities')
15221528
.set(activity)
15231529
.where('id', '=', this.id)
@@ -1544,6 +1550,8 @@ export class ActivityModel {
15441550
),
15451551
) as NewActivity
15461552

1553+
await this.mapCustomSetters(filteredValues)
1554+
15471555
if (this.id === undefined) {
15481556
await DB.instance.insertInto('activities')
15491557
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,8 @@ export class DeploymentModel {
877877
),
878878
) as NewDeployment
879879

880+
await this.mapCustomSetters(filteredValues)
881+
880882
filteredValues.uuid = randomUUIDv7()
881883

882884
const result = await DB.instance.insertInto('deployments')
@@ -1512,6 +1514,8 @@ export class DeploymentModel {
15121514
),
15131515
) as NewDeployment
15141516

1517+
await this.mapCustomSetters(filteredValues)
1518+
15151519
await DB.instance.updateTable('deployments')
15161520
.set(filteredValues)
15171521
.where('id', '=', this.id)
@@ -1533,6 +1537,8 @@ export class DeploymentModel {
15331537
this.updateFromQuery.set(deployment).execute()
15341538
}
15351539

1540+
await this.mapCustomSetters(deployment)
1541+
15361542
await DB.instance.updateTable('deployments')
15371543
.set(deployment)
15381544
.where('id', '=', this.id)
@@ -1559,6 +1565,8 @@ export class DeploymentModel {
15591565
),
15601566
) as NewDeployment
15611567

1568+
await this.mapCustomSetters(filteredValues)
1569+
15621570
if (this.id === undefined) {
15631571
await DB.instance.insertInto('deployments')
15641572
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ export class ErrorModel {
836836
),
837837
) as NewError
838838

839+
await this.mapCustomSetters(filteredValues)
840+
839841
const result = await DB.instance.insertInto('errors')
840842
.values(filteredValues)
841843
.executeTakeFirst()
@@ -1451,6 +1453,8 @@ export class ErrorModel {
14511453
),
14521454
) as NewError
14531455

1456+
await this.mapCustomSetters(filteredValues)
1457+
14541458
await DB.instance.updateTable('errors')
14551459
.set(filteredValues)
14561460
.where('id', '=', this.id)
@@ -1472,6 +1476,8 @@ export class ErrorModel {
14721476
this.updateFromQuery.set(error).execute()
14731477
}
14741478

1479+
await this.mapCustomSetters(error)
1480+
14751481
await DB.instance.updateTable('errors')
14761482
.set(error)
14771483
.where('id', '=', this.id)
@@ -1498,6 +1504,8 @@ export class ErrorModel {
14981504
),
14991505
) as NewError
15001506

1507+
await this.mapCustomSetters(filteredValues)
1508+
15011509
if (this.id === undefined) {
15021510
await DB.instance.insertInto('errors')
15031511
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ export class FailedJobModel {
836836
),
837837
) as NewFailedJob
838838

839+
await this.mapCustomSetters(filteredValues)
840+
839841
const result = await DB.instance.insertInto('failed_jobs')
840842
.values(filteredValues)
841843
.executeTakeFirst()
@@ -1451,6 +1453,8 @@ export class FailedJobModel {
14511453
),
14521454
) as NewFailedJob
14531455

1456+
await this.mapCustomSetters(filteredValues)
1457+
14541458
await DB.instance.updateTable('failed_jobs')
14551459
.set(filteredValues)
14561460
.where('id', '=', this.id)
@@ -1472,6 +1476,8 @@ export class FailedJobModel {
14721476
this.updateFromQuery.set(failedjob).execute()
14731477
}
14741478

1479+
await this.mapCustomSetters(failedjob)
1480+
14751481
await DB.instance.updateTable('failed_jobs')
14761482
.set(failedjob)
14771483
.where('id', '=', this.id)
@@ -1498,6 +1504,8 @@ export class FailedJobModel {
14981504
),
14991505
) as NewFailedJob
15001506

1507+
await this.mapCustomSetters(filteredValues)
1508+
15011509
if (this.id === undefined) {
15021510
await DB.instance.insertInto('failed_jobs')
15031511
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,8 @@ export class JobModel {
836836
),
837837
) as NewJob
838838

839+
await this.mapCustomSetters(filteredValues)
840+
839841
const result = await DB.instance.insertInto('jobs')
840842
.values(filteredValues)
841843
.executeTakeFirst()
@@ -1451,6 +1453,8 @@ export class JobModel {
14511453
),
14521454
) as NewJob
14531455

1456+
await this.mapCustomSetters(filteredValues)
1457+
14541458
await DB.instance.updateTable('jobs')
14551459
.set(filteredValues)
14561460
.where('id', '=', this.id)
@@ -1472,6 +1476,8 @@ export class JobModel {
14721476
this.updateFromQuery.set(job).execute()
14731477
}
14741478

1479+
await this.mapCustomSetters(job)
1480+
14751481
await DB.instance.updateTable('jobs')
14761482
.set(job)
14771483
.where('id', '=', this.id)
@@ -1498,6 +1504,8 @@ export class JobModel {
14981504
),
14991505
) as NewJob
15001506

1507+
await this.mapCustomSetters(filteredValues)
1508+
15011509
if (this.id === undefined) {
15021510
await DB.instance.insertInto('jobs')
15031511
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,8 @@ export class PaymentMethodModel {
884884
),
885885
) as NewPaymentMethod
886886

887+
await this.mapCustomSetters(filteredValues)
888+
887889
filteredValues.uuid = randomUUIDv7()
888890

889891
const result = await DB.instance.insertInto('payment_methods')
@@ -1519,6 +1521,8 @@ export class PaymentMethodModel {
15191521
),
15201522
) as NewPaymentMethod
15211523

1524+
await this.mapCustomSetters(filteredValues)
1525+
15221526
await DB.instance.updateTable('payment_methods')
15231527
.set(filteredValues)
15241528
.where('id', '=', this.id)
@@ -1540,6 +1544,8 @@ export class PaymentMethodModel {
15401544
this.updateFromQuery.set(paymentmethod).execute()
15411545
}
15421546

1547+
await this.mapCustomSetters(paymentmethod)
1548+
15431549
await DB.instance.updateTable('payment_methods')
15441550
.set(paymentmethod)
15451551
.where('id', '=', this.id)
@@ -1566,6 +1572,8 @@ export class PaymentMethodModel {
15661572
),
15671573
) as NewPaymentMethod
15681574

1575+
await this.mapCustomSetters(filteredValues)
1576+
15691577
if (this.id === undefined) {
15701578
await DB.instance.insertInto('payment_methods')
15711579
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,8 @@ export class PostModel {
822822
),
823823
) as NewPost
824824

825+
await this.mapCustomSetters(filteredValues)
826+
825827
const result = await DB.instance.insertInto('posts')
826828
.values(filteredValues)
827829
.executeTakeFirst()
@@ -1413,6 +1415,8 @@ export class PostModel {
14131415
),
14141416
) as NewPost
14151417

1418+
await this.mapCustomSetters(filteredValues)
1419+
14161420
await DB.instance.updateTable('posts')
14171421
.set(filteredValues)
14181422
.where('id', '=', this.id)
@@ -1434,6 +1438,8 @@ export class PostModel {
14341438
this.updateFromQuery.set(post).execute()
14351439
}
14361440

1441+
await this.mapCustomSetters(post)
1442+
14371443
await DB.instance.updateTable('posts')
14381444
.set(post)
14391445
.where('id', '=', this.id)
@@ -1460,6 +1466,8 @@ export class PostModel {
14601466
),
14611467
) as NewPost
14621468

1469+
await this.mapCustomSetters(filteredValues)
1470+
14631471
if (this.id === undefined) {
14641472
await DB.instance.insertInto('posts')
14651473
.values(filteredValues)

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,8 @@ export class ProductModel {
864864
),
865865
) as NewProduct
866866

867+
await this.mapCustomSetters(filteredValues)
868+
867869
filteredValues.uuid = randomUUIDv7()
868870

869871
const result = await DB.instance.insertInto('products')
@@ -1499,6 +1501,8 @@ export class ProductModel {
14991501
),
15001502
) as NewProduct
15011503

1504+
await this.mapCustomSetters(filteredValues)
1505+
15021506
await DB.instance.updateTable('products')
15031507
.set(filteredValues)
15041508
.where('id', '=', this.id)
@@ -1520,6 +1524,8 @@ export class ProductModel {
15201524
this.updateFromQuery.set(product).execute()
15211525
}
15221526

1527+
await this.mapCustomSetters(product)
1528+
15231529
await DB.instance.updateTable('products')
15241530
.set(product)
15251531
.where('id', '=', this.id)
@@ -1546,6 +1552,8 @@ export class ProductModel {
15461552
),
15471553
) as NewProduct
15481554

1555+
await this.mapCustomSetters(filteredValues)
1556+
15491557
if (this.id === undefined) {
15501558
await DB.instance.insertInto('products')
15511559
.values(filteredValues)

0 commit comments

Comments
 (0)