Fix request professional flow for new users
- Add Profesional.empty() factory for users with no professional record - initState: catch error from getProfessional and show empty form instead of infinite spinner - Backend upsert: create professional record if none exists (no longer throws 404) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
f1dc2cb75d
commit
eb63a3e415
@@ -46,6 +46,28 @@ class Profesional {
|
||||
required this.paymentMethods,
|
||||
});
|
||||
|
||||
static Profesional empty() => Profesional(
|
||||
id: '',
|
||||
identification: '',
|
||||
rethusCode: '',
|
||||
rethusValidated: false,
|
||||
address: '',
|
||||
aditionalAddress: '',
|
||||
profession: '',
|
||||
ratePreferences: false,
|
||||
rate: '',
|
||||
locationPreferences: LocationPreferences.office,
|
||||
bannerPicture: '',
|
||||
identificationPicture: '',
|
||||
certificatePicture: '',
|
||||
latitude: 0.0,
|
||||
longitude: 0.0,
|
||||
specializations: [],
|
||||
specializationsPictures: [],
|
||||
schedules: Schedules.empty,
|
||||
paymentMethods: PaymentMethodEntity.empty,
|
||||
);
|
||||
|
||||
static Profesional fromDocument(Map<String, dynamic> doc) {
|
||||
// Backend returns schedules as array [{day_of_week, enabled, ...}]; convert to Schedules
|
||||
Schedules parsedSchedules = Schedules.empty;
|
||||
|
||||
Reference in New Issue
Block a user