Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • build
  • build-dev
  • build-test
  • dev
  • lint/testing-libraby-plugin
  • master
  • renovate/copy-webpack-plugin-13.x
  • renovate/couchdb-3.x
  • renovate/cozy-client-49.x
  • renovate/cozy-device-helper-3.x
  • renovate/cozy-flags-4.x
  • renovate/cozy-harvest-lib-32.x
  • renovate/cozy-harvest-lib-9.x
  • renovate/cozy-realtime-5.x
  • renovate/cozy-scripts-8.x
  • renovate/devdependencies-(non-major)
  • renovate/eslint-9.x
  • renovate/eslint-config-prettier-10.x
  • renovate/eslint-plugin-testing-library-7.x
  • renovate/major-react-monorepo
  • renovate/major-react-router-monorepo
  • renovate/major-typescript-eslint-monorepo
  • renovate/react-19.x
  • renovate/react-dom-19.x
  • renovate/react-inspector-6.x
  • renovate/sass-loader-16.x
  • 0.1.0
  • 0.1.1
  • 0.1.2
  • 0.1.6
  • 0.1.7
  • 1.0.2
  • 1.0.3
  • 1.0.5
  • 1.0.6
  • 1.0.7
  • 1.0.8
  • 1.0.9
  • 1.1.0
  • 1.2.0
  • 1.2.1
  • 1.2.4-beta.1
  • V1.11.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.12.0
  • v1.12.1
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.4-beta.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.4.3
  • v1.4.4
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.6.3
  • v1.6.4
  • v1.6.5
  • v1.7.0
  • v1.7.1
  • v1.7.2
  • v1.7.3
  • v1.7.4
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.9.0
  • v1.9.1
  • v1.9.2
  • v1.9.3
  • v1.9.4
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.3.0
  • v2.3.1
  • v2.4.0
  • v2.5.0
  • v2.5.1
  • v2.6.0
  • v2.7.0
  • v2.7.1
  • v2.7.2
  • v2.8.0
  • v3.0.0
  • v3.1.0
  • v3.1.1
103 results

Target

Select target project
  • web-et-numerique/factory/llle_project/ecolyo
1 result
Select Git revision
  • build
  • build-dev
  • build-test
  • dev
  • lint/testing-libraby-plugin
  • master
  • renovate/copy-webpack-plugin-13.x
  • renovate/couchdb-3.x
  • renovate/cozy-client-49.x
  • renovate/cozy-device-helper-3.x
  • renovate/cozy-flags-4.x
  • renovate/cozy-harvest-lib-32.x
  • renovate/cozy-harvest-lib-9.x
  • renovate/cozy-realtime-5.x
  • renovate/cozy-scripts-8.x
  • renovate/devdependencies-(non-major)
  • renovate/eslint-9.x
  • renovate/eslint-config-prettier-10.x
  • renovate/eslint-plugin-testing-library-7.x
  • renovate/major-react-monorepo
  • renovate/major-react-router-monorepo
  • renovate/major-typescript-eslint-monorepo
  • renovate/react-19.x
  • renovate/react-dom-19.x
  • renovate/react-inspector-6.x
  • renovate/sass-loader-16.x
  • 0.1.0
  • 0.1.1
  • 0.1.2
  • 0.1.6
  • 0.1.7
  • 1.0.2
  • 1.0.3
  • 1.0.5
  • 1.0.6
  • 1.0.7
  • 1.0.8
  • 1.0.9
  • 1.1.0
  • 1.2.0
  • 1.2.1
  • 1.2.4-beta.1
  • V1.11.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.12.0
  • v1.12.1
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.4-beta.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.4.3
  • v1.4.4
  • v1.5.0
  • v1.5.1
  • v1.6.0
  • v1.6.1
  • v1.6.2
  • v1.6.3
  • v1.6.4
  • v1.6.5
  • v1.7.0
  • v1.7.1
  • v1.7.2
  • v1.7.3
  • v1.7.4
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.9.0
  • v1.9.1
  • v1.9.2
  • v1.9.3
  • v1.9.4
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.1.0
  • v2.1.1
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.3.0
  • v2.3.1
  • v2.4.0
  • v2.5.0
  • v2.5.1
  • v2.6.0
  • v2.7.0
  • v2.7.1
  • v2.7.2
  • v2.8.0
  • v3.0.0
  • v3.1.0
  • v3.1.1
