Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.31 KB | None | 0 0
  1. application {
  2. config {
  3. baseName store
  4. applicationType gateway
  5. packageName com.jhipster.demo.store
  6. serviceDiscoveryType no
  7. authenticationType jwt
  8. prodDatabaseType mysql
  9. cacheProvider hazelcast
  10. buildTool gradle
  11. clientFramework react
  12. useSass true
  13. testFrameworks [protractor]
  14. }
  15. entities *
  16. }
  17.  
  18.  
  19. application {
  20. config {
  21. baseName product
  22. applicationType microservice
  23. packageName com.jhipster.demo.product
  24. serviceDiscoveryType no
  25. authenticationType jwt
  26. prodDatabaseType mysql
  27. buildTool gradle
  28. serverPort 8081
  29. }
  30. entities Product, ProductCategory, ProductOrder, OrderItem
  31. }
  32.  
  33. application {
  34. config {
  35. baseName invoice
  36. applicationType microservice
  37. packageName com.jhipster.demo.invoice
  38. serviceDiscoveryType no
  39. authenticationType jwt
  40. prodDatabaseType mysql
  41. buildTool gradle
  42. serverPort 8082
  43. }
  44. entities Invoice, Shipment
  45. }
  46.  
  47. application {
  48. config {
  49. baseName notification
  50. applicationType microservice
  51. packageName com.jhipster.demo.notification
  52. serviceDiscoveryType no
  53. authenticationType jwt
  54. databaseType mongodb
  55. cacheProvider no
  56. enableHibernateCache false
  57. buildTool gradle
  58. serverPort 8083
  59. }
  60. entities Notification
  61. }
  62.  
  63. /**
  64. * Entities for Store Gateway
  65. */
  66.  
  67. // Customer for the store
  68. entity Customer {
  69. firstName String required
  70. lastName String required
  71. gender Gender required
  72. email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)
  73. phone String required
  74. addressLine1 String required
  75. addressLine2 String
  76. city String required
  77. country String required
  78. }
  79.  
  80. enum Gender {
  81. MALE, FEMALE, OTHER
  82. }
  83.  
  84. relationship OneToOne {
  85. Customer{user(login) required} to User
  86. }
  87.  
  88. service Customer with serviceClass
  89. paginate Customer with pagination
  90.  
  91.  
  92. /**
  93. * Entities for product microservice
  94. */
  95.  
  96.  
  97. // Product sold by the Online store
  98. entity Product {
  99. name String required
  100. description String
  101. price BigDecimal required min(0)
  102. size Size required
  103. image ImageBlob
  104. }
  105.  
  106. enum Size {
  107. S, M, L, XL, XXL
  108. }
  109.  
  110. entity ProductCategory {
  111. name String required
  112. description String
  113. }
  114.  
  115. entity ProductOrder {
  116. placedDate Instant required
  117. status OrderStatus required
  118. code String required
  119. invoiceId Long
  120. customer String required
  121. }
  122.  
  123. enum OrderStatus {
  124. COMPLETED, PENDING, CANCELLED
  125. }
  126.  
  127. entity OrderItem {
  128. quantity Integer required min(0)
  129. totalPrice BigDecimal required min(0)
  130. status OrderItemStatus required
  131. }
  132.  
  133. enum OrderItemStatus {
  134. AVAILABLE, OUT_OF_STOCK, BACK_ORDER
  135. }
  136.  
  137. relationship ManyToOne {
  138. OrderItem{product(name) required} to Product
  139. }
  140.  
  141. relationship OneToMany {
  142. ProductOrder{orderItem} to OrderItem{order(code) required} ,
  143. ProductCategory{product} to Product{productCategory(name)}
  144. }
  145.  
  146. service Product, ProductCategory, ProductOrder, OrderItem with serviceClass
  147. paginate Product, ProductOrder, OrderItem with pagination
  148. microservice Product, ProductOrder, ProductCategory, OrderItem with product
  149.  
  150.  
  151. /**
  152. * Entities for Invoice microservice
  153. */
  154.  
  155.  
  156. // Invoice for sales
  157. entity Invoice {
  158. code String required
  159. date Instant required
  160. details String
  161. status InvoiceStatus required
  162. paymentMethod PaymentMethod required
  163. paymentDate Instant required
  164. paymentAmount BigDecimal required
  165. }
  166.  
  167. enum InvoiceStatus {
  168. PAID, ISSUED, CANCELLED
  169. }
  170.  
  171. entity Shipment {
  172. trackingCode String
  173. date Instant required
  174. details String
  175. }
  176.  
  177. enum PaymentMethod {
  178. CREDIT_CARD, CASH_ON_DELIVERY, PAYPAL
  179. }
  180.  
  181. relationship OneToMany {
  182. Invoice{shipment} to Shipment{invoice(code) required}
  183. }
  184.  
  185. service Invoice, Shipment with serviceClass
  186. paginate Invoice, Shipment with pagination
  187. microservice Invoice, Shipment with invoice
  188.  
  189.  
  190. /**
  191. * Entities for notification microservice
  192. */
  193.  
  194.  
  195. entity Notification {
  196. date Instant required
  197. details String
  198. sentDate Instant required
  199. format NotificationType required
  200. userId Long required
  201. productId Long required
  202. }
  203.  
  204. enum NotificationType {
  205. EMAIL, SMS, PARCEL
  206. }
  207.  
  208. microservice Notification with notification
  209.  
  210. /**
  211. * Deployments
  212. */
  213.  
  214. deployment {
  215. deploymentType kubernetes
  216. appsFolders [store, invoice, notification, product]
  217. serviceDiscoveryType no
  218. dockerRepositoryName "deepu105"
  219. kubernetesNamespace jhipster
  220. kubernetesServiceType Ingress
  221. ingressDomain "35.241.165.213.nip.io"
  222. istio autoInjection
  223. istioRoute true
  224. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement