Skip to content

Instantly share code, notes, and snippets.

@zetekla
Last active April 9, 2019 03:44
Show Gist options
  • Save zetekla/a186ee0e11628f01912036381dbe72a1 to your computer and use it in GitHub Desktop.
Save zetekla/a186ee0e11628f01912036381dbe72a1 to your computer and use it in GitHub Desktop.
DigitalForm.yml
Business requirements:
A - Invoice -
Inputting process
B - Accounting (gross, net - all of markups, cost of good sold)
C - (good-to-have): Automate population of Form
Technical implementation:
Req A:
Goal: generate a list of services for a customer -
show total to charge customer
and conditionally show markups and all gross revenue (total of markups) as tooltip Add markups to the Form.
- Flatten for pdf and printer
Side requirements: Installation process should involve User Form to Add/Update a User, Customer Form to Add/Update a Customer.
- Provide DigitalForm's Form to generate Json schema and use that for Create/Edit Service (Mozilla React-Form)
form mandatory fields: CoGS, markup: price, configure tax percentage on sum of CoGS and markup.
- Allow user to delete the service
implementation: Select the services provided to customer to build the invoice, select customerName
Req C: Automate download & population of Form
with right customer profile data, given we have 16 forms,
List of customer profiles
customerA,
customerB,
customerC
drag Form 1167 to customerC-name,
0) show a modal of vehicles/cases the customer has (optional as if we require user to expand customnerC Card)
1) store a timestamp draft of the Form (containing customer data) for that customer
2) Populate the Form that contains customer data (open in a modal/new tab)
3) User should have the ability to Save the Form
4) User should have the ability to Retrieve (under customer profile) & Update the Form
5) User should have the ability to Finalize & print to pdf
6) User should have the ability to Trash the Form if outdated
7) User should have the ability to Restore the Form if trashed by mistake
8) User should have the ability to set Trash X days for garbage collection (cleanup of old X days Forms)
9) The system should be able to perform Trashing by X days
Meteor, MongoDB, React & TypeScript
Microservice architecture is not mandatory
####################################
## MICROSERVICE 1 user info ##
## user ##
user: # user<Schema>
_id: uuid
type: JSON # build this string as a string list of comma-separated types base on the number of apps a user joins. A user can be both owner/consumer, buyer/seller: 'foodie-consumer, foodie-truck-owner', patronage/buyer
apps:
- appName: String
appId: uuid # reference to the App. if,
userId: uuid # backward reference to the user _id above
realm: String # provider where they join: Google, Twitter, Facebook, etc.
email: String # default to abc@gmail.com
emailVerified: Boolean
required: JSON # "email,name,userName,birthDay,gender, password"
userName: String
name:
userId: uuid
firstName: String
middleName: String
lastName: String
suffixName: String
career: String
jobTitle: String
company: String
gender: String
ethnicity: String
origin: String
addresses: # multiple addresses
- address1: String
address2: String
city: String
state: String
zip: String
country: String
mainAddress: Boolean # hometown, e.g. Orange CA
currentAddress: Boolean # place of residence, e.g. Quincy MA
password: String
questions: JSON # storing questions for password reset
answers: JSON # storing answers for password reset. User input of answer for questions[0] must match answers[0], likewise for the other two.
birthDate: Date
phoneNumber1: String
phoneNumber2: String
createdAt: Date
updatedAt: Date
lastSeenAt: Date
# foodieUser<Schema> extends user<Schema>
foodieUser:
_id: uuid # for purpose of tracking how many foodie users. There can be users using other Apps, only the one active on this App has this uuid pertaining to the foodie for extra security
type: JSON # inherits from the generic user type, foodie-app specific type
usedId: uuid # matching user _id
foodiePreferences: [] # String JSON "['burger', 'burrito', 'tapaz', 'taco', 'salad']", allow user to sort their preference
foodieAllergences: [] # String JSON
favoriteRestaurants: []
favoriteFoodtrucks: []
favoriteIngredients: []
favoriteLocations: [] # list of their neighborhoods or cities
favoriteDishes: [] # list of restaurant|foodtruck to try, { foodtruckId, foodtruckName, dishes: []}
favoriteRecipes: [] # data-mining for kitchen & cookware business
wishList: [] # survey purpose, polls, wish to have several more dishes of salmon salad at a place X, wish to have more sushi in my area.
coupons: []
accumPromoPoint: Number
role: String # admin | tech-support | regular-user
status: String # active | disable | gone | banned | locked, locked if not activated.
# extension <foodieUserTransaction schema>
_id: uuid
appUserId: uuid # matching user _id
credit: String # buy-in credits
inAppPurchases: []
####################################
/// BrowserHistory - don't do HashHistory
/// location.hash should only be used for refreshing to load the right section of a page.
$agencyName = 'EasySticker'
`localhost:3050/digitalForm/agency/${agencyId}/form/add` - Add a form (provide the user application Form/toggled Raw json to add their fields for a JSON schema for a new Form)
`localhost:3050/digitalForm/agency/${agencyId}/form/${formId}` - Edit a form (similar to the above)
`localhost:3050/digitalForm/agency/${agencyId}/form/${title}` - Open a form
`localhost:3050/digitalForm/agency/${agencyId}/invoice/add` - Add a invoice (provide the user application Form/toggled Raw json to add their customer info for a JSON schema)
`localhost:3050/digitalForm/agency/${agencyId}/invoice/${invoiceId}` - Edit a invoice (similar to the above)
`localhost:3050/digitalForm/agency/${agencyId}/invoice?start_time=42340240086767&end_time=56456054960796768 - list of all invoices matching filter reqs
`localhost:3050/digitalForm/agency/${agencyId}/bookeeping - generate a memo summarizing: revenue, CoGS, profits (profit = revenue - CoGS)
`localhost:3050/digitalForm/agency/${agencyId}/customer/add` - Add a customer (provide the user application Form/toggled Raw json to add their customer info for a JSON schema)
`localhost:3050/digitalForm/agency/${agencyId}/customer/${customerId}` - Edit a customer (similar to the above)
`localhost:3050/digitalForm/agency` - agency list
<span><i>logo</i> name</span>, EIN, storeTitle (ellipsis), specialty (word wrap), managers, phone, lastSeen (01/01/19 8:05pm), status
`localhost:3050/digitalForm/agency/${agencyId}` - Readonly configs
`localhost:3050/digitalForm/agency/${agencyId}/config` - Edit configs (
name*,
estd* - year of establishment,
startDate*: joined DateTime, 1553224134000
lastSeen*: last active/logined DateTime, 1553224134000
desc*, motto: khau hieu,
logo: '/assets/img/ezlicense.svg',
specialty: 'chuyen ve services: A,B,C',
status*: active|closed|delinquent|inactive,
billingStatus*: active|inactive|banned|delinquent, (color code: green|orange|red|black)
businessHours: { Mon: ['0:00:00 am', '11:00:00 pm'], Tue: [], Wed: [], Sun: [] }),
storeTitle: ten cua hang business sign,
businessId: String,
licenseId: String,
EIN*: String (tax Id: default 00-000000),
category: automotive|real-estate|notary|immigration|interpreter,
keywords, owner: <userAccount: username/nickname>,
ownerId: String <userId: uuid>,
managers: [<userAccount>, <userAccount>],
...
credits: <$>,
billingInformation: address, cc, cvv, etc.
holidays
lastActivity: <name of the activity>
lastUpdate: date-time when user performed last Activity
`localhost:3050/digitalForm/agency/${agencyId}/home` - View stats, view recent invoices with Search function, view recent customers with Search function and Button to Create a new invoice
`localhost:3050/digitalForm/agency/${agencyId}/customer/${customerId}/invoice/${invoiceId}` - Edit configs
`localhost:3050/digitalForm/agency/${agencyId}/customer/${customerId}/invoice/${invoiceId}/service/add` - Add a service (provide the user application Form/toggled Raw json to add their service info {price/markup/tax/insurance} for a JSON schema)
`localhost:3050/digitalForm/agency/${agencyId}/customer/${customerId}/invoice/${invoiceId}/service/${serviceId}` - Edit a service (similar to the above)
.
manager:
email: String # default to abc@gmail.com
emailVerified: Boolean
userName: String
name:
userId: uuid
firstName: String
middleName: String
lastName: String
suffixName: String
career: String
roles: [] # [manager, customer, staff, techsupport, admin]
jobTitle: String
company: String
gender: String
ethnicity: String
origin: String
address1: String
address2: String
city: String
state: String
zip: String
country: String
password: String
questions: JSON # storing questions for password reset
answers: JSON # storing answers for password reset. User input of answer for questions[0] must match answers[0], likewise for the other two.
birthDate: Date
phoneNumber1: String
phoneNumber2: String
createdAt: Date
updatedAt: Date
lastSeenAt: Date
driverlicense: F2423053
customer:
customField: [] # for JSON schema
vehicles: [
]
insurancepolicies
@zenithtekla
Copy link

localhost:3050/digitalForm/agency/{agencyId}/service/add - current page to add Service
localhost:3050/digitalForm/agency/{agencyId}/service - listing page of all services by agency
localhost:3050/digitalForm/agency/ - list page of all agencies
localhost:3050/digitalForm/agency/add - add an agency (Form)

          <Route exact path={`${base}/message`} component={Wrap(<Message mode="message" />)} />
          <Route exact path={`${base}/message/add`} component={Wrap(<Message mode="add" />)} />
          <Route exact path={`${base}/message/preview`} component={Wrap(<Message mode="preview" />)} />
          <Route exact path={`${base}/message/export`} component={Wrap(<Message mode="export" />)} />
          <Route exact path={`${base}/message/import`} component={Wrap(<Message mode="import" />)} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment