Skip to content
Snippets Groups Projects
Commit 518f39ae authored by Benedikt Magnus's avatar Benedikt Magnus
Browse files

Smaller changes

parent 51afa44c
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ interface Commands ...@@ -27,7 +27,7 @@ interface Commands
informationBothAnalogueAndDigital: CommandInfo; informationBothAnalogueAndDigital: CommandInfo;
informationDigital: CommandInfo; informationDigital: CommandInfo;
maybe: CommandInfo; maybe: CommandInfo;
moddingRunAssignment: CommandInfo; moddingRunAssignment: CommandInfo; // TODO: Rename "modding" commands to "moderation".
moddingStatus: CommandInfo; moddingStatus: CommandInfo;
no: CommandInfo; no: CommandInfo;
registration: CommandInfo; registration: CommandInfo;
......
...@@ -206,7 +206,7 @@ export default class Database ...@@ -206,7 +206,7 @@ export default class Database
} }
/** /**
* NOTE: The contact objects's lastUpdateTime will be updated. * NOTE: The contact object's lastUpdateTime will be updated.
* TODO: Give the save methods a better name like "insert" or "create" or "saveNew". * TODO: Give the save methods a better name like "insert" or "create" or "saveNew".
*/ */
public saveContact (contact: Contact): void public saveContact (contact: Contact): void
...@@ -244,7 +244,7 @@ export default class Database ...@@ -244,7 +244,7 @@ export default class Database
} }
/** /**
* NOTE: The contact objects's lastUpdateTime will be updated. * NOTE: The contact object's lastUpdateTime will be updated.
*/ */
public updateContact (contact: Contact): void public updateContact (contact: Contact): void
{ {
...@@ -426,15 +426,6 @@ export default class Database ...@@ -426,15 +426,6 @@ export default class Database
runTransaction(); runTransaction();
} }
public getWaitingMemberCount (): number
{
const statement = this.mainDatabase.prepare(
'SELECT COUNT(*) FROM contact WHERE contact.state = ?'
);
return this.getCount(statement, State.Waiting);
}
/** /**
* Will return the type of contact that can be found for this ID. \ * Will return the type of contact that can be found for this ID. \
* If no contact is found, the given contactCoreData will be returned instead. * If no contact is found, the given contactCoreData will be returned instead.
...@@ -466,7 +457,16 @@ export default class Database ...@@ -466,7 +457,16 @@ export default class Database
} }
} }
public getWaitingMember (): Member[] public getWaitingMemberCount (): number
{
const statement = this.mainDatabase.prepare(
'SELECT COUNT(*) FROM contact WHERE contact.state = ?'
);
return this.getCount(statement, State.Waiting);
}
public getWaitingMembers (): Member[]
{ {
const statement = this.mainDatabase.prepare( const statement = this.mainDatabase.prepare(
`SELECT `SELECT
......
...@@ -17,7 +17,8 @@ enum State ...@@ -17,7 +17,8 @@ enum State
InformationUserExclusion = 'informationUserExclusion', InformationUserExclusion = 'informationUserExclusion',
InformationFreeText = 'informationFreeText', InformationFreeText = 'informationFreeText',
// As member: // As member:
Waiting = 'waiting', // Waiting for becoming a wichtel. /** Waiting for becoming a Wichtel. */
Waiting = 'waiting', // TODO: Rename to "registered".
ConfirmDeregistration = 'confirmDeregistration', ConfirmDeregistration = 'confirmDeregistration',
// As wichtel: // As wichtel:
MessageToGiftGiver = 'messageToGiftGiver', MessageToGiftGiver = 'messageToGiftGiver',
......
...@@ -42,7 +42,7 @@ export class AssignmentModule ...@@ -42,7 +42,7 @@ export class AssignmentModule
*/ */
public runAssignment (): boolean // TODO: Return the reason for failure. public runAssignment (): boolean // TODO: Return the reason for failure.
{ {
const members = this.database.getWaitingMember(); const members = this.database.getWaitingMembers();
if (members.length === 0) if (members.length === 0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment