Event.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import { Str, Uid, Attr, Num } from 'pinia-orm/dist/decorators'
  2. import ApiModel from '~/models/ApiModel'
  3. import { Assert, IriEncoded } from '~/models/decorators'
  4. import File from '~/models/Core/File'
  5. import Place from '~/models/Place/Place'
  6. import Country from '~/models/Core/Country'
  7. import Category from '~/models/Core/Category'
  8. import EventGender from '~/models/Booking/EventGender'
  9. /**
  10. * AP2i Model : Freemium / Event
  11. *
  12. * */
  13. export default class Event extends ApiModel {
  14. static entity = 'freemium/events'
  15. @Uid()
  16. declare id: number | string | null
  17. @Str(null)
  18. @Assert({ nullable: false, max: 255 })
  19. declare name: string | null
  20. @Str(null)
  21. @Assert({ nullable: false })
  22. declare datetimeStart: string
  23. @Str(null)
  24. @Assert({ nullable: false })
  25. declare datetimeEnd: string
  26. @Str(null)
  27. declare description: string
  28. @Attr(null)
  29. @IriEncoded(File)
  30. declare image: number | null
  31. @Str(null)
  32. @Assert({ max: 255, type: 'url' })
  33. declare url: string
  34. @Str(null)
  35. @Assert({ max: 255, type: 'url' })
  36. declare urlTicket: string
  37. @Attr(null)
  38. @IriEncoded(Place)
  39. declare place: number | null
  40. @Str(null)
  41. declare placeName: string | null
  42. @Str(null)
  43. declare streetAddress: string | null
  44. @Str(null)
  45. declare streetAddressSecond: string | null
  46. @Str(null)
  47. declare streetAddressThird: string | null
  48. @Str(null)
  49. declare postalCode: string | null
  50. @Str(null)
  51. declare addressCity: string | null
  52. @IriEncoded(Country)
  53. @Attr(null)
  54. declare addressCountry: number | null
  55. @Num(null)
  56. declare latitude: number | null
  57. @Num(null)
  58. declare longitude: number | null
  59. @Str('FREE')
  60. declare pricing: string | null
  61. @Num(null)
  62. @Assert({ nullable: true, positive: 'positive' })
  63. declare priceMini: number | null
  64. @Num(null)
  65. @Assert({ nullable: true, positive: 'positive' })
  66. declare priceMaxi: number | null
  67. @Attr(() => [])
  68. @IriEncoded(Category)
  69. declare categories: Array<string> | null
  70. @Attr(null)
  71. @IriEncoded(EventGender)
  72. @Assert({ nullable: false })
  73. declare gender: number | null
  74. }