Organization.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { Str, Uid } from 'pinia-orm/dist/decorators'
  2. import ApiModel from '~/models/ApiModel'
  3. import {Assert, IdLess, IriEncoded} from '~/models/decorators'
  4. import {Attr, Bool, Num} from "pinia-orm/decorators";
  5. import Country from "~/models/Core/Country";
  6. import File from "~/models/Core/File";
  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(null)
  20. declare description: string | null
  21. @Str(null)
  22. @Assert({'nullable': false, 'type' : 'email'})
  23. declare email: string | null
  24. @Str(null)
  25. declare tel: string | null
  26. @Str(null)
  27. declare streetAddress: string | null
  28. @Str(null)
  29. declare streetAddressSecond: string | null
  30. @Str(null)
  31. declare streetAddressThird: string | null
  32. @Str(null)
  33. declare postalCode: string | null
  34. @Str(null)
  35. declare addressCity: string | null
  36. @IriEncoded(Country)
  37. @Attr(null)
  38. declare addressCountry: number
  39. @Num(null)
  40. declare latitude: number | null
  41. @Num(null)
  42. declare longitude: number | null
  43. @Str(null)
  44. @Assert({'max':255})
  45. declare facebook: string
  46. @Str(null)
  47. @Assert({'max':255})
  48. declare twitter: string
  49. @Str(null)
  50. @Assert({'max':255})
  51. declare youtube: string
  52. @Str(null)
  53. @Assert({'max':255})
  54. declare instagram: string
  55. @Bool(true)
  56. declare portailVisibility: boolean
  57. @Attr(null)
  58. @IriEncoded(File)
  59. declare logo: number | null
  60. }