-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SAUL
committed
Jan 10, 2025
1 parent
594702a
commit 92028f5
Showing
20 changed files
with
362 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
package core.form.validation | ||
|
||
/** | ||
* Represents a validation rule for form input. | ||
* | ||
* @property condition A lambda function that takes a String and returns a Boolean indicating if the condition is met. | ||
* @property errorMessage The error message to be displayed if the condition is not met. | ||
*/ | ||
data class ValidationRule( | ||
val condition: (String) -> Boolean, | ||
val errorMessage: String | ||
) | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
package core.models | ||
|
||
/** | ||
* A sealed class representing a result, which can be either a success or an error. | ||
*/ | ||
sealed class Result<out T> { | ||
/** | ||
* Represents a successful result containing data. | ||
* | ||
* @param T The type of the data. | ||
* @property data The data of the successful result. | ||
*/ | ||
data class Success<out T>(val data: T) : Result<T>() | ||
|
||
/** | ||
* Represents an error result containing a message. | ||
* | ||
* @property message The error message. | ||
*/ | ||
data class Error(val message: String) : Result<Nothing>() | ||
} |
Oops, something went wrong.