Você está na página 1de 3

dd-->r-->c

dd->c
dr->c
dc
customer cann't login.
Users:
======
{
"userName": "abc",
"password": "password",
"role" : "admin/directDistributor/directReseller/directCustomer/reseller/
customer",
"eula" : "NA/notSigned/signed",
"email" : "mailId",
"locations" : {
"locationName": "usedById decided by the client program which marks this
location"
}
}
Products:
=========
{
"name" : "productName",
"status":"A/D"
}
Packages:
=========
{
"name" : "packageName",
"status" : "A/D",
"products": {
"productName": IntegerQuantity #??? key can be "productName" ????
}
"pricing" : {
"userRole": {"FirstTimeCost": Cost, "RecurringCost": Cost}
}
}
Coupons:
========
{
"name" : "couponName",
"status" : "A/D",
"startDate" : date,
"endDate" : date,
"packageRefId" : "_id of the package or * for total bill amount discoun
t",
"FirstTimeCost" : {
"percentage" : number/-1,
"amount" : number/-1,
},
"RecurringCost": {
"percentage" : number/-1,
"amount" : number/-1,
"numberMonths": number
}
}
Licenses:
=========
{
"productName": {
"count": IntegerCount
},
"invoiceReference": "Optional _id of the invoice which added this entry",
"location": "OptionalLocation" #exisits only if assigned to location
}
Queries:
========
* Direct guys, get total license count => ownedBy=myId and createdBy=myId and lo
cation not exists
* Direct guys, get used license count => ownedBy=not myId and createdBy=myId
* Direct customers, get used license count => ownedBy=myId and createdBy=myId an
d location exists
* Indirect guys, get total license count => ownedBy=myId and createdBy=not myId
* Indirect guys, get used license count => ownedBy=not myId and createdBy=myId a
nd location exists
* Indirect guys, get total license count for location => ownedBy=myId and create
dBy=not myId and location=specific location
Invoices:
==========
{
packages: {
"_id of the package": {
"quantity": Integer,
"coupon": _id
}
},
"coupon": "_id of the coupon applicable on the total bill amount"
"paymentMode": "Manual/Card"
"cardReference": Optional braintreeReference
}
Transactions:
==============
{
"_id of the package": {
"unitCost": Integer amount
"quantity": Integer,
"total": Integer amount
"discount": Integer Discount amount
"afterDiscount": Integer amount
},
"discount": "Discount on the total amount",
"total": "Grand total of the bill",
"invoiceReference": "Optional _id of the invoice which added this entry",
"paymentDetails": {
"creditCardId":braintree id
"transactionId": "id returned by braintree",
"status": "braintree status"
"amountPaid": Integer amount actually paid
}
}
Creditcards:
==========
{
userId: "_id of the user",
cardDetails: [{creditCardId:braintree id,cardNumber:0000,"userName":"DAD","e
mail":"SDA"},
{creditCardId:braintree id,cardNumber:0000}
]
}
}

Você também pode gostar