-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJob.ts
59 lines (51 loc) · 1.11 KB
/
Job.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { Stub } from '@formidablejs/stubs'
import { join } from 'path'
export class Job extends Stub {
/**
* @inheritdoc
*/
get props(): object {
return {
queue: {
type: String,
required: false
},
domain: {
type: String,
required: false
}
}
}
/**
* @inheritdoc
*/
get data(): object {
return {
'class': this.realClassName,
'queue': this.options.queue
}
}
/**
* @inheritdoc
*/
get stub(): string {
const ext = this.language == 'imba'
? '.imba' : (
this.language == 'typescript' ? '.ts' : '.imba'
)
let stub = 'stub'
if (this.options.queue) {
stub = 'stub-queue'
}
return join(__dirname, '..', '..', 'formidable', 'stubs', (stub + ext))
}
/**
* @inheritdoc
*/
get destination(): string {
if (this.options.domain) {
return `app/Domain/${this.options.domain}/Jobs`
}
return 'app/Jobs'
}
}