-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add project types attending to billing --------- Co-authored-by: adrianavillar <[email protected]>
- Loading branch information
1 parent
6c9d59a
commit 2704b05
Showing
58 changed files
with
386 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
tntconcept-binnacle/src/main/kotlin/com/autentia/tnt/binnacle/core/domain/Project.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...oncept-binnacle/src/main/kotlin/com/autentia/tnt/binnacle/entities/ProjectBillingTypes.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.autentia.tnt.binnacle.entities | ||
|
||
class ProjectBillingTypes{ | ||
private val noBillingDefault = ProjectBillingType("NO_BILLABLE", Billable.NEVER, false) | ||
private val closedPrice = ProjectBillingType("CLOSED_PRICE", Billable.ALWAYS, true) | ||
private val timeMaterials = ProjectBillingType("TIME_AND_MATERIALS", Billable.OPTIONAL, true) | ||
private val timeMaterialsLimited = ProjectBillingType("TIME_AND_MATERIALS_LIMITED", Billable.OPTIONAL, true) | ||
private val bundleOfHours = ProjectBillingType("BUNDLE_OF_HOURS", Billable.OPTIONAL, true) | ||
fun getProjectBillingType(type: String):ProjectBillingType{ | ||
when (type){ | ||
"NO_BILLABLE" -> return noBillingDefault | ||
"CLOSED_PRICE" ->return closedPrice | ||
"TIME_AND_MATERIALS" -> return timeMaterials | ||
"TIME_AND_MATERIALS_LIMITED" ->return timeMaterialsLimited | ||
"BUNDLE_OF_HOURS" ->return bundleOfHours | ||
else -> throw IllegalArgumentException(type + " is not a valid project billing type") | ||
} | ||
} | ||
} | ||
|
||
data class ProjectBillingType( | ||
val name: String, | ||
val type: Billable, | ||
val billableByDefault: Boolean | ||
) | ||
enum class Billable{ | ||
ALWAYS, NEVER, OPTIONAL | ||
} |
3 changes: 2 additions & 1 deletion
3
...ept-binnacle/src/main/kotlin/com/autentia/tnt/binnacle/entities/dto/ProjectResponseDTO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...c/main/kotlin/com/autentia/tnt/binnacle/exception/ActivityBillableIncoherenceException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.autentia.tnt.binnacle.exception | ||
|
||
class ActivityBillableIncoherenceException(message: String) : BinnacleException(message) { | ||
constructor() : this("The billing field of the activity is incoherent with the project billing type") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.