103 results
Show changes
Showing
with 87 additions and 208 deletions
......@@ -177,8 +177,6 @@ export default class FluidService {
/**
* Return fluids with data older than 5 days
* @param {FluidStatus[]} fluidStatus
* @returns {FluidType[]}
*/
static getOldFluidData = async (
fluidStatus: FluidStatus[]
......
......@@ -19,7 +19,6 @@ export default class FluidPricesService {
/**
* Get all prices available in database
* @returns {FluidPrice[]}
*/
public async getAllPrices(): Promise<FluidPrice[]> {
const query: QueryDefinition = Q(FLUIDSPRICES_DOCTYPE).limitBy(900)
......@@ -31,9 +30,6 @@ export default class FluidPricesService {
/**
* Get a price according to a fluidType and a data. This method return the nearest and valid price for the given date.
* @param {FluidType} fluidType
* @param {DateTime} date
* @returns {FluidPrice}
*/
public async getPrices(
fluidType: FluidType,
......@@ -57,7 +53,6 @@ export default class FluidPricesService {
/**
* Get current prices for all fluidTypes.
* @returns {FluidPrice[]}
*/
public async getAllLastPrices(): Promise<FluidPrice[]> {
const query: QueryDefinition = Q(FLUIDSPRICES_DOCTYPE)
......@@ -120,8 +115,7 @@ export default class FluidPricesService {
/**
* Check if a fluidprice exists in db
* @param {FluidPrice} fluidPrice
* @returns {FluidPrice | null} price or null
* @returns {Promise<FluidPrice | null>} price or null
*/
public async checkIfPriceExists(
fluidPrice: FluidPrice
......@@ -139,8 +133,7 @@ export default class FluidPricesService {
/**
* Creates a new fluidPrice
* @param {FluidPrice} fluidPrice
* @returns {FluidPrice | null} price or null
* @returns {Promise<FluidPrice | null>} price or null
*/
public async createPrice(newPrice: FluidPrice): Promise<FluidPrice | null> {
try {
......@@ -160,9 +153,6 @@ export default class FluidPricesService {
/**
* Updates a price in db
* @param {FluidPrice} doc
* @param {Partial<FluidPrice>} attributes
* @returns {FluidPrice | null}
*/
public async updatePrice(
doc: FluidPrice,
......
......@@ -12,8 +12,7 @@ export default class KonnectorStatusService {
/**
* Return a FluidType array containing each konnector fluid with a account
* @param void
* @return {Promise<FluidType[]>} configured FluidTypes array
* @returns {Promise<FluidType[]>} configured FluidTypes array
*/
async getKonnectorAccountStatus(): Promise<FluidType[]> {
const fluidConfig = new ConfigService().getFluidConfig()
......
......@@ -21,8 +21,6 @@ export default class ProfileService {
/**
* Retrieve Profile from the ProfileEntity
* @param {ProfileEntity} profileEntity
* @returns {Profile}
*/
private parseProfileEntityToProfile(profileEntity: ProfileEntity): Profile {
const profile: Profile = {
......
......@@ -10,7 +10,6 @@ export default class ProfileEcogestureService {
}
/**
* Retrieve the ProfileEcogesture from db
* @returns {ProfileEcogesture}
*/
public async getProfileEcogesture(): Promise<ProfileEcogesture | null> {
const query: QueryDefinition = Q(PROFILEECOGESTURE_DOCTYPE)
......@@ -25,7 +24,6 @@ export default class ProfileEcogestureService {
/**
* Saves ProfileEcogesture in database
* @returns {ProfileEcogesture}
*/
public async updateProfileEcogesture(
attributes: Partial<ProfileEcogesture>
......
......@@ -20,7 +20,6 @@ export default class ProfileEcogestureFormService {
/**
* getNextFormStep
* @param {EcogestureStepForm} step
* @returns {EcogestureStepForm} next step
*/
public getNextFormStep(step: EcogestureStepForm): EcogestureStepForm {
......@@ -43,7 +42,6 @@ export default class ProfileEcogestureFormService {
/**
* getPreviousFormStep
* @param {EcogestureStepForm} step
* @returns {EcogestureStepForm} previous step
*/
public getPreviousFormStep(step: EcogestureStepForm): EcogestureStepForm {
......@@ -64,8 +62,6 @@ export default class ProfileEcogestureFormService {
/**
* getAnswerForStep
* @param {EcogestureStepForm} step
* @returns {EcogestureFormAnswer}
*/
static getAnswerForStep(step: EcogestureStepForm): ProfileEcogestureAnswer {
switch (step) {
......
......@@ -66,7 +66,6 @@ export default class ProfileTypeService {
/**
* calculateWarmingCorrectedConsumption
* @param {number} estimatedConsumption
* @returns {number} - Corrected consumption
*/
public calculateWarmingCorrectedConsumption(
......@@ -183,10 +182,8 @@ export default class ProfileTypeService {
/**
* calculateWarmingMonthConsumption
@param {number} correctedConsumption
@param {number} number
@returns {number} monthConsumption
*/
*/
public async calculateWarmingMonthConsumption(
correctedConsumption: number,
month: number
......@@ -199,8 +196,6 @@ export default class ProfileTypeService {
}
/**
* getMonthHeating
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} Month heating consumption in kw/h
*/
public async getMonthHeating(month: number): Promise<number> {
......@@ -216,9 +211,6 @@ export default class ProfileTypeService {
/**
* Calculate water raw needs by month
*
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} rawConsumption
*/
public calculateMonthWaterRawNeeds(
......@@ -240,9 +232,6 @@ export default class ProfileTypeService {
}
/**
* Calculate spread water needs by month
*
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} spreadConsumption
*/
public calculateSpreadNeeds(profileType: ProfileType, month: number): number {
......@@ -261,9 +250,6 @@ export default class ProfileTypeService {
}
/**
* Calculate total ecs consumption by month
*
* @param {number} spreadConsumption
* @param {ProfileType} profileType
* @returns {number} monthEcsConsumption
*/
public calculateTotalConsumption(
......@@ -294,9 +280,6 @@ export default class ProfileTypeService {
}
/**
* Get ECS consumption by month
*
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} monthEcsConsumption
*/
public getMonthEcs(month: number) {
......@@ -313,8 +296,6 @@ export default class ProfileTypeService {
}
/**
* Get cooking consumption by month
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} monthCookingConsumption
*/
public getMonthCookingConsumption(month: number): number {
......@@ -332,8 +313,6 @@ export default class ProfileTypeService {
}
/**
* Get specific electricity consumption by month
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} monthElectricSpecificConsumption
*/
public getMonthElectricSpecificConsumption(month: number): number {
......@@ -352,8 +331,6 @@ export default class ProfileTypeService {
}
/**
* Get cold water consumption by month
* @param {ProfileType} profileType
* @param {number} month
* @returns {number} monthColdWaterConsumption
*/
public getMonthColdWaterConsumption(month: number): number {
......@@ -373,9 +350,7 @@ export default class ProfileTypeService {
}
/**
* getDetailsMonthlyForecast
* @param {FluidType} fluidType
* @param {number} month
* @returns {number} DetailsMonthlyForecast
* @returns DetailsMonthlyForecast
*/
public async getDetailsMonthlyForecast(
fluidType: FluidType,
......@@ -425,12 +400,6 @@ export default class ProfileTypeService {
return detailsMonthlyForecast
}
/**
* getFluidForecast
* @param {FluidType} fluidType
* @param {number} month
@returns {FluidForecast} fluidForecast
*/
public async getFluidForecast(
fluidType: FluidType,
month: number
......@@ -459,8 +428,7 @@ export default class ProfileTypeService {
/**
* getMonthlyForecast
* @param {number} month
* @returns {MonthlyForecast} MonthlyForecast
* @returns {Promise<MonthlyForecast>} MonthlyForecast
*/
public async getMonthlyForecast(month: number): Promise<MonthlyForecast> {
const elecForecast: FluidForecast = await this.getFluidForecast(
......@@ -486,9 +454,7 @@ export default class ProfileTypeService {
/**
* Try to fetch dju from remote doctype, if no data or error, return default data
* @param {Client} client
* @param {number} month
* @returns {number} monthDju
* @returns {Promise<number>} monthDju
*/
public fetchDJU = async (month: number): Promise<number> => {
const startDate: string = DateTime.local()
......@@ -540,7 +506,6 @@ export default class ProfileTypeService {
/**
* checkConsistency
* @param {ProfileType} profileType
* @returns {ProfileType} consistent profile type
*/
static checkConsistency(profileType: ProfileType): ProfileType {
......
......@@ -19,8 +19,6 @@ export default class ProfileTypeEntityService {
* Retrieves ProfileType from the PROFILETYPE_DOCTYPE
* When called with date parameter, fetches closest profileType to the date
* When called without parameters, fetches last profileType in doctype
* @param {DateTime} date
* @returns {ProfileType}
*/
public async getProfileType(date?: DateTime): Promise<ProfileType | null> {
const query: QueryDefinition = Q(PROFILETYPE_DOCTYPE)
......@@ -83,8 +81,6 @@ export default class ProfileTypeEntityService {
* Retrieves all ProfileTypes from the PROFILETYPE_DOCTYPE
* When called with period parameter, returns all profileTypes found for this period or null
* When called without parameters, returns all profileTypes or null if none exist
* @param {TimePeriod} timePeriod
* @returns {ProfileType}
*/
public async getAllProfileTypes(
timePeriod?: TimePeriod
......@@ -132,7 +128,6 @@ export default class ProfileTypeEntityService {
/**
* Saves profileType in database
* @returns {ProfileType}
*/
public async saveProfileType(
attributes: Partial<ProfileType>
......@@ -154,7 +149,6 @@ export default class ProfileTypeEntityService {
/**
* Deletes Array of ProfileTypes
* @returns {boolean}
*/
public async deleteProfileTypes(
profileTypes: ProfileType[]
......@@ -175,8 +169,6 @@ export default class ProfileTypeEntityService {
/**
* Retrieves ProfileType from the ProfileTypeEntity
* @param {ProfileType} profileTypeEntity
* @returns {ProfileType}
*/
private parseProfileTypeEntityToProfileType(
profileTypeEntity: ProfileType
......
......@@ -25,7 +25,6 @@ export default class ProfileTypeFormService {
/**
* getNextFormStep
* @param {ProfileTypeStepForm} step
* @returns {ProfileTypeStepForm} next step
*/
public getNextFormStep(
......@@ -88,7 +87,6 @@ export default class ProfileTypeFormService {
/**
* getPreviousFormStep
* @param {ProfileTypeStepForm} step
* @returns {ProfileTypeStepForm} previous step
*/
public getPreviousFormStep(step: ProfileTypeStepForm): ProfileTypeStepForm {
......@@ -144,8 +142,7 @@ export default class ProfileTypeFormService {
/**
* getAnswerForStep
* @param {ProfileTypeStepForm} step
* @returns {ProfileTypeAnswer}
* @returns {ProfileTypeAnswer} - answer type
*/
static getAnswerForStep(step: ProfileTypeStepForm): ProfileTypeAnswer {
switch (step) {
......
......@@ -34,7 +34,6 @@ export default class QuizService {
/**
* Retrieve all quiz entities from db
* @returns {QuizEntity[]}
*/
public async getAllQuizEntities(): Promise<QuizEntity[]> {
const query: QueryDefinition = Q(QUIZ_DOCTYPE)
......@@ -46,9 +45,7 @@ export default class QuizService {
/**
* Retrieve quiz entities from db given the id
*
* @param {string} quizId - ID of the searched quiz
* @returns {QuizEntity}
*/
public async getQuizEntityById(quizId: string): Promise<QuizEntity> {
const query: QueryDefinition = Q(QUIZ_DOCTYPE)
......@@ -77,7 +74,6 @@ export default class QuizService {
* Return quiz created from quiz entity
* @param {QuizEntity[]} quizEntityList - userQuiz to update
* @param {string} searchId - userQuiz to update
* @returns {UserQuiz}
*/
public getUserQuizfromQuizEntities(
quizEntityList: QuizEntity[],
......@@ -113,8 +109,6 @@ export default class QuizService {
/**
* Return UserQuestion created from QuestionEntity
* @param {QuestionEntity}
* @returns {UserQuestion}
*/
public parseQuestionEntityToQuestion(question: QuestionEntity): UserQuestion {
const userQuestion: UserQuestion = {
......@@ -126,8 +120,6 @@ export default class QuizService {
/**
* Return UserCustomQuestion created from CustomQuestionEntity
* @param {CustomQuestionEntity}
* @returns {UserCustomQuestion}
*/
public parseCustomQuestionEntityToCustomQuestion(
customQuestion: CustomQuestionEntity
......@@ -141,8 +133,6 @@ export default class QuizService {
/**
* Return UserQuiz created from QuizEntity
* @param {QuizEntity}
* @returns {UserQuiz}
*/
public parseQuizEntityToUserQuiz(quiz: QuizEntity): UserQuiz {
const userQuestions: UserQuestion[] = []
......@@ -173,7 +163,6 @@ export default class QuizService {
/**
* Return quiz with updated state to UserQuizState.ONGOING and randomize question and answers
* @param {UserQuiz} userQuiz - userQuiz to update
* @returns {UserQuiz}
*/
public async startUserQuiz(userQuiz: UserQuiz): Promise<UserQuiz> {
const questions = userQuiz.questions.map(question => ({
......@@ -193,7 +182,6 @@ export default class QuizService {
/**
* Return quiz with updated state to UserQuizState.UNLOCKED and updated questions with false result
* @param {UserQuiz} userQuiz - userQuiz to update
* @returns {UserQuiz}
*/
public async resetUserQuiz(userQuiz: UserQuiz): Promise<UserQuiz> {
const updatedQuestions: UserQuestion[] = userQuiz.questions.map(
......@@ -218,7 +206,6 @@ export default class QuizService {
/**
* Return quiz with updated state to UserQuizState.DONE
* @param {UserQuiz} userQuiz - userQuiz to update
* @returns {UserQuiz}
*/
public async endUserQuiz(userQuiz: UserQuiz): Promise<UserQuiz> {
const updatedUserQuiz: UserQuiz = {
......@@ -231,9 +218,6 @@ export default class QuizService {
/**
* Return quiz with result and updated question or customQuestion if no index is passed
* @param {UserQuiz} userQuiz - userQuiz to update
* @returns {UserQuiz}
* @returns {questionIndex}
* @returns {questionResult}
*/
public async updateUserQuiz(
userQuiz: UserQuiz,
......@@ -274,9 +258,6 @@ export default class QuizService {
/**
* Build a custom question with the customQuestionEntity
* @param customQuestionEntity
* @param fluidType
* @returns {QuestionEntity}
*/
public async getCustomQuestion(
customQuestionEntity: CustomQuestionEntity,
......@@ -362,9 +343,6 @@ export default class QuizService {
/**
* Get the interval needed for the further calculs
* @param interval
* @param period
* @returns {TimePeriod}
*/
private getTimePeriodFromInterval(
interval: TimeStep,
......@@ -413,10 +391,6 @@ export default class QuizService {
* Finds max load on given past time period
* when no max load is found looks x month/year back for a max value
* if nothing is found fall back on most recent data
* @param timeStep
* @param interval
* @param fluidType
* @returns {Promise<IntervalAnswer>}
*/
private async getMaxLoadOnLastInterval(
timeStep: TimeStep,
......@@ -501,11 +475,6 @@ export default class QuizService {
/**
* Calcul the average value on a given period
* @param timeStep
* @param interval
* @param fluidType
* @param weekday
* @returns {Promise<number>}
*/
private async getAverageOnGivenPeriod(
timeStep: TimeStep,
......@@ -550,9 +519,6 @@ export default class QuizService {
/**
* Generate wrong date answer following the right one
* @param rightDate
* @param interval
* @returns {Answer[]}
*/
private getAnswersForInterval(
rightDate: DateTime,
......@@ -641,9 +607,6 @@ export default class QuizService {
/**
* Generate wrong value answer following the right one
* @param maxLoad
* @param unit
* @returns {Answer[]}
*/
private getAnswersForNumberValue(maxLoad: number, unit: string): Answer[] {
const coefList: number[] = [0.6, 0.7, 0.8, 0.12, 0.13]
......
......@@ -16,7 +16,6 @@ export default class TermsService {
}
/**
* Gets the last term doctype
* @returns {Term}
*/
public async getLastTerm(): Promise<Term> {
const query: QueryDefinition = Q(TERMS_DOCTYPE)
......@@ -30,10 +29,7 @@ export default class TermsService {
return terms
}
/**
* Checks if the last term has been accepted by user
* @returns {boolean}
*/
/** Checks if the last term has been accepted by user */
public async isLastTermValidated(): Promise<boolean> {
const query: QueryDefinition = Q(TERMS_DOCTYPE)
.where({})
......@@ -46,10 +42,7 @@ export default class TermsService {
if (terms?.accepted) return true
else return false
}
/**
* Compares the version number in the last term with the current app CGU version in the manifest
* @returns {boolean}
*/
/** Compares the version number in the last term with the current app CGU version in the manifest */
public async isConsentVersionUpToDate(): Promise<boolean> {
const lastTerm = await this.getLastTerm()
if (lastTerm && lastTerm.version === config.termsVersion) return true
......@@ -73,8 +66,6 @@ export default class TermsService {
/**
* Creates a new term
* @param newTerm
* @returns
*/
public async createTerm(): Promise<Term | null> {
try {
......
......@@ -22,9 +22,6 @@ const logStack = logger.namespace('usageEventService')
export default class UsageEventService {
/**
* addEvent
* @param {Client} client
* @param {AddEventParams} params
* @returns {Promise<UsageEvent>} usageEvent added
*/
static async addEvent(
......@@ -49,9 +46,6 @@ export default class UsageEventService {
}
/**
* addEvent
* @param {Client} client
* @param {AddEventParams} params
* @returns {Promise<UsageEvent>} usageEvent added
*/
static async addEventIfDoesntExist(
......@@ -66,12 +60,6 @@ export default class UsageEventService {
return null
}
/**
*
* @param {Client} client
* @param {string} konnectorSlug
* @returns
*/
static async updateConnectionAttemptEvent(
client: Client,
konnectorSlug: string
......@@ -111,9 +99,6 @@ export default class UsageEventService {
}
/**
* updateUsageEventsAggregated
* @param {Client} client
* @param {string[]} ids
* @returns {Promise<boolean>} return true if all events are updated
*/
static async updateUsageEventsAggregated(
......@@ -140,9 +125,6 @@ export default class UsageEventService {
}
/**
* getEvents
* @param {Client} client
* @param {MongoSelector} filterParams
* @returns {Promise<UsageEvent[]>} usageEvent added
*/
static async getEvents(
......@@ -165,8 +147,6 @@ export default class UsageEventService {
/**
* Retrieve UsageEvent from the UsageEventEntity
* @param {UsageEventEntity} usageEventEntity
* @returns {UsageEvent}
*/
static parseUsageEventEntityToUsageEvent(
usageEventEntity: UsageEventEntity
......
......@@ -375,7 +375,6 @@ const calculateConnectedKonnectorPerDay = async (client: Client) => {
/**
* Build indicator group string with handling of : ECS, heating for gas and electricity.
*
* @param client Client
* @param fluidType FluidType
* @returns Promise<string>
......@@ -483,8 +482,7 @@ const getConsumptionValue = async (
/**
* Send an indicator on the consumption variation in % for each fluid type.
* @param client
* @group [{ slug }, { seniority (in month) }, { profile (ECS, chauffage, etc...) }],
* @description [{ slug }, { seniority (in month) }, { profile (ECS, chauffage, etc...) }],
*/
const calculateConsumptionVariation = async (client: Client) => {
logStack('info', `calculateConsumptionVariation`)
......@@ -540,7 +538,7 @@ const calculateConsumptionVariation = async (client: Client) => {
},
}
// if user wasnt connected during current month, dont send indicator
// if user wasn't connected during current month, dont send indicator
const events: UsageEvent[] = await UsageEventService.getEvents(client, {
eventDate: {
$lt: DateTime.local()
......
......@@ -22,30 +22,20 @@ interface EnedisMonthlyProps {
/**
* Gets the minimum consumption value in a month
* @param weekEndValuesArray
* @param weekValuesArray
* @returns number
*/
const getMinMonthlyLoad = (
weekEndValuesArray: number[][],
weekValuesArray: number[][],
numberofDaysInMonth: number
numberOfDaysInMonth: number
): number => {
const totalArray = union(...weekEndValuesArray, ...weekValuesArray)
const filteredTotal = totalArray.filter(val => val !== -1 && val !== 0)
const talonCons = Math.min(...filteredTotal)
const minCons = talonCons * 48 * numberofDaysInMonth
const minCons = talonCons * 48 * numberOfDaysInMonth
logStack('info', `Minimum value is ${minCons} `)
return minCons
}
/**
*
* @param monthlyArray
* @param dataChart
* @param isWeekend
* @returns
*/
const populateArrayWithTotalData = (
monthlyArray: number[][],
dataChart: Datachart,
......@@ -75,13 +65,7 @@ const populateArrayWithTotalData = (
})
}
}
/**
* Gets max Power value for a given month
* @param month
* @param year
* @param client
* @returns
*/
/** Gets max Power value for a given month */
const getMonthMaxPower = async (
month: number,
year: number,
......@@ -100,10 +84,6 @@ const getMonthMaxPower = async (
}
/**
* Get the average arrays of half-hour value on a given month
* @param client
* @param month
* @param year
* @returns {Promise<MonthlyAveragesLoads>}
*/
const getEnedisMonthAnalysisData = async (
client: Client,
......@@ -185,8 +165,6 @@ const getEnedisMonthAnalysisData = async (
/**
* Synchronize enedis monthly analysis with database depending on if the service has already ran
* and if the enedis minute tracking has been activated
* @param {Client} client
* @returns
*/
const syncEnedisMonthlyAnalysisDataDoctype = async ({
client,
......
......@@ -39,8 +39,6 @@ const getRemotePricesByFluid = async (
/**
* Synchro the remote prices with database and returns a date where we have to relaunch aggregation if a price has been edited in backoffice
* @param {Client} client
* @param {FluidType} fluidType
* @returns {string | null} the oldest startDate
*/
const synchroPricesToUpdate = async (
......
......@@ -23,7 +23,6 @@ interface MonthlyReportNotificationProps {
/**
* Get consumption value for all fluid if exist
* @param client
* @param fluidType - FluidType
*/
const getConsumptionValue = async (
......@@ -55,8 +54,6 @@ const getConsumptionValue = async (
/**
* Build consumption text to attach in email. According to client consumption, display electricity and/or gaz and/or water
* @param client
* @returns string
*/
const buildComparisonText = async (
client: Client,
......
/* eslint-disable jsdoc/no-undefined-types */
import { RealtimePlugin, TRealtimePlugin } from 'cozy-realtime'
import * as CozyStackClient from 'cozy-stack-client'
import { TDoctype } from 'doctypes'
......@@ -6,6 +7,7 @@ import { Relation } from 'models'
declare module 'cozy-client' {
/**
* @typedef {object} HydratedDocument
* @property {unknown} client client
*/
export const CozyProvider: React.FC<{ client: Client; store?: any }>
......@@ -109,7 +111,6 @@ declare module 'cozy-client' {
* `pluginName` that will be use as the key in the `plugins` object.
*
* Two plugins with the same `pluginName` cannot co-exist.
*
* @example
* ```
* class AlertPlugin {
......@@ -154,12 +155,10 @@ declare module 'cozy-client' {
*
* - "beforeLogin" at the beginning, before links have been set up
* - "login" when the client is fully logged in and links have been set up
*
* @param {object} options - Options
* @param {string} options.token - If passed, the token is set on the client
* @param {string} options.uri - If passed, the uri is set on the client
* @returns {Promise} - Resolves when all links have been setup and client is fully logged in
*
*/
login(options: ClientLogin): Promise<unknown>
......@@ -170,7 +169,6 @@ declare module 'cozy-client' {
*
* - "beforeLogout" at the beginning, before links have been reset
* - "login" when the client is fully logged out and links have been reset
*
* @returns {Promise} - Resolves when all links have been reset and client is fully logged out
*/
logout(): Promise<unknown>
......@@ -178,7 +176,6 @@ declare module 'cozy-client' {
/**
* Forwards to a stack client instance and returns
* a [DocumentCollection]{@link https://docs.cozy.io/en/cozy-client/api/cozy-stack-client/#DocumentCollection} instance.
*
* @param {string} doctype - The collection doctype.
* @returns {CozyStackClient.DocumentCollection} - Collection corresponding to the doctype
*/
......@@ -186,7 +183,6 @@ declare module 'cozy-client' {
/**
* Fetches an endpoint in an authorized way.
*
* @param {string} method The HTTP method.
* @param {string} path The URI.
* @param {object} body The payload.
......@@ -213,9 +209,8 @@ declare module 'cozy-client' {
* Saves multiple documents in one batch
* - Can only be called with documents from the same doctype
* - Does not support automatic creation of references
*
* @param {CozyClientDocument[]} docs
* @param {Object} mutationOptions
* @param {object} mutationOptions
* @returns {Promise<void>}
*/
saveAll(docs: D[], mutationOptions?: any): Promise<QueryResult<T, I>>
......@@ -227,12 +222,11 @@ declare module 'cozy-client' {
* const baseDoc = { _type: 'io.cozy.todo', label: 'Go hiking' }
* // relations can be arrays or single objects
* const relationships = {
* attachments: [{ _id: 12345, _type: 'io.cozy.files' }, { _id: 6789, _type: 'io.cozy.files' }],
* bills: { _id: 9999, _type: 'io.cozy.bills' }
* attachments: [{ _id: 12345, _type: 'io.cozy.files' }, { _id: 6789, _type: 'io.cozy.files' }],
* bills: { _id: 9999, _type: 'io.cozy.bills' }
* }
* client.getDocumentSavePlan(baseDoc, relationships)
* ```
*
* @param {object} document The base document to create
* @param {object} relationships The list of relationships to add, as a dictionnary. Keys should be relationship names and values the documents to link.
* @returns {Mutation[]} One or more mutation to execute
......@@ -242,7 +236,6 @@ declare module 'cozy-client' {
/**
* Destroys a document. {before,after}:destroy hooks will be fired.
*
* @param {Document} document - Document to be deleted
* @returns {Document} The document that has been deleted
*/
......@@ -259,7 +252,6 @@ declare module 'cozy-client' {
* Results from the query will be saved internally and can be retrieved via
* `getQueryFromState` or directly using `<Query />`. `<Query />` automatically
* executes its query when mounted if no fetch policy has been indicated.
*
* @param {QueryDefinition} queryDefinition - Definition that will be executed
* @param {string} options - Options
* @param {string} options.as - Names the query so it can be reused (by multiple components for example)
......@@ -275,8 +267,7 @@ declare module 'cozy-client' {
* Will fetch all documents for a `queryDefinition`, automatically fetching more
* documents if the total of documents is superior to the pagination limit. Can
* result in a lot of network requests.
*
* @param {QueryDefinition} queryDefinition - Definition to be executed
* @param queryDefinition - Definition to be executed
* @param {object} options - Options to the query
* @returns {Array} All documents matching the query
*/
......@@ -302,7 +293,6 @@ declare module 'cozy-client' {
* Returns documents with their relationships resolved according to their schema.
* If related documents are not in the store, they will not be fetched automatically.
* Instead, the relationships will have null documents.
*
* @param {string} doctype - Doctype of the documents being hydrated
* @param {Array<Document>} documents - Documents to be hydrated
* @returns {Array<HydratedDocument>}
......@@ -317,9 +307,8 @@ declare module 'cozy-client' {
*
* The original document is kept in the target attribute of
* the relationship
*
* @param {Document} document for which relationships must be resolved
* @param {Schema} schemaArg for the document doctype
* @param {TDoctype} schemaArg for the document doctype
* @returns {HydratedDocument}
*/
hydrateDocument<D>(document: D, schemaArg?: TDoctype): HydratedDocument
......@@ -339,7 +328,6 @@ declare module 'cozy-client' {
export class HasMany {
/**
* Sets a relationship item with the relationship name and id
*
* @param {object} doc - Document to be updated
* @param {string} relName - Name of the relationship
* @param {string} relItemId - Id of the relationship item
......@@ -354,7 +342,6 @@ declare module 'cozy-client' {
/**
* Gets a relationship item with the relationship name and id
*
* @param {object} doc - Document to be updated
* @param {string} relName - Name of the relationship
* @param {string} relItemId - Id of the relationship item
......@@ -363,7 +350,6 @@ declare module 'cozy-client' {
/**
* Updates a relationship item with the relationship name and id
*
* @param {object} doc - Document to be updated
* @param {string} relName - Name of the relationship
* @param {string} relItemId - Id of the relationship item
......
......@@ -4,7 +4,7 @@ import logApp from './logger'
* Logs the time spend and add "in xx ms"
* @param {string} scope string Migration | Initialization | ...
* @param startTime number raw duration in ms
* @output [Scope] Finished in XXX ms
* @description [Scope] Finished in XXX ms
* @example
* logDuration("[Migration] Finished", 764745674); // [Migration] Finished in 685 ms
*/
......
......@@ -35,7 +35,8 @@ export function getKonnectorSlug(fluidType: FluidType) {
throw new Error('unknown fluidtype')
}
}
/** Return lowercase fluidtype
/**
* Return lowercase fluidtype
* @example FluidType.ELECTRICITY => 'electricity'
*/
export function getFluidName(fluidType: FluidType) {
......@@ -120,7 +121,7 @@ export function getRelationshipHasMany<D>(doc: D, relName: string): Relation[] {
/**
* Get many relations in doc
* @param {object} doc - DocumentEntity
* @param {Array<[relName: string]: Array<Relation>>} relNameList - Array of name of the relations
* @param relNameList - Array of name of the relations
*/
export function getRelationships<D>(
doc: D,
......@@ -133,8 +134,6 @@ export function getRelationships<D>(
/**
* Import a svg file with format : id.svg
* @param id
* @param pathType
*/
export const importIconById = async (
id: string,
......@@ -175,7 +174,7 @@ export const getMonthFullName = (month: number) => {
/**
* Return month string according to month index
* @Note Equivalent to date.monthLong
* @variation Equivalent to date.monthLong
* @param date - DateTime
* @returns month in french
*/
......@@ -297,7 +296,6 @@ export const getTodayDate = () =>
/**
* Formats an array of strings into a list with commas and an "et" (and) before the last element.
*
* @param {string[]} array - The array of strings to be formatted.
* @returns {string} The formatted list string.
*
......@@ -306,7 +304,6 @@ export const getTodayDate = () =>
* If the array has two elements, they are joined with " et " (and).
* If the array has more than two elements, all but the last element are joined with commas,
* and " et " (and) is placed before the last element.
*
* @example
* // Returns "pomme, banane et cerise"
* formatListWithAnd(['pomme', 'banane', 'cerise']);
......
......@@ -1674,6 +1674,15 @@
resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46"
integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==
 
"@es-joy/jsdoccomment@~0.40.1":
version "0.40.1"
resolved "https://registry.yarnpkg.com/@es-joy/jsdoccomment/-/jsdoccomment-0.40.1.tgz#13acd77fb372ed1c83b7355edd865a3b370c9ec4"
integrity sha512-YORCdZSusAlBrFpZ77pJjc5r1bQs5caPWtAu+WWmiSo+8XaUzseapVrfAtiRFbQWnrBxxLLEwF6f6ZG/UgCQCg==
dependencies:
comment-parser "1.4.0"
esquery "^1.5.0"
jsdoc-type-pratt-parser "~4.0.0"
"@eslint-community/eslint-utils@^4.2.0":
version "4.3.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.3.0.tgz#a556790523a351b4e47e9d385f47265eaaf9780a"
......@@ -3665,6 +3674,11 @@ aproba@^1.1.1:
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
 
are-docs-informative@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/are-docs-informative/-/are-docs-informative-0.0.2.tgz#387f0e93f5d45280373d387a59d34c96db321963"
integrity sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==
argparse@^1.0.10, argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
......@@ -4552,6 +4566,11 @@ buffer@^5.5.0:
base64-js "^1.3.1"
ieee754 "^1.1.13"
 
builtin-modules@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6"
integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==
builtin-status-codes@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
......@@ -5262,6 +5281,11 @@ commander@^9.3.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-9.3.0.tgz#f619114a5a2d2054e0d9ff1b31d5ccf89255e26b"
integrity sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==
 
comment-parser@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/comment-parser/-/comment-parser-1.4.0.tgz#0f8c560f59698193854f12884c20c0e39a26d32c"
integrity sha512-QLyTNiZ2KDOibvFPlZ6ZngVsZ/0gYnE6uTXi5aoDg8ed3AkJAz4sEje3Y8a29hQ1s6A99MZXe47fLAXQ1rTqaw==
common-tags@^1.4.0:
version "1.8.2"
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6"
......@@ -7558,6 +7582,21 @@ eslint-plugin-jest@^27.2.3:
dependencies:
"@typescript-eslint/utils" "^5.10.0"
 
eslint-plugin-jsdoc@^46.8.2:
version "46.8.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-46.8.2.tgz#3e6b1c93e91e38fe01874d45da121b56393c54a5"
integrity sha512-5TSnD018f3tUJNne4s4gDWQflbsgOycIKEUBoCLn6XtBMgNHxQFmV8vVxUtiPxAQq8lrX85OaSG/2gnctxw9uQ==
dependencies:
"@es-joy/jsdoccomment" "~0.40.1"
are-docs-informative "^0.0.2"
comment-parser "1.4.0"
debug "^4.3.4"
escape-string-regexp "^4.0.0"
esquery "^1.5.0"
is-builtin-module "^3.2.1"
semver "^7.5.4"
spdx-expression-parse "^3.0.1"
eslint-plugin-prettier@3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba"
......@@ -7958,7 +7997,7 @@ esquery@^1.0.1, esquery@^1.4.0:
dependencies:
estraverse "^5.1.0"
 
esquery@^1.4.2:
esquery@^1.4.2, esquery@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b"
integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==
......@@ -9814,6 +9853,13 @@ is-buffer@^1.1.4, is-buffer@^1.1.5, is-buffer@~1.1.6:
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
 
is-builtin-module@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.1.tgz#f03271717d8654cfcaf07ab0463faa3571581169"
integrity sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==
dependencies:
builtin-modules "^3.3.0"
is-callable@^1.1.3, is-callable@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
......@@ -10760,6 +10806,11 @@ jsbn@~0.1.0:
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==
 
jsdoc-type-pratt-parser@~4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz#136f0571a99c184d84ec84662c45c29ceff71114"
integrity sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==
jsdom@^16.2.1, jsdom@^16.4.0:
version "16.7.0"
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.7.0.tgz#918ae71965424b197c819f8183a754e18977b710"
......@@ -15162,6 +15213,13 @@ semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semve
dependencies:
lru-cache "^6.0.0"
 
semver@^7.5.4:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"
send@0.18.0:
version "0.18.0"
resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be"
......@@ -15528,7 +15586,7 @@ spdx-exceptions@^2.1.0:
resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d"
integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==
 
spdx-expression-parse@^3.0.0:
spdx-expression-parse@^3.0.0, spdx-expression-parse@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679"
integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==
......