Skip to content

Annotation Feature : Past and Future Date fields#18

Open
anshubala1 wants to merge 2 commits intomasterfrom
FuturePastDateFieldsAnnotations
Open

Annotation Feature : Past and Future Date fields#18
anshubala1 wants to merge 2 commits intomasterfrom
FuturePastDateFieldsAnnotations

Conversation

@anshubala1
Copy link
Collaborator

This PR contains Annotation feature for Vador framework.

This will add 2 annotations.

  1. PastDateField
  2. FutureDateField

Added tests for the same.

@salesforce-cla
Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): anshu-bala <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

class FutureDateFieldValidator<FailureT> : ValidatorAnnotation1<LocalDate, FailureT> {
override fun validate(
field: Field,
value: LocalDate,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should support the deprecated Java 8 Date also as most of core and Connect APIs still use it.


@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FIELD)
annotation class FutureDateField(val failureKey: String)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we can drop Field suffix and call it @FutureDate itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants