Skip to content

Commit

Permalink
Merge branch 'master' into HCX-39
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Mar 4, 2020
2 parents 51687b9 + cfc4941 commit 34b0b62
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 101 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ v1.5 [unreleased]
- [#11](https://github.com/latera/camunda-ext/pull/11) Rename Invoice to Charge log
- [#13](https://github.com/latera/camunda-ext/pull/13) Fix id and non-id fields in helpers.hydra.Individual trait methods
- [#35](https://github.com/latera/camunda-ext/pull/35) Set private modifier for hid.hydra.Account#put* methods
- [#36](https://github.com/latera/camunda-ext/pull/36) Rename Bill to Invoice

v1.4.2 [unreleased]
-------------------
Expand All @@ -13,14 +14,17 @@ v1.4.2 [unreleased]
- [#33](https://github.com/latera/camunda-ext/pull/33) Allow to pass goodValueId into hid.Hydra#getGoodAddParamsBy
- [#32](https://github.com/latera/camunda-ext/pull/32) Allow to pass only specific fields into hid.Hydra#updateSubscription method
- [#24](https://github.com/latera/camunda-ext/pull/24) Add methods for files to document attaching
- [#39](https://github.com/latera/camunda-ext/pull/39) Add custom fields in create and update methods in PlanadoV2 class
- [#32](https://github.com/latera/camunda-ext/pull/32) Allow to pass only specific fields into hid.Hydra#updateSubscription method

### Bugfixes
- [#27](https://github.com/latera/camunda-ext/pull/27) Remove redundant get methods from hid.Hydra class
- [#27](https://github.com/latera/camunda-ext/pull/27) Remove redundant get methods from hid.Hydra class
- [#28](https://github.com/latera/camunda-ext/pull/28) Fix return types of HID class methods
- [#30](https://github.com/latera/camunda-ext/pull/30) Fix wrong Self-Care app id passing into method calls
- [#26](https://github.com/latera/camunda-ext/pull/26) Fix passing appCode into hid.Hydra#mainInit method
- [#34](https://github.com/latera/camunda-ext/pull/34) Search settlement accounts for base subjects, not personal ones
- [#41](https://github.com/latera/camunda-ext/pull/41) Use http-builder-ng-okhttp with PATCH requests support
- [#42](https://github.com/latera/camunda-ext/pull/42) Fix MailSender usage without auth

v1.4.1 [2020-02-14]
-------------------
Expand Down
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ COPY ./demo_processes/*/target/*.war /camunda/webapps/
COPY ./seed/target/*.war /camunda/webapps/
COPY ./target/camunda-ext-*.jar /camunda/lib/camunda-ext.jar

ENV DB_DRIVER=
ENV DB_HOST=
ENV DB_PORT=
ENV DB_NAME=
ENV DB_USERNAME=
ENV DB_PASSWORD=
ENV DB_URL=
ENV DB_DRIVER= \
DB_HOST= \
DB_PORT= \
DB_NAME= \
DB_USERNAME= \
DB_PASSWORD= \
DB_URL=

LABEL maintainer="Hydra Billing <info@hydra-billing.com>" \
org.opencontainers.image.authors="Hydra Billing <info@hydra-billing.com>" \
Expand All @@ -37,3 +37,6 @@ LABEL maintainer="Hydra Billing <info@hydra-billing.com>" \
org.openbuildservice.disturl="https://github.com/latera/camunda-ext/releases" \
org.opencontainers.image.source="https://github.com/latera/camunda-ext.git" \
org.opencontainers.image.documentation="https://latera.github.io/camunda-ext"

HEALTHCHECK --start-period=60s \
CMD wget -q --spider http://127.0.0.1:8080/camunda/app/welcome
6 changes: 0 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ services:
- default
- db
- bpm
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1:8080/camunda/app/welcome"]
interval: 10m
timeout: 5s
retries: 3
start_period: 180s
networks:
db:
internal: true
Expand Down
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
<id>maven.thingml.org</id>
<url>http://maven.thingml.org/thirdparty</url>
</repository>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -146,6 +150,12 @@
<version>${http-builder-ng.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.github.http-builder-ng</groupId>
<artifactId>http-builder-ng-okhttp</artifactId>
<version>${http-builder-ng.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
Expand Down
28 changes: 19 additions & 9 deletions src/org/camunda/latera/bss/connectors/MailSender.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import static org.camunda.latera.bss.utils.ListUtil.firstNotNull
class MailSender implements AutoCloseable {
private String host
private Integer port
private Boolean auth
private String user
private String password
private Session session
Expand All @@ -34,7 +35,7 @@ class MailSender implements AutoCloseable {
this.user = execution.getVariable('smtpUser') ?: ENV['SMTP_USER']
this.password = execution.getVariable('smtpPassword') ?: ENV['SMTP_PASSWORD']

Boolean auth = Boolean.valueOf(firstNotNull([
this.auth = Boolean.valueOf(firstNotNull([
execution.getVariable('smtpAuth'),
ENV['SMTP_AUTH'],
true
Expand All @@ -55,14 +56,18 @@ class MailSender implements AutoCloseable {
this.props = System.getProperties()
this.props.put('mail.smtp.host', host)
this.props.put('mail.smtp.port', port)
this.props.put('mail.smtp.user', user)
this.props.put('mail.smtp.password', password)
this.props.put('mail.smtp.auth', auth)
this.props.put('mail.mime.encodefilename', true)

if (this.auth) {
this.props.put('mail.smtp.user', user)
this.props.put('mail.smtp.password', password)
}

if (tls) {
this.props.put('mail.smtp.starttls.enable', tls.toString()) // DO NOT REMOVE toString() here !!!
}

if (ssl) {
this.props.put('mail.smtp.ssl.trust', ssl)
} else if (tls) {
Expand All @@ -79,16 +84,21 @@ class MailSender implements AutoCloseable {
if (isEmpty(this.host)) {
throw new Exception("Empty host name!")
}

if (isEmpty(this.port)) {
throw new Exception("Empty port number!")
}
if (isEmpty(this.user)) {
throw new Exception("Empty user name!")
}
if (isEmpty(this.password)) {
throw new Exception("Empty password!")

if (this.auth) {
if (isEmpty(this.user)) {
throw new Exception("Empty user name!")
}
if (isEmpty(this.password)) {
throw new Exception("Empty password!")
}
}
this.transport.connect(this.host, this.port, this.user, this.password)

this.transport.connect()
}
return this
}
Expand Down
28 changes: 16 additions & 12 deletions src/org/camunda/latera/bss/connectors/PlanadoV2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ class PlanadoV2 {
LinkedHashMap payload = [
external_id : extId,
organization : true,
organization_name : data.companyName ?: '',
organization_name : data.companyName ?: '',
site_address : [
formatted : data.addressStreet ?: '',
entrance_no : data.addressEntrance ?: '',
floor : data.addressFloor ?: '',
apartment : data.addressApartment ?: '',
description : data.addressDescription ?: ''
formatted : data.addressStreet ?: '',
entrance_no : data.addressEntrance ?: '',
floor : data.addressFloor ?: '',
apartment : data.addressApartment ?: '',
description : data.addressDescription ?: ''
],
contacts : [[
name : data.contactName ?: '',
value : data.phone ?: '',
name : data.contactName ?: '',
value : data.phone ?: '',
type : 'phone'
]]
]
Expand All @@ -203,10 +203,11 @@ class PlanadoV2 {
}

LinkedHashMap payload = [
template_id : toIntSafe(data.templateId),
client_id : data.clientId,
scheduled_at : data.startDate,
description : data.description ?: ''
template_id : toIntSafe(data.templateId),
client_id : data.clientId,
scheduled_at : data.startDate,
description : data.description ?: '',
custom_fields : data.customFields ?: []
]

logger.info('Creating new job')
Expand All @@ -221,6 +222,9 @@ class PlanadoV2 {
if (data.containsKey('description')) {
description = data.description
}
if (data.containsKey('customFields')) {
custom_fields = data.customFields
}

it
}
Expand Down
4 changes: 2 additions & 2 deletions src/org/camunda/latera/bss/connectors/hid/Hydra.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import org.camunda.latera.bss.connectors.hid.hydra.Document
import org.camunda.latera.bss.connectors.hid.hydra.Contract
import org.camunda.latera.bss.connectors.hid.hydra.PriceOrder
import org.camunda.latera.bss.connectors.hid.hydra.ChargeLog
import org.camunda.latera.bss.connectors.hid.hydra.Bill
import org.camunda.latera.bss.connectors.hid.hydra.Invoice
import org.camunda.latera.bss.connectors.hid.hydra.Subject
import org.camunda.latera.bss.connectors.hid.hydra.Company
import org.camunda.latera.bss.connectors.hid.hydra.Person
Expand All @@ -34,7 +34,7 @@ import org.camunda.latera.bss.connectors.hid.hydra.Param
import org.camunda.latera.bss.connectors.hid.hydra.Search
import org.camunda.latera.bss.connectors.hid.hydra.Tag

class Hydra implements Ref, Message, DataType, AddParam, Good, Document, Contract, PriceOrder, ChargeLog, Bill, Subject, Company, Person, Reseller, Group, Customer, Account, Subscription, Equipment, Region, Address, Param, Search, Tag {
class Hydra implements Ref, Message, DataType, AddParam, Good, Document, Contract, PriceOrder, ChargeLog, Invoice, Subject, Company, Person, Reseller, Group, Customer, Account, Subscription, Equipment, Region, Address, Param, Search, Tag {
private static String DEFAULT_USER = 'hydra'
private static String DEFAULT_LOCALE = 'ru'
HID hid
Expand Down
Loading

0 comments on commit 34b0b62

Please sign in to comment.