Skip to content

Commit 0002e31

Browse files
fix(domain-acl): fixes for challenge update
1 parent 234ade3 commit 0002e31

File tree

5 files changed

+424
-78
lines changed

5 files changed

+424
-78
lines changed

src/models/domain-layer/legacy/challenge.ts

Lines changed: 10 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ export interface CreateChallengeInput {
3030
tcDirectProjectId: number;
3131
winnerPrizes: CreateChallengeInput_Prize[];
3232
reviewType?: string | undefined;
33-
timelineNotification: boolean;
34-
statusNotification: boolean;
35-
rated: boolean;
3633
confidentialityType: string;
3734
billingProject: number;
3835
projectInfo: { [key: number]: string };
@@ -325,9 +322,6 @@ function createBaseCreateChallengeInput(): CreateChallengeInput {
325322
tcDirectProjectId: 0,
326323
winnerPrizes: [],
327324
reviewType: undefined,
328-
timelineNotification: false,
329-
statusNotification: false,
330-
rated: false,
331325
confidentialityType: "",
332326
billingProject: 0,
333327
projectInfo: {},
@@ -361,26 +355,17 @@ export const CreateChallengeInput = {
361355
if (message.reviewType !== undefined) {
362356
writer.uint32(66).string(message.reviewType);
363357
}
364-
if (message.timelineNotification === true) {
365-
writer.uint32(72).bool(message.timelineNotification);
366-
}
367-
if (message.statusNotification === true) {
368-
writer.uint32(80).bool(message.statusNotification);
369-
}
370-
if (message.rated === true) {
371-
writer.uint32(88).bool(message.rated);
372-
}
373358
if (message.confidentialityType !== "") {
374-
writer.uint32(98).string(message.confidentialityType);
359+
writer.uint32(74).string(message.confidentialityType);
375360
}
376361
if (message.billingProject !== 0) {
377-
writer.uint32(104).int32(message.billingProject);
362+
writer.uint32(80).int32(message.billingProject);
378363
}
379364
Object.entries(message.projectInfo).forEach(([key, value]) => {
380-
CreateChallengeInput_ProjectInfoEntry.encode({ key: key as any, value }, writer.uint32(114).fork()).ldelim();
365+
CreateChallengeInput_ProjectInfoEntry.encode({ key: key as any, value }, writer.uint32(90).fork()).ldelim();
381366
});
382367
for (const v of message.phases) {
383-
CreateChallengeInput_Phase.encode(v!, writer.uint32(122).fork()).ldelim();
368+
CreateChallengeInput_Phase.encode(v!, writer.uint32(106).fork()).ldelim();
384369
}
385370
return writer;
386371
},
@@ -417,27 +402,18 @@ export const CreateChallengeInput = {
417402
message.reviewType = reader.string();
418403
break;
419404
case 9:
420-
message.timelineNotification = reader.bool();
421-
break;
422-
case 10:
423-
message.statusNotification = reader.bool();
424-
break;
425-
case 11:
426-
message.rated = reader.bool();
427-
break;
428-
case 12:
429405
message.confidentialityType = reader.string();
430406
break;
431-
case 13:
407+
case 10:
432408
message.billingProject = reader.int32();
433409
break;
434-
case 14:
435-
const entry14 = CreateChallengeInput_ProjectInfoEntry.decode(reader, reader.uint32());
436-
if (entry14.value !== undefined) {
437-
message.projectInfo[entry14.key] = entry14.value;
410+
case 11:
411+
const entry11 = CreateChallengeInput_ProjectInfoEntry.decode(reader, reader.uint32());
412+
if (entry11.value !== undefined) {
413+
message.projectInfo[entry11.key] = entry11.value;
438414
}
439415
break;
440-
case 15:
416+
case 13:
441417
message.phases.push(CreateChallengeInput_Phase.decode(reader, reader.uint32()));
442418
break;
443419
default:
@@ -460,9 +436,6 @@ export const CreateChallengeInput = {
460436
? object.winnerPrizes.map((e: any) => CreateChallengeInput_Prize.fromJSON(e))
461437
: [],
462438
reviewType: isSet(object.reviewType) ? String(object.reviewType) : undefined,
463-
timelineNotification: isSet(object.timelineNotification) ? Boolean(object.timelineNotification) : false,
464-
statusNotification: isSet(object.statusNotification) ? Boolean(object.statusNotification) : false,
465-
rated: isSet(object.rated) ? Boolean(object.rated) : false,
466439
confidentialityType: isSet(object.confidentialityType) ? String(object.confidentialityType) : "",
467440
billingProject: isSet(object.billingProject) ? Number(object.billingProject) : 0,
468441
projectInfo: isObject(object.projectInfo)
@@ -491,9 +464,6 @@ export const CreateChallengeInput = {
491464
obj.winnerPrizes = [];
492465
}
493466
message.reviewType !== undefined && (obj.reviewType = message.reviewType);
494-
message.timelineNotification !== undefined && (obj.timelineNotification = message.timelineNotification);
495-
message.statusNotification !== undefined && (obj.statusNotification = message.statusNotification);
496-
message.rated !== undefined && (obj.rated = message.rated);
497467
message.confidentialityType !== undefined && (obj.confidentialityType = message.confidentialityType);
498468
message.billingProject !== undefined && (obj.billingProject = Math.round(message.billingProject));
499469
obj.projectInfo = {};
@@ -524,9 +494,6 @@ export const CreateChallengeInput = {
524494
message.tcDirectProjectId = object.tcDirectProjectId ?? 0;
525495
message.winnerPrizes = object.winnerPrizes?.map((e) => CreateChallengeInput_Prize.fromPartial(e)) || [];
526496
message.reviewType = object.reviewType ?? undefined;
527-
message.timelineNotification = object.timelineNotification ?? false;
528-
message.statusNotification = object.statusNotification ?? false;
529-
message.rated = object.rated ?? false;
530497
message.confidentialityType = object.confidentialityType ?? "";
531498
message.billingProject = object.billingProject ?? 0;
532499
message.projectInfo = Object.entries(object.projectInfo ?? {}).reduce<{ [key: number]: string }>(

src/models/domain-layer/legacy/phase.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ export interface ProjectPhase {
7575
projectId: number;
7676
phaseTypeId: number;
7777
phaseStatusId: number;
78-
fixedStartTime?: string | undefined;
79-
scheduledStartTime?: string | undefined;
80-
scheduledEndTime?: string | undefined;
81-
actualStartTime?: string | undefined;
82-
actualEndTime?: string | undefined;
78+
fixedStartTime?: number | undefined;
79+
scheduledStartTime?: number | undefined;
80+
scheduledEndTime?: number | undefined;
81+
actualStartTime?: number | undefined;
82+
actualEndTime?: number | undefined;
8383
duration: number;
8484
createUser?: number | undefined;
85-
createDate?: string | undefined;
85+
createDate?: number | undefined;
8686
modifyUser?: number | undefined;
87-
modifyDate?: string | undefined;
87+
modifyDate?: number | undefined;
8888
}
8989

9090
export interface GetProjectPhasesInput {
@@ -968,19 +968,19 @@ export const ProjectPhase = {
968968
writer.uint32(32).int64(message.phaseStatusId);
969969
}
970970
if (message.fixedStartTime !== undefined) {
971-
writer.uint32(42).string(message.fixedStartTime);
971+
writer.uint32(40).int64(message.fixedStartTime);
972972
}
973973
if (message.scheduledStartTime !== undefined) {
974-
writer.uint32(50).string(message.scheduledStartTime);
974+
writer.uint32(48).int64(message.scheduledStartTime);
975975
}
976976
if (message.scheduledEndTime !== undefined) {
977-
writer.uint32(58).string(message.scheduledEndTime);
977+
writer.uint32(56).int64(message.scheduledEndTime);
978978
}
979979
if (message.actualStartTime !== undefined) {
980-
writer.uint32(66).string(message.actualStartTime);
980+
writer.uint32(64).int64(message.actualStartTime);
981981
}
982982
if (message.actualEndTime !== undefined) {
983-
writer.uint32(74).string(message.actualEndTime);
983+
writer.uint32(72).int64(message.actualEndTime);
984984
}
985985
if (message.duration !== 0) {
986986
writer.uint32(80).int32(message.duration);
@@ -989,13 +989,13 @@ export const ProjectPhase = {
989989
writer.uint32(88).int32(message.createUser);
990990
}
991991
if (message.createDate !== undefined) {
992-
writer.uint32(98).string(message.createDate);
992+
writer.uint32(96).int64(message.createDate);
993993
}
994994
if (message.modifyUser !== undefined) {
995995
writer.uint32(104).int32(message.modifyUser);
996996
}
997997
if (message.modifyDate !== undefined) {
998-
writer.uint32(114).string(message.modifyDate);
998+
writer.uint32(112).int64(message.modifyDate);
999999
}
10001000
return writer;
10011001
},
@@ -1020,19 +1020,19 @@ export const ProjectPhase = {
10201020
message.phaseStatusId = longToNumber(reader.int64() as Long);
10211021
break;
10221022
case 5:
1023-
message.fixedStartTime = reader.string();
1023+
message.fixedStartTime = longToNumber(reader.int64() as Long);
10241024
break;
10251025
case 6:
1026-
message.scheduledStartTime = reader.string();
1026+
message.scheduledStartTime = longToNumber(reader.int64() as Long);
10271027
break;
10281028
case 7:
1029-
message.scheduledEndTime = reader.string();
1029+
message.scheduledEndTime = longToNumber(reader.int64() as Long);
10301030
break;
10311031
case 8:
1032-
message.actualStartTime = reader.string();
1032+
message.actualStartTime = longToNumber(reader.int64() as Long);
10331033
break;
10341034
case 9:
1035-
message.actualEndTime = reader.string();
1035+
message.actualEndTime = longToNumber(reader.int64() as Long);
10361036
break;
10371037
case 10:
10381038
message.duration = reader.int32();
@@ -1041,13 +1041,13 @@ export const ProjectPhase = {
10411041
message.createUser = reader.int32();
10421042
break;
10431043
case 12:
1044-
message.createDate = reader.string();
1044+
message.createDate = longToNumber(reader.int64() as Long);
10451045
break;
10461046
case 13:
10471047
message.modifyUser = reader.int32();
10481048
break;
10491049
case 14:
1050-
message.modifyDate = reader.string();
1050+
message.modifyDate = longToNumber(reader.int64() as Long);
10511051
break;
10521052
default:
10531053
reader.skipType(tag & 7);
@@ -1063,16 +1063,16 @@ export const ProjectPhase = {
10631063
projectId: isSet(object.projectId) ? Number(object.projectId) : 0,
10641064
phaseTypeId: isSet(object.phaseTypeId) ? Number(object.phaseTypeId) : 0,
10651065
phaseStatusId: isSet(object.phaseStatusId) ? Number(object.phaseStatusId) : 0,
1066-
fixedStartTime: isSet(object.fixedStartTime) ? String(object.fixedStartTime) : undefined,
1067-
scheduledStartTime: isSet(object.scheduledStartTime) ? String(object.scheduledStartTime) : undefined,
1068-
scheduledEndTime: isSet(object.scheduledEndTime) ? String(object.scheduledEndTime) : undefined,
1069-
actualStartTime: isSet(object.actualStartTime) ? String(object.actualStartTime) : undefined,
1070-
actualEndTime: isSet(object.actualEndTime) ? String(object.actualEndTime) : undefined,
1066+
fixedStartTime: isSet(object.fixedStartTime) ? Number(object.fixedStartTime) : undefined,
1067+
scheduledStartTime: isSet(object.scheduledStartTime) ? Number(object.scheduledStartTime) : undefined,
1068+
scheduledEndTime: isSet(object.scheduledEndTime) ? Number(object.scheduledEndTime) : undefined,
1069+
actualStartTime: isSet(object.actualStartTime) ? Number(object.actualStartTime) : undefined,
1070+
actualEndTime: isSet(object.actualEndTime) ? Number(object.actualEndTime) : undefined,
10711071
duration: isSet(object.duration) ? Number(object.duration) : 0,
10721072
createUser: isSet(object.createUser) ? Number(object.createUser) : undefined,
1073-
createDate: isSet(object.createDate) ? String(object.createDate) : undefined,
1073+
createDate: isSet(object.createDate) ? Number(object.createDate) : undefined,
10741074
modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined,
1075-
modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : undefined,
1075+
modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : undefined,
10761076
};
10771077
},
10781078

@@ -1082,16 +1082,16 @@ export const ProjectPhase = {
10821082
message.projectId !== undefined && (obj.projectId = Math.round(message.projectId));
10831083
message.phaseTypeId !== undefined && (obj.phaseTypeId = Math.round(message.phaseTypeId));
10841084
message.phaseStatusId !== undefined && (obj.phaseStatusId = Math.round(message.phaseStatusId));
1085-
message.fixedStartTime !== undefined && (obj.fixedStartTime = message.fixedStartTime);
1086-
message.scheduledStartTime !== undefined && (obj.scheduledStartTime = message.scheduledStartTime);
1087-
message.scheduledEndTime !== undefined && (obj.scheduledEndTime = message.scheduledEndTime);
1088-
message.actualStartTime !== undefined && (obj.actualStartTime = message.actualStartTime);
1089-
message.actualEndTime !== undefined && (obj.actualEndTime = message.actualEndTime);
1085+
message.fixedStartTime !== undefined && (obj.fixedStartTime = Math.round(message.fixedStartTime));
1086+
message.scheduledStartTime !== undefined && (obj.scheduledStartTime = Math.round(message.scheduledStartTime));
1087+
message.scheduledEndTime !== undefined && (obj.scheduledEndTime = Math.round(message.scheduledEndTime));
1088+
message.actualStartTime !== undefined && (obj.actualStartTime = Math.round(message.actualStartTime));
1089+
message.actualEndTime !== undefined && (obj.actualEndTime = Math.round(message.actualEndTime));
10901090
message.duration !== undefined && (obj.duration = Math.round(message.duration));
10911091
message.createUser !== undefined && (obj.createUser = Math.round(message.createUser));
1092-
message.createDate !== undefined && (obj.createDate = message.createDate);
1092+
message.createDate !== undefined && (obj.createDate = Math.round(message.createDate));
10931093
message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser));
1094-
message.modifyDate !== undefined && (obj.modifyDate = message.modifyDate);
1094+
message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate));
10951095
return obj;
10961096
},
10971097

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-disable */
2+
import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js";
3+
import { Empty } from "@topcoder-framework/lib-common";
4+
import { SyncInput } from "../sync";
5+
6+
export type LegacySyncService = typeof LegacySyncService;
7+
export const LegacySyncService = {
8+
syncLegacy: {
9+
path: "/topcoder.domain.service.sync.LegacySync/SyncLegacy",
10+
requestStream: false,
11+
responseStream: false,
12+
requestSerialize: (value: SyncInput) => Buffer.from(SyncInput.encode(value).finish()),
13+
requestDeserialize: (value: Buffer) => SyncInput.decode(value),
14+
responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()),
15+
responseDeserialize: (value: Buffer) => Empty.decode(value),
16+
},
17+
} as const;
18+
19+
export interface LegacySyncServer extends UntypedServiceImplementation {
20+
syncLegacy: handleUnaryCall<SyncInput, Empty>;
21+
}

0 commit comments

Comments
 (0)