/
household-persister.yml
174 lines (171 loc) · 8.1 KB
/
household-persister.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
serviceMaps:
serviceName: household
mappings:
- version: 1.0
description: Persists household.
fromTopic: save-household-topic
isTransaction: true
queryMaps:
- query: INSERT INTO HOUSEHOLD(id, tenantId, clientReferenceId, numberOfMembers, addressId, additionalDetails, createdBy, lastModifiedBy, createdTime, lastModifiedTime, rowVersion, isDeleted) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
basePath: $.*
jsonMaps:
- jsonPath: $.*.id
- jsonPath: $.*.tenantId
- jsonPath: $.*.clientReferenceId
- jsonPath: $.*.memberCount
- jsonPath: $.*.address.id
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.auditDetails.createdBy
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.createdTime
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- query: INSERT INTO ADDRESS(id, clientReferenceId, tenantid, doorno, latitude, longitude, locationAccuracy, type, addressline1, addressline2, landmark, city, pincode, buildingName, street, localityCode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
basePath: $.*.address
jsonMaps:
- jsonPath: $.*.address.id
- jsonPath: $.*.address.clientReferenceId
- jsonPath: $.*.address.tenantId
- jsonPath: $.*.address.doorNo
- jsonPath: $.*.address.latitude
- jsonPath: $.*.address.longitude
- jsonPath: $.*.address.locationAccuracy
- jsonPath: $.*.address.type
- jsonPath: $.*.address.addressLine1
- jsonPath: $.*.address.addressLine2
- jsonPath: $.*.address.landmark
- jsonPath: $.*.address.city
- jsonPath: $.*.address.pincode
- jsonPath: $.*.address.buildingName
- jsonPath: $.*.address.street
- jsonPath: $.*.address.locality.code
- version: 1.0
description: Updates household.
fromTopic: update-household-topic
isTransaction: true
queryMaps:
- query: UPDATE HOUSEHOLD SET tenantId = ?, clientReferenceId = ?, numberOfMembers = ?, addressId = ?, additionalDetails = ?, lastModifiedBy = ?, lastModifiedTime = ?, rowVersion = ?, isDeleted = ? WHERE ID = ?;
basePath: $.*
jsonMaps:
- jsonPath: $.*.tenantId
- jsonPath: $.*.clientReferenceId
- jsonPath: $.*.memberCount
- jsonPath: $.*.address.id
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.id
- query: INSERT INTO ADDRESS(id, clientReferenceId, tenantid, doorno, latitude, longitude, locationAccuracy, type, addressline1, addressline2, landmark, city, pincode, buildingName, street, localityCode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET tenantId = ?, doorno = ?, latitude = ?, longitude = ?, locationAccuracy = ?, type = ?, addressline1 = ?, addressline2 = ?, landmark = ?, city = ?, pincode = ?, buildingName = ?, street = ?, localityCode = ?;
basePath: $.*.address
jsonMaps:
- jsonPath: $.*.address.id
- jsonPath: $.*.address.clientReferenceId
- jsonPath: $.*.address.tenantId
- jsonPath: $.*.address.doorNo
- jsonPath: $.*.address.latitude
- jsonPath: $.*.address.longitude
- jsonPath: $.*.address.locationAccuracy
- jsonPath: $.*.address.type
- jsonPath: $.*.address.addressLine1
- jsonPath: $.*.address.addressLine2
- jsonPath: $.*.address.landmark
- jsonPath: $.*.address.city
- jsonPath: $.*.address.pincode
- jsonPath: $.*.address.buildingName
- jsonPath: $.*.address.street
- jsonPath: $.*.address.locality.code
- jsonPath: $.*.address.tenantId
- jsonPath: $.*.address.doorNo
- jsonPath: $.*.address.latitude
- jsonPath: $.*.address.longitude
- jsonPath: $.*.address.locationAccuracy
- jsonPath: $.*.address.type
- jsonPath: $.*.address.addressLine1
- jsonPath: $.*.address.addressLine2
- jsonPath: $.*.address.landmark
- jsonPath: $.*.address.city
- jsonPath: $.*.address.pincode
- jsonPath: $.*.address.buildingName
- jsonPath: $.*.address.street
- jsonPath: $.*.address.locality.code
- version: 1.0
description: Deletes household.
fromTopic: delete-household-topic
isTransaction: true
queryMaps:
- query: UPDATE HOUSEHOLD SET lastModifiedBy = ?, lastModifiedTime = ?, rowVersion = ?, isDeleted = ?, additionalDetails=? WHERE ID = ?;
basePath: $.*
jsonMaps:
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.id
- version: 1.0
description: Persists household member.
fromTopic: save-household-member-topic
isTransaction: true
queryMaps:
- query: INSERT INTO HOUSEHOLD_MEMBER(id, tenantId, individualId, individualClientReferenceId, householdId, householdClientReferenceId, isHeadOfHousehold, additionalDetails, createdBy, lastModifiedBy, createdTime, lastModifiedTime, rowVersion, isDeleted) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
basePath: $.*
jsonMaps:
- jsonPath: $.*.id
- jsonPath: $.*.tenantId
- jsonPath: $.*.individualId
- jsonPath: $.*.individualClientReferenceId
- jsonPath: $.*.householdId
- jsonPath: $.*.householdClientReferenceId
- jsonPath: $.*.isHeadOfHousehold
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.auditDetails.createdBy
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.createdTime
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- version: 1.0
description: Update household member.
fromTopic: update-household-member-topic
isTransaction: true
queryMaps:
- query: UPDATE HOUSEHOLD_MEMBER SET isHeadOfHousehold=?, additionalDetails=?, lastModifiedBy=?, lastModifiedTime=?, rowVersion=?, isDeleted=? WHERE individualId=? AND householdId=? AND isDeleted=false;
basePath: $.*
jsonMaps:
- jsonPath: $.*.isHeadOfHousehold
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.individualId
- jsonPath: $.*.householdId
- version: 1.0
description: Deletes household Member.
fromTopic: delete-household-member-topic
isTransaction: true
queryMaps:
- query: UPDATE HOUSEHOLD_MEMBER SET lastModifiedBy = ?, lastModifiedTime = ?, rowVersion = ?, isDeleted = ?, additionalDetails=? WHERE ID = ?;
basePath: $.*
jsonMaps:
- jsonPath: $.*.auditDetails.lastModifiedBy
- jsonPath: $.*.auditDetails.lastModifiedTime
- jsonPath: $.*.rowVersion
- jsonPath: $.*.isDeleted
- jsonPath: $.*.additionalFields
type: JSON
dbType: JSONB
- jsonPath: $.*.id