feat: add DXCC SAT award for satellite-only QSOs
Added new award "DXCC SAT" that only counts satellite QSOs (QSOs with satName field set). This adds a new "satellite_only" key to award definitions that filters to only include satellite communications. Award definition: - ID: dxcc-sat - Name: DXCC SAT - Target: 100 DXCC entities - Only satellite QSOs count Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
14
award-definitions/dxcc-sat.json
Normal file
14
award-definitions/dxcc-sat.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"id": "dxcc-sat",
|
||||||
|
"name": "DXCC SAT",
|
||||||
|
"description": "Confirm 100 DXCC entities via satellite",
|
||||||
|
"caption": "Contact and confirm 100 different DXCC entities using satellite communications. Only satellite QSOs count toward this award. QSOs are confirmed when LoTW QSL is received.",
|
||||||
|
"category": "dxcc",
|
||||||
|
"rules": {
|
||||||
|
"type": "entity",
|
||||||
|
"entityType": "dxcc",
|
||||||
|
"target": 100,
|
||||||
|
"displayField": "entity",
|
||||||
|
"satellite_only": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ function loadAwardDefinitions() {
|
|||||||
try {
|
try {
|
||||||
const files = [
|
const files = [
|
||||||
'dxcc.json',
|
'dxcc.json',
|
||||||
|
'dxcc-sat.json',
|
||||||
'was.json',
|
'was.json',
|
||||||
'vucc-sat.json',
|
'vucc-sat.json',
|
||||||
'sat-rs44.json',
|
'sat-rs44.json',
|
||||||
@@ -145,6 +146,12 @@ export async function calculateAwardProgress(userId, award, options = {}) {
|
|||||||
logger.debug('QSOs after allowed_bands filter', { count: finalQSOs.length });
|
logger.debug('QSOs after allowed_bands filter', { count: finalQSOs.length });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply satellite_only filter if present
|
||||||
|
if (rules.satellite_only) {
|
||||||
|
finalQSOs = finalQSOs.filter(qso => qso.satName);
|
||||||
|
logger.debug('QSOs after satellite_only filter', { count: finalQSOs.length });
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate worked and confirmed entities
|
// Calculate worked and confirmed entities
|
||||||
const workedEntities = new Set();
|
const workedEntities = new Set();
|
||||||
const confirmedEntities = new Set();
|
const confirmedEntities = new Set();
|
||||||
@@ -723,6 +730,11 @@ export async function getAwardEntityBreakdown(userId, awardId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply satellite_only filter if present
|
||||||
|
if (rules.satellite_only) {
|
||||||
|
finalQSOs = finalQSOs.filter(qso => qso.satName);
|
||||||
|
}
|
||||||
|
|
||||||
// Group by (entity, band, mode) slot for entity awards
|
// Group by (entity, band, mode) slot for entity awards
|
||||||
// This allows showing multiple QSOs per entity on different bands/modes
|
// This allows showing multiple QSOs per entity on different bands/modes
|
||||||
const slotMap = new Map(); // Key: "entity/band/mode" -> slot object
|
const slotMap = new Map(); // Key: "entity/band/mode" -> slot object
|
||||||
|
|||||||
Reference in New Issue
Block a user