From c64807ca98a95a0c076c336d2221b2987e8a7993 Mon Sep 17 00:00:00 2001 From: NyAndoMayah Date: Tue, 7 Nov 2023 14:53:06 +0300 Subject: [PATCH] revert: revert "chore: update fees (#375)" This reverts commit 5a32cd5d7475c17202ecfc8018d24da450f9ff08. --- src/__tests__/Manager.Fee.cy.js | 21 +++++++++++++++++---- src/conf.js | 10 ++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/__tests__/Manager.Fee.cy.js b/src/__tests__/Manager.Fee.cy.js index 3614bc582..1632bb48f 100644 --- a/src/__tests__/Manager.Fee.cy.js +++ b/src/__tests__/Manager.Fee.cy.js @@ -138,8 +138,8 @@ describe(specTitle('Manager.Fee'), () => { }) it('can create fees with manual fields', () => { - const monthlyAmount = '200000' - const monthsNumber = '5' + const monthlyAmount = 200000 //(1 + Math.floor(Math.random() * 2_000_000)).toString() + const monthsNumber = 5 //1 + Math.floor(Math.random() * 3) const comment = 'Dummy comment' const manuallyCreatedFees = createFeeWithManualDataMock(feeDateToSearch, monthlyAmount, comment, monthsNumber) cy.intercept('POST', `/students/${student1Mock.id}/fees`, manuallyCreatedFees).as('createFees') @@ -158,9 +158,22 @@ describe(specTitle('Manager.Fee'), () => { cy.intercept('GET', `/students/${student1Mock.id}/fees?page=1&page_size=500`, addFeeMock(feesMock, manuallyCreatedFees)).as('getFees') cy.contains('Enregistrer').click() + /* + cy.wait('@createFees').then(requestIntersection => { + const feeTypeMock = 'tuition' + let createAutomaticallyFeesBodyMock = { + comment: comment, + type: manualFeeTypes[feeTypeMock].type, + total_amount: monthlyAmount, + due_datetime: TurnsStringIntoDate(feeDateToSearch), + student_id: student1Mock.id + } + expect(requestIntersection.request.body[0]).to.deep.equal(createAutomaticallyFeesBodyMock) + expect(requestIntersection.request.body.length).to.equal(monthsNumber) + }) - cy.contains('Élément créé') - + cy.contains('Élément créé') + */ unmount() }) it('can create fees with manual fields without writing comments', () => { diff --git a/src/conf.js b/src/conf.js index 324539bc4..e270eeb15 100644 --- a/src/conf.js +++ b/src/conf.js @@ -3,18 +3,20 @@ export const currentYear = new Date().getFullYear() export const contactEmail = 'contact@hei.school' export const predefinedFeeTypes = { - annualTuition1x: [{ type: 'TUITION', name: 'Écolage annuel 1x', monthlyAmount: 1_915_000, monthsNumber: 1 }], - annualTuition9x: [{ type: 'TUITION', name: 'Écolage annuel 9x', monthlyAmount: 240_000, monthsNumber: 9 }], + annualTuition1x: [{ type: 'TUITION', name: 'Écolage annuel 1x', monthlyAmount: 1_740_000, monthsNumber: 1 }], + annualTuition9x: [ + { type: 'TUITION', name: 'Écolage annuel 9x', monthlyAmount: 240_000, monthsNumber: 1 }, + { type: 'TUITION', name: 'Écolage annuel 9x', monthlyAmount: 215_000, monthsNumber: 8 } + ], biAnnualTuition1x: [{ type: 'TUITION', name: 'Écolage semestriel 1x', monthlyAmount: 870_000, monthsNumber: 1 }], hardwareConf1_8x: [{ type: 'HARDWARE', name: 'Matériel conf1 8x', monthlyAmount: 240_000, monthsNumber: 8 }], hardwareConf2_8x: [{ type: 'HARDWARE', name: 'Matériel conf2 8x', monthlyAmount: 210_000, monthsNumber: 8 }], - studentInsurance: [{ type: 'STUDENT_INSURANCE', name: 'Assurance étudiante', monthlyAmount: 30_000, monthsNumber: 1 }], entranceExam: [{ type: 'ENTRANCE_EXAM', name: 'Concours', monthlyAmount: 40_000, monthsNumber: 1 }], knwoledgeValidationExam: [ { type: 'KNOWLEDGE_VALIDATION_EXAM', name: 'VAE examen', - monthlyAmount: 50_000, + monthlyAmount: 25_000, monthsNumber: 1 } ],