Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Settlements Table Schema #808

Closed
Tracked by #787
0x4007 opened this issue Sep 23, 2023 · 13 comments · Fixed by #644
Closed
Tracked by #787

Settlements Table Schema #808

0x4007 opened this issue Sep 23, 2023 · 13 comments · Fixed by #644

Comments

@0x4007
Copy link
Member

0x4007 commented Sep 23, 2023

Settlements

Represents the overarching record of a financial activity. Each entry can have references to either a credit or a debit.

Field Type Description
id int8 Unique identifier for the settlement.
created timestamptz Timestamp when the settlement was created.
updated timestamptz Timestamp when the settlement was last updated.
user_id int8 GitHub id of the user penalized.
org_id int8 GitHub id of the organization.
repo_id int8 GitHub id of the repository where the issue is located.
issue_id int8 GitHub id of the issue related to the penalty.
credit_id int8 Foreign key to the Credits table.
debit_id int8 Foreign key to the Debits table.
@GaryThisSidee
Copy link

/start

@ubiquibot
Copy link

ubiquibot bot commented Sep 25, 2023

Deadline Mon, 25 Sep 2023 12:44:25 UTC
Registered Wallet 0x2bBc6a8314044d70684C74CfA0E117eb75E3708c
Tips:
  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address @user.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the bounty.

    @seprintour
    Copy link
    Contributor

    @GaryThisSidee This depends on the Credit and Debit table, you'd have to set up a constraint and make sure it can only have a credit id or a debit id (not both)

    • Set up foreign key constraints for creditId and debitId in the Settlements table.
    • Application logic should prevent a Settlements entry from having both a creditId and a debitId.

    from the description: #787 (comment)

    Credit and Debit have to merged and then you need to add a function to create a table in permit, credit and settlement tables for every permit generated

    @seprintour
    Copy link
    Contributor

    So you'd have to wait for #810 and #811, and maybe #819 to be merged in for this to work

    @GaryThisSidee
    Copy link

    @GaryThisSidee This depends on the Credit and Debit table, you'd have to set up a constraint and make sure it can only have a credit id or a debit id (not both)

    • Set up foreign key constraints for creditId and debitId in the Settlements table.
    • Application logic should prevent a Settlements entry from having both a creditId and a debitId.

    from the description: #787 (comment)

    Credit and Debit have to merged and then you need to add a function to create a table in permit, credit and settlement tables for every permit generated

    ohh i see

    @GaryThisSidee
    Copy link

    GaryThisSidee commented Sep 25, 2023

    @seprintour looks like u already working on #811 should i do the #810 ?

    @seprintour
    Copy link
    Contributor

    @seprintour looks like u already working on #811 should i do the #810 ?

    Yea, you can start working on it.. It also depends on #811 though..

    There's a field for permitId

    @ubiquibot
    Copy link

    ubiquibot bot commented Sep 29, 2023

    Do you have any updates @GaryThisSidee? If you would like to release the bounty back to the DevPool, please comment /stop
    Last activity time: Mon Sep 25 2023 12:17:13 GMT+0000 (Coordinated Universal Time)

    @ubiquibot
    Copy link

    ubiquibot bot commented Oct 2, 2023

    @GaryThisSidee - Releasing the bounty back to dev pool because the allocated duration already ended!
    Last activity time: Mon Sep 25 2023 12:17:13 GMT+0000 (Coordinated Universal Time)

    @0x4007 0x4007 linked a pull request Oct 16, 2023 that will close this issue
    Copy link

    ubiquibot bot commented Feb 17, 2024

    + Evaluating results. Please wait...

    @0x4007 0x4007 self-assigned this Feb 17, 2024
    Copy link

    ubiquibot bot commented Feb 17, 2024

    @pavlovcik the deadline is at 2024-02-17T12:34:34.314Z

    @0x4007 0x4007 reopened this Feb 19, 2024
    @0x4007 0x4007 closed this as completed Feb 19, 2024
    Copy link

    ubiquibot bot commented Feb 19, 2024

    + Evaluating results. Please wait...

    Copy link

    ubiquibot bot commented Feb 19, 2024

    [ 346.2 WXDAI ]

    @pavlovcik
    Contributions Overview
    ViewContributionCountReward
    IssueSpecification161.2
    IssueTask1.00112.5
    ReviewComment14115
    ReviewComment1457.5
    Conversation Incentives
    CommentFormattingRelevanceReward
    ## **Settlements**

    Represents the overarching record of a fin...

    61.2

    h2:
      count: 1
      score: "1"
      words: 3
    code:
      count: 13
      score: "13"
      words: 13
    td:
      count: 27
      score: "27"
      words: 104
    
    161.2
    This should have merged this in weeks ago. The number of outstan...
    18.2-18.2
    @0xcodercrane In this case you should consider just regenerating...
    7.6-7.6
    Don't think it matters the order regarding conflicts but technic...
    3.8-3.8
    My mistake for not clarifying but the requirements inherit from ...
    4-4
    Will need to e2e test and merge...
    1.4-1.4
    Review comments at https://github.com/ubiquity/ubiquibot/pull/84...
    2-2
    There are many dimensions of your proposal to consider so it's h...
    16.8-16.8
    This should work on personal accounts (not just organizations) a...
    4.8-4.8
    Notes to self on incentive calculation architecture:
    • work bac...
    9.6
    li:
      count: 2
      score: "4"
      words: 21
    
    -9.6
    I think next week. It feels really close to being done but I'm a...
    5.6-5.6
    @wannacfuture its better that you branch from here instead of pu...
    3.8-3.8
    > I'm trying to use the new version with workflow dispatcher and...
    17
    code:
      count: 1
      score: "2"
      words: 26
    
    -17
    You guys should make sure you're using the same version of Node....
    18.4-18.4
    @gitcoindev maybe you can help fix the knip CI here...
    2-2
    This should have merged this in weeks ago. The number of outstan...
    9.1-9.1
    @0xcodercrane In this case you should consider just regenerating...
    3.8-3.8
    Don't think it matters the order regarding conflicts but technic...
    1.9-1.9
    My mistake for not clarifying but the requirements inherit from ...
    2-2
    Will need to e2e test and merge...
    0.7-0.7
    Review comments at https://github.com/ubiquity/ubiquibot/pull/84...
    1-1
    There are many dimensions of your proposal to consider so it's h...
    8.4-8.4
    This should work on personal accounts (not just organizations) a...
    2.4-2.4
    Notes to self on incentive calculation architecture:
    • work bac...
    4.8
    li:
      count: 2
      score: "2"
      words: 21
    
    -4.8
    I think next week. It feels really close to being done but I'm a...
    2.8-2.8
    @wannacfuture its better that you branch from here instead of pu...
    1.9-1.9
    > I'm trying to use the new version with workflow dispatcher and...
    8.5
    code:
      count: 1
      score: "1"
      words: 26
    
    -8.5
    You guys should make sure you're using the same version of Node....
    9.2-9.2
    @gitcoindev maybe you can help fix the knip CI here...
    1-1

    [ 17.15 WXDAI ]

    @seprintour
    Contributions Overview
    ViewContributionCountReward
    IssueComment314.05
    ReviewComment23.1
    Conversation Incentives
    CommentFormattingRelevanceReward
    @GaryThisSidee This depends on the Credit and Debit table, you'd...
    10.05
    li:
      count: 2
      score: "0.5"
      words: 40
    code:
      count: 9
      score: "2.25"
      words: 9
    
    0.84510.05
    So you'd have to wait for #810 and #811, and maybe #819 to be me...
    2.10.732.1
    > @seprintour looks like u already working on #811 should i do ...
    1.90.4451.9
    Check comment on issue @GaryThisSidee ...
    0.5-0.5
    @whilefoo this is not my PR, it's incomplete anyway and it's sup...
    2.6-2.6

    [ 0 WXDAI ]

    @BeanieMen
    Contributions Overview
    ViewContributionCountReward
    ReviewComment10
    Conversation Incentives
    CommentFormattingRelevanceReward
    🎉...
    ---

    [ 52.6 WXDAI ]

    @gitcoindev
    Contributions Overview
    ViewContributionCountReward
    ReviewComment752.6
    Conversation Incentives
    CommentFormattingRelevanceReward
    > There also seems to be an issue with ubiquibot-logger > > `...
    9.1
    code:
      count: 4
      score: "4"
      words: 4
    
    -9.1
    > > Hi @whilefoo , the `ubiquibot-logger` is an ESM module https...
    7.3
    code:
      count: 5
      score: "5"
      words: 7
    
    -7.3
    > > > Hi @whilefoo , the `ubiquibot-logger` is an ESM module htt...
    14.9
    code:
      count: 7
      score: "7"
      words: 10
    
    -14.9
    hi @whilefoo I will give this priority and try to fix till Monda...
    1.4-1.4
    @whilefoo I am on v0.3.4 already, so far no luck but closer and ...
    5.2-5.2
    hi @whilefoo could you please check ubiquibot-logger v0.3.5 ? I...
    8.9
    code:
      count: 1
      score: "1"
      words: 6
    
    -8.9
    Btw, about @pavlovcik 's last comment, I agree that we should sy...
    5.8-5.8

    [ 1.6 WXDAI ]

    @0xcodercrane
    Contributions Overview
    ViewContributionCountReward
    ReviewComment11.6
    Conversation Incentives
    CommentFormattingRelevanceReward
    should I merge https://github.com/ubiquity/ubiquibot/pull/643 in...
    1.6-1.6

    [ 0.6 WXDAI ]

    @wannacfuture
    Contributions Overview
    ViewContributionCountReward
    ReviewComment10.6
    Conversation Incentives
    CommentFormattingRelevanceReward
    should I resolve the conflicts? @pavlovcik ...
    0.6-0.6

    [ 139.7 WXDAI ]

    @rndquu
    Contributions Overview
    ViewContributionCountReward
    ReviewComment3139.7
    Conversation Incentives
    CommentFormattingRelevanceReward
    @pavlovcik

    There is the supabase [diff tool](https://supabas...

    42.1

    a:
      count: 4
      score: "4"
      words: 7
    li:
      count: 7
      score: "7"
      words: 110
    code:
      count: 10
      score: "10"
      words: 11
    
    -42.1
    @pavlovcik

    Regarding the locations and metadata.

    This i...

    96

    h2:
      count: 2
      score: "2"
      words: 11
    h3:
      count: 4
      score: "4"
      words: 4
    a:
      count: 2
      score: "2"
      words: 3
    li:
      count: 10
      score: "10"
      words: 170
    code:
      count: 21
      score: "21"
      words: 67
    td:
      count: 16
      score: "16"
      words: 57
    
    -96
    > Alternatively we do the two API calls but there's a good chanc...
    1.6-1.6

    [ 25.7 WXDAI ]

    @whilefoo
    Contributions Overview
    ViewContributionCountReward
    ReviewComment725.7
    Conversation Incentives
    CommentFormattingRelevanceReward
    @seprintour ...
    0.1-0.1
    oh sorry!...
    0.2-0.2
    I'm trying to use the new version with workflow dispatcher and I...
    6.8
    code:
      count: 1
      score: "1"
      words: 26
    
    -6.8
    There also seems to be an issue with ubiquibot-logger
    co...</a></h6></td><td><details><summary>7.9</summary>
    <pre>code:
      count: 1
      score: "1"
      words: 0
    </pre>
    </details></td><td>-</td><td>7.9</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1850189172">> Hi @whilefoo , the `ubiquibot-logger` is an ESM module https:/...</a></h6></td><td><details><summary>8.9</summary>
    <pre>code:
      count: 5
      score: "5"
      words: 7
    </pre>
    </details></td><td>-</td><td>8.9</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1859155851">> Following the article https://dev.to/tigawanna/building-and-pu...</a></h6></td><td>1.2</td><td>-</td><td>1.2</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1872954224">@gitcoindev it's working now, thanks!...</a></h6></td><td>0.6</td><td>-</td><td>0.6</td></tr></tbody></table>
      </details>
      
    
      <details>
        <summary>
          <b
            ><h3>
              <a
                href="https://pay.ubq.fi/?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIzNzAwMDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiMjU1NjU4MzE4MzgwOTAxMTE1NTQ0NDk5Nzk4Mjg0NDQxMTA3MTMwMzMxNDcxMzQxNzg0NzA5MjgxNTU5ODQ0MjkwMjQwNTI3MDg3NCIsImRlYWRsaW5lIjoiMTE1NzkyMDg5MjM3MzE2MTk1NDIzNTcwOTg1MDA4Njg3OTA3ODUzMjY5OTg0NjY1NjQwNTY0MDM5NDU3NTg0MDA3OTEzMTI5NjM5OTM1In0sInRyYW5zZmVyRGV0YWlscyI6eyJ0byI6IjB4YzRmYzYzZDg4ZGQ0MTFiMTlhY2Y4NmZiNTZiYTUwOTQxNjExYjNhNyIsInJlcXVlc3RlZEFtb3VudCI6IjM3MDAwMDAwMDAwMDAwMDAwMDAifSwib3duZXIiOiIweDQ0Q2ExNURiMTAxZkQxYzE5NDQ2N0RiNkFGMGM2N0M2QmJGNEFCNTEiLCJzaWduYXR1cmUiOiIweGQ3ZGMyOTRiZDE1NGNlMmVkZjM0Y2NmYzY2NmE2ZGFmMzMzNzUyOWQyNDNjMmI1YTQzNjkyMDkzNjYyYjE3ZDc3OGVmMDg2MDEzYTY0ZGIwNmRjODQ1NGEzMTM4MzBjMWU2NmYyNDFkNmM1MGIxYTY1OTU4OTEzOTkyNzMwZmMyMWIiLCJuZXR3b3JrSWQiOjEwMH1d"
              >
                [ 3.7 WXDAI ]</a
              >
            </h3>
            <h6>@EtherealGlow</h6></b
          >
        </summary>
        <h6>Contributions Overview</h6>
    <table><thead>
    <tr><th>View</th><th>Contribution</th><th>Count</th><th>Reward</th>
    </thead><tbody>
    <tr><td>Review</td><td>Comment</td><td>5</td><td>3.7</td></tr>
    </tbody></table>
        <h6>Conversation Incentives</h6><table><thead><tr><th>Comment</th><th>Formatting</th><th>Relevance</th><th>Reward</th></tr></thead><tbody><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1783856208">I pray for the refactor to be done quickly 🙏...</a></h6></td><td>0.9</td><td>-</td><td>0.9</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1792385039">Do you guys have any estimate on when the refactor will be done ...</a></h6></td><td>1.3</td><td>-</td><td>1.3</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1807904469">Any new estimate for how much time is left?...</a></h6></td><td>0.9</td><td>-</td><td>0.9</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1823077738">🙏...</a></h6></td><td>-</td><td>-</td><td>-</td></tr><tr><td><h6><a href="https://github.com/ubiquity/ubiquibot/pull/644#issuecomment-1840080819">When will the refactor be done 😭...</a></h6></td><td>0.6</td><td>-</td><td>0.6</td></tr></tbody></table>
      </details>
      
    <!-- Ubiquity - Transactions - generatePermits - 6fa67c1
    [
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "346200000000000000000"
          },
          "nonce": "9369881331828646377431377803365704744100822548642143742585765701575640597591",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x4007CE2083c7F3E18097aeB3A39bb8eC149a341d",
          "requestedAmount": "346200000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0xe490f7916ace61e2dcb9656a739a1d8494110f8a56af2f7ccc7c1e322c20f64a7fd5e25a9ffa134ef2af6c156347ffca130d6d888925573f91bba386d44c12f51b",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "17150000000000000000"
          },
          "nonce": "99069257311683952337495124169283450743081139263846682013148006587990282568337",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x3623338046b101ecEc741De9C3594CC2176f39E5",
          "requestedAmount": "17150000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0xee68903da543eeea4c115eb618e76117bdb56bfbcc47c076f4c233b2bfb56b53076ca8d8bbb63d6f85a73de195b06ee48a4a188f40ffbe1846df4ebcdd393c091b",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "0"
          },
          "nonce": "10780064462693900586989657052866146618949901330636976421284159945580407604470",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x24fbA1343132DE969Aeef0B1BD5CaAE1fB102978",
          "requestedAmount": "0"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0xc3af694804f4c5cbc3fd40df7bc18e982232d08610dac4e5f8635a1a5caf9e351b912f55e85056a42ae62da8aa44a143a08cc2e1111a15fcd5d9dbc6d68bebbe1c",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "52600000000000000000"
          },
          "nonce": "102758674911798968456135793236119010988981091612257415586624432294849570894288",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x7e92476D69Ff1377a8b45176b1829C4A5566653a",
          "requestedAmount": "52600000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0x60883ce34bd84eab3444483ffb12b28c8d0f1d79b06583948bc8e4343d51d288599d766ccca44512b82fca66c7ae578327a37a1b7083014027bc41741ca5238a1b",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "1600000000000000000"
          },
          "nonce": "36558621667594958622801774368488216493583453206256128211491706472354596249935",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x00868BB3BA2B36316c2fc42E4aFB6D4246b77E46",
          "requestedAmount": "1600000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0x259ba2b357c1952323ef1c843e15b4bd6fa01489197f12392e7f93976719455a496513f14eeb7bddc0d15cb31d390eb6338b4a54f9395142f34a1123abe6d24f1c",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "600000000000000000"
          },
          "nonce": "29573476171438851048142377307345891178945798592895504637279720973015467979544",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x9e4ef4353c928cd3eb473e8f12aecf58c208ef40",
          "requestedAmount": "600000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0x920c081d59a048ad0b51b1064d4d24f7e248a904b46a4b8730cc91d90180d69b764ce572dc1370e6f05384845fd23ced9a51329062f7f60d26a9e46c40211e251b",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "139700000000000000000"
          },
          "nonce": "25734525795828929267652637287192159384869287168021064728943400093048227545064",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0x336C033842FA316d470e820c81b742e62A0765DC",
          "requestedAmount": "139700000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0x4fe5e756e2cd7e613d513fc0f6983dd57a7e602ce130f391623858c4547781b95f9a4faaeaf5307e3c3d1408e29c21a49c18f8c4d205ef0b6bc41d7bb31b561c1b",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "25700000000000000000"
          },
          "nonce": "61869941257468243070424118604945752492415871853675010236491730379298724546086",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0xCee33C98410DEbe67A319Cb94F39e403435Df319",
          "requestedAmount": "25700000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0x196a3be213447b1219c000aad988711f7dd7388f46a6727b716bf39a22a02efe6616d0984a00e9be6dfa9c2a3903fc5f941338f2556bc120720fc0a30106b2871b",
        "networkId": 100
      },
      {
        "permit": {
          "permitted": {
            "token": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d",
            "amount": "3700000000000000000"
          },
          "nonce": "2556583183809011155444997982844411071303314713417847092815598442902405270874",
          "deadline": "115792089237316195423570985008687907853269984665640564039457584007913129639935"
        },
        "transferDetails": {
          "to": "0xc4fc63d88dd411b19acf86fb56ba50941611b3a7",
          "requestedAmount": "3700000000000000000"
        },
        "owner": "0x44Ca15Db101fD1c194467Db6AF0c67C6BbF4AB51",
        "signature": "0xd7dc294bd154ce2edf34ccfc666a6daf3337529d243c2b5a43692093662b17d778ef086013a64db06dc8454a313830c1e66f241d6c50b1a65958913992730fc21b",
        "networkId": 100
      }
    ]
    -->
    

    Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    3 participants