|
|
@@ -2,6 +2,7 @@ import { BaseOrganizationProfile } from '~/types/interfaces'
|
|
|
import { defineStore } from "pinia";
|
|
|
import {computed, Ref} from "@vue/reactivity";
|
|
|
import * as _ from 'lodash-es'
|
|
|
+import {LEGAL_STATUS, NETWORK, ORGANIZATION_ID, PRODUCT} from '~/types/enum/enums';
|
|
|
|
|
|
export const useOrganizationProfileStore = defineStore('organizationProfile', () => {
|
|
|
|
|
|
@@ -19,8 +20,6 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
const website: Ref<string | null> = ref(null)
|
|
|
const parents: Ref<Array<BaseOrganizationProfile>> = ref([])
|
|
|
|
|
|
- const runtimeConfig = useRuntimeConfig()
|
|
|
-
|
|
|
// Getters
|
|
|
/**
|
|
|
* L'organization fait-elle partie du réseau CMF ?
|
|
|
@@ -29,7 +28,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
*/
|
|
|
const isCmf = computed( (): boolean => {
|
|
|
return networks.value && networks.value.filter((network: string) => {
|
|
|
- return network === runtimeConfig.cmf_network
|
|
|
+ return network === NETWORK.CMF
|
|
|
}).length > 0
|
|
|
})
|
|
|
|
|
|
@@ -40,7 +39,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
*/
|
|
|
const isFfec = computed( (): boolean => {
|
|
|
return networks.value && networks.value.filter((network: string) => {
|
|
|
- return network === runtimeConfig.ffec_network
|
|
|
+ return network === NETWORK.FFEC
|
|
|
}).length > 0
|
|
|
})
|
|
|
|
|
|
@@ -58,7 +57,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
* @return {boolean}
|
|
|
*/
|
|
|
const isArtistProduct = computed( (): boolean => {
|
|
|
- return product.value === runtimeConfig.artist_product
|
|
|
+ return product.value === PRODUCT.ARTIST
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -66,7 +65,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
* @return {boolean}
|
|
|
*/
|
|
|
const isArtistPremiumProduct = computed( (): boolean => {
|
|
|
- return product.value === runtimeConfig.artist_premium_product
|
|
|
+ return product.value === PRODUCT.ARTIST_PREMIUM
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -83,7 +82,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
* @return {boolean}
|
|
|
*/
|
|
|
const isSchoolProduct = computed( (): boolean => {
|
|
|
- return product.value === runtimeConfig.school_product
|
|
|
+ return product.value === PRODUCT.SCHOOL
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -92,7 +91,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
* @return {boolean}
|
|
|
*/
|
|
|
const isSchoolPremiumProduct = computed( (): boolean => {
|
|
|
- return product.value === runtimeConfig.school_premium_product
|
|
|
+ return product.value === PRODUCT.SCHOOL_PREMIUM
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -104,11 +103,11 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
- * L'organization possède t'elle un produit manager
|
|
|
+ * L'organization possède-t-elle un produit manager
|
|
|
* @return {boolean}
|
|
|
*/
|
|
|
const isManagerProduct = computed( (): boolean => {
|
|
|
- return product.value === runtimeConfig.manager_product
|
|
|
+ return product.value === PRODUCT.MANAGER
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -124,7 +123,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
* @return {boolean|null}
|
|
|
*/
|
|
|
const isAssociation = computed(():any => {
|
|
|
- return legalStatus.value === 'ASSOCIATION_LAW_1901';
|
|
|
+ return legalStatus.value === LEGAL_STATUS.ASSOCIATION_LAW_1901;
|
|
|
})
|
|
|
|
|
|
/**
|
|
|
@@ -133,9 +132,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
* @return {boolean}
|
|
|
*/
|
|
|
const isCMFCentralService = computed((): boolean => {
|
|
|
- if(runtimeConfig.CMF_ID)
|
|
|
- return id.value === parseInt(runtimeConfig.CMF_ID)
|
|
|
- return false
|
|
|
+ return id.value === ORGANIZATION_ID.CMF
|
|
|
})
|
|
|
|
|
|
const getWebsite = computed((): string | null => {
|
|
|
@@ -200,6 +197,7 @@ export const useOrganizationProfileStore = defineStore('organizationProfile', ()
|
|
|
website,
|
|
|
parents,
|
|
|
isCmf,
|
|
|
+ isCMFCentralService,
|
|
|
isFfec,
|
|
|
isInsideNetwork,
|
|
|
isArtistProduct,
|