added 260907 version of worker toolkit

This commit is contained in:
2026-09-08 20:30:51 -04:00
parent cbd3f0f8ca
commit 97aca37663
1283 changed files with 142951 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
import Ember from 'ember';
import DS from 'ember-data';
const {
set,
get,
computed,
computed: { not },
} = Ember;
export default DS.Model.extend({
// Attributes
screenName: DS.attr('string'),
birthDate: DS.attr('birthdate'),
dayWalkingHours: DS.attr('number'),
ethnicityIds: DS.attr(),
pressureUnits: DS.attr('string'),
onboardingStepId: DS.attr('string'),
temperatureUnits: DS.attr('string'),
betaTester: DS.attr('boolean'),
notify: DS.attr('boolean'),
checkinReminder: DS.attr('boolean'),
checkinReminderAt: DS.attr('raw'),
timeZoneName: DS.attr('time_zone_name'),
notifyTopPosts: DS.attr('boolean'),
onboardingReminder: DS.attr('boolean', { defaultValue: false }),
// Associations
country: DS.belongsTo('country'),
sex: DS.belongsTo('sex'),
educationLevel: DS.belongsTo('educationLevel'),
dayHabit: DS.belongsTo('dayHabit'),
ethnicities: DS.hasMany('ethnicities'),
onboardingStep: computed('onboardingStepId', {
get() {
let stepId = get(this, 'onboardingStepId') || 'onboarding-personal';
return get(this, `stepsService.steps.${stepId}`);
},
set(_, step) {
set(this, 'onboardingStepId', step.id);
return step.id;
},
}),
// Properties
isOnboarded: not('onboardingStep.nextId'),
// Functions
syncEthnicityIds: Ember.observer('ethnicities', function() {
this.get('ethnicities').then( ethnicities => {
this.set('ethnicityIds', ethnicities.mapBy('id'));
});
})
});