Skip to content

Commit f23f478

Browse files
committed
fix: fixed so many fucking things i cant even
1 parent 24f6884 commit f23f478

10 files changed

+279
-46
lines changed

src/jobs/jobs.service.ts

Lines changed: 248 additions & 37 deletions
Large diffs are not rendered by default.

src/shared/entities/job-details.entity.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ export class JobDetailsEntity {
153153
project?.grants?.map(grant => ({
154154
...grant,
155155
//TODO: remove this once we have a better way to handle this
156+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
157+
tokenUnit: notStringOrNull(grant?.tokenUnit),
156158
programName: notStringOrNull(grant?.programName) ?? "N/A",
157159
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
158160
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/entities/job-list-result.entity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ export class JobListResultEntity {
214214
project?.grants?.map(grant => ({
215215
...grant,
216216
//TODO: remove this once we have a better way to handle this
217+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
218+
tokenUnit: notStringOrNull(grant?.tokenUnit),
217219
programName: notStringOrNull(grant?.programName) ?? "N/A",
218220
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
219221
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),
@@ -237,6 +239,8 @@ export class JobListResultEntity {
237239
organization?.grants?.map(grant => ({
238240
...grant,
239241
//TODO: remove this once we have a better way to handle this
242+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
243+
tokenUnit: notStringOrNull(grant?.tokenUnit),
240244
programName: notStringOrNull(grant?.programName) ?? "N/A",
241245
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
242246
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/entities/org-details-result.entity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ export class OrgDetailsResultEntity {
111111
project?.grants?.map(grant => ({
112112
...grant,
113113
//TODO: remove this once we have a better way to handle this
114+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
115+
tokenUnit: notStringOrNull(grant?.tokenUnit),
114116
programName: notStringOrNull(grant?.programName) ?? "N/A",
115117
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
116118
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),
@@ -176,6 +178,8 @@ export class OrgDetailsResultEntity {
176178
grants?.map(grant => ({
177179
...grant,
178180
//TODO: remove this once we have a better way to handle this
181+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
182+
tokenUnit: notStringOrNull(grant?.tokenUnit),
179183
programName: notStringOrNull(grant?.programName) ?? "N/A",
180184
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
181185
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/entities/organization-with-links.entity.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ export class OrganizationWithLinksEntity {
138138
grants?.map(grant => ({
139139
...grant,
140140
//TODO: remove this once we have a better way to handle this
141+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
142+
tokenUnit: notStringOrNull(grant?.tokenUnit),
141143
programName: notStringOrNull(grant?.programName) ?? "N/A",
142144
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
143145
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/entities/organization-with-relations.entity.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export class OrganizationWithRelationsEntity {
4141
organization?.grants?.map(grant => ({
4242
...grant,
4343
//TODO: remove this once we have a better way to handle this
44+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
45+
tokenUnit: notStringOrNull(grant?.tokenUnit),
4446
programName: notStringOrNull(grant?.programName) ?? "N/A",
4547
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
4648
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/entities/project-details.entity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ export class ProjectDetailsEntity {
100100
organization?.grants?.map(grant => ({
101101
...grant,
102102
//TODO: remove this once we have a better way to handle this
103+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
104+
tokenUnit: notStringOrNull(grant?.tokenUnit),
103105
programName: notStringOrNull(grant?.programName) ?? "N/A",
104106
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
105107
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),
@@ -136,6 +138,8 @@ export class ProjectDetailsEntity {
136138
project?.grants?.map(grant => ({
137139
...grant,
138140
//TODO: remove this once we have a better way to handle this
141+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
142+
tokenUnit: notStringOrNull(grant?.tokenUnit),
139143
programName: notStringOrNull(grant?.programName) ?? "N/A",
140144
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
141145
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/entities/project.entity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export class ProjectWithBaseRelationsEntity {
5959
project?.grants?.map(grant => ({
6060
...grant,
6161
//TODO: remove this once we have a better way to handle this
62+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
63+
tokenUnit: notStringOrNull(grant?.tokenUnit),
6264
programName: notStringOrNull(grant?.programName) ?? "N/A",
6365
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
6466
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),
@@ -137,6 +139,8 @@ export class ProjectWithRelationsEntity {
137139
project?.grants?.map(grant => ({
138140
...grant,
139141
//TODO: remove this once we have a better way to handle this
142+
tokenAmount: nonZeroOrNull(grant?.tokenAmount),
143+
tokenUnit: notStringOrNull(grant?.tokenUnit),
140144
programName: notStringOrNull(grant?.programName) ?? "N/A",
141145
createdTimestamp: nonZeroOrNull(grant?.createdTimestamp),
142146
updatedTimestamp: nonZeroOrNull(grant?.updatedTimestamp),

src/shared/interfaces/grant.interface.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -524,23 +524,23 @@ export class GrantListResult {
524524
export class GrantFunding {
525525
public static readonly GrantFundingType = t.strict({
526526
id: t.string,
527-
tokenAmount: t.number,
528-
tokenUnit: t.string,
527+
tokenAmount: t.union([t.number, t.null]),
528+
tokenUnit: t.union([t.string, t.null]),
529529
fundingDate: t.union([t.number, t.null]),
530530
amount: t.union([t.number, t.null]),
531-
programName: t.string,
532-
createdTimestamp: t.number,
531+
programName: t.union([t.string, t.null]),
532+
createdTimestamp: t.union([t.number, t.null]),
533533
updatedTimestamp: t.union([t.number, t.null]),
534534
});
535535

536536
@ApiProperty()
537537
id: string;
538538

539539
@ApiProperty()
540-
tokenAmount: number;
540+
tokenAmount: number | null;
541541

542542
@ApiProperty()
543-
tokenUnit: string;
543+
tokenUnit: string | null;
544544

545545
@ApiProperty()
546546
fundingDate: number | null;
@@ -549,10 +549,10 @@ export class GrantFunding {
549549
amount: number | null;
550550

551551
@ApiProperty()
552-
programName: string;
552+
programName: string | null;
553553

554554
@ApiProperty()
555-
createdTimestamp: number;
555+
createdTimestamp: number | null;
556556

557557
@ApiProperty()
558558
updatedTimestamp: number | null;

src/shared/interfaces/organization.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class OrganizationWithRelations extends Organization {
121121
investors: t.array(Investor.InvestorType),
122122
community: t.array(t.string),
123123
ecosystems: t.array(t.string),
124-
grants: t.array(t.string),
124+
grants: t.array(GrantFunding.GrantFundingType),
125125
reviews: t.array(OrgReview.OrgReviewType),
126126
}),
127127
]);

0 commit comments

Comments
 (0)