feat(api): add support for datetime conditions match
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.
hello. Can you assign this to me ? Still understanding the code but I am interested in contributing here
Sure. Go for it.
Hello. I'm looking forward to contributing to this project.
@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" } }'
@dev-bre please review https://github.com/switchfeat-com/switchfeat/pull/94
Hello will you please assign it to me i wanna interested in contributing this