Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b-2704-new-endpoint-get-apiv1contributionscontributionuuidevents #1297

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class AbstractMarketplaceApiIT {
protected static final String BILLING_PROFILE_INVOICES_MANDATE = "/api/v1/billing-profiles/%s/invoices/mandate";
protected static final String CONTRIBUTIONS = "/api/v1/contributions";
protected static final String CONTRIBUTIONS_BY_ID = "/api/v1/contributions/%s";
protected static final String CONTRIBUTIONS_BY_ID_EVENTS = "/api/v1/contributions/%s/events";
protected static final String PROJECTS_GET_CONTRIBUTION_BY_ID = "/api/v1/projects/%s/contributions/%s";
protected static final String PROJECTS_GET_BY_ID = "/api/v1/projects";
protected static final String PROJECTS_GET_BY_SLUG = "/api/v1/projects/slug";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,68 @@ void should_get_pr_contribution() {
""");
}

@Test
void should_get_pr_contribution_events() {
// When
client.get()
.uri(getApiURI(CONTRIBUTIONS_BY_ID_EVENTS.formatted("f4db1d9b-4e1d-300c-9277-8d05824c804e")))
// Then
.exchange()
.expectStatus()
.isOk()
.expectBody()
.json("""
{
"events": [
{
"timestamp": "2015-08-27T11:38:25Z",
"type": "PR_CREATED",
"assignee": null,
"mergedBy": null,
"linkedIssueContributionUuid": null
},
{
"timestamp": "2015-08-30T19:18:14Z",
"type": "PR_MERGED",
"assignee": null,
"mergedBy": {
"githubUserId": 595505,
"login": "ofux",
"avatarUrl": "https://onlydust-app-images.s3.eu-west-1.amazonaws.com/5494259449694867225.webp",
"contacts": [
{
"channel": "TWITTER",
"contact": "https://twitter.com/fuxeto",
"visibility": "private"
},
{
"channel": "TELEGRAM",
"contact": "https://t.me/ofux",
"visibility": "private"
}
]
},
"linkedIssueContributionUuid": null
},
{
"timestamp": "2023-10-29T01:01:47Z",
"type": "LINKED_ISSUE_CREATED",
"assignee": null,
"mergedBy": null,
"linkedIssueContributionUuid": "4782d22d-be45-3253-a3b4-5688045632f7"
},
{
"timestamp": "2023-10-29T07:41:49Z",
"type": "LINKED_ISSUE_CLOSED",
"assignee": null,
"mergedBy": null,
"linkedIssueContributionUuid": "4782d22d-be45-3253-a3b4-5688045632f7"
}
]
}
""");
}

@Test
void should_get_issue_contribution() {
// When
Expand Down Expand Up @@ -342,6 +404,72 @@ void should_get_issue_contribution() {
""");
}

@Test
void should_get_issue_contribution_events() {
// When
client.get()
.uri(getApiURI(CONTRIBUTIONS_BY_ID_EVENTS.formatted("0f8d789f-fbbd-3171-ad03-9b2b6f8d9174")))
// Then
.exchange()
.expectStatus()
.isOk()
.expectBody()
.json("""
{
"events": [
{
"timestamp": "2022-07-11T09:14:38Z",
"type": "ISSUE_CREATED",
"assignee": null,
"mergedBy": null,
"linkedIssueContributionUuid": null
},
{
"timestamp": "2024-10-17T14:03:10.967909Z",
"type": "ISSUE_ASSIGNED",
"assignee": {
"githubUserId": 595505,
"login": "ofux",
"avatarUrl": "https://onlydust-app-images.s3.eu-west-1.amazonaws.com/5494259449694867225.webp",
"since": "2024-10-17T14:03:10.967909Z",
"assignedBy": {
"githubUserId": 43467246,
"login": "AnthonyBuisset",
"avatarUrl": "https://onlydust-app-images.s3.eu-west-1.amazonaws.com/11725380531262934574.webp",
"contacts": [
{
"channel": "TELEGRAM",
"contact": "https://t.me/abuisset",
"visibility": "public"
},
{
"channel": "TWITTER",
"contact": "https://twitter.com/abuisset",
"visibility": "public"
},
{
"channel": "DISCORD",
"contact": "antho",
"visibility": "public"
}
]
}
},
"mergedBy": null,
"linkedIssueContributionUuid": null
},
{
"timestamp": "2022-08-05T08:07:52Z",
"type": "ISSUE_CLOSED",
"assignee": null,
"mergedBy": null,
"linkedIssueContributionUuid": null
}
]
}
""");
}

@Test
void should_get_linked_issue_by_id() {
// When
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,144 +218,15 @@ void should_get_recipient_bi_financial_stats() {
{
"totalDeposited": {
"totalUsdEquivalent": 0.00,
"totalPerCurrency": [
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "3f6e1c98-8659-493a-b941-943a803bd91f",
"code": "BTC",
"name": "Bitcoin",
"logoUrl": null,
"decimals": 8
},
"usdEquivalent": null,
"usdConversionRate": null,
"ratio": null
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "71bdfcf4-74ee-486b-8cfe-5d841dd93d5c",
"code": "ETH",
"name": "Ether",
"logoUrl": null,
"decimals": 18
},
"usdEquivalent": 0.00,
"usdConversionRate": 1781.983987,
"ratio": null
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "562bbf65-8a71-4d30-ad63-520c0d68ba27",
"code": "USDC",
"name": "USD Coin",
"logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
"decimals": 6
},
"usdEquivalent": 0.00,
"usdConversionRate": 1.010001,
"ratio": null
}
]
"totalPerCurrency": []
},
"totalAllocated": {
"totalUsdEquivalent": 0.00,
"totalPerCurrency": [
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "3f6e1c98-8659-493a-b941-943a803bd91f",
"code": "BTC",
"name": "Bitcoin",
"logoUrl": null,
"decimals": 8
},
"usdEquivalent": null,
"usdConversionRate": null,
"ratio": null
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "71bdfcf4-74ee-486b-8cfe-5d841dd93d5c",
"code": "ETH",
"name": "Ether",
"logoUrl": null,
"decimals": 18
},
"usdEquivalent": 0.00,
"usdConversionRate": 1781.983987,
"ratio": null
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "562bbf65-8a71-4d30-ad63-520c0d68ba27",
"code": "USDC",
"name": "USD Coin",
"logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
"decimals": 6
},
"usdEquivalent": 0.00,
"usdConversionRate": 1.010001,
"ratio": null
}
]
"totalPerCurrency": []
},
"totalGranted": {
"totalUsdEquivalent": 0.00,
"totalPerCurrency": [
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "3f6e1c98-8659-493a-b941-943a803bd91f",
"code": "BTC",
"name": "Bitcoin",
"logoUrl": null,
"decimals": 8
},
"usdEquivalent": null,
"usdConversionRate": null,
"ratio": null
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "71bdfcf4-74ee-486b-8cfe-5d841dd93d5c",
"code": "ETH",
"name": "Ether",
"logoUrl": null,
"decimals": 18
},
"usdEquivalent": 0.00,
"usdConversionRate": 1781.983987,
"ratio": null
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "562bbf65-8a71-4d30-ad63-520c0d68ba27",
"code": "USDC",
"name": "USD Coin",
"logoUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
"decimals": 6
},
"usdEquivalent": 0.00,
"usdConversionRate": 1.010001,
"ratio": null
}
]
"totalPerCurrency": []
},
"totalRewarded": {
"totalUsdEquivalent": 5850.95,
Expand Down Expand Up @@ -407,20 +278,6 @@ void should_get_recipient_bi_financial_stats() {
"totalPaid": {
"totalUsdEquivalent": 404.00,
"totalPerCurrency": [
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "3f6e1c98-8659-493a-b941-943a803bd91f",
"code": "BTC",
"name": "Bitcoin",
"logoUrl": null,
"decimals": 8
},
"usdEquivalent": null,
"usdConversionRate": null,
"ratio": null
},
{
"amount": 400,
"prettyAmount": 400,
Expand All @@ -434,20 +291,6 @@ void should_get_recipient_bi_financial_stats() {
"usdEquivalent": 404.00,
"usdConversionRate": 1.010001,
"ratio": 100
},
{
"amount": 0,
"prettyAmount": 0,
"currency": {
"id": "71bdfcf4-74ee-486b-8cfe-5d841dd93d5c",
"code": "ETH",
"name": "Ether",
"logoUrl": null,
"decimals": 18
},
"usdEquivalent": 0.00,
"usdConversionRate": 1781.983987,
"ratio": 0
}
]
},
Expand Down
Loading
Loading