fix: added new model classes for the onboard status and url

This commit is contained in:
Damien Ostler 2024-02-14 20:30:26 -05:00
parent a2d6c3fa3b
commit ccde0d3fa7
3 changed files with 18 additions and 3 deletions

View File

@ -231,7 +231,7 @@ public class SellerProfileController : Controller
existingSellerProfile = _dbContext.UserSellerProfiles.Update(existingSellerProfile).Entity;
await _dbContext.SaveChangesAsync();
var result = _paymentService.CreateSellerAccountOnboardingUrl(accountId);
return Ok(new { onboardUrl = result });
return Ok(new SellerOnboardUrlModel(){ OnboardUrl= result });
}
[HttpGet]
@ -259,7 +259,7 @@ public class SellerProfileController : Controller
existingSellerProfile = _dbContext.UserSellerProfiles.Update(existingSellerProfile).Entity;
await _dbContext.SaveChangesAsync();
var result = _paymentService.SellerAccountIsOnboarded(accountId);
return Ok(new { onboarded=result });
return Ok(new SellerOnboardStatusModel(){ Onboarded= result });
}
[HttpGet]
@ -282,7 +282,10 @@ public class SellerProfileController : Controller
return BadRequest();
var result = _paymentService.CreateSellerAccountOnboardingUrl(existingSellerProfile.StripeAccountId);
return Ok(new { onboardUrl = result });
return Ok(new SellerOnboardUrlModel()
{
OnboardUrl = result
});
}
}

View File

@ -0,0 +1,6 @@
namespace comissions.app.api.Models.SellerProfile;
public class SellerOnboardStatusModel
{
public bool Onboarded { get; set; }
}

View File

@ -0,0 +1,6 @@
namespace comissions.app.api.Models.SellerProfile;
public class SellerOnboardUrlModel
{
public string OnboardUrl { get; set; }
}