/
MODELS.txt
131 lines (102 loc) · 4.08 KB
/
MODELS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
FAIA
|
>aguardando
|
+- administradores (DITCH USERS/OPERATORS)
| |
| +- simplelogin:1: 1
|
+- clientes
| |
| +- "2180": { codigo: "2180", nome: "Redd", vendedor: "Rodrigo" }
| |
| +- "2742": { codigo: "2742", nome: "XBZ", vendedor: "Dona Sonia" }
|
+- produtos
| |
| +- "137350B": { codigo: "137350B", nome: "Chaveiro de metal" }
| |
| +- "143036": { codigo: "143036", nome: "Kit churrasco c/ 4 pcs" }
|
+- chegando
| |
| +- ---firebase-timestamp
| |
| +- codigo: "143036"
| +- quantidade: 10000 (INTEGER)
| +- container: "S/N"
|
+- linha
|
+- --- firebase-timestamp
|
+- criador: simplelogin:1
+- dataCriada: SEE DOCS Firebase.ServerValue.TIMESTAMP
+- dataModificada: SEE DOCS
+- status: one of "1: Reserva", "2: Desistencia", "3: Container",
| "4: Desistencia do container", "5: Faturado", or "6: Cancelado"
| Numbers are added for sorting.
| "1: Reserva" are the line items from which to request
+- cliente: "2180"
+- vendedor: "Celia" (USE DROPDOWN)
+- codigo: "143036"
+- quantidade: 200 (total, INTEGER)
+- jaReservado: 20 (INTEGER)
+- observacoes: "Com Joao"
```
# Views
LineItems (main)
Clientes
Produtos
Chegando
# Tasks
copy the structure of TiNAtasks, and apply the following changes
* replace table trs with divs, as in the [second answer here](http://stackoverflow.com/questions/4035966/create-a-html-table-where-each-tr-is-a-form)
* edits don't automatically save to firebase, see chat example in angularjs/angularfire/chat: `input ng-change="messages.$save(message)"`
* make each row edit its own form, toggle show/hide
* $add, update has `.then()` callbacks, use them to modify a status message indicating success "Successfully updated / added ..."
* css style changes based on line item status
Undo one level?
if Desistencia, then do not subtract from container totals (Chegando)
Does callback to child_modified provide previous values?
Count total number of line items per container, to verify against physical
paper copies
nesting line items as children of pedidos complicates aggregating data, beyond
my experience level right now
find a way to store container number, when changing status to Reserva (add
callback to child_modified?)
Editing a line item should change totals
autocomplete when entering codigo and clientes name. Entering a number also
fills in the string, and entering a string fills in the number
clicking on an edit button, icon, or link opens a modal with edit form (and x)
"On submit" it becomes gray and callback closes it
aggregate by cliente, produto, vendedor, container
checkbox to decide if "inactive" line items are included in aggregate lists,
simply use a ng-show on each element
how to handle multiple chegandos on same item? could tally by codigo and
concatenate the multiple containers into a string
line item's container label should be auto-computed
for testing, create child from firebaseRef based on user id.
the test branch is a sibling of banana_store
LineItems table should be sortable by column heading, like tablesorter.
Double-clicking reverses sort
Setup user profiles page where user's group is assigned manually by a
superuser, then use this group information like
"$group_id": "$group_id == $user_group_id"
count chegando totals summing by codigo, but note which container is assigned
to a pedido based on order, and based by quantity. For example, if 5000 arrives
in 1440, then 2000 in 1441, and there is a first pedido of 4000, it gets
assigned to 1440, but the next pedido would be assigned 1440 AND 1441. To keep
things simple I might just concatenate all container numbers and display that.
However, once the container amount is exhausted, later pedidos must become
"aguardando desistencia do container"
make login tokens last years
# Security rules
```
{
"rules": {
".read": "auth != null && auth.provider == 'password'",
".write": "auth != null && auth.provider == 'password'"
}
}
```