interfaces.d.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 Normalizer {
  54. normalize(args: DataPersisterArgs): any
  55. }
  56. interface Denormalizer {
  57. denormalize(data: any): any
  58. }
  59. interface Historical {
  60. future: boolean
  61. past: boolean
  62. present: boolean
  63. dateStart?: string | null
  64. dateEnd?: string | null
  65. }
  66. interface BaseAccessProfile {
  67. id: number | null
  68. name: string | null
  69. givenName: string | null
  70. gender: GENDER | null
  71. avatarId: number | null
  72. }
  73. interface BaseOrganizationProfile {
  74. id: number | null
  75. name: string | null
  76. website?: string | null
  77. }
  78. interface OrignalAccessProfile extends BaseAccessProfile {
  79. isSuperAdminAccess: boolean
  80. organization: BaseOrganizationProfile
  81. }
  82. interface AccessProfile extends BaseAccessProfile {
  83. bearer: string | null
  84. switchId: number | null
  85. activityYear: number | null
  86. historical: Historical | Array<string>
  87. roles: Array<string>
  88. abilities: Array<AbilitiesType>
  89. isAdminAccess: boolean | null
  90. isSuperAdminAccess: boolean | null
  91. isAdmin: boolean | null
  92. isAdministratifManager: boolean | null
  93. isPedagogicManager: boolean | null
  94. isFinancialManager: boolean | null
  95. isCaMember: boolean | null
  96. isStudent: boolean | null
  97. isTeacher: boolean | null
  98. isMember: boolean | null
  99. isOther: boolean | null
  100. isGuardian: boolean | null
  101. isPayer: boolean | null
  102. multiAccesses: Array<BaseOrganizationProfile>
  103. familyAccesses: Array<BaseAccessProfile>
  104. originalAccess: OrignalAccessProfile | null
  105. }
  106. interface organizationState extends BaseOrganizationProfile {
  107. id: number | null
  108. parametersId: number | null
  109. name: string | null
  110. product?: string | null
  111. currentActivityYear?: number | null
  112. modules?: Array<string>
  113. hasChildren?: boolean | null
  114. showAdherentList?: boolean | null
  115. legalStatus?: string | null
  116. networks: Array<string>
  117. parents: Array<BaseOrganizationProfile>
  118. }
  119. interface DolibarrContractLine {
  120. id: number
  121. contractId: number
  122. dateStart: Date
  123. dateEnd: Date
  124. serviceRef: string
  125. serviceLabel: string
  126. }
  127. interface DolibarrContract {
  128. ref: string
  129. socId: number
  130. lines: Array<DolibarrContractLine>
  131. }
  132. interface DolibarrBill {
  133. id: number
  134. ref: string
  135. socId: number
  136. date: Date
  137. taxExcludedAmount: number
  138. taxIncludedAmount: number
  139. paid: boolean
  140. }
  141. interface DolibarrAccount {
  142. organizationId: number
  143. socId: number
  144. clientNumber: string
  145. product:
  146. | 'PRODUCT_ARTIST'
  147. | 'PRODUCT_ARTIST_PREMIUM'
  148. | 'PRODUCT_SCHOOL'
  149. | 'PRODUCT_SCHOOL_PREMIUM'
  150. | 'PRODUCT_MANAGER'
  151. contract: DolibarrContract
  152. bills: Array<DolibarrBill>
  153. }
  154. interface MobytUserStatus {
  155. organizationId: number
  156. active: boolean
  157. amount: number
  158. money: number
  159. }
  160. interface MercureEntityUpdate {
  161. iri: string
  162. operation: 'create' | 'delete' | 'update'
  163. data: any
  164. }
  165. interface SseState {
  166. connected: boolean
  167. events: Array<MercureEntityUpdate>
  168. }
  169. interface LayoutState {
  170. menus: Record<string, MenuGroup | MenuItem>
  171. menusOpened: Record<string, boolean>
  172. }