Skip to content

Commit

Permalink
revert: revert "chore: update fees (#375)"
Browse files Browse the repository at this point in the history
This reverts commit 5a32cd5.
  • Loading branch information
NyAndoMayah committed Nov 7, 2023
1 parent 5a32cd5 commit c64807c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
21 changes: 17 additions & 4 deletions src/__tests__/Manager.Fee.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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', () => {
Expand Down
10 changes: 6 additions & 4 deletions src/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ export const currentYear = new Date().getFullYear()
export const contactEmail = '[email protected]'

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
}
],
Expand Down

0 comments on commit c64807c

Please sign in to comment.