interfaces.d.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. import { Store } from 'pinia'
  2. import {AnyJson} from "~/types/enum/data";
  3. import {
  4. ABILITIES,
  5. GENDER,
  6. TYPE_ALERT,
  7. } from '~/types/enum/enums'
  8. import {Ref} from "@vue/reactivity";
  9. import {MenuGroup, MenuItem} from "~/types/layout";
  10. declare module '@vuex-orm/core' {
  11. interface Query {
  12. getAllRelations: () => Array<string>
  13. }
  14. }
  15. interface AbilitiesType {
  16. action: ABILITIES
  17. subject: string
  18. /** an array of fields to which user has (or not) access */
  19. fields?: string[]
  20. /** an object of conditions which restricts the rule scope */
  21. conditions?: any
  22. /** indicates whether rule allows or forbids something */
  23. inverted?: boolean
  24. /** message which explains why rule is forbidden */
  25. reason?: string
  26. }
  27. interface Alert {
  28. type: TYPE_ALERT
  29. messages: Array<string>
  30. }
  31. type AnyStore = Store<any>
  32. interface EnumChoice {
  33. value: string
  34. label: string
  35. }
  36. interface Filter {
  37. readonly key: string
  38. readonly value: string | boolean | number
  39. }
  40. type EnumChoices = Array<EnumChoice>
  41. interface HookProvider {
  42. invoke(args: DataProviderArgs): Promise<any>
  43. }
  44. interface HookPersister {
  45. invoke(args: DataPersisterArgs): Promise<any>
  46. }
  47. interface HookDeleter {
  48. invoke(args: DataDeleterArgs): Promise<any>
  49. }
  50. interface Processor {
  51. process(data: AnyJson): Promise<any>
  52. }
  53. interface Encoder {
  54. encode(data: AnyJson): string
  55. decode(input: string): AnyJson
  56. }
  57. interface Historical {
  58. future: boolean
  59. past: boolean
  60. present: boolean
  61. dateStart?: string | null
  62. dateEnd?: string | null
  63. }
  64. interface BaseAccessProfile {
  65. id: number | null
  66. name: string | null
  67. givenName: string | null
  68. gender: GENDER | null
  69. avatarId: number | null
  70. }
  71. interface BaseOrganizationProfile {
  72. id: number | null
  73. name: string | null
  74. website?: string | null
  75. }
  76. interface OrignalAccessProfile extends BaseAccessProfile {
  77. isSuperAdminAccess: boolean
  78. organization: BaseOrganizationProfile
  79. }
  80. interface AccessProfile extends BaseAccessProfile {
  81. bearer: string | null
  82. switchId: number | null
  83. activityYear: number | null
  84. historical: Historical | Array<string>
  85. roles: Array<string>
  86. abilities: Array<AbilitiesType>
  87. isAdminAccess: boolean | null
  88. isSuperAdminAccess: boolean | null
  89. isAdmin: boolean | null
  90. isAdministratifManager: boolean | null
  91. isPedagogicManager: boolean | null
  92. isFinancialManager: boolean | null
  93. isCaMember: boolean | null
  94. isStudent: boolean | null
  95. isTeacher: boolean | null
  96. isMember: boolean | null
  97. isOther: boolean | null
  98. isGuardian: boolean | null
  99. isPayer: boolean | null
  100. multiAccesses: Array<BaseOrganizationProfile>
  101. familyAccesses: Array<BaseAccessProfile>
  102. originalAccess: OrignalAccessProfile | null
  103. }
  104. interface organizationState extends BaseOrganizationProfile {
  105. id: number | null
  106. parametersId: number | null
  107. name: string | null
  108. product?: string | null
  109. currentActivityYear?: number | null
  110. modules?: Array<string>
  111. hasChildren?: boolean | null
  112. showAdherentList?: boolean | null
  113. legalStatus?: string | null
  114. networks: Array<string>
  115. parents: Array<BaseOrganizationProfile>
  116. }
  117. interface DolibarrContractLine {
  118. id: number
  119. contractId: number
  120. dateStart: Date
  121. dateEnd: Date
  122. serviceRef: string
  123. serviceLabel: string
  124. }
  125. interface DolibarrContract {
  126. ref: string
  127. socId: number
  128. lines: Array<DolibarrContractLine>
  129. }
  130. interface DolibarrBill {
  131. id: number
  132. ref: string
  133. socId: number
  134. date: Date
  135. taxExcludedAmount: number
  136. taxIncludedAmount: number
  137. paid: boolean
  138. }
  139. interface DolibarrAccount {
  140. organizationId: number
  141. socId: number
  142. clientNumber: string
  143. product:
  144. | 'PRODUCT_ARTIST'
  145. | 'PRODUCT_ARTIST_PREMIUM'
  146. | 'PRODUCT_SCHOOL'
  147. | 'PRODUCT_SCHOOL_PREMIUM'
  148. | 'PRODUCT_MANAGER'
  149. contract: DolibarrContract
  150. bills: Array<DolibarrBill>
  151. }
  152. interface MobytUserStatus {
  153. organizationId: number
  154. active: boolean
  155. amount: number
  156. money: number
  157. }
  158. interface MercureEntityUpdate {
  159. iri: string
  160. operation: 'create' | 'delete' | 'update'
  161. data: any
  162. }
  163. interface SseState {
  164. connected: boolean
  165. events: Array<MercureEntityUpdate>
  166. }
  167. interface LayoutState {
  168. menus: Record<string, MenuGroup | MenuItem>
  169. menusOpened: Record<string, boolean>
  170. }