test-entity-library-asm 2.6.18 → 2.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/Permission.d.ts +9 -9
- package/dist/entities/Permission.js +63 -63
- package/dist/entities/Role.d.ts +12 -12
- package/dist/entities/Role.js +81 -81
- package/dist/entities/RoleVisibleTo.d.ts +6 -6
- package/dist/entities/RoleVisibleTo.js +47 -47
- package/dist/entities/ScheduleCategory.d.ts +9 -9
- package/dist/entities/ScheduleCategory.js +48 -48
- package/dist/entities/TypeFood.d.ts +8 -8
- package/dist/entities/TypeFood.js +68 -68
- package/dist/middlewares/timezoneMiddleware.d.ts +3 -3
- package/dist/middlewares/timezoneMiddleware.js +22 -22
- package/dist/repositories/VerifyLocalRepository.d.ts +4 -4
- package/dist/repositories/VerifyLocalRepository.js +142 -142
- package/dist/transformations.d.ts +4 -4
- package/dist/transformations.js +16 -16
- package/dist/views/DiscountsCodeUser.d.ts +28 -0
- package/dist/views/DiscountsCodeUser.js +151 -0
- package/dist/views/UserInformation.d.ts +39 -39
- package/dist/views/UserInformation.js +187 -187
- package/package.json +1 -1
- package/src/views/DiscountsCodeUser.ts +109 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ViewEntity, ViewColumn } from 'typeorm'
|
|
2
|
+
import moment = require('moment-timezone')
|
|
3
|
+
import { getTimeZone } from '..'
|
|
4
|
+
|
|
5
|
+
// JSON Transformer
|
|
6
|
+
const jsonTransformer = {
|
|
7
|
+
to: (value: any) => JSON.stringify(value),
|
|
8
|
+
|
|
9
|
+
from: (value: string) => {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(value)
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.log(error, 'Transformer error')
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const DateTransformer = {
|
|
20
|
+
to(value: Date | string): string {
|
|
21
|
+
return moment.utc(value).format('YYYY-MM-DD HH:mm:ss')
|
|
22
|
+
},
|
|
23
|
+
from(value: string): string {
|
|
24
|
+
return moment.utc(value).tz(getTimeZone()).format('YYYY-MM-DD HH:mm:ss')
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@ViewEntity({
|
|
29
|
+
name: 'discounts_code_user',
|
|
30
|
+
})
|
|
31
|
+
export class DiscountsCodeUser {
|
|
32
|
+
@ViewColumn()
|
|
33
|
+
id: number
|
|
34
|
+
|
|
35
|
+
@ViewColumn()
|
|
36
|
+
company: number
|
|
37
|
+
|
|
38
|
+
@ViewColumn()
|
|
39
|
+
local: number
|
|
40
|
+
|
|
41
|
+
@ViewColumn()
|
|
42
|
+
code: string
|
|
43
|
+
|
|
44
|
+
@ViewColumn()
|
|
45
|
+
discount: string
|
|
46
|
+
|
|
47
|
+
@ViewColumn()
|
|
48
|
+
type: number
|
|
49
|
+
|
|
50
|
+
@ViewColumn()
|
|
51
|
+
single_use: number
|
|
52
|
+
|
|
53
|
+
@ViewColumn()
|
|
54
|
+
use_limit: number
|
|
55
|
+
|
|
56
|
+
@ViewColumn({ transformer: DateTransformer })
|
|
57
|
+
created: string
|
|
58
|
+
|
|
59
|
+
@ViewColumn()
|
|
60
|
+
start: string
|
|
61
|
+
|
|
62
|
+
@ViewColumn()
|
|
63
|
+
expiration: string
|
|
64
|
+
|
|
65
|
+
@ViewColumn({ transformer: jsonTransformer })
|
|
66
|
+
repeat_days: any
|
|
67
|
+
|
|
68
|
+
@ViewColumn()
|
|
69
|
+
update_by: number
|
|
70
|
+
|
|
71
|
+
@ViewColumn({ transformer: DateTransformer })
|
|
72
|
+
updated: string
|
|
73
|
+
|
|
74
|
+
@ViewColumn()
|
|
75
|
+
status: number
|
|
76
|
+
|
|
77
|
+
@ViewColumn()
|
|
78
|
+
local_id: number
|
|
79
|
+
|
|
80
|
+
@ViewColumn()
|
|
81
|
+
local_name: string
|
|
82
|
+
|
|
83
|
+
@ViewColumn()
|
|
84
|
+
local_address: string
|
|
85
|
+
|
|
86
|
+
@ViewColumn()
|
|
87
|
+
local_status: number
|
|
88
|
+
|
|
89
|
+
@ViewColumn()
|
|
90
|
+
partner_id: number
|
|
91
|
+
|
|
92
|
+
@ViewColumn()
|
|
93
|
+
partner_code: string
|
|
94
|
+
|
|
95
|
+
@ViewColumn()
|
|
96
|
+
partner_name: string
|
|
97
|
+
|
|
98
|
+
@ViewColumn()
|
|
99
|
+
partner_surname: string
|
|
100
|
+
|
|
101
|
+
@ViewColumn({ transformer: jsonTransformer })
|
|
102
|
+
partner_profile: any
|
|
103
|
+
|
|
104
|
+
@ViewColumn()
|
|
105
|
+
partner_status: number
|
|
106
|
+
|
|
107
|
+
@ViewColumn()
|
|
108
|
+
assigned_local: number
|
|
109
|
+
}
|