mirror of
https://github.com/System-End/scraps.git
synced 2026-04-19 16:28:20 +00:00
aaa
This commit is contained in:
parent
8d2b90a482
commit
1c808047b4
2 changed files with 25 additions and 20 deletions
22
backend/dist/index.js
vendored
22
backend/dist/index.js
vendored
|
|
@ -34659,16 +34659,18 @@ async function syncProjectsToAirtable() {
|
|||
effectiveHours = Math.max(0, effectiveHours);
|
||||
}
|
||||
}
|
||||
let otherYswsDeduction = 0;
|
||||
if (project.githubUrl && otherYswsHours.has(project.githubUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.githubUrl);
|
||||
}
|
||||
if (project.playableUrl && otherYswsHours.has(project.playableUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.playableUrl);
|
||||
}
|
||||
if (otherYswsDeduction > 0) {
|
||||
console.log(`[AIRTABLE-SYNC] Deducting ${otherYswsDeduction}h from project ${project.id} (awarded in other YSWS programs)`);
|
||||
effectiveHours = Math.max(0, effectiveHours - otherYswsDeduction);
|
||||
if (project.hoursOverride === null) {
|
||||
let otherYswsDeduction = 0;
|
||||
if (project.githubUrl && otherYswsHours.has(project.githubUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.githubUrl);
|
||||
}
|
||||
if (project.playableUrl && otherYswsHours.has(project.playableUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.playableUrl);
|
||||
}
|
||||
if (otherYswsDeduction > 0) {
|
||||
console.log(`[AIRTABLE-SYNC] Deducting ${otherYswsDeduction}h from project ${project.id} (awarded in other YSWS programs)`);
|
||||
effectiveHours = Math.max(0, effectiveHours - otherYswsDeduction);
|
||||
}
|
||||
}
|
||||
const firstName = userIdentity?.first_name || (project.username || "").split(" ")[0] || "";
|
||||
const lastName = userIdentity?.last_name || (project.username || "").split(" ").slice(1).join(" ") || "";
|
||||
|
|
|
|||
|
|
@ -444,16 +444,19 @@ export async function syncProjectsToAirtable(): Promise<void> {
|
|||
}
|
||||
|
||||
// Deduct hours already awarded in other YSWS programs
|
||||
let otherYswsDeduction = 0
|
||||
if (project.githubUrl && otherYswsHours.has(project.githubUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.githubUrl)!
|
||||
}
|
||||
if (project.playableUrl && otherYswsHours.has(project.playableUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.playableUrl)!
|
||||
}
|
||||
if (otherYswsDeduction > 0) {
|
||||
console.log(`[AIRTABLE-SYNC] Deducting ${otherYswsDeduction}h from project ${project.id} (awarded in other YSWS programs)`)
|
||||
effectiveHours = Math.max(0, effectiveHours - otherYswsDeduction)
|
||||
// Skip deduction if project has an override — the reviewer already set the intended hours
|
||||
if (project.hoursOverride === null) {
|
||||
let otherYswsDeduction = 0
|
||||
if (project.githubUrl && otherYswsHours.has(project.githubUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.githubUrl)!
|
||||
}
|
||||
if (project.playableUrl && otherYswsHours.has(project.playableUrl)) {
|
||||
otherYswsDeduction += otherYswsHours.get(project.playableUrl)!
|
||||
}
|
||||
if (otherYswsDeduction > 0) {
|
||||
console.log(`[AIRTABLE-SYNC] Deducting ${otherYswsDeduction}h from project ${project.id} (awarded in other YSWS programs)`)
|
||||
effectiveHours = Math.max(0, effectiveHours - otherYswsDeduction)
|
||||
}
|
||||
}
|
||||
|
||||
const firstName = userIdentity?.first_name || (project.username || '').split(' ')[0] || ''
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue