Plan stuff. Log stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.3 KiB

4 years ago
  1. /**
  2. * Data about an activity.
  3. */
  4. export default class Activity {
  5. /** ID of the activity, ignored on input */
  6. public id : string;
  7. /** The user ID the activity is associated with. */
  8. public userId : string;
  9. /** A name for the activity */
  10. public name : string;
  11. /** Icon to use for it */
  12. public icon : string;
  13. /** Bonus awarded once daily. This is to reward consistency. */
  14. public dailyBonus : number;
  15. /** Sub activities */
  16. public subActivites : SubActivtiy[];
  17. }
  18. /**
  19. * An activity udpate for activities
  20. */
  21. export class ActivityUpdate {
  22. /** Add a sub activity */
  23. addSub? : SubActivtiy;
  24. /** Replace a sub activity */
  25. editSub? : SubActivtiy;
  26. /** Remove a sub activity by ID */
  27. removeSub? : string;
  28. /** Set activity name */
  29. setName? : string;
  30. /** Set activity icon */
  31. setIcon? : string;
  32. }
  33. /**
  34. * Sub-Activity of an activity. While an activity can be as general as "3D modeling", this
  35. * is where the specific activiteis under that umbrella is. Practice, tutorial, or whatever fits
  36. * the parent activity.
  37. */
  38. export class SubActivtiy {
  39. /** ID of the sub-activtiy, ignored on input */
  40. public id : string;
  41. /** Sub-activity name */
  42. public name : string;
  43. /** Measured unit, always plural (e.g. minutes) */
  44. public unitName : string;
  45. /** Points awarded per unit. */
  46. public value : number;
  47. }