social-experiments / TakmilAzureFunction-Prod

Production Code for takmil azure function
0 stars 0 forks source link

Add feature: train face/register student #11

Open swatopar opened 4 years ago

swatopar commented 4 years ago

prerequisite: Make StudentJsonModel

Create an Azure function that is triggered by writing to the takmil registration container. Use the existing azure function as starter code for writing an Azure function and implement the below pseudocode

[func("registerStudent")] Register(StudentModel model) { personGroup = NewOrExistingPersonGroup(model.school); personGroupPerson = NewPerson(model.school, model.id); foreach (photo in data.registration_photos) { add(dat.school, dat.person, photos); } var res = trainasync(dat.school); // make repository calls to add to db await res; while (await trainingStatus != complete) { await Task.Delay(1000); } // await any repository calls

}

Timeline

Week 6