Skip to content

Shared expenses #40

@ptbrowne

Description

@ptbrowne

The Tricount and Splitwise connectors are bringing shared expenses into the realm of Cozy.
For now, they are saved in a format very close to how they are consumed by their respective web-apps. For shared expenses to be interesting from a Cozy point of view, and to be exploitable in the same way by Banks for example, we should have a common format for this kind of expenses.

Here are two examples of shared expenses, one from Tricount and one from Splitwise. I do not have now the time to think of a common format, I am putting this here not to forget :)

com.tricount.expenses

{
  "_id": "5b59918ce0ecdfefb90b76ac17014b5c",
  "addedBy": {
    "email": null,
    "id": 22774410,
    "name": null
  },
  "amount": 5.5,
  "amountOfParts": 1,
  "currency": "",
  "id": 71467317,
  "name": "fou de pâtisserie",
  "payedBy": {
    "email": null,
    "id": 22774408,
    "name": "Patou"
  },
  "repartition": [
    {
      "amount": -1,
      "amountOfPart": 1,
      "user": {
        "email": null,
        "id": 22774410,
        "name": "Py"
      }
    }
  ],
  "tricountId": 5697832
}

com.splitwise.expenses

{
  "_id": "0f3d1d1e6e66f7a4ace61081f30377e4",
  "category": {
    "id": 18,
    "name": "Général"
  },
  "comments_count": 0,
  "cost": "22.0",
  "created_at": "2017-11-07T08:54:03Z",
  "created_by": {
    "first_name": "maureen",
    "id": 999663,
    "last_name": null,
    "picture": {
      "medium": "https://splitwise.s3.amazonaws.com/uploads/user/avatar/999663/medium_P7211233.JPG"
    }
  },
  "creation_method": "split",
  "currency_code": "EUR",
  "date": "2017-11-07T08:53:46Z",
  "deleted_at": null,
  "deleted_by": null,
  "description": "Biocbon",
  "details": "",
  "email_reminder": true,
  "email_reminder_in_advance": null,
  "expense_bundle_id": null,
  "friendship_id": null,
  "group_id": 2468147,
  "id": 279457166,
  "next_repeat": null,
  "payment": false,
  "receipt": {
    "large": null,
    "original": null
  },
  "repayments": [
    {
      "amount": "7.33",
      "from": 975791,
      "to": 999663
    },
    {
      "amount": "7.33",
      "from": 2752687,
      "to": 999663
    }
  ],
  "repeat_interval": "never",
  "repeats": false,
  "transaction_confirmed": false,
  "transaction_id": null,
  "transaction_method": "offline",
  "updated_at": "2017-11-07T08:54:03Z",
  "updated_by": null,
  "users": [
    {
      "net_balance": "-7.33",
      "owed_share": "7.33",
      "paid_share": "0.0",
      "user": {
        "first_name": "paulpeyret",
        "id": 2752687,
        "last_name": null,
        "picture": {
          "medium": "https://splitwise.s3.amazonaws.com/uploads/user/avatar/2752687/medium_e7c65326-4fe5-45c4-aeb5-14e6ff9f2548.jpg"
        }
      },
      "user_id": 2752687
    },
    {
      "net_balance": "14.66",
      "owed_share": "7.34",
      "paid_share": "22.0",
      "user": {
        "first_name": "maureen",
        "id": 999663,
        "last_name": null,
        "picture": {
          "medium": "https://splitwise.s3.amazonaws.com/uploads/user/avatar/999663/medium_P7211233.JPG"
        }
      },
      "user_id": 999663
    },
    {
      "net_balance": "-7.33",
      "owed_share": "7.33",
      "paid_share": "0.0",
      "user": {
        "first_name": "Patrick",
        "id": 975791,
        "last_name": "Browne",
        "picture": {
          "medium": "https://splitwise.s3.amazonaws.com/uploads/user/avatar/975791/medium_2ecb75c1-a460-45ca-a80a-3d6f14c517d4.jpg"
        }
      },
      "user_id": 975791
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions