Skip to content

Sample state

rachanavishwanath edited this page Sep 16, 2020 · 6 revisions
{
	entities: {
		users: {
			1: {
				id: 1,
				name: "rachana",
				email: "[email protected]"
			},
			2: {
				id: 2,
				name: "rachana",
				email: "[email protected]"
			},
			3: {
				id: 3,
				name: "vania",
				email: "[email protected]"
			}
		},
		friends: {
			15: {
				id: 15,
				profile_id: 1,
				friend_id: [2, 3],
			}
			16 :{
				id: 16,
				profile_id: 3,
				friend_id: [],
			}
		},
		groups: {
			1: {
				id: 1,
				name: "Home",
				type: "Home",
				friend_id: [2, 3]
			}
		},
		category: {
			8: {
				id: 8,
				name: "entertainment",
				logo: "asset_url",
				sub_category_id {
					3: {
						id: 3,
						sub_category_name: "movies",
						sub_category_logo: "asset_url"
					},
					4: {
						id: 4,
						sub_category_name: "games",
						sub_category_logo: "asset_url"
					}

				}
			},
			9: {
				id: 9,
				name: "Others",
				logo: "asset_url"
			},
			10: {
				id: 10,
				name: "food",
				logo: "asset_url",
				sub_category_id {
					5: {
						id: 5,
						sub_category_name: "coffee",
						sub_category_logo: "asset_url"
					},
					6: {
						id: 6,
						sub_category_name: "lunch",
						sub_category_logo: "asset_url"
					}

				}
			}
		},
		additional_details: {
			1: {
				id: 1,
				expense_id: 6,
				author_id: 2,
				notes: "Lunch @Chipotle amoung Vaina, Rachana, vania and rasna",
				asset: "receipt_url"
			}
		},
		expenses: {
			6: {
				id: 6,
				profile_id: 1,
				amount: 40.45,
				description: "lunch",
				category_id: 8,
				sub_category_id: 3,
				date: 2020-08-15,
				split-type: "equally"
			},
			7: {
				id: 7,
				profile_id: 1,
				amount: 11.98,
				description: "Coffee",
				category_id: 10,
				group_id: 1,
				date: 2020-08-15,
				split-type: "unequally"
			}
		},
		expense_details: {
			1: {
				id: 1,
				expense_id: 6,
				friend_id: [2, 3],
				paid_by: {
					profile_id: 1,
					amount_paid: 40.45,
				}
				amount_owed: 26.97 #generated in model
				amount_borrowed: 0
				settled: false #generated in model,
			},
			2: {
				id: 2,
				expense_id: 7,
				friend_id: [2, 3],
				paid_by: {
					1: {
						id: 1,
						profile_id: 2,
						amount_paid: 7.99,
					},
					3: {
						id: 2,
						profile_id: 3,
						amount_paid: 3.99,
					}
					
				}
				amount_owed: 0 #generated in model
				amount_borrowed: 3.99
				settled: false #generated in model,
			}
		},
		userFinance: {
			20: {
				id: 20,
				profile_id: 1,
				amount_payable: 3.99,
				amount_receivable: 26.97
			}
		},


	},
	ui: {
		loading: true/ false,
		add_expense_modal: true/false,
		choose_payer_modal: true/false,
		choose_split_options: true/false,
		additional_notes_modal: true/false,
		choose_date_modal: true/ false,
		choose_group_modal: true/ false,
		choose_category_modal: true/ false,
		settle_up_modal: true/ false,
		add_friends_modal: true/ false,	 
	},
	errors: ["Whoops! We couldn’t find an account for that email address and password. Maybe you’ve forgotten your password?", "Password is too short (minimum is 8 characters)", "[email protected] already belongs to another account. If [email protected] is your email address, you can reset your password from our password reset page." ],
	alerts: ["You must enter an amount", "You must enter a description", "The total of everyone's paid shares($10.98) is different than the total cost($11.98)"]
	},
	session: { currentUserId: 1 }
}
Clone this wiki locally