Skip to content

Commit

Permalink
[LUM-851] Hotfix Campaign module (#143)
Browse files Browse the repository at this point in the history
* Add Members to campaign response

* Add poolId
  • Loading branch information
ThibaultJRD authored Nov 22, 2023
1 parent a6da4f9 commit e9bbf26
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/database/entities/millions-campaign.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export class MillionsCampaignEntity {
@Column({ type: 'varchar', length: 1024 })
description: string;

@Column({ type: 'integer', default: 0 })
pool_id: number;

@Column({ type: 'varchar', length: 64 })
username: string;

Expand Down
1 change: 1 addition & 0 deletions src/http/responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * from './lum.response';
export * from './market.response';
export * from './message.response';
export * from './millions-campaign.response';
export * from './millions-campaign-member.response';
export * from './millions-deposit.response';
export * from './millions-depositor.response';
export * from './millions-draw.response';
Expand Down
26 changes: 26 additions & 0 deletions src/http/responses/millions-campaign-member.response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ApiProperty } from '@nestjs/swagger';

import { Exclude, Expose } from 'class-transformer';

@Exclude()
export class MillionsCampaignMemberResponse {
@ApiProperty()
@Expose()
id: string;

@ApiProperty()
@Expose()
campaign_id: string;

@ApiProperty()
@Expose()
wallet_address: string;

@ApiProperty()
@Expose()
created_at: Date;

@ApiProperty()
@Expose()
updated_at: Date;
}
8 changes: 8 additions & 0 deletions src/http/responses/millions-campaign.response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ApiProperty } from '@nestjs/swagger';
import { Exclude, Expose, Type } from 'class-transformer';

import { BalanceResponse } from '@app/http/responses/balance.response';
import { MillionsCampaignMemberResponse } from '@app/http/responses/millions-campaign-member.response';

@Exclude()
export class MillionsCampaignResponse {
Expand All @@ -18,6 +19,10 @@ export class MillionsCampaignResponse {
@Expose()
description: string;

@ApiProperty()
@Expose()
pool_id: string;

@ApiProperty()
@Expose()
username: string;
Expand All @@ -35,6 +40,9 @@ export class MillionsCampaignResponse {
@Type(() => BalanceResponse)
amount: BalanceResponse;

@ApiProperty({ type: () => MillionsCampaignMemberResponse })
members: MillionsCampaignMemberResponse[];

@ApiProperty()
@Expose()
start_at: Date;
Expand Down

0 comments on commit e9bbf26

Please sign in to comment.