Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: revert "chore: update fees (#375)" #378

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading