-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,336 additions
and
1,219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import type { RequestHandler } from "express"; | ||
export declare const handler: RequestHandler; | ||
export default handler; | ||
import type { Request, Response } from 'express'; | ||
import { type AddTransactionForm } from '../../helpers/licencesDB/addTransaction.js'; | ||
export default function handler(request: Request<unknown, unknown, AddTransactionForm>, response: Response): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { addTransaction } from "../../helpers/licencesDB/addTransaction.js"; | ||
export const handler = (request, response) => { | ||
import addTransaction from '../../helpers/licencesDB/addTransaction.js'; | ||
export default function handler(request, response) { | ||
const newTransactionIndex = addTransaction(request.body, request.session); | ||
response.json({ | ||
success: true, | ||
message: "Transaction Added Successfully", | ||
message: 'Transaction Added Successfully', | ||
transactionIndex: newTransactionIndex | ||
}); | ||
}; | ||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import type { RequestHandler } from "express"; | ||
import type { Request, Response } from 'express' | ||
|
||
import { addTransaction } from "../../helpers/licencesDB/addTransaction.js"; | ||
import addTransaction, { | ||
type AddTransactionForm | ||
} from '../../helpers/licencesDB/addTransaction.js' | ||
|
||
|
||
export const handler: RequestHandler = (request, response) => { | ||
|
||
const newTransactionIndex = addTransaction(request.body, request.session); | ||
export default function handler( | ||
request: Request<unknown, unknown, AddTransactionForm>, | ||
response: Response | ||
): void { | ||
const newTransactionIndex = addTransaction(request.body, request.session) | ||
|
||
response.json({ | ||
success: true, | ||
message: "Transaction Added Successfully", | ||
message: 'Transaction Added Successfully', | ||
transactionIndex: newTransactionIndex | ||
}); | ||
}; | ||
|
||
|
||
export default handler; | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import type { RequestHandler } from "express"; | ||
export declare const handler: RequestHandler; | ||
export default handler; | ||
import type { Request, Response } from 'express'; | ||
export default function handler(request: Request<unknown, unknown, { | ||
licenceID: string; | ||
}>, response: Response<{ | ||
success: boolean; | ||
message: string; | ||
}>): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
import { deleteLicence } from "../../helpers/licencesDB/deleteLicence.js"; | ||
export const handler = (request, response) => { | ||
if (request.body.licenceID === "") { | ||
import deleteLicence from '../../helpers/licencesDB/deleteLicence.js'; | ||
export default function handler(request, response) { | ||
if (request.body.licenceID === '') { | ||
response.json({ | ||
success: false, | ||
message: "Licence ID Unavailable" | ||
message: 'Licence ID Unavailable' | ||
}); | ||
} | ||
else { | ||
const changeCount = deleteLicence(request.body.licenceID, request.session); | ||
if (changeCount) { | ||
response.json({ | ||
success: true, | ||
message: "Licence Deleted" | ||
message: 'Licence Deleted' | ||
}); | ||
} | ||
else { | ||
response.json({ | ||
success: false, | ||
message: "Licence Not Deleted" | ||
message: 'Licence Not Deleted' | ||
}); | ||
} | ||
} | ||
}; | ||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,29 @@ | ||
import type { RequestHandler } from "express"; | ||
import type { Request, Response } from 'express' | ||
|
||
import { deleteLicence } from "../../helpers/licencesDB/deleteLicence.js"; | ||
|
||
|
||
export const handler: RequestHandler = (request, response) => { | ||
|
||
if (request.body.licenceID === "") { | ||
import deleteLicence from '../../helpers/licencesDB/deleteLicence.js' | ||
|
||
export default function handler( | ||
request: Request<unknown, unknown, { licenceID: string }>, | ||
response: Response<{ success: boolean; message: string }> | ||
): void { | ||
if (request.body.licenceID === '') { | ||
response.json({ | ||
success: false, | ||
message: "Licence ID Unavailable" | ||
}); | ||
|
||
message: 'Licence ID Unavailable' | ||
}) | ||
} else { | ||
|
||
const changeCount = deleteLicence(request.body.licenceID, request.session); | ||
const changeCount = deleteLicence(request.body.licenceID, request.session) | ||
|
||
if (changeCount) { | ||
|
||
response.json({ | ||
success: true, | ||
message: "Licence Deleted" | ||
}); | ||
|
||
message: 'Licence Deleted' | ||
}) | ||
} else { | ||
|
||
response.json({ | ||
success: false, | ||
message: "Licence Not Deleted" | ||
}); | ||
message: 'Licence Not Deleted' | ||
}) | ||
} | ||
} | ||
}; | ||
|
||
|
||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import type { RequestHandler } from "express"; | ||
export declare const handler: RequestHandler; | ||
export default handler; | ||
import type { Request, Response } from 'express'; | ||
export default function handler(request: Request<unknown, unknown, { | ||
organizationID: string; | ||
}>, response: Response): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { getDistinctTermsConditions } from "../../helpers/licencesDB/getDistinctTermsConditions.js"; | ||
export const handler = (request, response) => { | ||
import getDistinctTermsConditions from '../../helpers/licencesDB/getDistinctTermsConditions.js'; | ||
export default function handler(request, response) { | ||
const organizationID = request.body.organizationID; | ||
response.json(getDistinctTermsConditions(organizationID)); | ||
}; | ||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import type { RequestHandler } from "express"; | ||
import type { Request, Response } from 'express' | ||
|
||
import { getDistinctTermsConditions } from "../../helpers/licencesDB/getDistinctTermsConditions.js"; | ||
import getDistinctTermsConditions from '../../helpers/licencesDB/getDistinctTermsConditions.js' | ||
|
||
export default function handler( | ||
request: Request<unknown, unknown, { organizationID: string }>, | ||
response: Response | ||
): void { | ||
const organizationID = request.body.organizationID | ||
|
||
export const handler: RequestHandler = (request, response) => { | ||
|
||
const organizationID = request.body.organizationID; | ||
|
||
response.json(getDistinctTermsConditions(organizationID)); | ||
|
||
}; | ||
|
||
|
||
export default handler; | ||
response.json(getDistinctTermsConditions(organizationID)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import type { RequestHandler } from "express"; | ||
export declare const handler: RequestHandler; | ||
export default handler; | ||
import type { Request, Response } from 'express'; | ||
export default function handler(request: Request<unknown, unknown, { | ||
licenceTypeKey: string; | ||
}>, response: Response): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import * as configFunctions from "../../helpers/functions.config.js"; | ||
export const handler = (request, response) => { | ||
import * as configFunctions from '../../helpers/functions.config.js'; | ||
export default function handler(request, response) { | ||
const licenceTypeKey = request.body.licenceTypeKey; | ||
const licenceType = configFunctions.getLicenceType(licenceTypeKey); | ||
if (licenceType) { | ||
response.json(licenceType.ticketTypes || []); | ||
if (licenceType === undefined) { | ||
response.json([]); | ||
} | ||
else { | ||
response.json([]); | ||
response.json(licenceType.ticketTypes ?? []); | ||
} | ||
}; | ||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,18 @@ | ||
import type { RequestHandler } from "express"; | ||
import type { Request, Response } from 'express' | ||
|
||
import * as configFunctions from "../../helpers/functions.config.js"; | ||
import * as configFunctions from '../../helpers/functions.config.js' | ||
|
||
export default function handler( | ||
request: Request<unknown, unknown, { licenceTypeKey: string }>, | ||
response: Response | ||
): void { | ||
const licenceTypeKey = request.body.licenceTypeKey | ||
|
||
export const handler: RequestHandler = (request, response) => { | ||
|
||
const licenceTypeKey = request.body.licenceTypeKey; | ||
|
||
const licenceType = configFunctions.getLicenceType(licenceTypeKey); | ||
|
||
if (licenceType) { | ||
|
||
response.json(licenceType.ticketTypes || []); | ||
const licenceType = configFunctions.getLicenceType(licenceTypeKey) | ||
|
||
if (licenceType === undefined) { | ||
response.json([]) | ||
} else { | ||
|
||
response.json([]); | ||
response.json(licenceType.ticketTypes ?? []) | ||
} | ||
}; | ||
|
||
|
||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import type { RequestHandler } from "express"; | ||
export declare const handler: RequestHandler; | ||
export default handler; | ||
import type { Request, Response } from 'express'; | ||
export default function handler(request: Request<unknown, unknown, { | ||
licenceID: string; | ||
}>, response: Response): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import { issueLicence } from "../../helpers/licencesDB/issueLicence.js"; | ||
export const handler = (request, response) => { | ||
import issueLicence from '../../helpers/licencesDB/issueLicence.js'; | ||
export default function handler(request, response) { | ||
const success = issueLicence(request.body.licenceID, request.session); | ||
if (success) { | ||
response.json({ | ||
success: true, | ||
message: "Licence Issued Successfully" | ||
message: 'Licence Issued Successfully' | ||
}); | ||
} | ||
else { | ||
response.json({ | ||
success: false, | ||
message: "Licence Not Issued" | ||
message: 'Licence Not Issued' | ||
}); | ||
} | ||
}; | ||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
import type { RequestHandler } from "express"; | ||
import type { Request, Response } from 'express' | ||
|
||
import { issueLicence } from "../../helpers/licencesDB/issueLicence.js"; | ||
import issueLicence from '../../helpers/licencesDB/issueLicence.js' | ||
|
||
|
||
export const handler: RequestHandler = (request, response) => { | ||
|
||
const success = issueLicence(request.body.licenceID, request.session); | ||
export default function handler( | ||
request: Request<unknown, unknown, { licenceID: string }>, | ||
response: Response | ||
): void { | ||
const success = issueLicence(request.body.licenceID, request.session) | ||
|
||
if (success) { | ||
|
||
response.json({ | ||
success: true, | ||
message: "Licence Issued Successfully" | ||
}); | ||
|
||
message: 'Licence Issued Successfully' | ||
}) | ||
} else { | ||
|
||
response.json({ | ||
success: false, | ||
message: "Licence Not Issued" | ||
}); | ||
message: 'Licence Not Issued' | ||
}) | ||
} | ||
}; | ||
|
||
|
||
export default handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
import type { RequestHandler } from "express"; | ||
export declare const handler: RequestHandler; | ||
export default handler; | ||
import type { Request, Response } from 'express'; | ||
import { type LotteryLicenceForm } from '../../helpers/licencesDB/updateLicence.js'; | ||
export default function handler(request: Request<unknown, unknown, LotteryLicenceForm & { | ||
licenceID: string; | ||
}>, response: Response<{ | ||
success: boolean; | ||
licenceID?: number; | ||
message?: string; | ||
}>): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.