|
|
@@ -1,57 +1,65 @@
|
|
|
import { Model, Query } from 'pinia-orm'
|
|
|
import { Ability } from '@casl/ability'
|
|
|
import { Store } from 'pinia'
|
|
|
-import { Context } from '@nuxt/types/app'
|
|
|
import DataPersister from '~/services/data/dataPersister'
|
|
|
import DataProvider from '~/services/data/dataProvider'
|
|
|
import DataDeleter from '~/services/data/dataDeleter'
|
|
|
-import {ABILITIES, FORM_STATUS, GENDER, METADATA_TYPE, QUERY_TYPE, SUBMIT_TYPE, TYPE_ALERT} from '~/types/enums'
|
|
|
+import {
|
|
|
+ ABILITIES,
|
|
|
+ FORM_STATUS,
|
|
|
+ GENDER,
|
|
|
+ METADATA_TYPE,
|
|
|
+ QUERY_TYPE,
|
|
|
+ TYPE_ALERT,
|
|
|
+} from '~/types/enums'
|
|
|
|
|
|
/**
|
|
|
* Upgrade du @nuxt/types pour TypeScript
|
|
|
*/
|
|
|
declare module '@nuxt/types' {
|
|
|
interface Context {
|
|
|
- $ability: Ability,
|
|
|
- $dataPersister: DataPersister,
|
|
|
- $dataProvider: DataProvider,
|
|
|
- $dataDeleter: DataDeleter,
|
|
|
+ $ability: Ability
|
|
|
+ $dataPersister: DataPersister
|
|
|
+ $dataProvider: DataProvider
|
|
|
+ $dataDeleter: DataDeleter
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module '@vuex-orm/core' {
|
|
|
- interface Query{
|
|
|
+ interface Query {
|
|
|
getAllRelations: () => Array<string>
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-interface IconItem{
|
|
|
- name?: string,
|
|
|
- avatarId?:number|null,
|
|
|
- avatarByDefault?:string,
|
|
|
+interface IconItem {
|
|
|
+ name?: string
|
|
|
+ avatarId?: number | null
|
|
|
+ avatarByDefault?: string
|
|
|
}
|
|
|
|
|
|
interface ItemMenu {
|
|
|
- title: string,
|
|
|
- icon?: IconItem,
|
|
|
- avatar?: number,
|
|
|
- to?: string,
|
|
|
- children?: ItemsMenu,
|
|
|
- isExternalLink?: boolean,
|
|
|
- actions?: ItemsMenu,
|
|
|
+ title: string
|
|
|
+ icon?: IconItem
|
|
|
+ avatar?: number
|
|
|
+ to?: string
|
|
|
+ // eslint-disable-next-line no-use-before-define
|
|
|
+ children?: ItemsMenu
|
|
|
+ isExternalLink?: boolean
|
|
|
+ // eslint-disable-next-line no-use-before-define
|
|
|
+ actions?: ItemsMenu
|
|
|
}
|
|
|
|
|
|
-interface ItemsMenu extends Array<ItemMenu> {}
|
|
|
+type ItemsMenu = Array<ItemMenu>
|
|
|
|
|
|
interface Menu {
|
|
|
- getMenu : () => ItemMenu | null,
|
|
|
- getHeaderMenu : () => ItemMenu | null,
|
|
|
+ getMenu: () => ItemMenu | null
|
|
|
+ getHeaderMenu: () => ItemMenu | null
|
|
|
}
|
|
|
|
|
|
interface AbilitiesType {
|
|
|
- action: ABILITIES,
|
|
|
+ action: ABILITIES
|
|
|
|
|
|
- subject: string,
|
|
|
+ subject: string
|
|
|
/** an array of fields to which user has (or not) access */
|
|
|
fields?: string[]
|
|
|
/** an object of conditions which restricts the rule scope */
|
|
|
@@ -63,119 +71,119 @@ interface AbilitiesType {
|
|
|
}
|
|
|
|
|
|
interface formState {
|
|
|
- violations: Array<string>,
|
|
|
- readonly: boolean,
|
|
|
- formStatus: FORM_STATUS,
|
|
|
- dirty: boolean,
|
|
|
- showConfirmToLeave: boolean,
|
|
|
- goAfterLeave: string|null
|
|
|
+ violations: Array<string>
|
|
|
+ readonly: boolean
|
|
|
+ formStatus: FORM_STATUS
|
|
|
+ dirty: boolean
|
|
|
+ showConfirmToLeave: boolean
|
|
|
+ goAfterLeave: string | null
|
|
|
}
|
|
|
|
|
|
interface Alert {
|
|
|
- type: TYPE_ALERT,
|
|
|
+ type: TYPE_ALERT
|
|
|
messages: Array<string>
|
|
|
}
|
|
|
|
|
|
interface pageState {
|
|
|
- alerts: Array<Alert>,
|
|
|
+ alerts: Array<Alert>
|
|
|
}
|
|
|
|
|
|
interface Historical {
|
|
|
- future?: boolean,
|
|
|
- past?: boolean,
|
|
|
- present?: boolean,
|
|
|
- dateStart?: string,
|
|
|
+ future?: boolean
|
|
|
+ past?: boolean
|
|
|
+ present?: boolean
|
|
|
+ dateStart?: string
|
|
|
dateEnd?: string
|
|
|
}
|
|
|
|
|
|
-interface baseAccessState{
|
|
|
- id: number|null,
|
|
|
- name: string|null,
|
|
|
- givenName: string|null,
|
|
|
- gender: GENDER|null,
|
|
|
- avatarId: number|null
|
|
|
+interface baseAccessState {
|
|
|
+ id: number | null
|
|
|
+ name: string | null
|
|
|
+ givenName: string | null
|
|
|
+ gender: GENDER | null
|
|
|
+ avatarId: number | null
|
|
|
+}
|
|
|
+
|
|
|
+interface baseOrganizationState {
|
|
|
+ id: number | null
|
|
|
+ name: string | null
|
|
|
+ website?: string | null
|
|
|
}
|
|
|
|
|
|
interface OrignalAccessState extends baseAccessState {
|
|
|
- isSuperAdminAccess: boolean,
|
|
|
+ isSuperAdminAccess: boolean
|
|
|
organization: baseOrganizationState
|
|
|
}
|
|
|
|
|
|
interface accessState extends baseAccessState {
|
|
|
- bearer: string|null,
|
|
|
- switchId: number|null
|
|
|
- activityYear: number|null
|
|
|
- historical: Historical|Array<String>
|
|
|
+ bearer: string | null
|
|
|
+ switchId: number | null
|
|
|
+ activityYear: number | null
|
|
|
+ historical: Historical | Array<string>
|
|
|
roles: Array<string>
|
|
|
abilities: Array<AbilitiesType>
|
|
|
- isAdminAccess: boolean|null
|
|
|
- isSuperAdminAccess: boolean|null
|
|
|
- isAdmin: boolean|null
|
|
|
- isAdministratifManager: boolean|null
|
|
|
- isPedagogicManager: boolean|null
|
|
|
- isFinancialManager: boolean|null
|
|
|
- isCaMember: boolean|null
|
|
|
- isStudent: boolean|null
|
|
|
- isTeacher: boolean|null
|
|
|
- isMember: boolean|null
|
|
|
- isOther: boolean|null
|
|
|
- isGuardian: boolean|null
|
|
|
- isPayor: boolean|null
|
|
|
- hasLateralMenu: boolean|null
|
|
|
- hasConfigurationMenu: boolean|null
|
|
|
- hasAccessesMenu: boolean|null
|
|
|
- hasFamilyMenu: boolean|null
|
|
|
+ isAdminAccess: boolean | null
|
|
|
+ isSuperAdminAccess: boolean | null
|
|
|
+ isAdmin: boolean | null
|
|
|
+ isAdministratifManager: boolean | null
|
|
|
+ isPedagogicManager: boolean | null
|
|
|
+ isFinancialManager: boolean | null
|
|
|
+ isCaMember: boolean | null
|
|
|
+ isStudent: boolean | null
|
|
|
+ isTeacher: boolean | null
|
|
|
+ isMember: boolean | null
|
|
|
+ isOther: boolean | null
|
|
|
+ isGuardian: boolean | null
|
|
|
+ isPayor: boolean | null
|
|
|
+ hasLateralMenu: boolean | null
|
|
|
+ hasConfigurationMenu: boolean | null
|
|
|
+ hasAccessesMenu: boolean | null
|
|
|
+ hasFamilyMenu: boolean | null
|
|
|
multiAccesses: Array<baseOrganizationState>
|
|
|
familyAccesses: Array<baseAccessState>
|
|
|
- originalAccess: OrignalAccessState|null
|
|
|
-}
|
|
|
-
|
|
|
-interface baseOrganizationState {
|
|
|
- id: number|null,
|
|
|
- name: string|null,
|
|
|
- website?: string|null
|
|
|
+ originalAccess: OrignalAccessState | null
|
|
|
}
|
|
|
|
|
|
interface organizationState extends baseOrganizationState {
|
|
|
- id: number|null,
|
|
|
- parametersId: number|null,
|
|
|
- name: string|null,
|
|
|
- product?: string|null,
|
|
|
- currentActivityYear?: number|null,
|
|
|
- modules?: Array<string>,
|
|
|
- hasChildren?: boolean|null,
|
|
|
- showAdherentList?: boolean|null,
|
|
|
- legalStatus?: string|null,
|
|
|
- networks: Array<string>,
|
|
|
- parents: Array<baseOrganizationState>,
|
|
|
-}
|
|
|
-
|
|
|
-interface AnyJson extends Record<string, any> {}
|
|
|
-interface AnyStore extends Store<any> {}
|
|
|
+ id: number | null
|
|
|
+ parametersId: number | null
|
|
|
+ name: string | null
|
|
|
+ product?: string | null
|
|
|
+ currentActivityYear?: number | null
|
|
|
+ modules?: Array<string>
|
|
|
+ hasChildren?: boolean | null
|
|
|
+ showAdherentList?: boolean | null
|
|
|
+ legalStatus?: string | null
|
|
|
+ networks: Array<string>
|
|
|
+ parents: Array<baseOrganizationState>
|
|
|
+}
|
|
|
+
|
|
|
+type AnyJson = Record<string, any>
|
|
|
+type AnyStore = Store<any>
|
|
|
|
|
|
interface EnumChoice {
|
|
|
- value: string,
|
|
|
+ value: string
|
|
|
label: string
|
|
|
}
|
|
|
|
|
|
interface UrlArgs {
|
|
|
- readonly type: QUERY_TYPE,
|
|
|
- readonly url?: string,
|
|
|
- readonly baseUrl?: string,
|
|
|
- readonly enumType?: string,
|
|
|
- readonly model?: typeof Model,
|
|
|
- readonly rootModel?: typeof Model,
|
|
|
- readonly id?: any,
|
|
|
- readonly idTemp?: any,
|
|
|
- readonly rootId?: number,
|
|
|
- readonly showProgress?: boolean,
|
|
|
- readonly hook?: string,
|
|
|
+ readonly type: QUERY_TYPE
|
|
|
+ readonly url?: string
|
|
|
+ readonly baseUrl?: string
|
|
|
+ readonly enumType?: string
|
|
|
+ readonly model?: typeof Model
|
|
|
+ readonly rootModel?: typeof Model
|
|
|
+ readonly id?: any
|
|
|
+ readonly idTemp?: any
|
|
|
+ readonly rootId?: number
|
|
|
+ readonly showProgress?: boolean
|
|
|
+ readonly hook?: string
|
|
|
readonly params?: AnyJson
|
|
|
}
|
|
|
|
|
|
interface ImageArgs {
|
|
|
- readonly id: number,
|
|
|
- readonly height: number,
|
|
|
+ readonly id: number
|
|
|
+ readonly height: number
|
|
|
readonly width: number
|
|
|
}
|
|
|
|
|
|
@@ -183,43 +191,43 @@ interface FileArgs {
|
|
|
readonly fileId: number
|
|
|
}
|
|
|
|
|
|
-interface Filter{
|
|
|
- readonly key: string,
|
|
|
- readonly value: string|boolean|number
|
|
|
+interface Filter {
|
|
|
+ readonly key: string
|
|
|
+ readonly value: string | boolean | number
|
|
|
}
|
|
|
|
|
|
interface ListArgs {
|
|
|
- readonly itemsPerPage?: number,
|
|
|
+ readonly itemsPerPage?: number
|
|
|
readonly page?: number
|
|
|
readonly filters?: Array<Filter>
|
|
|
}
|
|
|
|
|
|
interface DataProviderArgs extends UrlArgs {
|
|
|
- imgArgs?: ImageArgs,
|
|
|
- listArgs?: ListArgs,
|
|
|
- fileArgs?: FileArgs,
|
|
|
+ imgArgs?: ImageArgs
|
|
|
+ listArgs?: ListArgs
|
|
|
+ fileArgs?: FileArgs
|
|
|
}
|
|
|
interface DataPersisterArgs extends UrlArgs {
|
|
|
- data?: AnyJson,
|
|
|
- query?: Query,
|
|
|
+ data?: AnyJson
|
|
|
+ query?: Query
|
|
|
file?: string
|
|
|
}
|
|
|
-interface DataDeleterArgs extends UrlArgs {}
|
|
|
+type DataDeleterArgs = UrlArgs
|
|
|
|
|
|
-interface EnumChoices extends Array<EnumChoice> {}
|
|
|
+type EnumChoices = Array<EnumChoice>
|
|
|
|
|
|
interface DataManager {
|
|
|
- invoke(args: UrlArgs): Promise<any>,
|
|
|
+ invoke(args: UrlArgs): Promise<any>
|
|
|
}
|
|
|
|
|
|
interface HookProvider {
|
|
|
- invoke(args: DataProviderArgs): Promise<any>,
|
|
|
+ invoke(args: DataProviderArgs): Promise<any>
|
|
|
}
|
|
|
interface HookPersister {
|
|
|
- invoke(args: DataPersisterArgs): Promise<any>,
|
|
|
+ invoke(args: DataPersisterArgs): Promise<any>
|
|
|
}
|
|
|
interface HookDeleter {
|
|
|
- invoke(args: DataDeleterArgs): Promise<any>,
|
|
|
+ invoke(args: DataDeleterArgs): Promise<any>
|
|
|
}
|
|
|
|
|
|
interface Processor {
|
|
|
@@ -227,75 +235,79 @@ interface Processor {
|
|
|
}
|
|
|
|
|
|
interface Normalizer {
|
|
|
- normalize(args: DataPersisterArgs): any,
|
|
|
+ normalize(args: DataPersisterArgs): any
|
|
|
}
|
|
|
interface Denormalizer {
|
|
|
- denormalize(data: any): any,
|
|
|
+ denormalize(data: any): any
|
|
|
}
|
|
|
|
|
|
interface DolibarrContractLine {
|
|
|
- id: number,
|
|
|
- contractId: number,
|
|
|
- dateStart: Date,
|
|
|
- dateEnd: Date,
|
|
|
- serviceRef: string,
|
|
|
+ id: number
|
|
|
+ contractId: number
|
|
|
+ dateStart: Date
|
|
|
+ dateEnd: Date
|
|
|
+ serviceRef: string
|
|
|
serviceLabel: string
|
|
|
}
|
|
|
|
|
|
interface DolibarrContract {
|
|
|
- ref: string,
|
|
|
- socId: number,
|
|
|
+ ref: string
|
|
|
+ socId: number
|
|
|
lines: Array<DolibarrContractLine>
|
|
|
}
|
|
|
|
|
|
interface DolibarrBill {
|
|
|
- id: number,
|
|
|
- ref: string,
|
|
|
- socId: number,
|
|
|
- date: Date,
|
|
|
- taxExcludedAmount: number,
|
|
|
- taxIncludedAmount: number,
|
|
|
+ id: number
|
|
|
+ ref: string
|
|
|
+ socId: number
|
|
|
+ date: Date
|
|
|
+ taxExcludedAmount: number
|
|
|
+ taxIncludedAmount: number
|
|
|
paid: boolean
|
|
|
}
|
|
|
|
|
|
interface DolibarrAccount {
|
|
|
- organizationId: number,
|
|
|
- socId: number,
|
|
|
- clientNumber: string,
|
|
|
- product: 'PRODUCT_ARTIST' | 'PRODUCT_ARTIST_PREMIUM' | 'PRODUCT_SCHOOL' |
|
|
|
- 'PRODUCT_SCHOOL_PREMIUM' | 'PRODUCT_MANAGER',
|
|
|
- contract: DolibarrContract,
|
|
|
+ organizationId: number
|
|
|
+ socId: number
|
|
|
+ clientNumber: string
|
|
|
+ product:
|
|
|
+ | 'PRODUCT_ARTIST'
|
|
|
+ | 'PRODUCT_ARTIST_PREMIUM'
|
|
|
+ | 'PRODUCT_SCHOOL'
|
|
|
+ | 'PRODUCT_SCHOOL_PREMIUM'
|
|
|
+ | 'PRODUCT_MANAGER'
|
|
|
+ contract: DolibarrContract
|
|
|
bills: Array<DolibarrBill>
|
|
|
}
|
|
|
|
|
|
interface MobytUserStatus {
|
|
|
- organizationId: number,
|
|
|
- active: boolean,
|
|
|
- amount: number,
|
|
|
+ organizationId: number
|
|
|
+ active: boolean
|
|
|
+ amount: number
|
|
|
money: number
|
|
|
}
|
|
|
|
|
|
-interface ApiResponse{
|
|
|
- data: AnyJson,
|
|
|
- metadata: HydraMetadata
|
|
|
-}
|
|
|
-
|
|
|
interface HydraMetadata {
|
|
|
- readonly totalItems?: number,
|
|
|
- firstPage?: number,
|
|
|
- lastPage?: number,
|
|
|
- nextPage?: number,
|
|
|
- previousPage?: number,
|
|
|
+ readonly totalItems?: number
|
|
|
+ firstPage?: number
|
|
|
+ lastPage?: number
|
|
|
+ nextPage?: number
|
|
|
+ previousPage?: number
|
|
|
type?: METADATA_TYPE
|
|
|
}
|
|
|
|
|
|
+interface ApiResponse {
|
|
|
+ data: AnyJson
|
|
|
+ metadata: HydraMetadata
|
|
|
+}
|
|
|
+
|
|
|
interface MercureEntityUpdate {
|
|
|
- iri: string,
|
|
|
- operation: 'create' | 'delete' | 'update',
|
|
|
+ iri: string
|
|
|
+ operation: 'create' | 'delete' | 'update'
|
|
|
data: any
|
|
|
}
|
|
|
|
|
|
interface sseState {
|
|
|
- connected: boolean,
|
|
|
- events: Array<MercureEntityUpdate>,
|
|
|
+ connected: boolean
|
|
|
+ events: Array<MercureEntityUpdate>
|
|
|
}
|