Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add support for datetime conditions match #64

Open
dev-bre opened this issue Aug 3, 2023 · 6 comments
Open

feat(api): add support for datetime conditions match #64

dev-bre opened this issue Aug 3, 2023 · 6 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@dev-bre
Copy link
Contributor

dev-bre commented Aug 3, 2023

A datetime condition should include the following checks:

"before" | "after" | "beforeOrAt" | "afterOrAt" | "equals" | "notEquals"

between a the given context (datetime) and the condition value.

The SdkService should be updated with a new condtion matcher to evaluate this condition.

@dev-bre dev-bre added the good first issue Good for newcomers label Aug 4, 2023
@shariqmalik10
Copy link

hello. Can you assign this to me ? Still understanding the code but I am interested in contributing here

@dev-bre
Copy link
Contributor Author

dev-bre commented Oct 3, 2023

Sure. Go for it.

@stephenmaina2995
Copy link

Hello. I'm looking forward to contributing to this project.

@rajeshj11
Copy link

@dev-bre Hi. I have set up the project in my local. I am testing it in the local, below input is my flag. I am trying to evaluate it. I am not able to get how to pass context in the body in evaluate api. please guide me with some example snapshots.

{ "success": true, "data": { "name": "testing1", "description": "testing1", "createdOn": "2024-03-06T09:25:36.091Z", "status": true, "updatedOn": "2024-03-06T09:25:49.472Z", "key": "testing1", "rules": [ { "segment": { "name": "Test", "description": "testing", "matching": "all", "conditions": [ { "context": "testing1", "value": "12-02-2022", "conditionType": "datetime", "operator": "beforeOrAt", "key": "condition_fa8da9a7-9baf-40c3-862b-858a97fe5920" }, { "context": "testing2", "value": "test", "conditionType": "string", "operator": "equals", "key": "condition_4dec1293-62e9-49da-a5a0-87717b0b4d98" } ], "createdOn": "2024-03-06T09:23:52.820Z", "updatedOn": "2024-03-06T09:23:52.820Z", "key": "segment_05ee150d-f9c9-4e2b-9bd9-78b7f90627dd" }, "key": "rule_0d9bbc93-a43c-4cd1-817c-a73ddb754c3d" }, { "segment": { "name": "test2", "description": "", "matching": "all", "conditions": [ { "context": "test1", "conditionType": "boolean", "operator": "true", "key": "condition_188f4644-3863-4f90-8583-47824c1f947c" }, { "context": "test2", "value": "14-01-2001", "conditionType": "datetime", "operator": "afterOrAt", "key": "condition_87cd2521-4896-4623-b65d-c88494ab2839" } ], "createdOn": "2024-03-06T09:24:59.470Z", "updatedOn": "2024-03-06T09:24:59.470Z", "key": "segment_218d627d-26cc-49cf-93e2-16bcabbf878f" }, "key": "rule_ca3e3e6e-b1b7-43f2-981d-b79c1fe8d7bb" } ], "_id": "mrcMvuyoUrbSFyLB" } }

API I am hitting this API
curl --location 'http://localhost:4000/api/sdk/flags/testing1/evaluate' \ --header 'Accept: */*' \ --header 'Accept-Language: en-US,en;q=0.9' \ --header 'Connection: keep-alive' \ --header 'Content-Type: application/json' \ --header 'sf-api-key: sk_97c9a247-bd44-450c-85cc-61637108a866' \ --header 'Cookie: connect.sid=s%3A4NcJZVGEiV436H9PA5Bho4Zg1PsD_0wM.BQcnwuDX9GtLkxxQ32SMO1S0%2FY4nCeKpOIFOsMRL190' \ --data '{ "context": { "value": "something" } }'

@rajeshj11
Copy link

@dev-bre please review
#94

@Gopigunaganti
Copy link

Hello will you please assign it to me i wanna interested in contributing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Development

No branches or pull requests

5 participants