Organization.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. /**
  7. * AP2i Model : Freemium / Organization
  8. *
  9. * */
  10. @IdLess()
  11. export default class Organization extends ApiModel {
  12. static entity = 'freemium/organization'
  13. @Uid()
  14. declare id: number | string | null
  15. @Str(null)
  16. @Assert({ nullable: false, max: 128 })
  17. declare name: string | null
  18. @Str(null)
  19. declare description: string | null
  20. @Str(null)
  21. @Assert({ nullable: false, type: 'email' })
  22. declare email: string | null
  23. @Str(null)
  24. declare tel: string | null
  25. @Str(null)
  26. declare streetAddress: string | null
  27. @Str(null)
  28. declare streetAddressSecond: string | null
  29. @Str(null)
  30. declare streetAddressThird: string | null
  31. @Str(null)
  32. declare postalCode: string | null
  33. @Str(null)
  34. declare addressCity: string | null
  35. @IriEncoded(Country)
  36. @Attr(null)
  37. declare addressCountry: number
  38. @Num(null)
  39. declare latitude: number | null
  40. @Num(null)
  41. declare longitude: number | null
  42. @Str(null)
  43. @Assert({ max: 255, type: 'url' })
  44. declare facebook: string
  45. @Str(null)
  46. @Assert({ max: 255, type: 'url' })
  47. declare twitter: string
  48. @Str(null)
  49. @Assert({ max: 255, type: 'url' })
  50. declare youtube: string
  51. @Str(null)
  52. @Assert({ max: 255, type: 'url' })
  53. declare instagram: string
  54. @Bool(true)
  55. declare portailVisibility: boolean
  56. @Attr(null)
  57. @IriEncoded(File)
  58. declare logo: number | null
  59. }