Organization.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { Str, Uid, Attr, Bool, Num } from 'pinia-orm/dist/decorators'
  2. import ApiModel from '~/models/ApiModel'
  3. import { Assert, IdLess, IriEncoded } from '~/models/decorators'
  4. import Country from '~/models/Core/Country'
  5. import File from '~/models/Core/File'
  6. import TypeOfPractice from '~/models/Organization/TypeOfPractice'
  7. /**
  8. * AP2i Model : Freemium / Organization
  9. *
  10. * */
  11. @IdLess()
  12. export default class Organization extends ApiModel {
  13. static entity = 'freemium/organization'
  14. @Uid()
  15. declare id: number | string | null
  16. @Str(null)
  17. @Assert({ nullable: false, max: 128 })
  18. declare name: string | null
  19. @Str('ARTISTIC_PRACTICE_ONLY')
  20. @Assert({ nullable: false })
  21. declare principalType: string | null
  22. @Str('ASSOCIATION_LAW_1901')
  23. @Assert({ nullable: false })
  24. declare legalStatus: string | null
  25. @Str(null)
  26. declare description: string | null
  27. @Str(null)
  28. @Assert({ nullable: false, type: 'email' })
  29. declare email: string | null
  30. @Str(null)
  31. declare tel: string | null
  32. @Str(null)
  33. declare streetAddress: string | null
  34. @Str(null)
  35. declare streetAddressSecond: string | null
  36. @Str(null)
  37. declare streetAddressThird: string | null
  38. @Str(null)
  39. declare postalCode: string | null
  40. @Str(null)
  41. declare addressCity: string | null
  42. @IriEncoded(Country)
  43. @Attr(null)
  44. declare addressCountry: number
  45. @Num(null)
  46. declare latitude: number | null
  47. @Num(null)
  48. declare longitude: number | null
  49. @Str(null)
  50. @Assert({ max: 255, type: 'url' })
  51. declare facebook: string
  52. @Str(null)
  53. @Assert({ max: 255, type: 'url' })
  54. declare twitter: string
  55. @Str(null)
  56. @Assert({ max: 255, type: 'url' })
  57. declare youtube: string
  58. @Str(null)
  59. @Assert({ max: 255, type: 'url' })
  60. declare instagram: string
  61. @Bool(true)
  62. declare portailVisibility: boolean
  63. @Attr(null)
  64. @IriEncoded(File)
  65. declare logo: number | null
  66. @Attr(() => [])
  67. @IriEncoded(TypeOfPractice)
  68. declare typeOfPractices: Array<string> | null
  69. }