Skip to content

Commit

Permalink
Add aliases for methods to hid.Hydra
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed May 9, 2019
1 parent 8d38d30 commit 893c659
Show file tree
Hide file tree
Showing 9 changed files with 228 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Account.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ trait Account {
}
}

LinkedHashMap createCustomerAccount(LinkedHashMap input) {
input.remove('accountId')
return putCustomerAccount(input)
}

LinkedHashMap updateCustomerAccount(def accountId, LinkedHashMap input) {
return putCustomerAccount(input + [accountId: accountId])
}

Boolean putAdjustment(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
accountId : null,
Expand Down Expand Up @@ -196,6 +205,14 @@ trait Account {
}
}

Boolean addAdjustment(LinkedHashMap input) {
return putAdjustment(input)
}

Boolean addAdjustment(def accountId, LinkedHashMap input) {
return putAdjustment(input + [accountId: accountId])
}

Boolean putPermanentOverdraft(
def accountId,
def sum = 0,
Expand Down Expand Up @@ -230,6 +247,18 @@ trait Account {
return putPermanentOverdraft(params.accountId, params.sum, params.reasonId)
}

Boolean addPermanentOverdraft(
def accountId,
def sum = 0,
def reasonId = null
) {
return putPermanentOverdraft(accountId, sum, reasonId)
}

Boolean addPermanentOverdraft(LinkedHashMap input) {
return putPermanentOverdraft(input)
}

Boolean deletePermanentOverdraft(def accountId) {
try {
logger.info("Deleting permanent overdraft with params ${params}")
Expand Down Expand Up @@ -282,6 +311,19 @@ trait Account {
return putTemporalOverdraft(params.accountId, params.sum, params.endDate, params.reasonId)
}

Boolean addTemporalOverdraft(
def accountId,
def sum = 0,
def endDate = DateTimeUtil.dayEnd(),
def reasonId = null
) {
return putTemporalOverdraft(accountId, sum, endDate, reasonId)
}

Boolean addTemporalOverdraft(LinkedHashMap input) {
return putTemporalOverdraft(input)
}

Boolean deleteTemporalOverdraft(def accountId) {
try {
logger.info("Deleting temporal overdraft with params ${params}")
Expand Down
39 changes: 39 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Address.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,45 @@ trait Address {
}
}

LinkedHashMap createSubjAddress(LinkedHashMap input) {
input.remove('subjAddressId')
return putSubjAddress(input)
}

LinkedHashMap createObjAddress(LinkedHashMap input) {
input.remove('objAddressId')
return putObjAddress(input)
}

LinkedHashMap createEntityAddress(LinkedHashMap input) {
input.remove('entityAddressId')
return putEntityAddress(input)
}

LinkedHashMap createSubjAddress(def subjectId, LinkedHashMap input) {
return putSubjAddress(input + [subjectId: subjectId])
}

LinkedHashMap createObjAddress(def objectId, LinkedHashMap input) {
return putObjAddress(input + [objectId: objectId])
}

LinkedHashMap createEntityAddress(def entityId, LinkedHashMap input) {
return putEntityAddress(input + [entityId: entityId])
}

LinkedHashMap updateSubjAddress(def subjAddressId, LinkedHashMap input) {
return putSubjAddress(input + [subjAddressId: subjAddressId])
}

LinkedHashMap updateObjAddress(def objAddressId, LinkedHashMap input) {
return putObjAddress(input + [objAddressId: objAddressId])
}

LinkedHashMap updateEntityAddress(def entityAddressId, LinkedHashMap input) {
return putEntityAddress(input + [entityAddressId: entityAddressId])
}

List getAddressItemsValues(LinkedHashMap input) {
List addressItemsValues = []
getAddressItems().each{ type, value ->
Expand Down
17 changes: 17 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Company.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ trait Company {
}
}

LinkedHashMap createCompany(LinkedHashMap input) {
input.remove('companyId')
return putCompany(input)
}

LinkedHashMap updateCompany(def companyId, LinkedHashMap input) {
return putCompany(input + [companyId: companyId])
}

def getCompanyAddParamTypeIdByCode(String code) {
return getSubjectAddParamTypeIdByCode(code, getCompanyTypeId())
}
Expand Down Expand Up @@ -188,4 +197,12 @@ trait Company {
}
return putSubjectAddParam(input)
}

Boolean addCompanyAddParam(LinkedHashMap input) {
return putCompanyAddParam(input)
}

Boolean addCompanyAddParam(def companyId, LinkedHashMap input) {
return putCompanyAddParam(input + [companyId: companyId])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ trait Contract {
}
}

LinkedHashMap createContract(LinkedHashMap input) {
input.remove('docId')
return putContract(input)
}

LinkedHashMap updateContract(def docId, LinkedHashMap input) {
return putContract(input + [docId: docId])
}

Boolean dissolveContract(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
docId : null,
Expand Down
49 changes: 49 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Customer.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ trait Customer {
}
}

LinkedHashMap createCustomer(LinkedHashMap input) {
input.remove('customerId')
return putCustomer(input)
}

LinkedHashMap updateCustomer(def customerId, LinkedHashMap input) {
return putCustomer(input + [customerId: customerId])
}

def getCustomerAddParamTypeIdByCode(String code) {
return getSubjectAddParamTypeIdByCode(code, getCustomerTypeId())
}
Expand Down Expand Up @@ -265,6 +274,14 @@ trait Customer {
return putSubjectAddParam(input)
}

Boolean addCustomerAddParam(LinkedHashMap input) {
return putCustomerAddParam(input)
}

Boolean addCustomerAddParam(def customerId, LinkedHashMap input) {
return putCustomerAddParam(input + [customerId: customerId])
}

Boolean enableCustomer(def customerId) {
enableSubject(subjectId)
}
Expand Down Expand Up @@ -309,6 +326,14 @@ trait Customer {
return putSubjectGroup(input)
}

LinkedHashMap addCustomerGroup(LinkedHashMap input) {
return putCustomerGroup(input)
}

LinkedHashMap addCustomerGroup(def customerId, LinkedHashMap input) {
return putCustomerGroup(input + [customerId: customerId])
}

Boolean deleteCustomerGroup(LinkedHashMap input) {
if (input.containsKey('customerId')) {
input.subjectId = input.customerId
Expand Down Expand Up @@ -406,6 +431,14 @@ trait Customer {
}
}

LinkedHashMap addCustomerNetServiceAccess(LinkedHashMap input) {
return putCustomerNetServiceAccess(input)
}

LinkedHashMap addCustomerNetServiceAccess(def customerId, LinkedHashMap input) {
return putCustomerNetServiceAccess(input + [customerId: customerId])
}

Boolean changeNetServicePassword(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
subjServId : null,
Expand Down Expand Up @@ -501,6 +534,14 @@ trait Customer {
}
}

LinkedHashMap addCustomerAppAccess(LinkedHashMap input) {
return putCustomerAppAccess(input)
}

LinkedHashMap addCustomerAppAccess(def customerId, LinkedHashMap input) {
return putCustomerAppAccess(input + [customerId: customerId])
}

Boolean changeAppPassword(LinkedHashMap input) {
return changeNetServicePassword(input)
}
Expand Down Expand Up @@ -536,6 +577,14 @@ trait Customer {
}
}

LinkedHashMap addCustomerSelfCareAccess(LinkedHashMap input) {
return putCustomerSelfCareAccess(input)
}

LinkedHashMap addCustomerSelfCareAccess(def customerId, LinkedHashMap input) {
return putCustomerSelfCareAccess(input + [customerId: customerId])
}

Boolean changeSelfCarePassword(LinkedHashMap input) {
return changeNetServicePassword(input)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@ trait Document {
}
}

LinkedHashMap addDocumentSubject(LinkedHashMap input) {
return putDocumentSubject(input)
}

LinkedHashMap addDocumentSubject(def docId, LinkedHashMap input) {
return putDocumentSubject(input + [docId: docId])
}

Boolean changeDocumentState(
def docId,
def stateId
Expand Down
31 changes: 31 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Equipment.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ trait Equipment {
}
}

LinkedHashMap createEquipment(LinkedHashMap input) {
input.remove('equipmentId')
return putEquipment(input)
}

LinkedHashMap updateEquipment(def equipmentId, LinkedHashMap input) {
return putEquipment(input + [equipmentId: equipmentId])
}

LinkedHashMap putEquipmentComponent(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
equipmentId : null,
Expand Down Expand Up @@ -281,6 +290,16 @@ trait Equipment {
}
}

LinkedHashMap createEquipmentComponent(LinkedHashMap input) {
input.remove('equipmentComponentId')
return putEquipmentComponent(input)
}

LinkedHashMap createEquipmentComponent(def equipmentId, LinkedHashMap input) {
input.remove('equipmentComponentId')
return putEquipment(input + [equipmentId: equipmentId])
}

Boolean deleteEquipment(def equipmentId) {
try {
logger.info("Deleting eqipment ${equipmentId}")
Expand Down Expand Up @@ -378,6 +397,14 @@ trait Equipment {
}
}

LinkedHashMap addEquipmentAddParam(LinkedHashMap input) {
return putEquipmentAddParam(input)
}

LinkedHashMap addEquipmentAddParam(def equipmentId, LinkedHashMap input) {
return putEquipmentAddParam(input + [equipmentId: equipmentId])
}

LinkedHashMap putEquipmentBind(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
bindId : null,
Expand Down Expand Up @@ -406,6 +433,10 @@ trait Equipment {
}
}

LinkedHashMap addEquipmentBind(LinkedHashMap input) {
return putEquipmentBind(input)
}

Boolean deleteEquipmentBind(def bindId) {
try {
logger.info("Deleting eqipment bind id ${bindId}")
Expand Down
17 changes: 17 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Person.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ trait Person {
return entityIdOrEntityTypeId == getPersonTypeId() || getPerson(entityIdOrEntityTypeId) != null
}

LinkedHashMap createPerson(LinkedHashMap input) {
input.remove('personId')
return putPerson(input)
}

LinkedHashMap updatePerson(def personId, LinkedHashMap input) {
return putPerson(input + [personId: personId])
}

LinkedHashMap putPerson(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
personId : null,
Expand Down Expand Up @@ -196,4 +205,12 @@ trait Person {
}
return putSubjectAddParam(input)
}

Boolean addPersonAddParam(LinkedHashMap input) {
return putPersonAddParam(input)
}

Boolean addPersonAddParam(def personId, LinkedHashMap input) {
return putPersonAddParam(input + [personId: personId])
}
}
16 changes: 16 additions & 0 deletions src/org/camunda/latera/bss/connectors/hid/hydra/Subject.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ trait Subject {
}
}

Boolean addSubjectAddParam(LinkedHashMap input) {
return putSubjectAddParam(input)
}

Boolean addSubjectAddParam(def subjectId, LinkedHashMap input) {
return putSubjectAddParam(input + [subjectId: subjectId])
}

List getSubjectGroupsBy(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
subjectId : null,
Expand Down Expand Up @@ -343,6 +351,14 @@ trait Subject {
}
}

Boolean addSubjectGroup(LinkedHashMap input) {
return putSubjectGroup(input)
}

Boolean addSubjectGroup(def subjectId, LinkedHashMap input) {
return putSubjectGroup(input + [subjectId: subjectId])
}

Boolean deleteSubjectGroup(LinkedHashMap input) {
LinkedHashMap params = mergeParams([
subjSubjectId : null,
Expand Down

0 comments on commit 893c659

Please sign in to comment.