Skip to content

Sample state

rachanavishwanath edited this page Sep 24, 2020 · 6 revisions
{
	entities: {
		users: {
			1: {
				id: 1,
				name: "rachana",
				email: "rachana.gujrathi@gmail.com",
				friend: [2, 3]
			},
			2: {
				id: 2,
				name: "rachana",
				email: "rasna321@gmail.com",
				friend: [1, 3]
			},
			3: {
				id: 3,
				name: "vania",
				email: "vania@gmail.com",
				friend; [1,2 ]
			},
			4: {
				id: 4,
				name: "rach",
				email: "rach@gmail.com",
				friend: []
			}
		},
		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, 4]
			},
			9: {
				id: 9,
				name: "Others",
				logo: "asset_url",
				sub_category_id: []
			},
			10: {
				id: 10,
				name: "food",
				logo: "asset_url",
				sub_category_id: [5, 6]
			}
		},
		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,
				additional_details: [1,2]
				payable_id: 1,
				payable_type: friend
				date: 2020-08-15,
				split-type: "equally",
                                expense_details: 1
			},
			7: {
				id: 7,
				profile_id: 1,
				amount: 11.98,
				description: "Coffee",
				category_id: 10,
				payable_id: 1,
				payable_type: group
				date: 2020-08-15,
				split-type: "unequally",
                                expense_details: [2, 3]
			}
		},
		expense_details: {
			1: {
				id: 1,
				expense_id: 6,
				paid_by: 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,
				paid_by: 2
				amount_paid: 7.99
				amount_owed: 0 #generated in model
				amount_borrowed: 3.99
				settled: false #generated in model,
			}
                        3: {
				id: 3,
				expense_id: 7,
				paid_by: 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,
		modal: "values refers to the modal that is open" 
	},
	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)", "rachana.gujrathi@gmail.com already belongs to another account. If rachana.gujrathi@gmail.com 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 }
}

modals in this project: add_expense_modal choose_payer_modal choose_split_options additional_notes_modal choose_date_modal choose_group_modal choose_category_modal settle_up_modal add_friends_modal

Clone this wiki locally