Skip to content

Commit 5671651

Browse files
chore: wip
1 parent f833ee7 commit 5671651

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import type { Model } from '@stacksjs/types'
2+
import { faker } from '@stacksjs/faker'
3+
import { schema } from '@stacksjs/validation'
4+
5+
export default {
6+
name: 'FailedJob',
7+
table: 'failed_jobs',
8+
primaryKey: 'id',
9+
autoIncrement: true,
10+
11+
traits: {
12+
useTimestamps: true,
13+
},
14+
15+
attributes: {
16+
connection: {
17+
required: true,
18+
fillable: true,
19+
validation: {
20+
rule: schema.string().maxLength(100),
21+
message: {
22+
maxLength: 'Connection must have a maximum of 100 characters',
23+
string: 'Connection must be a string',
24+
},
25+
},
26+
factory: () => 'default',
27+
},
28+
29+
queue: {
30+
required: true,
31+
fillable: true,
32+
validation: {
33+
rule: schema.string().maxLength(255),
34+
message: {
35+
maxLength: 'Queue must have a maximum of 255 characters',
36+
},
37+
},
38+
factory: () => 'default',
39+
},
40+
41+
payload: {
42+
required: true,
43+
fillable: true,
44+
validation: {
45+
rule: schema.string(),
46+
},
47+
factory: () => faker.lorem.sentence(),
48+
},
49+
50+
exception: {
51+
required: true,
52+
fillable: true,
53+
validation: {
54+
rule: schema.string(),
55+
},
56+
factory: () => faker.lorem.sentence(),
57+
},
58+
59+
failed_at: {
60+
fillable: true,
61+
validation: {
62+
rule: schema.date(),
63+
},
64+
factory: () => '2024-12-23 13:32:19',
65+
}
66+
},
67+
} satisfies Model

0 commit comments

Comments
 (0)